iwmlib/dist/iwmlib.3rdparty.min.js

1 line
1.3 MiB

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OptimalSelect=t():e.OptimalSelect=t()}(this,function(){return function(r){var i={};function n(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=r,n.c=i,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertNodeList=function(e){for(var t=e.length,r=new Array(t),i=0;i<t;i++)r[i]=e[i];return r},t.escapeValue=function(e){return e&&e.replace(/['"`\\/:\?&!#$%^()[\]{|}*+;,.<=>@~]/g,"\\$&").replace(/\n/g,"A")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCommonAncestor=function(e){var t=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).root,i=void 0===t?document:t,n=[];e.forEach(function(e,t){for(var r=[];e!==i;)e=e.parentNode,r.unshift(e);n[t]=r}),n.sort(function(e,t){return e.length-t.length});for(var r=n.shift(),o=null,a=function(){var t=r[s],e=n.some(function(e){return!e.some(function(e){return e===t})});if(e)return"break";o=t},s=0,u=r.length;s<u;s++){var h=a();if("break"===h)break}return o},t.getCommonProperties=function(e){var c={classes:[],attributes:{},tag:null};return e.forEach(function(e){var n,i,t,r,o=c.classes,a=c.attributes,s=c.tag;if(void 0!==o){var u=e.getAttribute("class");u?(u=u.trim().split(" "),o.length?(o=o.filter(function(t){return u.some(function(e){return e===t})})).length?c.classes=o:delete c.classes:c.classes=u):delete c.classes}if(void 0!==a&&(n=e.attributes,i=Object.keys(n).reduce(function(e,t){var r=n[t],i=r.name;return r&&"class"!==i&&(e[i]=r.value),e},{}),t=Object.keys(i),r=Object.keys(a),t.length?r.length?(a=r.reduce(function(e,t){var r=a[t];return r===i[t]&&(e[t]=r),e},{}),Object.keys(a).length?c.attributes=a:delete c.attributes):c.attributes=i:delete c.attributes),void 0!==s){var h=e.tagName.toLowerCase();s?h!==s&&delete c.tag:c.tag=h}}),c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};Array.isArray(t)||(t=t.length?(0,f.convertNodeList)(t):[t]);if(!t.length||t.some(function(e){return 1!==e.nodeType}))throw new Error('Invalid input - to compare HTMLElements its necessary to provide a reference of the selected node(s)! (missing "elements")');(0,c.default)(t[0],r);var i=e.replace(/> /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(i.length<2)return l("",e,"",t);var n=[i.pop()];for(;1<i.length;){var o=i.pop(),a=i.join(" "),s=n.join(" "),u=a+" "+s,h=document.querySelectorAll(u);h.length!==t.length&&n.unshift(l(a,o,s,t))}n.unshift(i[0]),(i=n)[0]=l("",i[0],i.slice(1).join(" "),t),i[i.length-1]=l(i.slice(0,-1).join(" "),i[i.length-1],"",t);return i.join(" ").replace(/>/g,"> ").trim()};var i,n=r(3),c=(i=n)&&i.__esModule?i:{default:i},f=r(0);function l(r,i,n,o){if(r.length&&(r+=" "),n.length&&(n=" "+n),/\[*\]/.test(i)){var e=i.replace(/=.*$/,"]"),a=""+r+e+n;if(v(document.querySelectorAll(a),o))i=e;else for(var s=document.querySelectorAll(""+r+e),t=function(){var t=s[u];if(o.some(function(e){return t.contains(e)})){var e=t.tagName.toLowerCase();return a=""+r+e+n,v(document.querySelectorAll(a),o)&&(i=e),"break"}},u=0,h=s.length;u<h;u++){if("break"===t())break}}if(/>/.test(i)){var c=i.replace(/>/,"");a=""+r+c+n;v(document.querySelectorAll(a),o)&&(i=c)}if(/:nth-child/.test(i)){var f=i.replace(/nth-child/g,"nth-of-type");a=""+r+f+n;v(document.querySelectorAll(a),o)&&(i=f)}if(/\.\S+\.\S+/.test(i)){for(var l=i.trim().split(".").slice(1).map(function(e){return"."+e}).sort(function(e,t){return e.length-t.length});l.length;){var d=i.replace(l.shift(),"").trim();if(!(a=(""+r+d+n).trim()).length||">"===a.charAt(0)||">"===a.charAt(a.length-1))break;v(document.querySelectorAll(a),o)&&(i=d)}if((l=i&&i.match(/\./g))&&2<l.length){var p=document.querySelectorAll(""+r+i),m=function(){var t=p[u];if(o.some(function(e){return t.contains(e)})){var e=t.tagName.toLowerCase();return a=""+r+e+n,v(document.querySelectorAll(a),o)&&(i=e),"break"}};for(u=0,h=p.length;u<h;u++){if("break"===m())break}}}return i}function v(r,e){var i=r.length;return i===e.length&&e.every(function(e){for(var t=0;t<i;t++)if(r[t]===e)return!0;return!1})}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],i=!0,n=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);i=!0);}catch(e){n=!0,o=e}finally{try{!i&&s.return&&s.return()}finally{if(n)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function m(e,r){e.forEach(function(e){var t=!0;r(e,function(){return t=!1}),e.childTags&&t&&m(e.childTags,r)})}function v(e,t,r){for(;e.parent;){if(r(e=e.parent))return e;if(e===t)break}return null}t.default=function(e,t){return!1;var r=Object.getPrototypeOf(!0);Object.getOwnPropertyDescriptor(r,"childTags")||Object.defineProperty(r,"childTags",{enumerable:!0,get:function(){return this.children.filter(function(e){return"tag"===e.type||"script"===e.type||"style"===e.type})}});Object.getOwnPropertyDescriptor(r,"attributes")||Object.defineProperty(r,"attributes",{enumerable:!0,get:function(){var i=this.attribs,e=Object.keys(i),t=e.reduce(function(e,t,r){return e[r]={name:t,value:i[t]},e},{});return Object.defineProperty(t,"length",{enumerable:!1,configurable:!1,value:e.length}),t}});r.getAttribute||(r.getAttribute=function(e){return this.attribs[e]||null});r.getElementsByTagName||(r.getElementsByTagName=function(t){var r=[];return m(this.childTags,function(e){e.name!==t&&"*"!==t||r.push(e)}),r});r.getElementsByClassName||(r.getElementsByClassName=function(e){var r=e.trim().replace(/\s+/g," ").split(" "),i=[];return m([this],function(e){var t=e.attribs.class;t&&r.every(function(e){return-1<t.indexOf(e)})&&i.push(e)}),i});r.querySelectorAll||(r.querySelectorAll=function(e){var r=this,i=function(e){return e.split(" ").reverse().map(function(e,t){var a=0===t,r=e.split(":"),i=p(r,2),s=i[0],n=i[1],u=null,h=null;if(function(){switch(!0){case/>/.test(s):h=function(t){return function(e){return e(t.parent)&&t.parent}};break;case/^\./.test(s):var r=s.substr(1).split(".");u=function(e){var t=e.attribs.class;return t&&r.every(function(e){return-1<t.indexOf(e)})},h=function(e,t){return a?e.getElementsByClassName(r.join(" ")):"function"==typeof e?e(u):v(e,t,u)};break;case/^\[/.test(s):var e=s.replace(/\[|\]|"/g,"").split("="),t=p(e,2),i=t[0],n=t[1];u=function(e){var t=-1<Object.keys(e.attribs).indexOf(i);return t&&(!n||e.attribs[i]===n)},h=function(e,t){if(a){var r=function(){var t=[];return m([e],function(e){u(e)&&t.push(e)}),{v:t}}();if("object"===(void 0===r?"undefined":d(r)))return r.v}return"function"==typeof e?e(u):v(e,t,u)};break;case/^#/.test(s):var o=s.substr(1);u=function(e){return e.attribs.id===o},h=function(e,t){if(a){var r=function(){var r=[];return m([e],function(e,t){u(e)&&(r.push(e),t())}),{v:r}}();if("object"===(void 0===r?"undefined":d(r)))return r.v}return"function"==typeof e?e(u):v(e,t,u)};break;case/\*/.test(s):u=function(e){return!0},h=function(e,t){if(a){var r=function(){var t=[];return m([e],function(e){return t.push(e)}),{v:t}}();if("object"===(void 0===r?"undefined":d(r)))return r.v}return"function"==typeof e?e(u):v(e,t,u)};break;default:u=function(e){return e.name===s},h=function(e,t){if(a){var r=function(){var t=[];return m([e],function(e){u(e)&&t.push(e)}),{v:t}}();if("object"===(void 0===r?"undefined":d(r)))return r.v}return"function"==typeof e?e(u):v(e,t,u)}}}(),!n)return h;var o=n.match(/-(child|type)\((\d+)\)$/),c=o[1],f=parseInt(o[2],10)-1,l=function(t){if(t){var e=t.parent.childTags;"type"===c&&(e=e.filter(u));var r=e.findIndex(function(e){return e===t});if(r===f)return!0}return!1};return function(e){var t=h(e);return a?t.reduce(function(e,t){return l(t)&&e.push(t),e},[]):l(t)&&t}})}(e=e.replace(/(>)(\S)/g,"$1 $2").trim()),t=i.shift(),n=i.length;return t(this).filter(function(e){for(var t=0;t<n;){if(!(e=i[t](e,r)))return!1;t+=1}return!0})});r.contains||(r.contains=function(r){var i=!1;return m([this],function(e,t){e===r&&(i=!0,t())}),i});return!0},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getSingleSelector=c,t.getMultiSelector=f,t.default=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return!e.length||e.name?c(e,t):f(e,t)};var a=o(r(3)),n=o(r(5)),s=o(r(2)),u=r(0),h=r(1);function o(e){return e&&e.__esModule?e:{default:e}}function c(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(3===e.nodeType&&(e=e.parentNode),1!==e.nodeType)throw new Error('Invalid input - only HTMLElements or representations of them are supported! (not "'+(void 0===e?"undefined":i(e))+'")');(0,a.default)(e,t);var r=(0,n.default)(e,t);return(0,s.default)(r,e,t)}function f(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(e)||(e=(0,u.convertNodeList)(e)),e.some(function(e){return 1!==e.nodeType}))throw new Error("Invalid input - only an Array of HTMLElements or representations of them is supported!");(0,a.default)(e[0],t);var r=c((0,h.getCommonAncestor)(e,t),t),i=function(e){var t=(0,h.getCommonProperties)(e),r=t.classes,i=t.attributes,n=t.tag,o=[];n&&o.push(n);if(r){var a=r.map(function(e){return"."+e}).join("");o.push(a)}if(i){var s=Object.keys(i).reduce(function(e,t){return e.push("["+t+'="'+i[t]+'"]'),e},[]).join("");o.push(s)}o.length;return[o.join("")]}(e)[0],n=(0,s.default)(r+" "+i,e,t),o=(0,u.convertNodeList)(document.querySelectorAll(n));return e.every(function(t){return o.some(function(e){return e===t})})?n:console.warn("\n The selected elements can't be efficiently mapped.\n Its probably best to use multiple single selectors instead!\n ",e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=t.root,i=void 0===r?document:r,n=t.skip,o=void 0===n?null:n,a=t.priority,s=void 0===a?["id","class","href","src"]:a,u=t.ignore,h=void 0===u?{}:u,c=[],f=e,l=c.length,d=!1,p=o&&(Array.isArray(o)?o:[o]).map(function(t){return"function"!=typeof t?function(e){return e===t}:t}),m=function(t){return o&&p.some(function(e){return e(t)})};Object.keys(h).forEach(function(e){"class"===e&&(d=!0);var r=h[e];"function"!=typeof r&&("number"==typeof r&&(r=r.toString()),"string"==typeof r&&(r=new RegExp((0,b.escapeValue)(r).replace(/\\/g,"\\\\"))),"boolean"==typeof r&&(r=r?/(?:)/:/.^/),h[e]=function(e,t){return r.test(t)})}),d&&function(){var i=h.attribute;h.attribute=function(e,t,r){return h.class(t)||i&&i(e,t,r)}}();for(;f!==i;){if(!0!==m(f)){if(g(s,f,h,c,i))break;if(y(f,h,c,i))break;g(s,f,h,c),c.length===l&&y(f,h,c),c.length===l&&_(s,f,h,c)}f=f.parentNode,l=c.length}if(f===i){var v=w(s,f,h);c.unshift(v)}return c.join(" ")};var b=r(0),l={attribute:function(e){return-1<["style","data-reactid","data-react-checksum"].indexOf(e)}};function g(e,t,r,i){var n=4<arguments.length&&void 0!==arguments[4]?arguments[4]:t.parentNode,o=a(e,t,r);if(o&&1===n.querySelectorAll(o).length)return i.unshift(o),!0;return!1}function a(n,e,t){for(var o=e.attributes,r=Object.keys(o).sort(function(e,t){var r=n.indexOf(o[e].name),i=n.indexOf(o[t].name);return-1===i?-1===r?0:-1:r-i}),i=0,a=r.length;i<a;i++){var s=r[i],u=o[s],h=u.name,c=(0,b.escapeValue)(u.value);if(!d(t[h]||t.attribute,h,c,l[h]||l.attribute)){var f="["+h+'="'+c+'"]';if(!1===/\b\d/.test(c))if("id"===h&&(f="#"+c),"class"===h)f="."+c.trim().replace(/\s+/g,".");return f}}return null}function y(e,t,r){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:e.parentNode,n=o(e,t);if(n&&1===i.getElementsByTagName(n).length)return r.unshift(n),!0;return!1}function o(e,t){var r=e.tagName.toLowerCase();return d(t.tag,null,r)?null:r}function _(e,t,r,i){for(var n=t.parentNode,o=n.childTags||n.children,a=0,s=o.length;a<s;a++){var u=o[a];if(u===t){var h=w(e,u,r);if(!h)return console.warn("\n Element couldn't be matched through strict ignore pattern!\n ",u,r,h);var c="> "+h+":nth-child("+(a+1)+")";return i.unshift(c),!0}}return!1}function w(e,t,r){var i=a(e,t,r);return i||(i=o(t,r)),i}function d(e,t,r,i){if(!r)return!0;var n=e||i;return!!n&&n(t,r,i)}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.common=t.optimize=t.getMultiSelector=t.getSingleSelector=t.select=void 0;var i=r(4);Object.defineProperty(t,"getSingleSelector",{enumerable:!0,get:function(){return i.getSingleSelector}}),Object.defineProperty(t,"getMultiSelector",{enumerable:!0,get:function(){return i.getMultiSelector}});var n=s(i),o=s(r(2)),a=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(r(1));function s(e){return e&&e.__esModule?e:{default:e}}t.select=n.default,t.optimize=o.default,t.common=a,t.default=n.default}])}),function(o,n,e,f){"use strict";var a,s=["","webkit","Moz","MS","ms","o"],t=n.createElement("div"),r="function",u=Math.round,l=Math.abs,d=Date.now;function h(e,t,r){return setTimeout(g(e,r),t)}function i(e,t,r){return!!Array.isArray(e)&&(c(e,r[t],r),!0)}function c(e,t,r){var i;if(e)if(e.forEach)e.forEach(t,r);else if(e.length!==f)for(i=0;i<e.length;)t.call(r,e[i],i,e),i++;else for(i in e)e.hasOwnProperty(i)&&t.call(r,e[i],i,e)}function p(i,e,t){var n="DEPRECATED METHOD: "+e+"\n"+t+" AT \n";return function(){var e=new Error("get-stack-trace"),t=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=o.console&&(o.console.warn||o.console.log);return r&&r.call(o.console,n,t),i.apply(this,arguments)}}a="function"!=typeof Object.assign?function(e){if(e===f||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r<arguments.length;r++){var i=arguments[r];if(i!==f&&null!==i)for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])}return t}:Object.assign;var m=p(function(e,t,r){for(var i=Object.keys(t),n=0;n<i.length;)(!r||r&&e[i[n]]===f)&&(e[i[n]]=t[i[n]]),n++;return e},"extend","Use `assign`."),v=p(function(e,t){return m(e,t,!0)},"merge","Use `assign`.");function b(e,t,r){var i,n=t.prototype;(i=e.prototype=Object.create(n)).constructor=e,i._super=n,r&&a(i,r)}function g(e,t){return function(){return e.apply(t,arguments)}}function y(e,t){return typeof e==r?e.apply(t&&t[0]||f,t):e}function _(e,t){return e===f?t:e}function w(t,e,r){c(E(e),function(e){t.addEventListener(e,r,!1)})}function x(t,e,r){c(E(e),function(e){t.removeEventListener(e,r,!1)})}function T(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return-1<e.indexOf(t)}function E(e){return e.trim().split(/\s+/g)}function A(e,t,r){if(e.indexOf&&!r)return e.indexOf(t);for(var i=0;i<e.length;){if(r&&e[i][r]==t||!r&&e[i]===t)return i;i++}return-1}function P(e){return Array.prototype.slice.call(e,0)}function M(e,r,t){for(var i=[],n=[],o=0;o<e.length;){var a=r?e[o][r]:e[o];A(n,a)<0&&i.push(e[o]),n[o]=a,o++}return t&&(i=r?i.sort(function(e,t){return e[r]>t[r]}):i.sort()),i}function C(e,t){for(var r,i,n=t[0].toUpperCase()+t.slice(1),o=0;o<s.length;){if((i=(r=s[o])?r+n:t)in e)return i;o++}return f}var k=1;function I(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||o}var R="ontouchstart"in o,O=C(o,"PointerEvent")!==f,D=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),L="touch",F="mouse",j=25,B=1,N=4,U=8,z=1,X=2,q=4,H=8,G=16,V=X|q,Y=H|G,W=V|Y,J=["x","y"],K=["clientX","clientY"];function Z(t,e){var r=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){y(t.options.enable,[t])&&r.handler(e)},this.init()}function Q(e,t,r){var i=r.pointers.length,n=r.changedPointers.length,o=t&B&&i-n==0,a=t&(N|U)&&i-n==0;r.isFirst=!!o,r.isFinal=!!a,o&&(e.session={}),r.eventType=t,function(e,t){var r=e.session,i=t.pointers,n=i.length;r.firstInput||(r.firstInput=$(t));1<n&&!r.firstMultiple?r.firstMultiple=$(t):1===n&&(r.firstMultiple=!1);var o=r.firstInput,a=r.firstMultiple,s=a?a.center:o.center,u=t.center=ee(i);t.timeStamp=d(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=ne(s,u),t.distance=ie(s,u),function(e,t){var r=t.center,i=e.offsetDelta||{},n=e.prevDelta||{},o=e.prevInput||{};t.eventType!==B&&o.eventType!==N||(n=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:r.x,y:r.y});t.deltaX=n.x+(r.x-i.x),t.deltaY=n.y+(r.y-i.y)}(r,t),t.offsetDirection=re(t.deltaX,t.deltaY);var h=te(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=h.x,t.overallVelocityY=h.y,t.overallVelocity=l(h.x)>l(h.y)?h.x:h.y,t.scale=a?function(e,t){return ie(t[0],t[1],K)/ie(e[0],e[1],K)}(a.pointers,i):1,t.rotation=a?function(e,t){return ne(t[1],t[0],K)+ne(e[1],e[0],K)}(a.pointers,i):0,t.maxPointers=r.prevInput?t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length,function(e,t){var r,i,n,o,a=e.lastInterval||t,s=t.timeStamp-a.timeStamp;if(t.eventType!=U&&(j<s||a.velocity===f)){var u=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,c=te(s,u,h);i=c.x,n=c.y,r=l(c.x)>l(c.y)?c.x:c.y,o=re(u,h),e.lastInterval=t}else r=a.velocity,i=a.velocityX,n=a.velocityY,o=a.direction;t.velocity=r,t.velocityX=i,t.velocityY=n,t.direction=o}(r,t);var c=e.element;T(t.srcEvent.target,c)&&(c=t.srcEvent.target);t.target=c}(e,r),e.emit("hammer.input",r),e.recognize(r),e.session.prevInput=r}function $(e){for(var t=[],r=0;r<e.pointers.length;)t[r]={clientX:u(e.pointers[r].clientX),clientY:u(e.pointers[r].clientY)},r++;return{timeStamp:d(),pointers:t,center:ee(t),deltaX:e.deltaX,deltaY:e.deltaY}}function ee(e){var t=e.length;if(1===t)return{x:u(e[0].clientX),y:u(e[0].clientY)};for(var r=0,i=0,n=0;n<t;)r+=e[n].clientX,i+=e[n].clientY,n++;return{x:u(r/t),y:u(i/t)}}function te(e,t,r){return{x:t/e||0,y:r/e||0}}function re(e,t){return e===t?z:l(e)>=l(t)?e<0?X:q:t<0?H:G}function ie(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return Math.sqrt(i*i+n*n)}function ne(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return 180*Math.atan2(n,i)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(I(this.element),this.evWin,this.domHandler)}};var oe={mousedown:B,mousemove:2,mouseup:N},ae="mousedown",se="mousemove mouseup";function ue(){this.evEl=ae,this.evWin=se,this.pressed=!1,Z.apply(this,arguments)}b(ue,Z,{handler:function(e){var t=oe[e.type];t&B&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=N),this.pressed&&(t&N&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:F,srcEvent:e}))}});var he={pointerdown:B,pointermove:2,pointerup:N,pointercancel:U,pointerout:U},ce={2:L,3:"pen",4:F,5:"kinect"},fe="pointerdown",le="pointermove pointerup pointercancel";function de(){this.evEl=fe,this.evWin=le,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(fe="MSPointerDown",le="MSPointerMove MSPointerUp MSPointerCancel"),b(de,Z,{handler:function(e){var t=this.store,r=!1,i=e.type.toLowerCase().replace("ms",""),n=he[i],o=ce[e.pointerType]||e.pointerType,a=o==L,s=A(t,e.pointerId,"pointerId");n&B&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):n&(N|U)&&(r=!0),s<0||(t[s]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),r&&t.splice(s,1))}});var pe={touchstart:B,touchmove:2,touchend:N,touchcancel:U};function me(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}b(me,Z,{handler:function(e){var t=pe[e.type];if(t===B&&(this.started=!0),this.started){var r=function(e,t){var r=P(e.touches),i=P(e.changedTouches);t&(N|U)&&(r=M(r.concat(i),"identifier",!0));return[r,i]}.call(this,e,t);t&(N|U)&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:r[0],changedPointers:r[1],pointerType:L,srcEvent:e})}}});var ve={touchstart:B,touchmove:2,touchend:N,touchcancel:U},be="touchstart touchmove touchend touchcancel";function ge(){this.evTarget=be,this.targetIds={},Z.apply(this,arguments)}b(ge,Z,{handler:function(e){var t=ve[e.type],r=function(e,t){var r=P(e.touches),i=this.targetIds;if(t&(2|B)&&1===r.length)return i[r[0].identifier]=!0,[r,r];var n,o,a=P(e.changedTouches),s=[],u=this.target;if(o=r.filter(function(e){return T(e.target,u)}),t===B)for(n=0;n<o.length;)i[o[n].identifier]=!0,n++;n=0;for(;n<a.length;)i[a[n].identifier]&&s.push(a[n]),t&(N|U)&&delete i[a[n].identifier],n++;return s.length?[M(o.concat(s),"identifier",!0),s]:void 0}.call(this,e,t);r&&this.callback(this.manager,t,{pointers:r[0],changedPointers:r[1],pointerType:L,srcEvent:e})}});var ye=2500;function _e(){Z.apply(this,arguments);var e=g(this.handler,this);this.touch=new ge(this.manager,e),this.mouse=new ue(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function we(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var r={x:t.clientX,y:t.clientY};this.lastTouches.push(r);var i=this.lastTouches;setTimeout(function(){var e=i.indexOf(r);-1<e&&i.splice(e,1)},ye)}}b(_e,Z,{handler:function(e,t,r){var i=r.pointerType==L,n=r.pointerType==F;if(!(n&&r.sourceCapabilities&&r.sourceCapabilities.firesTouchEvents)){if(i)(function(e,t){e&B?(this.primaryTouch=t.changedPointers[0].identifier,we.call(this,t)):e&(N|U)&&we.call(this,t)}).call(this,t,r);else if(n&&function(e){for(var t=e.srcEvent.clientX,r=e.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var n=this.lastTouches[i],o=Math.abs(t-n.x),a=Math.abs(r-n.y);if(o<=25&&a<=25)return!0}return!1}.call(this,r))return;this.callback(e,t,r)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var xe=C(t.style,"touchAction"),Te=xe!==f,Se="compute",Ee="manipulation",Ae="none",Pe="pan-x",Me="pan-y",Ce=function(){if(!Te)return!1;var t={},r=o.CSS&&o.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){t[e]=!r||o.CSS.supports("touch-action",e)}),t}();function ke(e,t){this.manager=e,this.set(t)}ke.prototype={set:function(e){e==Se&&(e=this.compute()),Te&&this.manager.element.style&&Ce[e]&&(this.manager.element.style[xe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return c(this.manager.recognizers,function(e){y(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(e){if(S(e,Ae))return Ae;var t=S(e,Pe),r=S(e,Me);if(t&&r)return Ae;if(t||r)return t?Pe:Me;if(S(e,Ee))return Ee;return"auto"}(t.join(" "))},preventDefaults:function(e){var t=e.srcEvent,r=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var i=this.actions,n=S(i,Ae)&&!Ce[Ae],o=S(i,Me)&&!Ce[Me],a=S(i,Pe)&&!Ce[Pe];if(n){var s=1===e.pointers.length,u=e.distance<2,h=e.deltaTime<250;if(s&&u&&h)return}if(!a||!o)return n||o&&r&V||a&&r&Y?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Ie=1;function Re(e){this.options=a({},this.defaults,e||{}),this.id=k++,this.manager=null,this.options.enable=_(this.options.enable,!0),this.state=Ie,this.simultaneous={},this.requireFail=[]}function Oe(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function De(e){return e==G?"down":e==H?"up":e==X?"left":e==q?"right":""}function Le(e,t){var r=t.manager;return r?r.get(e):e}function Fe(){Re.apply(this,arguments)}function je(){Fe.apply(this,arguments),this.pX=null,this.pY=null}function Be(){Fe.apply(this,arguments)}function Ne(){Re.apply(this,arguments),this._timer=null,this._input=null}function Ue(){Fe.apply(this,arguments)}function ze(){Fe.apply(this,arguments)}function Xe(){Re.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function qe(e,t){return(t=t||{}).recognizers=_(t.recognizers,qe.defaults.preset),new He(e,t)}Re.prototype={defaults:{},set:function(e){return a(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(i(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Le(e,this)).id]||(t[e.id]=e).recognizeWith(this),this},dropRecognizeWith:function(e){return i(e,"dropRecognizeWith",this)||(e=Le(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(i(e,"requireFailure",this))return this;var t=this.requireFail;return-1===A(t,e=Le(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(i(e,"dropRequireFailure",this))return this;e=Le(e,this);var t=A(this.requireFail,e);return-1<t&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return 0<this.requireFail.length},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(t){var r=this,e=this.state;function i(e){r.manager.emit(e,t)}e<8&&i(r.options.event+Oe(e)),i(r.options.event),t.additionalEvent&&i(t.additionalEvent),8<=e&&i(r.options.event+Oe(e))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(32|Ie)))return!1;e++}return!0},recognize:function(e){var t=a({},e);if(!y(this.options.enable,[this,t]))return this.reset(),void(this.state=32);56&this.state&&(this.state=Ie),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},b(Fe,Re,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,r=e.eventType,i=6&t,n=this.attrTest(e);return i&&(r&U||!n)?16|t:i||n?r&N?8|t:2&t?4|t:2:32}}),b(je,Fe,{defaults:{event:"pan",threshold:10,pointers:1,direction:W},getTouchAction:function(){var e=this.options.direction,t=[];return e&V&&t.push(Me),e&Y&&t.push(Pe),t},directionTest:function(e){var t=this.options,r=!0,i=e.distance,n=e.direction,o=e.deltaX,a=e.deltaY;return n&t.direction||(i=t.direction&V?(n=0===o?z:o<0?X:q,r=o!=this.pX,Math.abs(e.deltaX)):(n=0===a?z:a<0?H:G,r=a!=this.pY,Math.abs(e.deltaY))),e.direction=n,r&&i>t.threshold&&n&t.direction},attrTest:function(e){return Fe.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),b(Be,Fe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ae]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),b(Ne,Re,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distance<t.threshold,n=e.deltaTime>t.time;if(this._input=e,!i||!r||e.eventType&(N|U)&&!n)this.reset();else if(e.eventType&B)this.reset(),this._timer=h(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&N)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&N?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),b(Ue,Fe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ae]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),b(ze,Fe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:V|Y,pointers:1},getTouchAction:function(){return je.prototype.getTouchAction.call(this)},attrTest:function(e){var t,r=this.options.direction;return r&(V|Y)?t=e.overallVelocity:r&V?t=e.overallVelocityX:r&Y&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&r&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&l(t)>this.options.velocity&&e.eventType&N},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),b(Xe,Re,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ee]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distance<t.threshold,n=e.deltaTime<t.time;if(this.reset(),e.eventType&B&&0===this.count)return this.failTimeout();if(i&&n&&r){if(e.eventType!=N)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||ie(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0==this.count%t.taps)return this.hasRequireFailures()?(this._timer=h(function(){this.state=8,this.tryEmit()},t.interval,this),2):8}return 32},failTimeout:function(){return this._timer=h(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),qe.VERSION="2.0.7",qe.defaults={domEvents:!1,touchAction:Se,enable:!0,inputTarget:null,inputClass:null,preset:[[Ue,{enable:!1}],[Be,{enable:!1},["rotate"]],[ze,{direction:V}],[je,{direction:V},["swipe"]],[Xe],[Xe,{event:"doubletap",taps:2},["tap"]],[Ne]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function He(e,t){this.options=a({},qe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=function(e){var t=e.options.inputClass;return new(t||(O?de:D?ge:R?_e:ue))(e,Q)}(this),this.touchAction=new ke(this,this.options.touchAction),Ge(this,!0),c(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function Ge(r,i){var n,o=r.element;o.style&&(c(r.options.cssProps,function(e,t){n=C(o.style,t),i?(r.oldCssProps[n]=o.style[n],o.style[n]=e):o.style[n]=r.oldCssProps[n]||""}),i||(r.oldCssProps={}))}He.prototype={set:function(e){return a(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var r;this.touchAction.preventDefaults(e);var i=this.recognizers,n=t.curRecognizer;(!n||n&&8&n.state)&&(n=t.curRecognizer=null);for(var o=0;o<i.length;)r=i[o],2===t.stopped||n&&r!=n&&!r.canRecognizeWith(n)?r.reset():r.recognize(e),!n&&14&r.state&&(n=t.curRecognizer=r),o++}},get:function(e){if(e instanceof Re)return e;for(var t=this.recognizers,r=0;r<t.length;r++)if(t[r].options.event==e)return t[r];return null},add:function(e){if(i(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),(e.manager=this).touchAction.update(),e},remove:function(e){if(i(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,r=A(t,e);-1!==r&&(t.splice(r,1),this.touchAction.update())}return this},on:function(e,t){if(e!==f&&t!==f){var r=this.handlers;return c(E(e),function(e){r[e]=r[e]||[],r[e].push(t)}),this}},off:function(e,t){if(e!==f){var r=this.handlers;return c(E(e),function(e){t?r[e]&&r[e].splice(A(r[e],t),1):delete r[e]}),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),(r.gesture=t).target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&Ge(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},a(qe,{INPUT_START:B,INPUT_MOVE:2,INPUT_END:N,INPUT_CANCEL:U,STATE_POSSIBLE:Ie,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:z,DIRECTION_LEFT:X,DIRECTION_RIGHT:q,DIRECTION_UP:H,DIRECTION_DOWN:G,DIRECTION_HORIZONTAL:V,DIRECTION_VERTICAL:Y,DIRECTION_ALL:W,Manager:He,Input:Z,TouchAction:ke,TouchInput:ge,MouseInput:ue,PointerEventInput:de,TouchMouseInput:_e,SingleTouchInput:me,Recognizer:Re,AttrRecognizer:Fe,Tap:Xe,Pan:je,Swipe:ze,Pinch:Be,Rotate:Ue,Press:Ne,on:w,off:x,each:c,merge:v,extend:m,assign:a,inherit:b,bindFn:g,prefixed:C}),(void 0!==o?o:"undefined"!=typeof self?self:{}).Hammer=qe,"function"==typeof define&&define.amd?define(function(){return qe}):"undefined"!=typeof module&&module.exports?module.exports=qe:o.Hammer=qe}(window,document),function(e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():window.propagating=e()}(function(){var c=null;return function i(n,e){var o=e||{preventDefault:!1};if(n.Manager){var a=n,t=function(e,t){var r=Object.create(o);return t&&a.assign(r,t),i(new a(e,r),r)};return a.assign(t,a),t.Manager=function(e,t){var r=Object.create(o);return t&&a.assign(r,t),i(new a.Manager(e,r),r)},t}var s=Object.create(n),r=n.element;function u(e){return e.match(/[^ ]+/g)}function h(e){if("hammer.input"!==e.type){if(e.srcEvent._handled||(e.srcEvent._handled={}),e.srcEvent._handled[e.type])return;e.srcEvent._handled[e.type]=!0}var t=!1;e.stopPropagation=function(){t=!0};var r=e.srcEvent.stopPropagation.bind(e.srcEvent);"function"==typeof r&&(e.srcEvent.stopPropagation=function(){r(),e.stopPropagation()});for(var i=e.firstTarget=c;i&&!t;){var n=i.hammer;if(n)for(var o,a=0;a<n.length;a++)if(o=n[a]._handlers[e.type])for(var s=0;s<o.length&&!t;s++)o[s](e);i=i.parentNode}}return r.hammer||(r.hammer=[]),r.hammer.push(s),n.on("hammer.input",function(e){!0!==o.preventDefault&&o.preventDefault!==e.pointerType||e.preventDefault(),e.isFirst&&(c=e.target)}),s._handlers={},s.on=function(e,r){return u(e).forEach(function(e){var t=s._handlers[e];t||(s._handlers[e]=t=[],n.on(e,h)),t.push(r)}),s},s.off=function(e,r){return u(e).forEach(function(e){var t=s._handlers[e];t&&(0<(t=r?t.filter(function(e){return e!==r}):[]).length?s._handlers[e]=t:(n.off(e,h),delete s._handlers[e]))}),s},s.emit=function(e,t){c=t.target,n.emit(e,t)},s.destroy=function(){var e=n.element.hammer,t=e.indexOf(s);-1!==t&&e.splice(t,1),e.length||delete n.element.hammer,s._handlers={},n.destroy()},s}}),function(e){var t="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):t&&(t.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return t.hljs}))}(function(n){var r,f=[],u=Object.keys,g={},s={},t=/^(no-?highlight|plain|text)$/i,h=/\blang(?:uage)?-([\w-]+)\b/i,i=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,y="</span>",_={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function w(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function l(e){return e.nodeName.toLowerCase()}function x(e,t){var r=e&&e.exec(t);return r&&0===r.index}function c(e){return t.test(e)}function d(e){var t,r={},i=Array.prototype.slice.call(arguments,1);for(t in e)r[t]=e[t];return i.forEach(function(e){for(t in e)r[t]=e[t]}),r}function p(e){var n=[];return function e(t,r){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:r,node:i}),r=e(i,r),l(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:r,node:i}));return r}(e,0),n}function o(e){if(r&&!e.langApiRestored){for(var t in e.langApiRestored=!0,r)e[t]&&(e[r[t]]=e[t]);(e.contains||[]).concat(e.variants||[]).forEach(o)}}function T(a){function h(e){return e&&e.source||e}function s(e,t){return new RegExp(h(e),"m"+(a.case_insensitive?"i":"")+(t?"g":""))}!function t(r,e){if(!r.compiled){if(r.compiled=!0,r.keywords=r.keywords||r.beginKeywords,r.keywords){var i={},n=function(r,e){a.case_insensitive&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var t=e.split("|");i[t[0]]=[r,t[1]?Number(t[1]):1]})};"string"==typeof r.keywords?n("keyword",r.keywords):u(r.keywords).forEach(function(e){n(e,r.keywords[e])}),r.keywords=i}r.lexemesRe=s(r.lexemes||/\w+/,!0),e&&(r.beginKeywords&&(r.begin="\\b("+r.beginKeywords.split(" ").join("|")+")\\b"),r.begin||(r.begin=/\B|\b/),r.beginRe=s(r.begin),r.endSameAsBegin&&(r.end=r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(r.endRe=s(r.end)),r.terminator_end=h(r.end)||"",r.endsWithParent&&e.terminator_end&&(r.terminator_end+=(r.end?"|":"")+e.terminator_end)),r.illegal&&(r.illegalRe=s(r.illegal)),null==r.relevance&&(r.relevance=1),r.contains||(r.contains=[]),r.contains=Array.prototype.concat.apply([],r.contains.map(function(e){return function(t){return t.variants&&!t.cached_variants&&(t.cached_variants=t.variants.map(function(e){return d(t,{variants:null},e)})),t.cached_variants||t.endsWithParent&&[d(t)]||[t]}("self"===e?r:e)})),r.contains.forEach(function(e){t(e,r)}),r.starts&&t(r.starts,e);var o=r.contains.map(function(e){return e.beginKeywords?"\\.?(?:"+e.begin+")\\.?":e.begin}).concat([r.terminator_end,r.illegal]).map(h).filter(Boolean);r.terminators=o.length?s(function(e,t){for(var r=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,i=0,n="",o=0;o<e.length;o++){var a=i,s=h(e[o]);for(0<o&&(n+=t);0<s.length;){var u=r.exec(s);if(null==u){n+=s;break}n+=s.substring(0,u.index),s=s.substring(u.index+u[0].length),"\\"==u[0][0]&&u[1]?n+="\\"+String(Number(u[1])+a):(n+=u[0],"("==u[0]&&i++)}}return n}(o,"|"),!0):{exec:function(){return null}}}}(a)}function S(e,t,o,r){function s(e,t,r,i){var n='<span class="'+(i?"":_.classPrefix);return(n+=e+'">')+t+(r?"":y)}function a(){l+=null!=c.subLanguage?function(){var e="string"==typeof c.subLanguage;if(e&&!g[c.subLanguage])return w(d);var t=e?S(c.subLanguage,d,!0,f[c.subLanguage]):E(d,c.subLanguage.length?c.subLanguage:void 0);return 0<c.relevance&&(p+=t.relevance),e&&(f[c.subLanguage]=t.top),s(t.language,t.value,!1,!0)}():function(){var e,t,r,i,n,o,a;if(!c.keywords)return w(d);for(i="",t=0,c.lexemesRe.lastIndex=0,r=c.lexemesRe.exec(d);r;)i+=w(d.substring(t,r.index)),n=c,o=r,a=h.case_insensitive?o[0].toLowerCase():o[0],(e=n.keywords.hasOwnProperty(a)&&n.keywords[a])?(p+=e[1],i+=s(e[0],w(r[0]))):i+=w(r[0]),t=c.lexemesRe.lastIndex,r=c.lexemesRe.exec(d);return i+w(d.substr(t))}(),d=""}function u(e){l+=e.className?s(e.className,"",!0):"",c=Object.create(e,{parent:{value:c}})}function i(e,t){if(d+=e,null==t)return a(),0;var r=function(e,t){var r,i,n;for(r=0,i=t.contains.length;r<i;r++)if(x(t.contains[r].beginRe,e))return t.contains[r].endSameAsBegin&&(t.contains[r].endRe=(n=t.contains[r].beginRe.exec(e)[0],new RegExp(n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"m"))),t.contains[r]}(t,c);if(r)return r.skip?d+=t:(r.excludeBegin&&(d+=t),a(),r.returnBegin||r.excludeBegin||(d=t)),u(r),r.returnBegin?0:t.length;var i=function e(t,r){if(x(t.endRe,r)){for(;t.endsParent&&t.parent;)t=t.parent;return t}if(t.endsWithParent)return e(t.parent,r)}(c,t);if(i){var n=c;for(n.skip?d+=t:(n.returnEnd||n.excludeEnd||(d+=t),a(),n.excludeEnd&&(d=t));c.className&&(l+=y),c.skip||c.subLanguage||(p+=c.relevance),(c=c.parent)!==i.parent;);return i.starts&&(i.endSameAsBegin&&(i.starts.endRe=i.endRe),u(i.starts)),n.returnEnd?0:t.length}if(function(e,t){return!o&&x(t.illegalRe,e)}(t,c))throw new Error('Illegal lexeme "'+t+'" for mode "'+(c.className||"<unnamed>")+'"');return d+=t,t.length||1}var h=A(e);if(!h)throw new Error('Unknown language: "'+e+'"');T(h);var n,c=r||h,f={},l="";for(n=c;n!==h;n=n.parent)n.className&&(l=s(n.className,"",!0)+l);var d="",p=0;try{for(var m,v,b=0;c.terminators.lastIndex=b,m=c.terminators.exec(t);)v=i(t.substring(b,m.index),m[0]),b=m.index+v;for(i(t.substr(b)),n=c;n.parent;n=n.parent)n.className&&(l+=y);return{relevance:p,value:l,language:e,top:c}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{relevance:0,value:w(t)};throw e}}function E(r,e){e=e||_.languages||u(g);var i={relevance:0,value:w(r)},n=i;return e.filter(A).filter(b).forEach(function(e){var t=S(e,r,!1);t.language=e,t.relevance>n.relevance&&(n=t),t.relevance>i.relevance&&(n=i,i=t)}),n.language&&(i.second_best=n),i}function m(e){return _.tabReplace||_.useBR?e.replace(i,function(e,t){return _.useBR&&"\n"===e?"<br>":_.tabReplace?t.replace(/\t/g,_.tabReplace):""}):e}function a(e){var t,r,i,n,o,a=function(e){var t,r,i,n,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",r=h.exec(o))return A(r[1])?r[1]:"no-highlight";for(t=0,i=(o=o.split(/\s+/)).length;t<i;t++)if(c(n=o[t])||A(n))return n}(e);c(a)||(_.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n"):t=e,o=t.textContent,i=a?S(a,o,!0):E(o),(r=p(t)).length&&((n=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=i.value,i.value=function(e,t,r){var i=0,n="",o=[];function a(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function s(e){n+="<"+l(e)+f.map.call(e.attributes,function(e){return" "+e.nodeName+'="'+w(e.value).replace('"',"&quot;")+'"'}).join("")+">"}function u(e){n+="</"+l(e)+">"}function h(e){("start"===e.event?s:u)(e.node)}for(;e.length||t.length;){var c=a();if(n+=w(r.substring(i,c[0].offset)),i=c[0].offset,c===e){for(o.reverse().forEach(u);h(c.splice(0,1)[0]),(c=a())===e&&c.length&&c[0].offset===i;);o.reverse().forEach(s)}else"start"===c[0].event?o.push(c[0].node):o.pop(),h(c.splice(0,1)[0])}return n+w(r.substr(i))}(r,p(n),o)),i.value=m(i.value),e.innerHTML=i.value,e.className=function(e,t,r){var i=t?s[t]:r,n=[e.trim()];return e.match(/\bhljs\b/)||n.push("hljs"),-1===e.indexOf(i)&&n.push(i),n.join(" ").trim()}(e.className,a,i.language),e.result={language:i.language,re:i.relevance},i.second_best&&(e.second_best={language:i.second_best.language,re:i.second_best.relevance}))}function v(){if(!v.called){v.called=!0;var e=document.querySelectorAll("pre code");f.forEach.call(e,a)}}function A(e){return e=(e||"").toLowerCase(),g[e]||g[s[e]]}function b(e){var t=A(e);return t&&!t.disableAutodetect}return n.highlight=S,n.highlightAuto=E,n.fixMarkup=m,n.highlightBlock=a,n.configure=function(e){_=d(_,e)},n.initHighlighting=v,n.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",v,!1),addEventListener("load",v,!1)},n.registerLanguage=function(t,e){var r=g[t]=e(n);o(r),r.aliases&&r.aliases.forEach(function(e){s[e]=t})},n.listLanguages=function(){return u(g)},n.getLanguage=A,n.autoDetection=b,n.inherit=d,n.IDENT_RE="[a-zA-Z]\\w*",n.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",n.NUMBER_RE="\\b\\d+(\\.\\d+)?",n.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",n.BINARY_NUMBER_RE="\\b(0b[01]+)",n.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",n.BACKSLASH_ESCAPE={begin:"\\\\[\\s\\S]",relevance:0},n.APOS_STRING_MODE={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},n.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},n.PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},n.COMMENT=function(e,t,r){var i=n.inherit({className:"comment",begin:e,end:t,contains:[]},r||{});return i.contains.push(n.PHRASAL_WORDS_MODE),i.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|XXX):",relevance:0}),i},n.C_LINE_COMMENT_MODE=n.COMMENT("//","$"),n.C_BLOCK_COMMENT_MODE=n.COMMENT("/\\*","\\*/"),n.HASH_COMMENT_MODE=n.COMMENT("#","$"),n.NUMBER_MODE={className:"number",begin:n.NUMBER_RE,relevance:0},n.C_NUMBER_MODE={className:"number",begin:n.C_NUMBER_RE,relevance:0},n.BINARY_NUMBER_MODE={className:"number",begin:n.BINARY_NUMBER_RE,relevance:0},n.CSS_NUMBER_MODE={className:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},n.REGEXP_MODE={className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[n.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[n.BACKSLASH_ESCAPE]}]},n.TITLE_MODE={className:"title",begin:n.IDENT_RE,relevance:0},n.UNDERSCORE_TITLE_MODE={className:"title",begin:n.UNDERSCORE_IDENT_RE,relevance:0},n.METHOD_GUARD={begin:"\\.\\s*"+n.UNDERSCORE_IDENT_RE,relevance:0},n});var PIXI=function(e){"use strict";var O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e,t){return e(t={exports:{}},t.exports),t.exports}var i=r(function(e,S){!function(e){var t,r=e.Promise,i=r&&"resolve"in r&&"reject"in r&&"all"in r&&"race"in r&&(new r(function(e){t=e}),"function"==typeof t);S?(S.Promise=i?r:T,S.Polyfill=T):i||(e.Promise=T);var n="pending",o="sealed",a="fulfilled",s="rejected",u=function(){};function h(e){return"[object Array]"===Object.prototype.toString.call(e)}var c,f="undefined"!=typeof setImmediate?setImmediate:setTimeout,l=[];function d(){for(var e=0;e<l.length;e++)l[e][0](l[e][1]);c=!(l=[])}function p(e,t){l.push([e,t]),c||(c=!0,f(d,0))}function m(e){var t=e.owner,r=t.state_,i=t.data_,n=e[r],o=e.then;if("function"==typeof n){r=a;try{i=n(i)}catch(e){y(o,e)}}v(o,i)||(r===a&&b(o,i),r===s&&y(o,i))}function v(t,r){var i;try{if(t===r)throw new TypeError("A promises callback cannot return that same promise.");if(r&&("function"==typeof r||"object"==typeof r)){var e=r.then;if("function"==typeof e)return e.call(r,function(e){i||(i=!0,r!==e?b(t,e):g(t,e))},function(e){i||(i=!0,y(t,e))}),!0}}catch(e){return i||y(t,e),!0}return!1}function b(e,t){e!==t&&v(e,t)||g(e,t)}function g(e,t){e.state_===n&&(e.state_=o,e.data_=t,p(w,e))}function y(e,t){e.state_===n&&(e.state_=o,e.data_=t,p(x,e))}function _(e){var t=e.then_;e.then_=void 0;for(var r=0;r<t.length;r++)m(t[r])}function w(e){e.state_=a,_(e)}function x(e){e.state_=s,_(e)}function T(e){if("function"!=typeof e)throw new TypeError("Promise constructor takes a function argument");if(this instanceof T==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[],function(e,t){function r(e){y(t,e)}try{e(function(e){b(t,e)},r)}catch(e){r(e)}}(e,this)}T.prototype={constructor:T,state_:n,then_:null,data_:void 0,then:function(e,t){var r={owner:this,then:new this.constructor(u),fulfilled:e,rejected:t};return this.state_===a||this.state_===s?p(m,r):this.then_.push(r),r.then},catch:function(e){return this.then(null,e)}},T.all=function(s){if(!h(s))throw new TypeError("You must pass an array to Promise.all().");return new this(function(r,e){var i=[],n=0;function t(t){return n++,function(e){i[t]=e,--n||r(i)}}for(var o,a=0;a<s.length;a++)(o=s[a])&&"function"==typeof o.then?o.then(t(a),e):i[a]=o;n||r(i)})},T.race=function(n){if(!h(n))throw new TypeError("You must pass an array to Promise.race().");return new this(function(e,t){for(var r,i=0;i<n.length;i++)(r=n[i])&&"function"==typeof r.then?r.then(e,t):e(r)})},T.resolve=function(t){return t&&"object"==typeof t&&t.constructor===this?t:new this(function(e){e(t)})},T.reject=function(r){return new this(function(e,t){t(r)})}}("undefined"!=typeof window?window:void 0!==O?O:"undefined"!=typeof self?self:O)}),n=(i.Promise,i.Polyfill),h=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var o=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,i,n=arguments,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a<arguments.length;a++){for(var s in r=Object(n[a]))c.call(r,s)&&(o[s]=r[s]);if(h){i=h(r);for(var u=0;u<i.length;u++)f.call(r,i[u])&&(o[i[u]]=r[i[u]])}}return o};window.Promise||(window.Promise=n),Object.assign||(Object.assign=o);var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!a.performance||!a.performance.now){var s=Date.now();a.performance||(a.performance={}),a.performance.now=function(){return Date.now()-s}}for(var u=Date.now(),l=["ms","moz","webkit","o"],d=0;d<l.length&&!a.requestAnimationFrame;++d){var p=l[d];a.requestAnimationFrame=a[p+"RequestAnimationFrame"],a.cancelAnimationFrame=a[p+"CancelAnimationFrame"]||a[p+"CancelRequestAnimationFrame"]}a.requestAnimationFrame||(a.requestAnimationFrame=function(e){if("function"!=typeof e)throw new TypeError(e+"is not a function");var t=Date.now(),r=16+u-t;return r<0&&(r=0),u=t,setTimeout(function(){u=Date.now(),e(performance.now())},r)}),a.cancelAnimationFrame||(a.cancelAnimationFrame=function(e){return clearTimeout(e)}),Math.sign||(Math.sign=function(e){return 0===(e=Number(e))||isNaN(e)?e:0<e?1:-1}),Number.isInteger||(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var m=r(function(r){!function(e){var n=/iPhone/i,o=/iPod/i,a=/iPad/i,s=/\bAndroid(?:.+)Mobile\b/i,u=/Android/i,h=/\bAndroid(?:.+)SD4930UR\b/i,c=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,f=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,d=/BlackBerry/i,p=/BB10/i,m=/Opera Mini/i,v=/\b(CriOS|Chrome)(?:.+)Mobile/i,b=/\Mobile(?:.+)Firefox\b/i;function g(e,t){return e.test(t)}function t(e){var t=e||("undefined"!=typeof navigator?navigator.userAgent:""),r=t.split("[FBAN");void 0!==r[1]&&(t=r[0]),void 0!==(r=t.split("Twitter"))[1]&&(t=r[0]);var i={apple:{phone:g(n,t)&&!g(f,t),ipod:g(o,t),tablet:!g(n,t)&&g(a,t)&&!g(f,t),device:(g(n,t)||g(o,t)||g(a,t))&&!g(f,t)},amazon:{phone:g(h,t),tablet:!g(h,t)&&g(c,t),device:g(h,t)||g(c,t)},android:{phone:!g(f,t)&&g(h,t)||!g(f,t)&&g(s,t),tablet:!g(f,t)&&!g(h,t)&&!g(s,t)&&(g(c,t)||g(u,t)),device:!g(f,t)&&(g(h,t)||g(c,t)||g(s,t)||g(u,t))},windows:{phone:g(f,t),tablet:g(l,t),device:g(f,t)||g(l,t)},other:{blackberry:g(d,t),blackberry10:g(p,t),opera:g(m,t),firefox:g(b,t),chrome:g(v,t),device:g(d,t)||g(p,t)||g(m,t)||g(b,t)||g(v,t)}};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}r.exports&&"undefined"==typeof window?r.exports=t:r.exports&&"undefined"!=typeof window?r.exports=t():e.isMobile=t()}(O)});var A={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(e){var t=!0;if(m.tablet||m.phone){if(t=!1,m.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&11<=parseInt(r[1],10)&&(t=!0)}if(m.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&7<=parseInt(i[1],10)&&(t=!0)}}return t?e:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:m.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!m.apple.device,CREATE_IMAGE_BITMAP:!0,ROUND_PIXELS:!1},v=r(function(e){var i=Object.prototype.hasOwnProperty,p="~";function r(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function n(e,t,r,i,n){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new s(r,i||e,n),a=p?p+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],o]:e._events[a].push(o):(e._events[a]=o,e._eventsCount++),e}function h(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function t(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(p=!1)),t.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)i.call(e,t)&&r.push(p?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},t.prototype.listeners=function(e){var t=p?p+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,n=r.length,o=new Array(n);i<n;i++)o[i]=r[i].fn;return o},t.prototype.listenerCount=function(e){var t=p?p+e:e,r=this._events[t];return r?r.fn?1:r.length:0},t.prototype.emit=function(e,t,r,i,n,o){var a=arguments,s=p?p+e:e;if(!this._events[s])return!1;var u,h,c=this._events[s],f=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,i),!0;case 5:return c.fn.call(c.context,t,r,i,n),!0;case 6:return c.fn.call(c.context,t,r,i,n,o),!0}for(h=1,u=new Array(f-1);h<f;h++)u[h-1]=a[h];c.fn.apply(c.context,u)}else{var l,d=c.length;for(h=0;h<d;h++)switch(c[h].once&&this.removeListener(e,c[h].fn,void 0,!0),f){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,t);break;case 3:c[h].fn.call(c[h].context,t,r);break;case 4:c[h].fn.call(c[h].context,t,r,i);break;default:if(!u)for(l=1,u=new Array(f-1);l<f;l++)u[l-1]=a[l];c[h].fn.apply(c[h].context,u)}}return!0},t.prototype.on=function(e,t,r){return n(this,e,t,r,!1)},t.prototype.once=function(e,t,r){return n(this,e,t,r,!0)},t.prototype.removeListener=function(e,t,r,i){var n=p?p+e:e;if(!this._events[n])return this;if(!t)return h(this,n),this;var o=this._events[n];if(o.fn)o.fn!==t||i&&!o.once||r&&o.context!==r||h(this,n);else{for(var a=0,s=[],u=o.length;a<u;a++)(o[a].fn!==t||i&&!o[a].once||r&&o[a].context!==r)&&s.push(o[a]);s.length?this._events[n]=1===s.length?s[0]:s:h(this,n)}return this},t.prototype.removeAllListeners=function(e){var t;return e?(t=p?p+e:e,this._events[t]&&h(this,t)):(this._events=new r,this._eventsCount=0),this},t.prototype.off=t.prototype.removeListener,t.prototype.addListener=t.prototype.on,t.prefixed=p,t.EventEmitter=t,e.exports=t}),b=y,g=y;function y(e,t,r){r=r||2;var i,n,o,a,s,u,h,c=t&&t.length,f=c?t[0]*r:e.length,l=_(e,0,f,r,!0),d=[];if(!l||l.next===l.prev)return d;if(c&&(l=function(e,t,r,i){var n,o,a,s,u,h=[];for(n=0,o=t.length;n<o;n++)a=t[n]*i,s=n<o-1?t[n+1]*i:e.length,(u=_(e,a,s,i,!1))===u.next&&(u.steiner=!0),h.push(I(u));for(h.sort(M),n=0;n<h.length;n++)C(h[n],r),r=w(r,r.next);return r}(e,t,l,r)),e.length>80*r){i=o=e[0],n=a=e[1];for(var p=r;p<f;p+=r)(s=e[p])<i&&(i=s),(u=e[p+1])<n&&(n=u),o<s&&(o=s),a<u&&(a=u);h=0!==(h=Math.max(o-i,a-n))?1/h:0}return x(l,d,r,i,n,h),d}function _(e,t,r,i,n){var o,a;if(n===0<X(e,t,r,i))for(o=t;o<r;o+=i)a=N(o,e[o],e[o+1],a);else for(o=r-i;t<=o;o-=i)a=N(o,e[o],e[o+1],a);return a&&L(a,a.next)&&(U(a),a=a.next),a}function w(e,t){if(!e)return e;t||(t=e);var r,i=e;do{if(r=!1,i.steiner||!L(i,i.next)&&0!==D(i.prev,i,i.next))i=i.next;else{if(U(i),(i=t=i.prev)===i.next)break;r=!0}}while(r||i!==t);return t}function x(e,t,r,i,n,o,a){if(e){!a&&o&&function(e,t,r,i){var n=e;for(;null===n.z&&(n.z=k(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next,n!==e;);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,r,i,n,o,a,s,u,h=1;do{for(r=e,o=e=null,a=0;r;){for(a++,i=r,t=s=0;t<h&&(s++,i=i.nextZ);t++);for(u=h;0<s||0<u&&i;)0!==s&&(0===u||!i||r.z<=i.z)?(r=(n=r).nextZ,s--):(i=(n=i).nextZ,u--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;r=i}o.nextZ=null,h*=2}while(1<a)}(n)}(e,i,n,o);for(var s,u,h=e;e.prev!==e.next;)if(s=e.prev,u=e.next,o?S(e,i,n,o):T(e))t.push(s.i/r),t.push(e.i/r),t.push(u.i/r),U(e),e=u.next,h=u.next;else if((e=u)===h){a?1===a?x(e=E(e,t,r),t,r,i,n,o,2):2===a&&P(e,t,r,i,n,o):x(w(e),t,r,i,n,o,1);break}}}function T(e){var t=e.prev,r=e,i=e.next;if(0<=D(t,r,i))return!1;for(var n=e.next.next;n!==e.prev;){if(R(t.x,t.y,r.x,r.y,i.x,i.y,n.x,n.y)&&0<=D(n.prev,n,n.next))return!1;n=n.next}return!0}function S(e,t,r,i){var n=e.prev,o=e,a=e.next;if(0<=D(n,o,a))return!1;for(var s=n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,u=n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,h=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,f=k(s,u,t,r,i),l=k(h,c,t,r,i),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=l;){if(d!==e.prev&&d!==e.next&&R(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=D(d.prev,d,d.next))return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&R(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=D(p.prev,p,p.next))return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&R(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=D(d.prev,d,d.next))return!1;d=d.prevZ}for(;p&&p.z<=l;){if(p!==e.prev&&p!==e.next&&R(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=D(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function E(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!L(n,o)&&F(n,i,i.next,o)&&j(n,o)&&j(o,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(o.i/r),U(i),U(i.next),i=e=o),i=i.next}while(i!==e);return i}function P(e,t,r,i,n,o){var a,s,u=e;do{for(var h=u.next.next;h!==u.prev;){if(u.i!==h.i&&(s=h,(a=u).next.i!==s.i&&a.prev.i!==s.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&F(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(a,s)&&j(a,s)&&j(s,a)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next,r!==e;);return i}(a,s))){var c=B(u,h);return u=w(u,u.next),c=w(c,c.next),x(u,t,r,i,n,o),void x(c,t,r,i,n,o)}h=h.next}u=u.next}while(u!==e)}function M(e,t){return e.x-t.x}function C(e,t){if(t=function(e,t){var r,i=t,n=e.x,o=e.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&a<s){if((a=s)===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!r)return null;if(n===a)return r.prev;var u,h=r,c=r.x,f=r.y,l=1/0;i=r.next;for(;i!==h;)n>=i.x&&i.x>=c&&n!==i.x&&R(o<f?n:a,o,c,f,o<f?a:n,o,i.x,i.y)&&((u=Math.abs(o-i.y)/(n-i.x))<l||u===l&&i.x>r.x)&&j(i,e)&&(r=i,l=u),i=i.next;return r}(e,t)){var r=B(t,e);w(r,r.next)}}function k(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function I(e){for(var t=e,r=e;(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),(t=t.next)!==e;);return r}function R(e,t,r,i,n,o,a,s){return 0<=(n-a)*(t-s)-(e-a)*(o-s)&&0<=(e-a)*(i-s)-(r-a)*(t-s)&&0<=(r-a)*(o-s)-(n-a)*(i-s)}function D(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function L(e,t){return e.x===t.x&&e.y===t.y}function F(e,t,r,i){return!!(L(e,t)&&L(r,i)||L(e,i)&&L(r,t))||0<D(e,t,r)!=0<D(e,t,i)&&0<D(r,i,e)!=0<D(r,i,t)}function j(e,t){return D(e.prev,e,e.next)<0?0<=D(e,t,e.next)&&0<=D(e,e.prev,t):D(e,t,e.prev)<0||D(e,e.next,t)<0}function B(e,t){var r=new z(e.i,e.x,e.y),i=new z(t.i,t.x,t.y),n=e.next,o=t.prev;return(e.next=t).prev=e,(r.next=n).prev=r,(i.next=r).prev=i,(o.next=i).prev=o,i}function N(e,t,r,i){var n=new z(e,t,r);return i?(n.next=i.next,(n.prev=i).next.prev=n,i.next=n):(n.prev=n).next=n,n}function U(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function z(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function X(e,t,r,i){for(var n=0,o=t,a=r-i;o<r;o+=i)n+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return n}y.deviation=function(e,t,r,i){var n=t&&t.length,o=n?t[0]*r:e.length,a=Math.abs(X(e,0,o,r));if(n)for(var s=0,u=t.length;s<u;s++){var h=t[s]*r,c=s<u-1?t[s+1]*r:e.length;a-=Math.abs(X(e,h,c,r))}var f=0;for(s=0;s<i.length;s+=3){var l=i[s]*r,d=i[s+1]*r,p=i[s+2]*r;f+=Math.abs((e[l]-e[p])*(e[1+d]-e[1+l])-(e[l]-e[d])*(e[1+p]-e[1+l]))}return 0===a&&0===f?0:Math.abs((f-a)/a)},y.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},i=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[n][o][a]);0<n&&(i+=e[n-1].length,r.holes.push(i))}return r},b.default=g;var q=r(function(I,R){!function(e){var t=R&&!R.nodeType&&R,r=I&&!I.nodeType&&I,i="object"==typeof O&&O;i.global!==i&&i.window!==i&&i.self!==i||(e=i);var n,o,b=2147483647,g=36,y=1,_=26,a=38,s=700,w=72,x=128,T="-",u=/^xn--/,h=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},l=g-y,S=Math.floor,E=String.fromCharCode;function A(e){throw RangeError(f[e])}function d(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function p(e,t){var r=e.split("@"),i="";return 1<r.length&&(i=r[0]+"@",e=r[1]),i+d((e=e.replace(c,".")).split("."),t).join(".")}function P(e){for(var t,r,i=[],n=0,o=e.length;n<o;)55296<=(t=e.charCodeAt(n++))&&t<=56319&&n<o?56320==(64512&(r=e.charCodeAt(n++)))?i.push(((1023&t)<<10)+(1023&r)+65536):(i.push(t),n--):i.push(t);return i}function M(e){return d(e,function(e){var t="";return 65535<e&&(t+=E((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=E(e)}).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);l*_>>1<e;i+=g)e=S(e/l);return S(i+(l+1)*e/(e+a))}function m(e){var t,r,i,n,o,a,s,u,h,c,f,l=[],d=e.length,p=0,m=x,v=w;for((r=e.lastIndexOf(T))<0&&(r=0),i=0;i<r;++i)128<=e.charCodeAt(i)&&A("not-basic"),l.push(e.charCodeAt(i));for(n=0<r?r+1:0;n<d;){for(o=p,a=1,s=g;d<=n&&A("invalid-input"),f=e.charCodeAt(n++),(g<=(u=f-48<10?f-22:f-65<26?f-65:f-97<26?f-97:g)||u>S((b-p)/a))&&A("overflow"),p+=u*a,!(u<(h=s<=v?y:v+_<=s?_:s-v));s+=g)a>S(b/(c=g-h))&&A("overflow"),a*=c;v=k(p-o,t=l.length+1,0==o),S(p/t)>b-m&&A("overflow"),m+=S(p/t),p%=t,l.splice(p++,0,m)}return M(l)}function v(e){var t,r,i,n,o,a,s,u,h,c,f,l,d,p,m,v=[];for(l=(e=P(e)).length,t=x,o=w,a=r=0;a<l;++a)(f=e[a])<128&&v.push(E(f));for(i=n=v.length,n&&v.push(T);i<l;){for(s=b,a=0;a<l;++a)t<=(f=e[a])&&f<s&&(s=f);for(s-t>S((b-r)/(d=i+1))&&A("overflow"),r+=(s-t)*d,t=s,a=0;a<l;++a)if((f=e[a])<t&&++r>b&&A("overflow"),f==t){for(u=r,h=g;!(u<(c=h<=o?y:o+_<=h?_:h-o));h+=g)m=u-c,p=g-c,v.push(E(C(c+m%p,0))),u=S(m/p);v.push(E(C(u,0))),o=k(r,d,i==n),r=0,++i}++r,++t}return v.join("")}if(n={version:"1.3.2",ucs2:{decode:P,encode:M},decode:m,encode:v,toASCII:function(e){return p(e,function(e){return h.test(e)?"xn--"+v(e):e})},toUnicode:function(e){return p(e,function(e){return u.test(e)?m(e.slice(4).toLowerCase()):e})}},t&&r)if(I.exports==t)r.exports=n;else for(o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);else e.punycode=n}(O)}),H={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};H.isString,H.isObject,H.isNull,H.isNullOrUndefined;var G=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var o=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var s,u,h=e.length;0<a&&a<h&&(h=a);for(var c=0;c<h;++c){var f,l,d,p,m=e[c].replace(o,"%20"),v=m.indexOf(r);l=0<=v?(f=m.substr(0,v),m.substr(v+1)):(f=m,""),d=decodeURIComponent(f),p=decodeURIComponent(l),s=n,u=d,Object.prototype.hasOwnProperty.call(s,u)?Array.isArray(n[d])?n[d].push(p):n[d]=[n[d],p]:n[d]=p}return n},V=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},Y=function(r,i,n,e){return i=i||"&",n=n||"=",null===r&&(r=void 0),"object"==typeof r?Object.keys(r).map(function(e){var t=encodeURIComponent(V(e))+n;return Array.isArray(r[e])?r[e].map(function(e){return t+encodeURIComponent(V(e))}).join(i):t+encodeURIComponent(V(r[e]))}).join(i):e?encodeURIComponent(V(e))+n+encodeURIComponent(V(r)):""},W=r(function(e,t){t.decode=t.parse=G,t.encode=t.stringify=Y}),J=(W.decode,W.parse,W.encode,W.stringify,de),K=function(e,t){return de(e,!1,!0).resolve(t)},Z=function(e,t){return e?de(e,!1,!0).resolveObject(t):t},Q=function(e){H.isString(e)&&(e=de(e));return e instanceof ee?e.format():ee.prototype.format.call(e)},$=ee;function ee(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var te=/^([a-z0-9.+-]+:)/i,re=/:[0-9]*$/,ie=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ne=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),oe=["'"].concat(ne),ae=["%","/","?",";","#"].concat(oe),se=["/","?","#"],ue=/^[+a-z0-9A-Z_-]{0,63}$/,he=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ce={javascript:!0,"javascript:":!0},fe={javascript:!0,"javascript:":!0},le={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function de(e,t,r){if(e&&H.isObject(e)&&e instanceof ee)return e;var i=new ee;return i.parse(e,t,r),i}ee.prototype.parse=function(e,t,r){if(!H.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),n=-1!==i&&i<e.indexOf("#")?"?":"#",o=e.split(n);o[0]=o[0].replace(/\\/g,"/");var a=e=o.join(n);if(a=a.trim(),!r&&1===e.split("#").length){var s=ie.exec(a);if(s)return this.path=a,this.href=a,this.pathname=s[1],s[2]?(this.search=s[2],this.query=t?W.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var u=te.exec(a);if(u){var h=(u=u[0]).toLowerCase();this.protocol=h,a=a.substr(u.length)}if(r||u||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var c="//"===a.substr(0,2);!c||u&&fe[u]||(a=a.substr(2),this.slashes=!0)}if(!fe[u]&&(c||u&&!le[u])){for(var f,l,d=-1,p=0;p<se.length;p++){-1!==(m=a.indexOf(se[p]))&&(-1===d||m<d)&&(d=m)}-1!==(l=-1===d?a.lastIndexOf("@"):a.lastIndexOf("@",d))&&(f=a.slice(0,l),a=a.slice(l+1),this.auth=decodeURIComponent(f)),d=-1;for(p=0;p<ae.length;p++){var m;-1!==(m=a.indexOf(ae[p]))&&(-1===d||m<d)&&(d=m)}-1===d&&(d=a.length),this.host=a.slice(0,d),a=a.slice(d),this.parseHost(),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!v)for(var b=this.hostname.split(/\./),g=(p=0,b.length);p<g;p++){var y=b[p];if(y&&!y.match(ue)){for(var _="",w=0,x=y.length;w<x;w++)127<y.charCodeAt(w)?_+="x":_+=y[w];if(!_.match(ue)){var T=b.slice(0,p),S=b.slice(p+1),E=y.match(he);E&&(T.push(E[1]),S.unshift(E[2])),S.length&&(a="/"+S.join(".")+a),this.hostname=T.join(".");break}}}255<this.hostname.length?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=q.toASCII(this.hostname));var A=this.port?":"+this.port:"",P=this.hostname||"";this.host=P+A,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!ce[h])for(p=0,g=oe.length;p<g;p++){var M=oe[p];if(-1!==a.indexOf(M)){var C=encodeURIComponent(M);C===M&&(C=escape(M)),a=a.split(M).join(C)}}var k=a.indexOf("#");-1!==k&&(this.hash=a.substr(k),a=a.slice(0,k));var I=a.indexOf("?");if(-1!==I?(this.search=a.substr(I),this.query=a.substr(I+1),t&&(this.query=W.parse(this.query)),a=a.slice(0,I)):t&&(this.search="",this.query={}),a&&(this.pathname=a),le[h]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){A=this.pathname||"";var R=this.search||"";this.path=A+R}return this.href=this.format(),this},ee.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=e+this.host:this.hostname&&(n=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&H.isObject(this.query)&&Object.keys(this.query).length&&(o=W.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||le[t])&&!1!==n?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),a&&"?"!==a.charAt(0)&&(a="?"+a),t+n+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(a=a.replace("#","%23"))+i},ee.prototype.resolve=function(e){return this.resolveObject(de(e,!1,!0)).format()},ee.prototype.resolveObject=function(e){if(H.isString(e)){var t=new ee;t.parse(e,!1,!0),e=t}for(var r=new ee,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),s=0;s<a.length;s++){var u=a[s];"protocol"!==u&&(r[u]=e[u])}return le[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!le[e.protocol]){for(var h=Object.keys(e),c=0;c<h.length;c++){var f=h[c];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||fe[e.protocol])r.pathname=e.pathname;else{for(var l=(e.pathname||"").split("/");l.length&&!(e.host=l.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==l[0]&&l.unshift(""),l.length<2&&l.unshift(""),r.pathname=l.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var m=r.pathname&&"/"===r.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=v||m||r.host&&e.pathname,g=b,y=r.pathname&&r.pathname.split("/")||[],_=(l=e.pathname&&e.pathname.split("/")||[],r.protocol&&!le[r.protocol]);if(_&&(r.hostname="",r.port=null,r.host&&(""===y[0]?y[0]=r.host:y.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===l[0]?l[0]=e.host:l.unshift(e.host)),e.host=null),b=b&&(""===l[0]||""===y[0])),v)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,y=l;else if(l.length)y||(y=[]),y.pop(),y=y.concat(l),r.search=e.search,r.query=e.query;else if(!H.isNullOrUndefined(e.search)){if(_)r.hostname=r.host=y.shift(),(E=!!(r.host&&0<r.host.indexOf("@"))&&r.host.split("@"))&&(r.auth=E.shift(),r.host=r.hostname=E.shift());return r.search=e.search,r.query=e.query,H.isNull(r.pathname)&&H.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!y.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var w=y.slice(-1)[0],x=(r.host||e.host||1<y.length)&&("."===w||".."===w)||""===w,T=0,S=y.length;0<=S;S--)"."===(w=y[S])?y.splice(S,1):".."===w?(y.splice(S,1),T++):T&&(y.splice(S,1),T--);if(!b&&!g)for(;T--;T)y.unshift("..");!b||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),x&&"/"!==y.join("/").substr(-1)&&y.push("");var E,A=""===y[0]||y[0]&&"/"===y[0].charAt(0);_&&(r.hostname=r.host=A?"":y.length?y.shift():"",(E=!!(r.host&&0<r.host.indexOf("@"))&&r.host.split("@"))&&(r.auth=E.shift(),r.host=r.hostname=E.shift()));return(b=b||r.host&&y.length)&&!A&&y.unshift(""),y.length?r.pathname=y.join("/"):(r.pathname=null,r.path=null),H.isNull(r.pathname)&&H.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},ee.prototype.parseHost=function(){var e=this.host,t=re.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var pe,me={parse:J,resolve:K,resolveObject:Z,format:Q,Url:$},ve={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},be={UNKNOWN:0,WEBGL:1,CANVAS:2},ge={NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},ye={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},_e={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},we={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},xe={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},Te={LINEAR:1,NEAREST:0},Se={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Ee={OFF:0,POW2:1,ON:2},Ae={AUTO:0,MANUAL:1},Pe={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},Me=!(A.RETINA_PREFIX=/@([0-9\.]+)x/),Ce="5.0.0-rc.3";function ke(e){if(!Me){if(-1<navigator.userAgent.toLowerCase().indexOf("chrome")){var t=["\n %c %c %c PixiJS "+Ce+" - ✰ "+e+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,t)}else window.console&&window.console.log("PixiJS "+Ce+" - "+e+" - http://www.pixijs.com/");Me=!0}}function Ie(){return void 0===pe&&(pe=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(e){return!1}}()),pe}function Re(e,t){return(t=t||[])[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t}function Oe(e){return e=e.toString(16),"#"+(e="000000".substr(0,6-e.length)+e)}function De(e){return"string"==typeof e&&"#"===e[0]&&(e=e.substr(1)),parseInt(e,16)}var Le=function(){for(var e=[],t=[],r=0;r<32;r++)t[e[r]=r]=r;e[ge.NORMAL_NPM]=ge.NORMAL,e[ge.ADD_NPM]=ge.ADD,e[ge.SCREEN_NPM]=ge.SCREEN,t[ge.NORMAL]=ge.NORMAL_NPM,t[ge.ADD]=ge.ADD_NPM,t[ge.SCREEN]=ge.SCREEN_NPM;var i=[];return i.push(t),i.push(e),i}();function Fe(e,t){return Le[t?1:0][e]}function je(e,t,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t):(r[0]=e[0],r[1]=e[1],r[2]=e[2]),r[3]=t,r}function Be(e,t){if(1===t)return(255*t<<24)+e;if(0===t)return 0;var r=e>>16&255,i=e>>8&255,n=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((i=i*t+.5|0)<<8)+(n=n*t+.5|0)}function Ne(e,t,r,i){return(r=r||new Float32Array(4))[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,(i||void 0===i)&&(r[0]*=t,r[1]*=t,r[2]*=t),r[3]=t,r}function Ue(e){for(var t=6*e,r=new Uint16Array(t),i=0,n=0;i<t;i+=6,n+=4)r[i+0]=n+0,r[i+1]=n+1,r[i+2]=n+2,r[i+3]=n+0,r[i+4]=n+2,r[i+5]=n+3;return r}function ze(e,t,r){var i,n=e.length;if(!(n<=t||0===r)){var o=n-(r=n<t+r?n-t:r);for(i=t;i<o;++i)e[i]=e[i+r];e.length=o}}var Xe=0;function qe(){return++Xe}function He(e){return 0===e?0:e<0?-1:1}function Ge(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1}function Ve(e){return!(e&e-1||!e)}function Ye(e){var t=(65535<e)<<4,r=(255<(e>>>=t))<<3;return t|=r,t|=r=(15<(e>>>=r))<<2,(t|=r=(3<(e>>>=r))<<1)|(e>>>=r)>>1}var We={},Je=Object.create(null),Ke=Object.create(null);function Ze(e){var t,r,i,n=e.width,o=e.height,a=e.getContext("2d"),s=a.getImageData(0,0,n,o).data,u=s.length,h={top:null,left:null,right:null,bottom:null},c=null;for(t=0;t<u;t+=4)0!==s[t+3]&&(r=t/4%n,i=~~(t/4/n),null===h.top&&(h.top=i),null===h.left?h.left=r:r<h.left&&(h.left=r),null===h.right?h.right=1+r:h.right<r&&(h.right=1+r),null===h.bottom?h.bottom=i:h.bottom<i&&(h.bottom=i));return null!==h.top&&(n=h.right-h.left,o=h.bottom-h.top+1,c=a.getImageData(h.left,h.top,n,o)),{height:o,width:n,data:c}}var Qe=function(e,t,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||A.RESOLUTION,this.resize(e,t)},$e={width:{configurable:!0},height:{configurable:!0}};Qe.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},Qe.prototype.resize=function(e,t){this.canvas.width=e*this.resolution,this.canvas.height=t*this.resolution},Qe.prototype.destroy=function(){this.context=null,this.canvas=null},$e.width.get=function(){return this.canvas.width},$e.width.set=function(e){this.canvas.width=e},$e.height.get=function(){return this.canvas.height},$e.height.set=function(e){this.canvas.height=e},Object.defineProperties(Qe.prototype,$e);var et,tt=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function rt(e){var t=tt.exec(e);if(t)return{mediaType:t[1]?t[1].toLowerCase():void 0,subType:t[2]?t[2].toLowerCase():void 0,charset:t[3]?t[3].toLowerCase():void 0,encoding:t[4]?t[4].toLowerCase():void 0,data:t[5]}}function it(e,t){if(void 0===t&&(t=window.location),0===e.indexOf("data:"))return"";t=t||window.location,et||(et=document.createElement("a")),et.href=e;var r=!(e=me.parse(et.href)).port&&""===t.port||e.port===t.port;return e.hostname===t.hostname&&r&&e.protocol===t.protocol?"":"anonymous"}function nt(e,t){var r=A.RETINA_PREFIX.exec(e);return r?parseFloat(r[1]):void 0!==t?t:1}var ot={};function at(e,t,r){if(void 0===r&&(r=3),!ot[t]){var i=(new Error).stack;void 0===i?console.warn("PixiJS Deprecation Warning: ",t+"\nDeprecated since v"+e):(i=i.split("\n").splice(r).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",t+"\nDeprecated since v"+e),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",t+"\nDeprecated since v"+e),console.warn(i))),ot[t]=!0}}var st={BaseTextureCache:Ke,CanvasRenderTarget:Qe,DATA_URI:tt,ProgramCache:We,TextureCache:Je,clearTextureCache:function(){var e;for(e in Je)delete Je[e];for(e in Ke)delete Ke[e]},correctBlendMode:Fe,createIndicesForQuads:Ue,decomposeDataUri:rt,deprecation:at,destroyTextureCache:function(){var e;for(e in Je)Je[e].destroy();for(e in Ke)Ke[e].destroy()},determineCrossOrigin:it,getResolutionOfUrl:nt,hex2rgb:Re,hex2string:Oe,isPow2:Ve,isWebGLSupported:Ie,log2:Ye,nextPow2:Ge,premultiplyBlendMode:Le,premultiplyRgba:je,premultiplyTint:Be,premultiplyTintToRgba:Ne,removeItems:ze,rgb2hex:function(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)},sayHello:ke,sign:He,skipHello:function(){Me=!0},string2hex:De,trimCanvas:Ze,uid:qe,isMobile:m,EventEmitter:v,earcut:b,url:me},ut=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.x=e,this.y=t};ut.prototype.clone=function(){return new ut(this.x,this.y)},ut.prototype.copyFrom=function(e){return this.set(e.x,e.y),this},ut.prototype.copyTo=function(e){return e.set(this.x,this.y),e},ut.prototype.equals=function(e){return e.x===this.x&&e.y===this.y},ut.prototype.set=function(e,t){this.x=e||0,this.y=t||(0!==t?this.x:0)};var ht=function(e,t,r,i){void 0===r&&(r=0),void 0===i&&(i=0),this._x=r,this._y=i,this.cb=e,this.scope=t},ct={x:{configurable:!0},y:{configurable:!0}};ht.prototype.clone=function(e,t){void 0===e&&(e=null),void 0===t&&(t=null);var r=e||this.cb,i=t||this.scope;return new ht(r,i,this._x,this._y)},ht.prototype.set=function(e,t){var r=e||0,i=t||(0!==t?r:0);this._x===r&&this._y===i||(this._x=r,this._y=i,this.cb.call(this.scope))},ht.prototype.copyFrom=function(e){return this._x===e.x&&this._y===e.y||(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},ht.prototype.copyTo=function(e){return e.set(this._x,this._y),e},ht.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},ct.x.get=function(){return this._x},ct.x.set=function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},ct.y.get=function(){return this._y},ct.y.set=function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},Object.defineProperties(ht.prototype,ct);var ft=2*Math.PI,lt=180/Math.PI,dt=Math.PI/180,pt={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},mt=function(e,t,r,i,n,o){void 0===e&&(e=1),void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),this.a=e,this.b=t,this.c=r,this.d=i,this.tx=n,this.ty=o,this.array=null},vt={IDENTITY:{configurable:!0},TEMP_MATRIX:{configurable:!0}};mt.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},mt.prototype.set=function(e,t,r,i,n,o){return this.a=e,this.b=t,this.c=r,this.d=i,this.tx=n,this.ty=o,this},mt.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));var r=t||this.array;return e?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0),r[8]=1,r},mt.prototype.apply=function(e,t){t=t||new ut;var r=e.x,i=e.y;return t.x=this.a*r+this.c*i+this.tx,t.y=this.b*r+this.d*i+this.ty,t},mt.prototype.applyInverse=function(e,t){t=t||new ut;var r=1/(this.a*this.d+this.c*-this.b),i=e.x,n=e.y;return t.x=this.d*r*i+-this.c*r*n+(this.ty*this.c-this.tx*this.d)*r,t.y=this.a*r*n+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,t},mt.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},mt.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},mt.prototype.rotate=function(e){var t=Math.cos(e),r=Math.sin(e),i=this.a,n=this.c,o=this.tx;return this.a=i*t-this.b*r,this.b=i*r+this.b*t,this.c=n*t-this.d*r,this.d=n*r+this.d*t,this.tx=o*t-this.ty*r,this.ty=o*r+this.ty*t,this},mt.prototype.append=function(e){var t=this.a,r=this.b,i=this.c,n=this.d;return this.a=e.a*t+e.b*i,this.b=e.a*r+e.b*n,this.c=e.c*t+e.d*i,this.d=e.c*r+e.d*n,this.tx=e.tx*t+e.ty*i+this.tx,this.ty=e.tx*r+e.ty*n+this.ty,this},mt.prototype.setTransform=function(e,t,r,i,n,o,a,s,u){return this.a=Math.cos(a+u)*n,this.b=Math.sin(a+u)*n,this.c=-Math.sin(a-s)*o,this.d=Math.cos(a-s)*o,this.tx=e-(r*this.a+i*this.c),this.ty=t-(r*this.b+i*this.d),this},mt.prototype.prepend=function(e){var t=this.tx;if(1!==e.a||0!==e.b||0!==e.c||1!==e.d){var r=this.a,i=this.c;this.a=r*e.a+this.b*e.c,this.b=r*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},mt.prototype.decompose=function(e){var t=this.a,r=this.b,i=this.c,n=this.d,o=-Math.atan2(-i,n),a=Math.atan2(r,t),s=Math.abs(o+a);return s<1e-5||Math.abs(ft-s)<1e-5?(e.rotation=a,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=a),e.scale.x=Math.sqrt(t*t+r*r),e.scale.y=Math.sqrt(i*i+n*n),e.position.x=this.tx,e.position.y=this.ty,e},mt.prototype.invert=function(){var e=this.a,t=this.b,r=this.c,i=this.d,n=this.tx,o=e*i-t*r;return this.a=i/o,this.b=-t/o,this.c=-r/o,this.d=e/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(e*this.ty-t*n)/o,this},mt.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},mt.prototype.clone=function(){var e=new mt;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},mt.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},mt.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},vt.IDENTITY.get=function(){return new mt},vt.TEMP_MATRIX.get=function(){return new mt},Object.defineProperties(mt,vt);var bt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],gt=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],yt=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],_t=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],wt=[],xt=[];function Tt(e){return e<0?-1:0<e?1:0}!function(){for(var e=0;e<16;e++){var t=[];xt.push(t);for(var r=0;r<16;r++)for(var i=Tt(bt[e]*bt[r]+yt[e]*gt[r]),n=Tt(gt[e]*bt[r]+_t[e]*gt[r]),o=Tt(bt[e]*yt[r]+yt[e]*_t[r]),a=Tt(gt[e]*yt[r]+_t[e]*_t[r]),s=0;s<16;s++)if(bt[s]===i&&gt[s]===n&&yt[s]===o&&_t[s]===a){t.push(s);break}}for(var u=0;u<16;u++){var h=new mt;h.set(bt[u],gt[u],yt[u],_t[u],0,0),wt.push(h)}}();var St={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(e){return bt[e]},uY:function(e){return gt[e]},vX:function(e){return yt[e]},vY:function(e){return _t[e]},inv:function(e){return 8&e?15&e:7&-e},add:function(e,t){return xt[e][t]},sub:function(e,t){return xt[e][St.inv(t)]},rotate180:function(e){return 4^e},isVertical:function(e){return 2==(3&e)},byDirection:function(e,t){return 2*Math.abs(e)<=Math.abs(t)?0<=t?St.S:St.N:2*Math.abs(t)<=Math.abs(e)?0<e?St.E:St.W:0<t?0<e?St.SE:St.SW:0<e?St.NE:St.NW},matrixAppendRotationInv:function(e,t,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=wt[St.inv(t)];n.tx=r,n.ty=i,e.append(n)}},Et=function(){this.worldTransform=new mt,this.localTransform=new mt,this.position=new ht(this.onChange,this,0,0),this.scale=new ht(this.onChange,this,1,1),this.pivot=new ht(this.onChange,this,0,0),this.skew=new ht(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0},At={rotation:{configurable:!0}};Et.prototype.onChange=function(){this._localID++},Et.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew._y),this._sx=Math.sin(this._rotation+this.skew._y),this._cy=-Math.sin(this._rotation-this.skew._x),this._sy=Math.cos(this._rotation-this.skew._x),this._localID++},Et.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},Et.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale._x,t.b=this._sx*this.scale._x,t.c=this._cy*this.scale._y,t.d=this._sy*this.scale._y,t.tx=this.position._x-(this.pivot._x*t.a+this.pivot._y*t.c),t.ty=this.position._y-(this.pivot._x*t.b+this.pivot._y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var r=e.worldTransform,i=this.worldTransform;i.a=t.a*r.a+t.b*r.c,i.b=t.a*r.b+t.b*r.d,i.c=t.c*r.a+t.d*r.c,i.d=t.c*r.b+t.d*r.d,i.tx=t.tx*r.a+t.ty*r.c+r.tx,i.ty=t.tx*r.b+t.ty*r.d+r.ty,this._parentID=e._worldID,this._worldID++}},Et.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},At.rotation.get=function(){return this._rotation},At.rotation.set=function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},Object.defineProperties(Et.prototype,At),Et.IDENTITY=new Et;var Pt=function(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(e),this.y=Number(t),this.width=Number(r),this.height=Number(i),this.type=pt.RECT},Mt={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Ct={EMPTY:{configurable:!0}};Mt.left.get=function(){return this.x},Mt.right.get=function(){return this.x+this.width},Mt.top.get=function(){return this.y},Mt.bottom.get=function(){return this.y+this.height},Ct.EMPTY.get=function(){return new Pt(0,0,0,0)},Pt.prototype.clone=function(){return new Pt(this.x,this.y,this.width,this.height)},Pt.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this},Pt.prototype.copyTo=function(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},Pt.prototype.contains=function(e,t){return!(this.width<=0||this.height<=0)&&(e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height)},Pt.prototype.pad=function(e,t){e=e||0,t=t||(0!==t?e:0),this.x-=e,this.y-=t,this.width+=2*e,this.height+=2*t},Pt.prototype.fit=function(e){var t=Math.max(this.x,e.x),r=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),n=Math.min(this.y+this.height,e.y+e.height);this.x=t,this.width=Math.max(r-t,0),this.y=i,this.height=Math.max(n-i,0)},Pt.prototype.ceil=function(e,t){void 0===e&&(e=1),void 0===t&&(t=.001);var r=Math.ceil((this.x+this.width-t)*e)/e,i=Math.ceil((this.y+this.height-t)*e)/e;this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=r-this.x,this.height=i-this.y},Pt.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),r=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),n=Math.max(this.y+this.height,e.y+e.height);this.x=t,this.width=r-t,this.y=i,this.height=n-i},Object.defineProperties(Pt.prototype,Mt),Object.defineProperties(Pt,Ct);var kt=function(e,t,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),this.x=e,this.y=t,this.radius=r,this.type=pt.CIRC};kt.prototype.clone=function(){return new kt(this.x,this.y,this.radius)},kt.prototype.contains=function(e,t){if(this.radius<=0)return!1;var r=this.radius*this.radius,i=this.x-e,n=this.y-t;return(i*=i)+(n*=n)<=r},kt.prototype.getBounds=function(){return new Pt(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)};var It=function(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=e,this.y=t,this.width=r,this.height=i,this.type=pt.ELIP};It.prototype.clone=function(){return new It(this.x,this.y,this.width,this.height)},It.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var r=(e-this.x)/this.width,i=(t-this.y)/this.height;return(r*=r)+(i*=i)<=1},It.prototype.getBounds=function(){return new Pt(this.x-this.width,this.y-this.height,this.width,this.height)};var Rt=function(){for(var e=arguments,t=[],r=arguments.length;r--;)t[r]=e[r];if(Array.isArray(t[0])&&(t=t[0]),t[0]instanceof ut){for(var i=[],n=0,o=t.length;n<o;n++)i.push(t[n].x,t[n].y);t=i}this.points=t,this.type=pt.POLY,this.closeStroke=!0};Rt.prototype.clone=function(){var e=new Rt(this.points.slice());return e.closeStroke=this.closeStroke,e},Rt.prototype.contains=function(e,t){for(var r=!1,i=this.points.length/2,n=0,o=i-1;n<i;o=n++){var a=this.points[2*n],s=this.points[2*n+1],u=this.points[2*o],h=this.points[2*o+1];t<s!=t<h&&e<(t-s)/(h-s)*(u-a)+a&&(r=!r)}return r};var Ot=function(e,t,r,i,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=e,this.y=t,this.width=r,this.height=i,this.radius=n,this.type=pt.RREC};Ot.prototype.clone=function(){return new Ot(this.x,this.y,this.width,this.height,this.radius)},Ot.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){if(t>=this.y+this.radius&&t<=this.y+this.height-this.radius||e>=this.x+this.radius&&e<=this.x+this.width-this.radius)return!0;var r=e-(this.x+this.radius),i=t-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=e-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=t-(this.y+this.height-this.radius))*i<=n)return!0;if((r=e-(this.x+this.radius))*r+i*i<=n)return!0}return!1},A.SORTABLE_CHILDREN=!1;var Dt=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Dt.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Dt.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Dt.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?Pt.EMPTY:((e=e||new Pt(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},Dt.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},Dt.prototype.addQuad=function(e){var t=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=e[0],a=e[1];t=o<t?o:t,r=a<r?a:r,i=i<o?o:i,n=n<a?a:n,t=(o=e[2])<t?o:t,r=(a=e[3])<r?a:r,i=i<o?o:i,n=n<a?a:n,t=(o=e[4])<t?o:t,r=(a=e[5])<r?a:r,i=i<o?o:i,n=n<a?a:n,t=(o=e[6])<t?o:t,r=(a=e[7])<r?a:r,i=i<o?o:i,n=n<a?a:n,this.minX=t,this.minY=r,this.maxX=i,this.maxY=n},Dt.prototype.addFrame=function(e,t,r,i,n){var o=e.worldTransform,a=o.a,s=o.b,u=o.c,h=o.d,c=o.tx,f=o.ty,l=this.minX,d=this.minY,p=this.maxX,m=this.maxY,v=a*t+u*r+c,b=s*t+h*r+f;l=v<l?v:l,d=b<d?b:d,p=p<v?v:p,m=m<b?b:m,l=(v=a*i+u*r+c)<l?v:l,d=(b=s*i+h*r+f)<d?b:d,p=p<v?v:p,m=m<b?b:m,l=(v=a*t+u*n+c)<l?v:l,d=(b=s*t+h*n+f)<d?b:d,p=p<v?v:p,m=m<b?b:m,l=(v=a*i+u*n+c)<l?v:l,d=(b=s*i+h*n+f)<d?b:d,p=p<v?v:p,m=m<b?b:m,this.minX=l,this.minY=d,this.maxX=p,this.maxY=m},Dt.prototype.addVertexData=function(e,t,r){for(var i=this.minX,n=this.minY,o=this.maxX,a=this.maxY,s=t;s<r;s+=2){var u=e[s],h=e[s+1];i=u<i?u:i,n=h<n?h:n,o=o<u?u:o,a=a<h?h:a}this.minX=i,this.minY=n,this.maxX=o,this.maxY=a},Dt.prototype.addVertices=function(e,t,r,i){for(var n=e.worldTransform,o=n.a,a=n.b,s=n.c,u=n.d,h=n.tx,c=n.ty,f=this.minX,l=this.minY,d=this.maxX,p=this.maxY,m=r;m<i;m+=2){var v=t[m],b=t[m+1],g=o*v+s*b+h,y=u*b+a*v+c;f=g<f?g:f,l=y<l?y:l,d=d<g?g:d,p=p<y?y:p}this.minX=f,this.minY=l,this.maxX=d,this.maxY=p},Dt.prototype.addBounds=function(e){var t=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=e.minX<t?e.minX:t,this.minY=e.minY<r?e.minY:r,this.maxX=e.maxX>i?e.maxX:i,this.maxY=e.maxY>n?e.maxY:n},Dt.prototype.addBoundsMask=function(e,t){var r=e.minX>t.minX?e.minX:t.minX,i=e.minY>t.minY?e.minY:t.minY,n=e.maxX<t.maxX?e.maxX:t.maxX,o=e.maxY<t.maxY?e.maxY:t.maxY;if(r<=n&&i<=o){var a=this.minX,s=this.minY,u=this.maxX,h=this.maxY;this.minX=r<a?r:a,this.minY=i<s?i:s,this.maxX=u<n?n:u,this.maxY=h<o?o:h}},Dt.prototype.addBoundsArea=function(e,t){var r=e.minX>t.x?e.minX:t.x,i=e.minY>t.y?e.minY:t.y,n=e.maxX<t.x+t.width?e.maxX:t.x+t.width,o=e.maxY<t.y+t.height?e.maxY:t.y+t.height;if(r<=n&&i<=o){var a=this.minX,s=this.minY,u=this.maxX,h=this.maxY;this.minX=r<a?r:a,this.minY=i<s?i:s,this.maxX=u<n?n:u,this.maxY=h<o?o:h}};var Lt=function(e){function n(){e.call(this),this.tempDisplayObjectParent=null,this.transform=new Et,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Dt,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}e&&(n.__proto__=e);var t={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return((n.prototype=Object.create(e&&e.prototype)).constructor=n).mixin=function(e){for(var t=Object.keys(e),r=0;r<t.length;++r){var i=t[r];Object.defineProperty(n.prototype,i,Object.getOwnPropertyDescriptor(e,i))}},t._tempDisplayObjectParent.get=function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new n),this.tempDisplayObjectParent},n.prototype.updateTransform=function(){this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._bounds.updateID++},n.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},n.prototype.getBounds=function(e,t){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._boundsID!==this._lastBoundsID&&this.calculateBounds(),t||(this._boundsRect||(this._boundsRect=new Pt),t=this._boundsRect),this._bounds.getRectangle(t)},n.prototype.getLocalBounds=function(e){var t=this.transform,r=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform,e||(this._localBoundsRect||(this._localBoundsRect=new Pt),e=this._localBoundsRect);var i=this.getBounds(!1,e);return this.parent=r,this.transform=t,i},n.prototype.toGlobal=function(e,t,r){return void 0===r&&(r=!1),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,t)},n.prototype.toLocal=function(e,t,r,i){return t&&(e=t.toGlobal(e,r,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,r)},n.prototype.render=function(e){},n.prototype.setParent=function(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e},n.prototype.setTransform=function(e,t,r,i,n,o,a,s,u){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=1),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===s&&(s=0),void 0===u&&(u=0),this.position.x=e,this.position.y=t,this.scale.x=r||1,this.scale.y=i||1,this.rotation=n,this.skew.x=o,this.skew.y=a,this.pivot.x=s,this.pivot.y=u,this},n.prototype.destroy=function(){this.removeAllListeners(),this.parent&&this.parent.removeChild(this),this.transform=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.filterArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},t.x.get=function(){return this.position.x},t.x.set=function(e){this.transform.position.x=e},t.y.get=function(){return this.position.y},t.y.set=function(e){this.transform.position.y=e},t.worldTransform.get=function(){return this.transform.worldTransform},t.localTransform.get=function(){return this.transform.localTransform},t.position.get=function(){return this.transform.position},t.position.set=function(e){this.transform.position.copyFrom(e)},t.scale.get=function(){return this.transform.scale},t.scale.set=function(e){this.transform.scale.copyFrom(e)},t.pivot.get=function(){return this.transform.pivot},t.pivot.set=function(e){this.transform.pivot.copyFrom(e)},t.skew.get=function(){return this.transform.skew},t.skew.set=function(e){this.transform.skew.copyFrom(e)},t.rotation.get=function(){return this.transform.rotation},t.rotation.set=function(e){this.transform.rotation=e},t.angle.get=function(){return this.transform.rotation*lt},t.angle.set=function(e){this.transform.rotation=e*dt},t.zIndex.get=function(){return this._zIndex},t.zIndex.set=function(e){this._zIndex=e,this.parent&&(this.parent.sortDirty=!0)},t.worldVisible.get=function(){var e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0},t.mask.get=function(){return this._mask},t.mask.set=function(e){this._mask&&(this._mask.renderable=!0,this._mask.isMask=!1),this._mask=e,this._mask&&(this._mask.renderable=!1,this._mask.isMask=!0)},Object.defineProperties(n.prototype,t),n}(v);function Ft(e,t){return e.zIndex===t.zIndex?e._lastSortedIndex-t._lastSortedIndex:e.zIndex-t.zIndex}Lt.prototype.displayObjectUpdateTransform=Lt.prototype.updateTransform;var jt=function(n){function e(){n.call(this),this.children=[],this.sortableChildren=A.SORTABLE_CHILDREN,this.sortDirty=!1}n&&(e.__proto__=n);var t={width:{configurable:!0},height:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.onChildrenChange=function(){},e.prototype.addChild=function(e){var t=arguments,r=arguments.length;if(1<r)for(var i=0;i<r;i++)this.addChild(t[i]);else e.parent&&e.parent.removeChild(e),(e.parent=this).sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this);return e},e.prototype.addChildAt=function(e,t){if(t<0||t>this.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),(e.parent=this).sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e},e.prototype.swapChildren=function(e,t){if(e!==t){var r=this.getChildIndex(e),i=this.getChildIndex(t);this.children[r]=t,this.children[i]=e,this.onChildrenChange(r<i?r:i)}},e.prototype.getChildIndex=function(e){var t=this.children.indexOf(e);if(-1===t)throw new Error("The supplied DisplayObject must be a child of the caller");return t},e.prototype.setChildIndex=function(e,t){if(t<0||t>=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(e);ze(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)},e.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},e.prototype.removeChild=function(e){var t=arguments,r=arguments.length;if(1<r)for(var i=0;i<r;i++)this.removeChild(t[i]);else{var n=this.children.indexOf(e);if(-1===n)return null;e.parent=null,e.transform._parentID=-1,ze(this.children,n,1),this._boundsID++,this.onChildrenChange(n),e.emit("removed",this),this.emit("childRemoved",e,this,n)}return e},e.prototype.removeChildAt=function(e){var t=this.getChildAt(e);return t.parent=null,t.transform._parentID=-1,ze(this.children,e,1),this._boundsID++,this.onChildrenChange(e),t.emit("removed",this),this.emit("childRemoved",t,this,e),t},e.prototype.removeChildren=function(e,t){void 0===e&&(e=0);var r,i=e,n="number"==typeof t?t:this.children.length,o=n-i;if(0<o&&o<=n){r=this.children.splice(i,o);for(var a=0;a<r.length;++a)r[a].parent=null,r[a].transform&&(r[a].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(var s=0;s<r.length;++s)r[s].emit("removed",this),this.emit("childRemoved",r[s],this,s);return r}if(0==o&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var e=!1,t=0,r=this.children.length;t<r;++t){var i=this.children[t];i._lastSortedIndex=t,e||0===i.zIndex||(e=!0)}e&&1<this.children.length&&this.children.sort(Ft),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,t=this.children.length;e<t;++e){var r=this.children[e];r.visible&&r.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var e=0;e<this.children.length;e++){var t=this.children[e];t.visible&&t.renderable&&(t.calculateBounds(),t._mask?(t._mask.calculateBounds(),this._bounds.addBoundsMask(t._bounds,t._mask._bounds)):t.filterArea?this._bounds.addBoundsArea(t._bounds,t.filterArea):this._bounds.addBounds(t._bounds))}this._lastBoundsID=this._boundsID},e.prototype._calculateBounds=function(){},e.prototype.render=function(e){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters)this.renderAdvanced(e);else{this._render(e);for(var t=0,r=this.children.length;t<r;++t)this.children[t].render(e)}},e.prototype.renderAdvanced=function(e){e.batch.flush();var t=this.filters,r=this._mask;if(t){this._enabledFilters||(this._enabledFilters=[]);for(var i=this._enabledFilters.length=0;i<t.length;i++)t[i].enabled&&this._enabledFilters.push(t[i]);this._enabledFilters.length&&e.filter.push(this,this._enabledFilters)}r&&e.mask.push(this,this._mask),this._render(e);for(var n=0,o=this.children.length;n<o;n++)this.children[n].render(e);e.batch.flush(),r&&e.mask.pop(this,this._mask),t&&this._enabledFilters&&this._enabledFilters.length&&e.filter.pop()},e.prototype._render=function(e){},e.prototype.destroy=function(e){n.prototype.destroy.call(this),this.sortDirty=!1;var t="boolean"==typeof e?e:e&&e.children,r=this.removeChildren(0,this.children.length);if(t)for(var i=0;i<r.length;++i)r[i].destroy(e)},t.width.get=function(){return this.scale.x*this.getLocalBounds().width},t.width.set=function(e){var t=this.getLocalBounds().width;this.scale.x=0!==t?e/t:1,this._width=e},t.height.get=function(){return this.scale.y*this.getLocalBounds().height},t.height.set=function(e){var t=this.getLocalBounds().height;this.scale.y=0!==t?e/t:1,this._height=e},Object.defineProperties(e.prototype,t),e}(Lt);jt.prototype.containerUpdateTransform=jt.prototype.updateTransform;var Bt={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:!1};Lt.mixin(Bt);var Nt=function(e){this._hookDiv=null,(m.tablet||m.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width="100px",t.style.height="100px",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.zIndex=2,this.div=t,this.pool=[],this.renderId=0,this.debug=!1,this.renderer=e,this.children=[],this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this.isActive=!1,this.isMobileAccessibility=!1,window.addEventListener("keydown",this._onKeyDown,!1)};Nt.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2,t.style.backgroundColor="#FF0000",t.title="HOOK DIV",t.addEventListener("focus",function(){e.isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t},Nt.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},Nt.prototype.activate=function(){this.isActive||(this.isActive=!0,window.document.addEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),this.renderer.view.parentNode&&this.renderer.view.parentNode.appendChild(this.div))},Nt.prototype.deactivate=function(){this.isActive&&!this.isMobileAccessibility&&(this.isActive=!1,window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),this.div.parentNode&&this.div.parentNode.removeChild(this.div))},Nt.prototype.updateAccessibleObjects=function(e){if(e.visible){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);for(var t=e.children,r=0;r<t.length;r++)this.updateAccessibleObjects(t[r])}},Nt.prototype.update=function(){if(this.renderer.renderingToScreen){this.updateAccessibleObjects(this.renderer._lastObjectRendered);var e=this.renderer.view.getBoundingClientRect(),t=e.width/this.renderer.width,r=e.height/this.renderer.height,i=this.div;i.style.left=e.left+"px",i.style.top=e.top+"px",i.style.width=this.renderer.width+"px",i.style.height=this.renderer.height+"px";for(var n=0;n<this.children.length;n++){var o=this.children[n];if(o.renderId!==this.renderId)o._accessibleActive=!1,ze(this.children,n,1),this.div.removeChild(o._accessibleDiv),this.pool.push(o._accessibleDiv),o._accessibleDiv=null,n--,0===this.children.length&&this.deactivate();else{i=o._accessibleDiv;var a=o.hitArea,s=o.worldTransform;o.hitArea?(i.style.left=(s.tx+a.x*s.a)*t+"px",i.style.top=(s.ty+a.y*s.d)*r+"px",i.style.width=a.width*s.a*t+"px",i.style.height=a.height*s.d*r+"px"):(a=o.getBounds(),this.capHitArea(a),i.style.left=a.x*t+"px",i.style.top=a.y*r+"px",i.style.width=a.width*t+"px",i.style.height=a.height*r+"px",i.title!==o.accessibleTitle&&null!==o.accessibleTitle&&(i.title=o.accessibleTitle),i.getAttribute("aria-label")!==o.accessibleHint&&null!==o.accessibleHint&&i.setAttribute("aria-label",o.accessibleHint))}}this.renderId++}},Nt.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0),e.x+e.width>this.renderer.width&&(e.width=this.renderer.width-e.x),e.y+e.height>this.renderer.height&&(e.height=this.renderer.height-e.y)},Nt.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2,t.style.borderStyle="none",-1<navigator.userAgent.toLowerCase().indexOf("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),e._accessibleActive=!0,(e._accessibleDiv=t).displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},Nt.prototype._onClick=function(e){var t=this.renderer.plugins.interaction;t.dispatchEvent(e.target.displayObject,"click",t.eventData)},Nt.prototype._onFocus=function(e){e.target.getAttribute("aria-live","off")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction;t.dispatchEvent(e.target.displayObject,"mouseover",t.eventData)},Nt.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live","off")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction;t.dispatchEvent(e.target.displayObject,"mouseout",t.eventData)},Nt.prototype._onKeyDown=function(e){9===e.keyCode&&this.activate()},Nt.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},Nt.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var e=0;e<this.children.length;e++)this.children[e].div=null;window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null};var Ut={AccessibilityManager:Nt,accessibleTarget:Bt},zt=function(e){this.items=[],this._name=e},Xt={empty:{configurable:!0},name:{configurable:!0}};zt.prototype.emit=function(e,t,r,i,n,o,a,s){if(8<arguments.length)throw new Error("max arguments reached");for(var u=this.name,h=this.items,c=0,f=h.length;c<f;c++)h[c][u](e,t,r,i,n,o,a,s);return this},zt.prototype.add=function(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this},zt.prototype.remove=function(e){var t=this.items.indexOf(e);return-1!==t&&this.items.splice(t,1),this},zt.prototype.contains=function(e){return-1!==this.items.indexOf(e)},zt.prototype.removeAll=function(){return this.items.length=0,this},zt.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Xt.empty.get=function(){return 0===this.items.length},Xt.name.get=function(){return this._name},Object.defineProperties(zt.prototype,Xt),zt.prototype.dispatch=zt.prototype.emit,zt.prototype.run=zt.prototype.emit,A.TARGET_FPMS=.06;var qt={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50},Ht=function(e,t,r,i){void 0===t&&(t=null),void 0===r&&(r=0),void 0===i&&(i=!1),this.fn=e,this.context=t,this.priority=r,this.once=i,this.next=null,this.previous=null,this._destroyed=!1};Ht.prototype.match=function(e,t){return t=t||null,this.fn===e&&this.context===t},Ht.prototype.emit=function(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));var t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t},Ht.prototype.connect=function(e){(this.previous=e).next&&(e.next.previous=this),this.next=e.next,e.next=this},Ht.prototype.destroy=function(e){void 0===e&&(e=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var t=this.next;return this.next=e?null:t,this.previous=null,t};var Gt=function(){var t=this;this._head=new Ht(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/A.TARGET_FPMS,this.elapsedMS=1/A.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}},Vt={FPS:{configurable:!0},minFPS:{configurable:!0},maxFPS:{configurable:!0}},Yt={shared:{configurable:!0},system:{configurable:!0}};Gt.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._requestId=requestAnimationFrame(this._tick))},Gt.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},Gt.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},Gt.prototype.add=function(e,t,r){return void 0===r&&(r=qt.NORMAL),this._addListener(new Ht(e,t,r))},Gt.prototype.addOnce=function(e,t,r){return void 0===r&&(r=qt.NORMAL),this._addListener(new Ht(e,t,r,!0))},Gt.prototype._addListener=function(e){var t=this._head.next,r=this._head;if(t){for(;t;){if(e.priority>t.priority){e.connect(r);break}t=(r=t).next}e.previous||e.connect(r)}else e.connect(r);return this._startIfPossible(),this},Gt.prototype.remove=function(e,t){for(var r=this._head.next;r;)r=r.match(e,t)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Gt.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},Gt.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},Gt.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},Gt.prototype.update=function(e){var t;if(void 0===e&&(e=performance.now()),e>this.lastTime){if((t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS&&t+1<this._minElapsedMS)return;this.deltaMS=t,this.deltaTime=this.deltaMS*A.TARGET_FPMS;for(var r=this._head,i=r.next;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e},Vt.FPS.get=function(){return 1e3/this.elapsedMS},Vt.minFPS.get=function(){return 1e3/this._maxElapsedMS},Vt.minFPS.set=function(e){var t=Math.min(this.maxFPS,e),r=Math.min(Math.max(0,t)/1e3,A.TARGET_FPMS);this._maxElapsedMS=1/r},Vt.maxFPS.get=function(){return this._minElapsedMS?1e3/this._minElapsedMS:1e3*A.TARGET_FPMS},Vt.maxFPS.set=function(e){if(e/1e3>=A.TARGET_FPMS)this._minElapsedMS=0;else{var t=Math.max(this.minFPS,e),r=Math.min(Math.max(1,t)/1e3,A.TARGET_FPMS);this._minElapsedMS=1/r}},Yt.shared.get=function(){if(!Gt._shared){var e=Gt._shared=new Gt;e.autoStart=!0,e._protected=!0}return Gt._shared},Yt.system.get=function(){if(!Gt._system){var e=Gt._system=new Gt;e.autoStart=!0,e._protected=!0}return Gt._system},Object.defineProperties(Gt.prototype,Vt),Object.defineProperties(Gt,Yt);var Wt=function(){};Wt.init=function(e){var t=this;e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set:function(e){this._ticker&&this._ticker.remove(this.render,this),(this._ticker=e)&&e.add(this.render,this,qt.LOW)},get:function(){return this._ticker}}),this.stop=function(){t._ticker.stop()},this.start=function(){t._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Gt.shared:new Gt,e.autoStart&&this.start()},Wt.destroy=function(){if(this._ticker){var e=this._ticker;this.ticker=null,e.destroy()}};var Jt=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new zt("setRealSize",2),this.onUpdate=new zt("update")},Kt={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Jt.prototype.bind=function(e){this.onResize.add(e),this.onUpdate.add(e),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Jt.prototype.unbind=function(e){this.onResize.remove(e),this.onUpdate.remove(e)},Jt.prototype.resize=function(e,t){e===this._width&&t===this._height||(this._width=e,this._height=t,this.onResize.run(e,t))},Kt.valid.get=function(){return!!this._width&&!!this._height},Jt.prototype.update=function(){this.destroyed||this.onUpdate.run()},Jt.prototype.load=function(){return Promise.resolve()},Kt.width.get=function(){return this._width},Kt.height.get=function(){return this._height},Jt.prototype.upload=function(e,t,r){return!1},Jt.prototype.style=function(e,t,r){return!1},Jt.prototype.dispose=function(){},Jt.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Jt.prototype,Kt);var Zt=function(t){function e(e){t.call(this,e.width,e.height),this.source=e}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).crossOrigin=function(e,t,r){void 0===r&&0!==t.indexOf("data:")?e.crossOrigin=it(t):!1!==r&&(e.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(e,t,r,i){var n=e.gl,o=t.realWidth,a=t.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),t.target===n.TEXTURE_2D&&r.width===o&&r.height===a?n.texSubImage2D(n.TEXTURE_2D,0,0,0,t.format,t.type,i):(r.width=o,r.height=a,n.texImage2D(t.target,0,t.format,t.format,t.type,i)),!0},e.prototype.dispose=function(){this.source=null},e}(Jt),Qt=function(a){function e(e,t){if(t=t||{},!(e instanceof HTMLImageElement)){var r=new Image;a.crossOrigin(r,e,t.crossorigin),r.src=e,e=r}a.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=!1!==t.createBitmap&&A.CREATE_IMAGE_BITMAP&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==t.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==t.autoLoad&&this.load()}return a&&(e.__proto__=a),((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.load=function(e){var i=this;return void 0!==e&&(this.createBitmap=e),this._load||(this._load=new Promise(function(e){i.url=i.source.src;var t=i.source,r=function(){i.destroyed||(t.onload=null,t.onerror=null,i.resize(t.width,t.height),i._load=null,i.createBitmap?e(i.process()):e(i))};t.complete&&t.src?r():t.onload=r})),this._load},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,t,r){if(t.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return a.prototype.upload.call(this,e,t,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(a.prototype.upload.call(this,e,t,r,this.bitmap),!this.preserveBitmap){var i=!0;for(var n in t._glTextures){var o=t._glTextures[n];if(o!==r&&o.dirtyId!==t.dirtyId){i=!1;break}}i&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){a.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}(Zt),$t=[];function er(e,t){if(!e)return null;var r="";if("string"==typeof e){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(e);i&&(r=i[1].toLowerCase())}for(var n=$t.length-1;0<=n;--n){var o=$t[n];if(o.test&&o.test(e,r))return new o(e,t)}return new Qt(e,t)}var tr=function(o){function e(e,t){var r=t||{},i=r.width,n=r.height;if(!i||!n)throw new Error("BufferResource width or height invalid");o.call(this,i,n),this.data=e}return o&&(e.__proto__=o),((e.prototype=Object.create(o&&o.prototype)).constructor=e).prototype.upload=function(e,t,r){var i=e.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),r.width===t.width&&r.height===t.height)i.texSubImage2D(t.target,0,0,0,t.width,t.height,t.format,t.type,this.data);else{r.width=t.width,r.height=t.height;var n=t.format;2===e.context.webGLVersion&&t.type===e.gl.FLOAT&&t.format===e.gl.RGBA&&(n=e.gl.RGBA32F),i.texImage2D(t.target,0,n,t.width,t.height,0,t.format,t.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(e){return e instanceof Float32Array||e instanceof Uint8Array||e instanceof Uint32Array},e}(Jt),rr={scaleMode:Te.NEAREST,format:_e.RGBA,premultiplyAlpha:!1},ir=function(d){function a(e,t){void 0===e&&(e=null),void 0===t&&(t=null),d.call(this);var r=(t=t||{}).premultiplyAlpha,i=t.mipmap,n=t.scaleMode,o=t.width,a=t.height,s=t.wrapMode,u=t.format,h=t.type,c=t.target,f=t.resolution,l=t.resourceOptions;!e||e instanceof Jt||((e=er(e,l)).internal=!0),this.width=o||0,this.height=a||0,this.resolution=f||A.RESOLUTION,this.mipmap=void 0!==i?i:A.MIPMAP_TEXTURES,this.wrapMode=s||A.WRAP_MODE,this.scaleMode=void 0!==n?n:A.SCALE_MODE,this.format=u||_e.RGBA,this.type=h||xe.UNSIGNED_BYTE,this.target=c||we.TEXTURE_2D,this.premultiplyAlpha=!1!==r,this.uid=qe(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=0<o&&0<a,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}d&&(a.__proto__=d),(a.prototype=Object.create(d&&d.prototype)).constructor=a;var e={realWidth:{configurable:!0},realHeight:{configurable:!0}};return e.realWidth.get=function(){return this.width*this.resolution},e.realHeight.get=function(){return this.height*this.resolution},a.prototype.setStyle=function(e,t){var r;return void 0!==e&&e!==this.scaleMode&&(this.scaleMode=e,r=!0),void 0!==t&&t!==this.mipmap&&(this.mipmap=t,r=!0),r&&this.dirtyStyleId++,this},a.prototype.setSize=function(e,t,r){return this.resolution=r||this.resolution,this.width=e,this.height=t,this._refreshPOT(),this.update(),this},a.prototype.setRealSize=function(e,t,r){return this.resolution=r||this.resolution,this.width=e/this.resolution,this.height=t/this.resolution,this._refreshPOT(),this.update(),this},a.prototype._refreshPOT=function(){this.isPowerOfTwo=Ve(this.realWidth)&&Ve(this.realHeight)},a.prototype.setResolution=function(e){var t=this.resolution;return t===e||(this.resolution=e,this.valid&&(this.width=this.width*t/e,this.height=this.height*t/e,this.emit("update")),this._refreshPOT()),this},a.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},a.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):0<this.width&&0<this.height&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},a.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Ke[this.cacheId],delete Je[this.cacheId],this.cacheId=null),this.dispose(),a.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},a.prototype.dispose=function(){this.emit("dispose",this)},a.from=function(e,t){var r=null;r="string"==typeof e?e:(e._pixiId||(e._pixiId="pixiid_"+qe()),e._pixiId);var i=Ke[r];return i||((i=new a(e,t)).cacheId=r,a.addToCache(i,r)),i},a.fromBuffer=function(e,t,r,i){e=e||new Float32Array(t*r*4);var n=new tr(e,{width:t,height:r}),o=e instanceof Float32Array?xe.FLOAT:xe.UNSIGNED_BYTE;return new a(n,Object.assign(rr,i||{width:t,height:r,type:o}))},a.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),Ke[t]&&console.warn("BaseTexture added to the cache with an id ["+t+"] that already had an entry"),Ke[t]=e)},a.removeFromCache=function(e){if("string"==typeof e){var t=Ke[e];if(t){var r=t.textureCacheIds.indexOf(e);return-1<r&&t.textureCacheIds.splice(r,1),delete Ke[e],t}}else if(e&&e.textureCacheIds){for(var i=0;i<e.textureCacheIds.length;++i)delete Ke[e.textureCacheIds[i]];return e.textureCacheIds.length=0,e}return null},Object.defineProperties(a.prototype,e),a}(v);ir._globalBatch=0;var nr=function(s){function e(e,t){var r;t=t||{};var i=e;Array.isArray(e)&&(i=(r=e).length),s.call(this,t.width,t.height),this.items=[],this.itemDirtyIds=[];for(var n=0;n<i;n++){var o=new ir;this.items.push(o),this.itemDirtyIds.push(-1)}if(this.length=i,this._load=null,r)for(var a=0;a<i;a++)this.addResourceAt(er(r[a],t),a)}return s&&(e.__proto__=s),((e.prototype=Object.create(s&&s.prototype)).constructor=e).prototype.dispose=function(){for(var e=0,t=this.length;e<t;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(e,t){if(!this.items[t])throw new Error("Index "+t+" is out of bounds");return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[t].setResource(e),this},e.prototype.bind=function(e){s.prototype.bind.call(this,e),e.target=we.TEXTURE_2D_ARRAY;for(var t=0;t<this.length;t++)this.items[t].on("update",e.update,e)},e.prototype.unbind=function(e){s.prototype.unbind.call(this,e);for(var t=0;t<this.length;t++)this.items[t].off("update",e.update,e)},e.prototype.load=function(){var i=this;if(this._load)return this._load;var n=this.items.map(function(e){return e.resource}),e=n.map(function(e){return e.load()});return this._load=Promise.all(e).then(function(){var e=n[0],t=e.width,r=e.height;return i.resize(t,r),Promise.resolve(i)}),this._load},e.prototype.upload=function(e,t,r){var i=this.length,n=this.itemDirtyIds,o=this.items,a=e.gl;r.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,t.format,this._width,this._height,i,0,t.format,t.type,null);for(var s=0;s<i;s++){var u=o[s];n[s]<u.dirtyId&&(n[s]=u.dirtyId,u.valid&&a.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,s,u.resource.width,u.resource.height,1,t.format,t.type,u.resource.source))}return!0},e}(Jt),or=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).test=function(e){return e instanceof HTMLCanvasElement},t}(Zt),ar=function(i){function a(e,t){if(t=t||{},i.call(this,e,t),this.length!==a.SIDES)throw new Error("Invalid length. Got "+this.length+", expected 6");for(var r=0;r<a.SIDES;r++)this.items[r].target=we.TEXTURE_CUBE_MAP_POSITIVE_X+r;!1!==t.autoLoad&&this.load()}return i&&(a.__proto__=i),((a.prototype=Object.create(i&&i.prototype)).constructor=a).prototype.bind=function(e){i.prototype.bind.call(this,e),e.target=we.TEXTURE_CUBE_MAP},a.prototype.upload=function(e,t,r){for(var i=this.itemDirtyIds,n=0;n<a.SIDES;n++){var o=this.items[n];i[n]<o.dirtyId&&(i[n]=o.dirtyId,o.valid&&o.resource.upload(e,o,r))}return!0},a}(nr);ar.SIDES=6;var sr=function(r){function a(e,t){t=t||{},r.call(this,document.createElement("canvas")),this.svg=e,this.scale=t.scale||1,this._resolve=null,this._load=null,!1!==t.autoLoad&&this.load()}return r&&(a.__proto__=r),((a.prototype=Object.create(r&&r.prototype)).constructor=a).prototype.load=function(){var r=this;return this._load||(this._load=new Promise(function(e){r._resolve=function(){r.resize(r.source.width,r.source.height),e(r)},/^\<svg/.test(r.svg.trim())&&(r.svg="data:image/svg+xml;utf8,"+r.svg);var t=rt(r.svg);t?r._loadDataUri(t):r._loadXhr()})),this._load},a.prototype._loadDataUri=function(e){var t;if("base64"===e.encoding){if(!atob)throw new Error("Your browser doesn't support base64 conversions.");t=atob(e.data)}else t=e.data;this._loadString(t)},a.prototype._loadXhr=function(){var e=this,t=new XMLHttpRequest;t.onload=function(){if(t.readyState!==t.DONE||200!==t.status)throw new Error("Failed to load SVG using XHR.");e._loadString(t.response)},t.open("GET",this.svg,!0),t.send()},a.prototype._loadString=function(e){var t=a.getSize(e),r=new Image;r.src="data:image/svg+xml,"+e;var i=t.width,n=t.height;if(!i||!n)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");this._width=Math.round(i*this.scale),this._height=Math.round(n*this.scale);var o=this.source;o.width=this._width,o.height=this._height,o._pixiId="canvas_"+qe(),o.getContext("2d").drawImage(r,0,0,i,n,0,0,this.width,this.height),this._resolve(),this._resolve=null},a.getSize=function(e){var t=a.SVG_SIZE.exec(e),r={};return t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7]))),r},a.prototype.dispose=function(){r.prototype.dispose.call(this),this._resolve=null},a.test=function(e,t){return"svg"===t||"string"==typeof e&&0===e.indexOf("data:image/svg+xml")},a}(Zt);sr.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var ur=function(c){function r(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),c.crossOrigin(r,e[0].src||e[0],t.crossorigin);for(var i=0;i<e.length;++i){var n=document.createElement("source"),o=e[i],a=o.src,s=o.mime,u=(a=a||e[i]).split("?").shift().toLowerCase(),h=u.substr(u.lastIndexOf(".")+1);s=s||"video/"+h,n.src=a,n.type=s,r.appendChild(n)}e=r}c.call(this,e),this._autoUpdate=!0,this._isAutoUpdating=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==t.autoPlay,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),!1!==t.autoLoad&&this.load()}c&&(r.__proto__=c);var e={autoUpdate:{configurable:!0},updateFPS:{configurable:!0}};return((r.prototype=Object.create(c&&c.prototype)).constructor=r).prototype.update=function(e){if(void 0===e&&(e=0),!this.destroyed){var t=Gt.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t),(!this._updateFPS||this._msToNextUpdate<=0)&&(c.prototype.update.call(this,e),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},r.prototype.load=function(){var t=this;if(this._load)return this._load;var r=this.source;return(r.readyState===r.HAVE_ENOUGH_DATA||r.readyState===r.HAVE_FUTURE_DATA)&&r.width&&r.height&&(r.complete=!0),r.addEventListener("play",this._onPlayStart.bind(this)),r.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(r.addEventListener("canplay",this._onCanPlay),r.addEventListener("canplaythrough",this._onCanPlay)),this._load=new Promise(function(e){t.valid?e(t):(t._resolve=e,r.load())}),this._load},r.prototype._isSourcePlaying=function(){var e=this.source;return 0<e.currentTime&&!1===e.paused&&!1===e.ended&&2<e.readyState},r.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},r.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(Gt.shared.add(this.update,this),this._isAutoUpdating=!0)},r.prototype._onPlayStop=function(){this._isAutoUpdating&&(Gt.shared.remove(this.update,this),this._isAutoUpdating=!1)},r.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},r.prototype.dispose=function(){this._isAutoUpdating&&Gt.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),c.prototype.dispose.call(this)},e.autoUpdate.get=function(){return this._autoUpdate},e.autoUpdate.set=function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isAutoUpdating?(Gt.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(Gt.shared.add(this.update,this),this._isAutoUpdating=!0))},e.updateFPS.get=function(){return this._updateFPS},e.updateFPS.set=function(e){e!==this._updateFPS&&(this._updateFPS=e)},r.test=function(e,t){return e instanceof HTMLVideoElement||-1<r.TYPES.indexOf(t)},Object.defineProperties(r.prototype,e),r}(Zt);ur.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],$t.push(Qt,or,ur,sr,tr,ar,nr);var hr={INSTALLED:$t,autoDetectResource:er,ArrayResource:nr,BufferResource:tr,CanvasResource:or,CubeResource:ar,ImageResource:Qt,SVGResource:sr,VideoResource:ur,Resource:Jt,BaseImageResource:Zt},cr=function(e){this.renderer=e,this.renderer.runners.contextChange.add(this)};cr.prototype.contextChange=function(e){},cr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var fr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.upload=function(e,t,r){var i=e.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),r.width===t.width&&r.height===t.height?i.texSubImage2D(t.target,0,0,0,t.width,t.height,t.format,t.type,this.data):(r.width=t.width,r.height=t.height,i.texImage2D(t.target,0,i.DEPTH_COMPONENT16,t.width,t.height,0,t.format,t.type,this.data)),!0},t}(tr),lr=function(e,t){this.width=Math.ceil(e||100),this.height=Math.ceil(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new zt("disposeFramebuffer",2)},dr={colorTexture:{configurable:!0}};dr.colorTexture.get=function(){return this.colorTextures[0]},lr.prototype.addColorTexture=function(e,t){return void 0===e&&(e=0),this.colorTextures[e]=t||new ir(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},lr.prototype.addDepthTexture=function(e){return this.depthTexture=e||new ir(new fr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:_e.DEPTH_COMPONENT,type:xe.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},lr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},lr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},lr.prototype.resize=function(e,t){if(e=Math.ceil(e),t=Math.ceil(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var r=0;r<this.colorTextures.length;r++){var i=this.colorTextures[r],n=i.resolution;i.setSize(e/n,t/n)}if(this.depthTexture){var o=this.depthTexture.resolution;this.depthTexture.setSize(e/o,t/o)}}},lr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Object.defineProperties(lr.prototype,dr);var pr=function(n){function e(e){"number"==typeof e&&(e={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]});n.call(this,null,e);var t=e||{},r=t.width,i=t.height;this.mipmap=!1,this.width=Math.ceil(r)||100,this.height=Math.ceil(i)||100,this.valid=!0,this._canvasRenderTarget=null,this.clearColor=[0,0,0,0],this.framebuffer=new lr(this.width*this.resolution,this.height*this.resolution).addColorTexture(0,this).enableStencil(),this.stencilMaskStack=[],this.filterStack=[{}]}return n&&(e.__proto__=n),((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.resize=function(e,t){e=Math.ceil(e),t=Math.ceil(t),this.framebuffer.resize(e*this.resolution,t*this.resolution)},e.prototype.dispose=function(){this.framebuffer.dispose(),n.prototype.dispose.call(this)},e.prototype.destroy=function(){n.prototype.destroy.call(this,!0),this.framebuffer=null,this.renderer=null},e}(ir),mr=function(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)};mr.prototype.set=function(e,t,r){var i=t.width,n=t.height;if(r){var o=e.width/2/i,a=e.height/2/n,s=e.x/i+o,u=e.y/n+a;r=St.add(r,St.NW),this.x0=s+o*St.uX(r),this.y0=u+a*St.uY(r),r=St.add(r,2),this.x1=s+o*St.uX(r),this.y1=u+a*St.uY(r),r=St.add(r,2),this.x2=s+o*St.uX(r),this.y2=u+a*St.uY(r),r=St.add(r,2),this.x3=s+o*St.uX(r),this.y3=u+a*St.uY(r)}else this.x0=e.x/i,this.y0=e.y/n,this.x1=(e.x+e.width)/i,this.y1=e.y/n,this.x2=(e.x+e.width)/i,this.y2=(e.y+e.height)/n,this.x3=e.x/i,this.y3=(e.y+e.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3};var vr=new mr,br=function(a){function s(e,t,r,i,n,o){if(a.call(this),this.noFrame=!1,t||(this.noFrame=!0,t=new Pt(0,0,1,1)),e instanceof s&&(e=e.baseTexture),this.baseTexture=e,this._frame=t,this.trim=i,this.valid=!1,this.requiresUpdate=!1,this._uvs=vr,this.uvMatrix=null,this.orig=r||t,this._rotate=Number(n||0),!0===n)this._rotate=2;else if(this._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");e.valid?(this.noFrame&&(t=new Pt(0,0,e.width,e.height),e.on("update",this.onBaseTextureUpdated,this)),this.frame=t):e.once("loaded",this.onBaseTextureUpdated,this),this.defaultAnchor=o?new ut(o.x,o.y):new ut(0,0),this._updateID=0,this.textureCacheIds=[]}a&&(s.__proto__=a);var e={frame:{configurable:!0},rotate:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return((s.prototype=Object.create(a&&a.prototype)).constructor=s).prototype.update=function(){this.baseTexture.update()},s.prototype.onBaseTextureUpdated=function(e){this._updateID++,this.noFrame?this.frame=new Pt(0,0,e.width,e.height):this.frame=this._frame,this.emit("update",this)},s.prototype.destroy=function(e){this.baseTexture&&(e&&(Je[this.baseTexture.imageUrl]&&s.removeFromCache(this.baseTexture.imageUrl),this.baseTexture.destroy()),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,s.removeFromCache(this),this.textureCacheIds=null},s.prototype.clone=function(){return new s(this.baseTexture,this.frame,this.orig,this.trim,this.rotate,this.defaultAnchor)},s.prototype.updateUvs=function(){this._uvs===vr&&(this._uvs=new mr),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},s.from=function(e,t){void 0===t&&(t={});var r=null;r="string"==typeof e?e:(e._pixiId||(e._pixiId="pixiid_"+qe()),e._pixiId);var i=Je[r];return i||(t.resolution||(t.resolution=nt(e)),(i=new s(new ir(e,t))).baseTexture.cacheId=r,ir.addToCache(i.baseTexture,r),s.addToCache(i,r)),i},s.fromBuffer=function(e,t,r,i){return new s(ir.fromBuffer(e,t,r,i))},s.fromLoader=function(e,t,r){var i=new Qt(e);i.url=t;var n=new s(new ir(i,{scaleMode:A.SCALE_MODE,resolution:nt(t)}));return r||(r=t),ir.addToCache(n.baseTexture,r),s.addToCache(n,r),r!==t&&(ir.addToCache(n.baseTexture,t),s.addToCache(n,t)),n},s.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),Je[t]&&console.warn("Texture added to the cache with an id ["+t+"] that already had an entry"),Je[t]=e)},s.removeFromCache=function(e){if("string"==typeof e){var t=Je[e];if(t){var r=t.textureCacheIds.indexOf(e);return-1<r&&t.textureCacheIds.splice(r,1),delete Je[e],t}}else if(e&&e.textureCacheIds){for(var i=0;i<e.textureCacheIds.length;++i)Je[e.textureCacheIds[i]]===e&&delete Je[e.textureCacheIds[i]];return e.textureCacheIds.length=0,e}return null},e.frame.get=function(){return this._frame},e.frame.set=function(e){this._frame=e,this.noFrame=!1;var t=e.x,r=e.y,i=e.width,n=e.height,o=t+i>this.baseTexture.width,a=r+n>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+i+" = "+(t+i)+" > "+this.baseTexture.width,h="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+h)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},e.rotate.get=function(){return this._rotate},e.rotate.set=function(e){this._rotate=e,this.valid&&this.updateUvs()},e.width.get=function(){return this.orig.width},e.height.get=function(){return this.orig.height},Object.defineProperties(s.prototype,e),s}(v);function gr(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}br.EMPTY=new br(new ir),gr(br.EMPTY),gr(br.EMPTY.baseTexture),br.WHITE=function(){var e=document.createElement("canvas");e.width=16,e.height=16;var t=e.getContext("2d");return t.fillStyle="white",t.fillRect(0,0,16,16),new br(new ir(new or(e)))}(),gr(br.WHITE),gr(br.WHITE.baseTexture);var yr=function(s){function t(e,t){var r=null;if(!(e instanceof pr)){var i=arguments[1],n=arguments[2],o=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+i+", "+n+") instead of the ctor directly."),r=arguments[0],t=null,e=new pr({width:i,height:n,scaleMode:o,resolution:a})}s.call(this,e,t),this.legacyRenderer=r,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return s&&(t.__proto__=s),((t.prototype=Object.create(s&&s.prototype)).constructor=t).prototype.resize=function(e,t,r){void 0===r&&(r=!0),e=Math.ceil(e),t=Math.ceil(t),this.valid=0<e&&0<t,this._frame.width=this.orig.width=e,this._frame.height=this.orig.height=t,r&&this.baseTexture.resize(e,t),this.updateUvs()},t.create=function(e){return"number"==typeof e&&(e={width:e,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new t(new pr(e))},t}(br),_r=function(e,t,r,i,n,o,a){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=e,this.size=t,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=a};_r.prototype.destroy=function(){this.buffer=null},_r.from=function(e,t,r,i,n){return new _r(e,t,r,i,n)};var wr=0,xr=function(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=!1),this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=t,this.id=wr++,this.disposeRunner=new zt("disposeBuffer",2)};function Tr(e){if(4===e.BYTES_PER_ELEMENT)return e instanceof Float32Array?"Float32Array":e instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===e.BYTES_PER_ELEMENT){if(e instanceof Uint16Array)return"Uint16Array"}else if(1===e.BYTES_PER_ELEMENT&&e instanceof Uint8Array)return"Uint8Array";return null}xr.prototype.update=function(e){this.data=e||this.data,this._updateID++},xr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},xr.prototype.destroy=function(){this.dispose(),this.data=null},xr.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new xr(e)};var Sr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Er={5126:4,5123:2,5121:1},Ar=0,Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Mr=function(e,t){void 0===e&&(e=[]),void 0===t&&(t={}),this.buffers=e,this.indexBuffer=null,this.attributes=t,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new zt("disposeGeometry",2),this.refCount=0};Mr.prototype.addAttribute=function(e,t,r,i,n,o,a,s){if(void 0===i&&(i=!1),void 0===s&&(s=!1),!t)throw new Error("You must pass a buffer when creating an attribute");t.data||(t instanceof Array&&(t=new Float32Array(t)),t=new xr(t));var u=e.split("|");if(1<u.length){for(var h=0;h<u.length;h++)this.addAttribute(u[h],t,r,i,n);return this}var c=this.buffers.indexOf(t);return-1===c&&(this.buffers.push(t),c=this.buffers.length-1),this.attributes[e]=new _r(c,r,i,n,o,a,s),this.instanced=this.instanced||s,this},Mr.prototype.getAttribute=function(e){return this.attributes[e]},Mr.prototype.getBuffer=function(e){return this.buffers[this.getAttribute(e).buffer]},Mr.prototype.addIndex=function(e){return e.data||(e instanceof Array&&(e=new Uint16Array(e)),e=new xr(e)),e.index=!0,this.indexBuffer=e,-1===this.buffers.indexOf(e)&&this.buffers.push(e),this},Mr.prototype.getIndex=function(){return this.indexBuffer},Mr.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var e,t=[],r=[],i=new xr;for(e in this.attributes){var n=this.attributes[e],o=this.buffers[n.buffer];t.push(o.data),r.push(n.size*Er[n.type]/4),n.buffer=0}for(i.data=function(e,t){for(var r=0,i=0,n={},o=0;o<e.length;o++)i+=t[o],r+=e[o].length;for(var a=new ArrayBuffer(4*r),s=null,u=0,h=0;h<e.length;h++){var c=t[h],f=e[h],l=Tr(f);n[l]||(n[l]=new Sr[l](a)),s=n[l];for(var d=0;d<f.length;d++)s[(d/c|0)*i+u+d%c]=f[d];u+=c}return new Float32Array(a)}(t,r),e=0;e<this.buffers.length;e++)this.buffers[e]!==this.indexBuffer&&this.buffers[e].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},Mr.prototype.getSize=function(){for(var e in this.attributes){var t=this.attributes[e];return this.buffers[t.buffer].data.length/(t.stride/4||t.size)}return 0},Mr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Mr.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer.destroy(),this.attributes=null},Mr.prototype.clone=function(){for(var e=new Mr,t=0;t<this.buffers.length;t++)e.buffers[t]=new xr(this.buffers[t].data.slice());for(var r in this.attributes){var i=this.attributes[r];e.attributes[r]=new _r(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.index=!0),e},Mr.merge=function(e){for(var t,r=new Mr,i=[],n=[],o=[],a=0;a<e.length;a++){t=e[a];for(var s=0;s<t.buffers.length;s++)n[s]=n[s]||0,n[s]+=t.buffers[s].data.length,o[s]=0}for(var u=0;u<t.buffers.length;u++)i[u]=new(Pr[Tr(t.buffers[u].data)])(n[u]),r.buffers[u]=new xr(i[u]);for(var h=0;h<e.length;h++){t=e[h];for(var c=0;c<t.buffers.length;c++)i[c].set(t.buffers[c].data,o[c]),o[c]+=t.buffers[c].data.length}if(r.attributes=t.attributes,t.indexBuffer){r.indexBuffer=r.buffers[t.buffers.indexOf(t.indexBuffer)],r.indexBuffer.index=!0;for(var f=0,l=0,d=0,p=0,m=0;m<t.buffers.length;m++)if(t.buffers[m]!==t.indexBuffer){p=m;break}for(var v in t.attributes){var b=t.attributes[v];(0|b.buffer)===p&&(l+=b.size*Er[b.type]/4)}for(var g=0;g<e.length;g++){for(var y=e[g].indexBuffer.data,_=0;_<y.length;_++)r.indexBuffer.data[_+d]+=f;f+=t.buffers[p].data.length/l,d+=y.length}}return r};var Cr=function(e){function t(){e.call(this),this.addAttribute("aVertexPosition",[0,0,1,0,1,1,0,1]).addIndex([0,1,3,2])}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(Mr),kr=function(e){function t(){e.call(this),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new xr(this.vertices),this.uvBuffer=new xr(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.map=function(e,t){var r=0,i=0;return this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+t.width/e.width,this.uvs[3]=i,this.uvs[4]=r+t.width/e.width,this.uvs[5]=i+t.height/e.height,this.uvs[6]=r,this.uvs[7]=i+t.height/e.height,r=t.x,i=t.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+t.width,this.vertices[3]=i,this.vertices[4]=r+t.width,this.vertices[5]=i+t.height,this.vertices[6]=r,this.vertices[7]=i+t.height,this.invalidate(),this},t.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},t}(Mr),Ir=0,Rr=function(e,t){this.uniforms=e,this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Ir++,this.static=!!t};Rr.prototype.update=function(){this.dirtyId++},Rr.prototype.add=function(e,t,r){this.uniforms[e]=new Rr(t,r)},Rr.from=function(e,t){return new Rr(e,t)};var Or=function(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.sourceFrame=new Pt,this.destinationFrame=new Pt,this.filters=[]};Or.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null};var Dr="screen",Lr=function(t){function e(e){t.call(this,e),this.defaultFilterStack=[{}],this.texturePool={},this.statePool=[],this.quad=new Cr,this.quadUv=new kr,this.tempRect=new Pt,this.activeState={},this.globalUniforms=new Rr({outputFrame:this.tempRect,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this._pixelsWidth=e.view.width,this._pixelsHeight=e.view.height}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.push=function(e,t){for(var r=this.renderer,i=this.defaultFilterStack,n=this.statePool.pop()||new Or,o=t[0].resolution,a=t[0].padding,s=t[0].autoFit,u=t[0].legacy,h=1;h<t.length;h++){var c=t[h];o=Math.min(o,c.resolution),a=Math.max(a,c.padding),s=s||c.autoFit,u=u||c.legacy}1===i.length&&(this.defaultFilterStack[0].renderTexture=r.renderTexture.current),i.push(n),n.resolution=o,n.legacy=u,n.target=e,n.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),n.sourceFrame.pad(a),s&&n.sourceFrame.fit(this.renderer.renderTexture.sourceFrame),n.sourceFrame.ceil(o),n.renderTexture=this.getOptimalFilterTexture(n.sourceFrame.width,n.sourceFrame.height,o),n.filters=t,n.destinationFrame.width=n.renderTexture.width,n.destinationFrame.height=n.renderTexture.height,n.renderTexture.filterFrame=n.sourceFrame,r.renderTexture.bind(n.renderTexture,n.sourceFrame),r.renderTexture.clear()},e.prototype.pop=function(){var e=this.defaultFilterStack,t=e.pop(),r=t.filters;this.activeState=t;var i=this.globalUniforms.uniforms;i.outputFrame=t.sourceFrame,i.resolution=t.resolution;var n=i.inputSize,o=i.inputPixel,a=i.inputClamp;if(n[0]=t.destinationFrame.width,n[1]=t.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],o[0]=n[0]*t.resolution,o[1]=n[1]*t.resolution,o[2]=1/o[0],o[3]=1/o[1],a[0]=.5*o[2],a[1]=.5*o[3],a[2]=t.sourceFrame.width*n[2]-.5*o[2],a[3]=t.sourceFrame.height*n[3]-.5*o[3],t.legacy){var s=i.filterArea;s[0]=t.destinationFrame.width,s[1]=t.destinationFrame.height,s[2]=t.sourceFrame.x,s[3]=t.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();var u=e[e.length-1];if(1===r.length)r[0].apply(this,t.renderTexture,u.renderTexture,!1,t),this.returnFilterTexture(t.renderTexture);else{var h=t.renderTexture,c=this.getOptimalFilterTexture(h.width,h.height,t.resolution);c.filterFrame=h.filterFrame;var f=0;for(f=0;f<r.length-1;++f){r[f].apply(this,h,c,!0,t);var l=h;h=c,c=l}r[f].apply(this,h,u.renderTexture,!1,t),this.returnFilterTexture(h),this.returnFilterTexture(c)}t.clear(),this.statePool.push(t)},e.prototype.applyFilter=function(e,t,r,i){var n=this.renderer;n.renderTexture.bind(r,r?r.filterFrame:null),i&&n.renderTexture.clear(),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,n.state.setState(e.state),n.shader.bind(e),e.legacy?(this.quadUv.map(t._frame,t.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(ye.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(ye.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var r=this.activeState,i=r.sourceFrame,n=r.destinationFrame,o=t._texture.orig,a=e.set(n.width,0,0,n.height,i.x,i.y),s=t.worldTransform.copyTo(mt.TEMP_MATRIX);return s.invert(),a.prepend(s),a.scale(1/o.width,1/o.height),a.translate(t.anchor.x,t.anchor.y),a},e.prototype.destroy=function(e){void 0===e&&(e=!1),e?this.texturePool={}:this.emptyPool()},e.prototype.getOptimalFilterTexture=function(e,t,r){void 0===r&&(r=1);var i=Dr;t*=r,(e*=r)===this._pixelsWidth&&t===this._pixelsHeight||(i=(65535&(e=Ge(e)))<<16|65535&(t=Ge(t))),this.texturePool[i]||(this.texturePool[i]=[]);var n=this.texturePool[i].pop();return n||(n=yr.create({width:e/r,height:t/r,resolution:r})),n.filterPoolKey=i,n},e.prototype.getFilterTexture=function(e){var t=this.activeState.renderTexture,r=this.getOptimalFilterTexture(t.width,t.height,e||t.baseTexture.resolution);return r.filterFrame=t.filterFrame,r},e.prototype.returnFilterTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.emptyPool=function(){for(var e in this.texturePool){var t=this.texturePool[e];if(t)for(var r=0;r<t.length;r++)t[r].destroy(!0)}this.texturePool={}},e.prototype.resize=function(){var e=this.texturePool[Dr];if(e)for(var t=0;t<e.length;t++)e[t].destroy(!0);this.texturePool[Dr]=[],this._pixelsWidth=this.renderer.view.width,this._pixelsHeight=this.renderer.view.height},e}(cr),Fr=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.flush=function(){},t.prototype.render=function(e){},t}(cr),jr=function(t){function e(e){t.call(this,e),this.emptyRenderer=new Fr(e),this.currentRenderer=this.emptyRenderer}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e}(cr);A.PREFER_ENV=m.any?ve.WEBGL:ve.WEBGL2;var Br=0,Nr=function(t){function e(e){t.call(this,e),this.webGLVersion=1,this.extensions={},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),e.view.addEventListener("webglcontextlost",this.handleContextLost,!1),e.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={isLost:{configurable:!0}};return r.isLost.get=function(){return!this.gl||this.gl.isContextLost()},e.prototype.contextChange=function(e){(this.gl=e).isContextLost()&&e.getExtension("WEBGL_lose_context")&&e.getExtension("WEBGL_lose_context").restoreContext()},e.prototype.initFromContext=function(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=Br++,this.renderer.runners.contextChange.run(e)},e.prototype.initFromOptions=function(e){var t=this.createContext(this.renderer.view,e);this.initFromContext(t)},e.prototype.createContext=function(e,t){var r;if(A.PREFER_ENV>=ve.WEBGL2&&(r=e.getContext("webgl2",t)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var e=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:e.getExtension("OES_texture_float"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object")})},e.prototype.handleContextLost=function(e){e.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.gl.flush()},e.prototype.validateContext=function(e){e.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(cr),Ur=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new lr(10,10)}t&&(e.__proto__=t);var r={size:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Pt,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var t=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;A.PREFER_ENV===ve.WEBGL_LEGACY&&(r=t=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(e,t){var r=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat!==e.dirtyFormat?(i.dirtyFormat=e.dirtyFormat,this.updateFramebuffer(e)):i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var n=0;n<e.colorTextures.length;n++)e.colorTextures[n].texturePart?this.renderer.texture.unbind(e.colorTextures[n].texture):this.renderer.texture.unbind(e.colorTextures[n]);e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,e.width,e.height)}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,r,i){var n=this.viewport;n.width===r&&n.height===i&&n.x===e&&n.y===t||(n.x=e,n.y=t,n.width=r,n.height=i,this.gl.viewport(e,t,r,i))},r.size.get=function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},e.prototype.clear=function(e,t,r,i){var n=this.gl;n.clearColor(e,t,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},e.prototype.initFramebuffer=function(e){var t={framebuffer:this.gl.createFramebuffer(),stencil:null,dirtyId:0,dirtyFormat:0,dirtySize:0};return e.glFramebuffers[this.CONTEXT_UID]=t,this.managedFramebuffers.push(e),e.disposeRunner.add(this),t},e.prototype.resizeFramebuffer=function(e){var t=this.gl,r=e.glFramebuffers[this.CONTEXT_UID];r.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,r.stencil),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));for(var i=e.colorTextures,n=0;n<i.length;n++)this.renderer.texture.bind(i[n],0);e.depthTexture&&this.renderer.texture.bind(e.depthTexture,0)},e.prototype.updateFramebuffer=function(e){var t=this.gl,r=e.glFramebuffers[this.CONTEXT_UID],i=e.colorTextures.length;t.drawBuffers||(i=Math.min(i,1));for(var n=[],o=0;o<i;o++){var a=e.colorTextures[o];a.texturePart?(this.renderer.texture.bind(a.texture,0),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+o,t.TEXTURE_CUBE_MAP_NEGATIVE_X+a.side,a.texture._glTextures[this.CONTEXT_UID].texture,0)):(this.renderer.texture.bind(a,0),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+o,t.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)),n.push(t.COLOR_ATTACHMENT0+o)}if((1<n.length&&t.drawBuffers(n),e.depthTexture)&&this.writeDepthTexture){var s=e.depthTexture;this.renderer.texture.bind(s,0),t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,s._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!e.stencil&&!e.depth||(r.stencil=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,r.stencil),e.depthTexture||t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,r.stencil),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height))},e.prototype.disposeFramebuffer=function(e,t){var r=e.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete e.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(e);0<=n&&this.managedFramebuffers.splice(n,1),e.disposeRunner.remove(this),t||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r<t.count;r++)this.disposeFramebuffer(t[r],e)},e.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new Pt},Object.defineProperties(e.prototype,r),e}(cr),zr=function(e){this.buffer=e,this.updateID=-1,this.byteLength=-1,this.refCount=0},Xr={5126:4,5123:2,5121:1},qr=function(t){function e(e){t.call(this,e),this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.boundBuffers={},this.managedGeometries={},this.managedBuffers={}}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,!e.createVertexArray){var t=this.renderer.context.extensions.vertexArrayObject;A.PREFER_ENV===ve.WEBGL_LEGACY&&(t=null),t?(e.createVertexArray=function(){return t.createVertexArrayOES()},e.bindVertexArray=function(e){return t.bindVertexArrayOES(e)},e.deleteVertexArray=function(e){return t.deleteVertexArrayOES(e)}):(this.hasVao=!1,e.createVertexArray=function(){},e.bindVertexArray=function(){},e.deleteVertexArray=function(){})}if(!e.vertexAttribDivisor){var o=e.getExtension("ANGLE_instanced_arrays");o?(e.vertexAttribDivisor=function(e,t){return o.vertexAttribDivisorANGLE(e,t)},e.drawElementsInstanced=function(e,t,r,i,n){return o.drawElementsInstancedANGLE(e,t,r,i,n)},e.drawArraysInstanced=function(e,t,r,i){return o.drawArraysInstancedANGLE(e,t,r,i)}):this.hasInstance=!1}},e.prototype.bind=function(e,t){t=t||this.renderer.shader.shader;var r=this.gl,i=e.glVertexArrayObjects[this.CONTEXT_UID];i||((this.managedGeometries[e.id]=e).disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=i={});var n=i[t.program.id]||this.initGeometryVao(e,t.program);this._activeGeometry=e,this._activeVao!==n&&(this._activeVao=n,this.hasVao?r.bindVertexArray(n):this.activateVao(e,t.program)),this.updateBuffers()},e.prototype.reset=function(){this.unbind()},e.prototype.updateBuffers=function(){for(var e=this._activeGeometry,t=this.gl,r=0;r<e.buffers.length;r++){var i=e.buffers[r],n=i._glBuffers[this.CONTEXT_UID];if(i._updateID!==n.updateID){n.updateID=i._updateID;var o=i.index?t.ELEMENT_ARRAY_BUFFER:t.ARRAY_BUFFER;if(t.bindBuffer(o,n.buffer),(this._boundBuffer=n).byteLength>=i.data.byteLength)t.bufferSubData(o,0,i.data);else{var a=i.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,t.bufferData(o,i.data,a)}}}},e.prototype.checkCompatibility=function(e,t){var r=e.attributes,i=t.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(e,t){var r=e.attributes,i=t.attributeData,n=["g",e.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(e,t){this.checkCompatibility(e,t);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(e,t),o=e.glVertexArrayObjects[this.CONTEXT_UID],a=o[n];if(a)return o[t.id]=a;var s=e.buffers,u=e.attributes,h={},c={};for(var f in s)h[f]=0,c[f]=0;for(var l in u)!u[l].size&&t.attributeData[l]?u[l].size=t.attributeData[l].size:u[l].size||console.warn("PIXI Geometry attribute '"+l+"' size cannot be determined (likely the bound shader does not have the attribute)"),h[u[l].buffer]+=u[l].size*Xr[u[l].type];for(var d in u){var p=u[d],m=p.size;void 0===p.stride&&(h[p.buffer]===m*Xr[p.type]?p.stride=0:p.stride=h[p.buffer]),void 0===p.start&&(p.start=c[p.buffer],c[p.buffer]+=m*Xr[p.type])}a=r.createVertexArray(),r.bindVertexArray(a);for(var v=0;v<s.length;v++){var b=s[v];b._glBuffers[i]||(b._glBuffers[i]=new zr(r.createBuffer()),(this.managedBuffers[b.id]=b).disposeRunner.add(this)),b._glBuffers[i].refCount++}return this.activateVao(e,t),this._activeVao=a,o[t.id]=a,o[n]=a},e.prototype.disposeBuffer=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var r=e._glBuffers[this.CONTEXT_UID],i=this.gl;e.disposeRunner.remove(this),r&&(t||i.deleteBuffer(r.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeGeometry=function(e,t){if(this.managedGeometries[e.id]){delete this.managedGeometries[e.id];var r=e.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,n=e.buffers;if(e.disposeRunner.remove(this),r){for(var o=0;o<n.length;o++){var a=n[o]._glBuffers[this.CONTEXT_UID];a.refCount--,0!==a.refCount||t||this.disposeBuffer(n[o],t)}if(!t)for(var s in r)if("g"===s[0]){var u=r[s];this._activeVao===u&&this.unbind(),i.deleteVertexArray(u)}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedGeometries),r=0;r<t.length;r++)this.disposeGeometry(this.managedGeometries[t[r]],e);t=Object.keys(this.managedBuffers);for(var i=0;i<t.length;i++)this.disposeBuffer(this.managedBuffers[t[i]],e)},e.prototype.activateVao=function(e,t){var r=this.gl,i=this.CONTEXT_UID,n=e.buffers,o=e.attributes;e.indexBuffer&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.indexBuffer._glBuffers[i].buffer);var a=null;for(var s in o){var u=o[s],h=n[u.buffer]._glBuffers[i];if(t.attributeData[s]){a!==h&&(r.bindBuffer(r.ARRAY_BUFFER,h.buffer),a=h);var c=t.attributeData[s].location;if(r.enableVertexAttribArray(c),r.vertexAttribPointer(c,u.size,u.type||r.FLOAT,u.normalized,u.stride,u.start),u.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");r.vertexAttribDivisor(c,1)}}}},e.prototype.draw=function(e,t,r,i){var n=this.gl,o=this._activeGeometry;return o.indexBuffer?o.instanced?n.drawElementsInstanced(e,t||o.indexBuffer.data.length,n.UNSIGNED_SHORT,2*(r||0),i||1):n.drawElements(e,t||o.indexBuffer.data.length,n.UNSIGNED_SHORT,2*(r||0)):o.instanced?n.drawArraysInstanced(e,r,t||o.getSize(),i||1):n.drawArrays(e,r,t||o.getSize()),this},e.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},e}(cr);function Hr(e,t,r,i){var n=Gr(e,e.VERTEX_SHADER,t),o=Gr(e,e.FRAGMENT_SHADER,r),a=e.createProgram();if(e.attachShader(a,n),e.attachShader(a,o),i)for(var s in i)e.bindAttribLocation(a,i[s],s);return e.linkProgram(a),e.getProgramParameter(a,e.LINK_STATUS)||(console.error("Pixi.js Error: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",e.getProgramParameter(a,e.VALIDATE_STATUS)),console.error("gl.getError()",e.getError()),""!==e.getProgramInfoLog(a)&&console.warn("Pixi.js Warning: gl.getProgramInfoLog()",e.getProgramInfoLog(a)),e.deleteProgram(a),a=null),e.deleteShader(n),e.deleteShader(o),a}function Gr(e,t,r){var i=e.createShader(t);return e.shaderSource(i,r),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)?i:(console.warn(r),console.error(e.getShaderInfoLog(i)),null)}function Vr(e,t){switch(e){case"float":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"int":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*t);case"ivec3":return new Int32Array(3*t);case"ivec4":return new Int32Array(4*t);case"bool":return!1;case"bvec2":return Yr(2*t);case"bvec3":return Yr(3*t);case"bvec4":return Yr(4*t);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}function Yr(e){for(var t=new Array(e),r=0;r<t.length;r++)t[r]=!1;return t}var Wr,Jr=null;function Kr(){if(Jr)return Jr;var e,t=document.createElement("canvas");if(A.PREFER_ENV>=ve.WEBGL2&&(e=t.getContext("webgl2",{})),!e){if(!(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");e.getExtension("WEBGL_draw_buffers")}return Jr=e}function Zr(e,t,r){if("precision"===e.substring(0,9))return r!==Pe.HIGH&&"precision highp"===e.substring(0,15)?e.replace("precision highp","precision mediump"):e;var i=t;return t===Pe.HIGH&&r!==Pe.HIGH&&(i=Pe.MEDIUM),"precision "+i+" float;\n"+e}var Qr={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};var $r=null,ei={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ti(e,t){if(!$r){var r=Object.keys(ei);$r={};for(var i=0;i<r.length;++i){var n=r[i];$r[e[n]]=ei[n]}}return $r[t]}var ri={float:"\n if(cv !== v)\n {\n cv.v = v;\n gl.uniform1f(location, v)\n }",vec2:"\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(location, v[0], v[1])\n }",vec3:"\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }",vec4:"gl.uniform4f(location, v[0], v[1], v[2], v[3])",int:"gl.uniform1i(location, v)",ivec2:"gl.uniform2i(location, v[0], v[1])",ivec3:"gl.uniform3i(location, v[0], v[1], v[2])",ivec4:"gl.uniform4i(location, v[0], v[1], v[2], v[3])",bool:"gl.uniform1i(location, v)",bvec2:"gl.uniform2i(location, v[0], v[1])",bvec3:"gl.uniform3i(location, v[0], v[1], v[2])",bvec4:"gl.uniform4i(location, v[0], v[1], v[2], v[3])",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"gl.uniform1i(location, v)",samplerCube:"gl.uniform1i(location, v)",sampler2DArray:"gl.uniform1i(location, v)"},ii={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};var ni,oi=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function ai(e,t){if(0===e)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var r=t.createShader(t.FRAGMENT_SHADER);;){var i=oi.replace(/%forloop%/gi,si(e));if(t.shaderSource(r,i),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))break;e=e/2|0}return e}function si(e){for(var t="",r=0;r<e;++r)0<r&&(t+="\nelse "),r<e-1&&(t+="if(test == "+r+".0){}");return t}var ui=0,hi={},ci=function e(t,r,i){void 0===i&&(i="pixi-shader"),this.id=ui++,this.vertexSrc=t||e.defaultVertexSrc,this.fragmentSrc=r||e.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(i=i.replace(/\s+/g,"-"),hi[i]?(hi[i]++,i+="-"+hi[i]):hi[i]=1,this.vertexSrc="#define SHADER_NAME "+i+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+i+"\n"+this.fragmentSrc,this.vertexSrc=Zr(this.vertexSrc,A.PRECISION_VERTEX,Pe.HIGH),this.fragmentSrc=Zr(this.fragmentSrc,A.PRECISION_FRAGMENT,function(){if(!Wr){Wr=Pe.MEDIUM;var e=Kr();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);Wr=t.precision?Pe.HIGH:Pe.MEDIUM}}return Wr}())),this.extractData(this.vertexSrc,this.fragmentSrc),this.glPrograms={},this.syncUniforms=null},fi={defaultVertexSrc:{configurable:!0},defaultFragmentSrc:{configurable:!0}};ci.prototype.extractData=function(e,t){var r=Kr();if(r){var i=Hr(r,e,t);this.attributeData=this.getAttributeData(i,r),this.uniformData=this.getUniformData(i,r),r.deleteProgram(i)}else this.uniformData={},this.attributeData={}},ci.prototype.getAttributeData=function(e,t){for(var r,i={},n=[],o=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),a=0;a<o;a++){var s=t.getActiveAttrib(e,a),u=ti(t,s.type),h={type:u,name:s.name,size:(r=u,Qr[r]),location:0};i[s.name]=h,n.push(h)}n.sort(function(e,t){return e.name>t.name?1:-1});for(var c=0;c<n.length;c++)n[c].location=c;return i},ci.prototype.getUniformData=function(e,t){for(var r={},i=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),n=0;n<i;n++){var o=t.getActiveUniform(e,n),a=o.name.replace(/\[.*?\]/,""),s=o.name.match(/\[.*?\]/,""),u=ti(t,o.type);r[a]={type:u,size:o.size,isArray:s,value:Vr(u,o.size)}}return r},fi.defaultVertexSrc.get=function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},fi.defaultFragmentSrc.get=function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},ci.from=function(e,t,r){var i=e+t,n=We[i];return n||(We[i]=n=new ci(e,t,r)),n},Object.defineProperties(ci,fi);var li=function(e,t){for(var r in this.program=e,this.uniformGroup=t?t instanceof Rr?t:new Rr(t):new Rr({}),e.uniformData)this.uniformGroup.uniforms[r]instanceof Array&&(this.uniformGroup.uniforms[r]=new Float32Array(this.uniformGroup.uniforms[r]))},di={uniforms:{configurable:!0}};li.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var r in t.uniforms){var i=t.uniforms[r];if(i.group&&this.checkUniformExists(e,i))return!0}return!1},li.prototype.destroy=function(){this.uniformGroup=null},di.uniforms.get=function(){return this.uniformGroup.uniforms},li.from=function(e,t,r){var i=ci.from(e,t);return new li(i,r)},Object.defineProperties(li.prototype,di);var pi=function(){this.data=0,this.blendMode=ge.NORMAL,this.polygonOffset=0,this.blend=!0},mi={blend:{configurable:!0},offsets:{configurable:!0},culling:{configurable:!0},depthTest:{configurable:!0},clockwiseFrontFace:{configurable:!0},blendMode:{configurable:!0},polygonOffset:{configurable:!0}};mi.blend.get=function(){return!!(1&this.data)},mi.blend.set=function(e){!!(1&this.data)!==e&&(this.data^=1)},mi.offsets.get=function(){return!!(2&this.data)},mi.offsets.set=function(e){!!(2&this.data)!==e&&(this.data^=2)},mi.culling.get=function(){return!!(4&this.data)},mi.culling.set=function(e){!!(4&this.data)!==e&&(this.data^=4)},mi.depthTest.get=function(){return!!(8&this.data)},mi.depthTest.set=function(e){!!(8&this.data)!==e&&(this.data^=8)},mi.clockwiseFrontFace.get=function(){return!!(16&this.data)},mi.clockwiseFrontFace.set=function(e){!!(16&this.data)!==e&&(this.data^=16)},mi.blendMode.get=function(){return this._blendMode},mi.blendMode.set=function(e){this.blend=e!==ge.NONE,this._blendMode=e},mi.polygonOffset.get=function(){return this._polygonOffset},mi.polygonOffset.set=function(e){this.offsets=!!e,this._polygonOffset=e},pi.for2d=function(){var e=new pi;return e.depthTest=!1,e.blend=!0,e},Object.defineProperties(pi.prototype,mi);var vi=function(n){function o(e,t,r){var i=ci.from(e||o.defaultVertexSrc,t||o.defaultFragmentSrc);n.call(this,i,r),this.padding=0,this.resolution=A.FILTER_RESOLUTION,this.enabled=!0,this.autoFit=!0,this.legacy=!!this.program.attributeData.aTextureCoord,this.state=new pi}n&&(o.__proto__=n);var e={blendMode:{configurable:!0}},t={defaultVertexSrc:{configurable:!0},defaultFragmentSrc:{configurable:!0}};return((o.prototype=Object.create(n&&n.prototype)).constructor=o).prototype.apply=function(e,t,r,i,n){e.applyFilter(this,t,r,i,n)},e.blendMode.get=function(){return this.state.blendMode},e.blendMode.set=function(e){this.state.blendMode=e},t.defaultVertexSrc.get=function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},t.defaultFragmentSrc.get=function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},Object.defineProperties(o.prototype,e),Object.defineProperties(o,t),o}(li);vi.SOURCE_KEY_MAP={};var bi=new mt,gi=function(e,t){this._texture=e,this.mapCoord=new mt,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=-1,this.clampOffset=0,this.clampMargin=void 0===t?.5:t,this.isSimple=!1},yi={texture:{configurable:!0}};yi.texture.get=function(){return this._texture},yi.texture.set=function(e){this._texture=e,this._updateID=-1},gi.prototype.multiplyUvs=function(e,t){void 0===t&&(t=e);for(var r=this.mapCoord,i=0;i<e.length;i+=2){var n=e[i],o=e[i+1];t[i]=n*r.a+o*r.c+r.tx,t[i+1]=n*r.b+o*r.d+r.ty}return t},gi.prototype.update=function(e){var t=this._texture;if(!t||!t.valid)return!1;if(!e&&this._updateID===t._updateID)return!1;this._updateID=t._updateID;var r=t._uvs;this.mapCoord.set(r.x1-r.x0,r.y1-r.y0,r.x3-r.x0,r.y3-r.y0,r.x0,r.y0);var i=t.orig,n=t.trim;n&&(bi.set(i.width/n.width,0,0,i.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(bi));var o=t.baseTexture,a=this.uClampFrame,s=this.clampMargin/o.resolution,u=this.clampOffset;return a[0]=(t._frame.x+s+u)/o.width,a[1]=(t._frame.y+s+u)/o.height,a[2]=(t._frame.x+t._frame.width-s+u)/o.width,a[3]=(t._frame.y+t._frame.height-s+u)/o.height,this.uClampOffset[0]=u/o.realWidth,this.uClampOffset[1]=u/o.realHeight,this.isSimple=t._frame.width===o.width&&t._frame.height===o.height&&0===t.rotate,!0},Object.defineProperties(gi.prototype,yi);var _i=function(r){function e(e){var t=new mt;r.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n"),e.renderable=!1,this.maskSprite=e,this.maskMatrix=t}return r&&(e.__proto__=r),((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=this.maskSprite,o=this.maskSprite.texture;o.valid&&(o.transform||(o.transform=new gi(o,0)),o.transform.update(),this.uniforms.npmAlpha=o.baseTexture.premultiplyAlpha?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,n).prepend(o.transform.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=o.transform.uClampFrame,e.applyFilter(this,t,r,i))},e}(vi),wi=function(t){function e(e){t.call(this,e),this.scissor=!1,this.scissorData=null,this.scissorRenderTarget=null,this.enableScissor=!1,this.alphaMaskPool=[],this.alphaMaskIndex=0}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.push=function(e,t){if(t.isSprite)this.pushSpriteMask(e,t);else if(this.enableScissor&&!this.scissor&&this.renderer._activeRenderTarget.root&&!this.renderer.stencil.stencilMaskStack.length&&t.isFastRect()){var r=t.worldTransform,i=Math.atan2(r.b,r.a);(i=Math.round(i*(180/Math.PI)))%90?this.pushStencilMask(t):this.pushScissorMask(e,t)}else this.pushStencilMask(t)},e.prototype.pop=function(e,t){t.isSprite?this.popSpriteMask(e,t):this.enableScissor&&!this.renderer.stencil.stencilMaskStack.length?this.popScissorMask(e,t):this.popStencilMask(e,t)},e.prototype.pushSpriteMask=function(e,t){var r=this.alphaMaskPool[this.alphaMaskIndex];r||(r=this.alphaMaskPool[this.alphaMaskIndex]=[new _i(t)]),r[0].resolution=this.renderer.resolution,r[0].maskSprite=t;var i=e.filterArea;e.filterArea=t.getBounds(!0),this.renderer.filter.push(e,r),e.filterArea=i,this.alphaMaskIndex++},e.prototype.popSpriteMask=function(){this.renderer.filter.pop(),this.alphaMaskIndex--},e.prototype.pushStencilMask=function(e){this.renderer.batch.flush(),this.renderer.stencil.pushStencil(e)},e.prototype.popStencilMask=function(){this.renderer.stencil.popStencil()},e.prototype.pushScissorMask=function(e,t){t.renderable=!0;var r=this.renderer._activeRenderTarget,i=t.getBounds();i.fit(r.size),t.renderable=!1,this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);var n=this.renderer.resolution;this.renderer.gl.scissor(i.x*n,(r.root?r.size.height-i.y-i.height:i.y)*n,i.width*n,i.height*n),this.scissorRenderTarget=r,this.scissorData=t,this.scissor=!0},e.prototype.popScissorMask=function(){this.scissorRenderTarget=null,this.scissorData=null,this.scissor=!1;var e=this.renderer.gl;e.disable(e.SCISSOR_TEST)},e}(cr),xi=function(t){function e(e){t.call(this,e),this.stencilMaskStack=[]}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.setMaskStack=function(e){var t=this.renderer.gl;e.length!==this.stencilMaskStack.length&&(0===e.length?t.disable(t.STENCIL_TEST):t.enable(t.STENCIL_TEST)),this.stencilMaskStack=e},e.prototype.pushStencil=function(e){var t=this.renderer.gl,r=this.stencilMaskStack.length;0===r&&t.enable(t.STENCIL_TEST),this.stencilMaskStack.push(e),t.colorMask(!1,!1,!1,!1),t.stencilFunc(t.EQUAL,r,this._getBitwiseMask()),t.stencilOp(t.KEEP,t.KEEP,t.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},e.prototype.popStencil=function(){var e=this.renderer.gl,t=this.stencilMaskStack.pop();0===this.stencilMaskStack.length?(e.disable(e.STENCIL_TEST),e.clear(e.STENCIL_BUFFER_BIT),e.clearStencil(0)):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.EQUAL,this.stencilMaskStack.length,this._getBitwiseMask()),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},e.prototype._getBitwiseMask=function(){return(1<<this.stencilMaskStack.length)-1},e.prototype.destroy=function(){t.prototype.destroy.call(this,this),this.stencilMaskStack=null},e}(cr),Ti=function(t){function e(e){t.call(this,e),this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new mt,this.transform=null}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.update=function(e,t,r,i){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,i),this.transform&&this.projectionMatrix.append(this.transform);var n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,r,i){var n=this.projectionMatrix;i?(n.a=1/e.width*2*r,n.d=-1/e.height*2*r,n.tx=-1-t.x*n.a,n.ty=1-t.y*n.d):(n.a=1/e.width*2*r,n.d=1/e.height*2*r,n.tx=-1-t.x*n.a,n.ty=-1-t.y*n.d)},e.prototype.setTransform=function(){},e}(cr),Si=new Pt,Ei=function(t){function e(e){t.call(this,e),this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Pt,this.destinationFrame=new Pt}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.bind=function(e,t,r){void 0===e&&(e=null),this.current=e;var i,n=this.renderer;if(e){var o=e.baseTexture;i=o.resolution,r||(Si.width=o.realWidth,Si.height=o.realHeight,r=Si),t||(t=r),this.renderer.framebuffer.bind(o.framebuffer,r),this.renderer.projection.update(r,t,i,!1),this.renderer.stencil.setMaskStack(o.stencilMaskStack)}else i=this.renderer.resolution,r||(Si.width=n.width,Si.height=n.height,r=Si),t||(t=r),n.framebuffer.bind(null,r),this.renderer.projection.update(r,t,i,!0),this.renderer.stencil.setMaskStack(this.defaultMaskStack);this.sourceFrame.copyFrom(t),this.destinationFrame.x=r.x/i,this.destinationFrame.y=r.y/i,this.destinationFrame.width=r.width/i,this.destinationFrame.height=r.height/i},e.prototype.clear=function(e){e=this.current?e||this.current.baseTexture.clearColor:e||this.clearColor,this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3])},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e}(cr),Ai=function(e,t){this.program=e,this.uniformData=t,this.uniformGroups={}};Ai.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.program=null};var Pi=0,Mi=function(t){function e(e){t.call(this,e),this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this.id=Pi++}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.systemCheck=function(){if(!function(){if("boolean"==typeof ni)return ni;try{var e=new Function("param1","param2","param3","return param1[param2] === param3;");ni=!0===e({a:"b"},"a","b")}catch(e){ni=!1}return ni}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(e){this.gl=e},e.prototype.bind=function(e,t){e.uniforms.globals=this.renderer.globalUniforms;var r=e.program,i=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateShader(e);return this.shader=e,this.program!==r&&(this.program=r,this.gl.useProgram(i.program)),t||this.syncUniformGroup(e.uniformGroup),i},e.prototype.setUniforms=function(e){var t=this.shader.program,r=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(r.uniformData,e,this.renderer)},e.prototype.syncUniformGroup=function(e){var t=this.getglProgram();e.static&&e.dirtyId===t.uniformGroups[e.id]||(t.uniformGroups[e.id]=e.dirtyId,this.syncUniforms(e,t))},e.prototype.syncUniforms=function(e,t){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer)},e.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData);return this.cache[t]||(this.cache[t]=function(e,t){var r=0,i="var v = null;\n var cv = null\n var gl = renderer.gl";for(var n in e.uniforms){var o=t[n];o?"float"===o.type&&1===o.size?i+="\n if(uv."+n+" !== ud."+n+".value)\n {\n ud."+n+".value = uv."+n+"\n gl.uniform1f(ud."+n+".location, uv."+n+")\n }\n":"sampler2D"!==o.type&&"samplerCube"!==o.type&&"sampler2DArray"!==o.type||1!==o.size||o.isArray?"mat3"===o.type&&1===o.size?void 0!==e.uniforms[n].a?i+="\n gl.uniformMatrix3fv(ud."+n+".location, false, uv."+n+".toArray(true));\n \n":i+="\n gl.uniformMatrix3fv(ud."+n+".location, false, uv."+n+");\n \n":"vec2"===o.type&&1===o.size?void 0!==e.uniforms[n].x?i+="\n cv = ud."+n+".value;\n v = uv."+n+";\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud."+n+".location, v.x, v.y);\n }\n":i+="\n cv = ud."+n+".value;\n v = uv."+n+";\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud."+n+".location, v[0], v[1]);\n }\n \n":"vec4"===o.type&&1===o.size?void 0!==e.uniforms[n].width?i+="\n cv = ud."+n+".value;\n v = uv."+n+";\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud."+n+".location, v.x, v.y, v.width, v.height)\n }\n":i+="\n cv = ud."+n+".value;\n v = uv."+n+";\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud."+n+".location, v[0], v[1], v[2], v[3])\n }\n \n":i+="\n cv = ud."+n+".value;\n v = uv."+n+";\n "+(1===o.size?ri:ii)[o.type].replace("location","ud."+n+".location")+";\n":(i+="\n renderer.texture.bind(uv."+n+", "+r+");\n\n if(ud."+n+".value !== "+r+")\n {\n ud."+n+".value = "+r+";\n gl.uniform1i(ud."+n+".location, "+r+");\n; // eslint-disable-line max-len\n }\n",r++):e.uniforms[n].group&&(i+="\n renderer.shader.syncUniformGroup(uv."+n+");\n ")}return new Function("ud","uv","renderer",i)}(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]},e.prototype.getSignature=function(e,t){var r=e.uniforms,i=[];for(var n in r)i.push(n),t[n]&&i.push(t[n].type);return i.join("-")},e.prototype.getglProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateShader=function(e){var t=this.gl,r=e.program,i={};for(var n in r.attributeData)i[n]=r.attributeData[n].location;var o=Hr(t,r.vertexSrc,r.fragmentSrc,i),a={};for(var s in r.uniformData){var u=r.uniformData[s];a[s]={location:t.getUniformLocation(o,s),value:Vr(u.type,u.size)}}var h=new Ai(o,a);return r.glPrograms[this.renderer.CONTEXT_UID]=h},e.prototype.reset=function(){this.program=null,this.shader=null},e.prototype.destroy=function(){this.destroyed=!0},e}(cr);var Ci=function(t){function r(e){t.call(this,e),this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=ge.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.checks=[],this.defaultState=new pi,this.defaultState.blend=!0,this.defaultState.depth=!0}return t&&(r.__proto__=t),((r.prototype=Object.create(t&&t.prototype)).constructor=r).prototype.contextChange=function(e){this.gl=e,this.blendModes=function(e,t){return void 0===t&&(t=[]),t[ge.NORMAL]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.ADD]=[e.ONE,e.DST_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.MULTIPLY]=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.SCREEN]=[e.ONE,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.OVERLAY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.DARKEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.LIGHTEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.COLOR_DODGE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.COLOR_BURN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.HARD_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.SOFT_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.DIFFERENCE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.EXCLUSION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.HUE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.SATURATION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.COLOR]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.LUMINOSITY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.NONE]=[0,0],t[ge.NORMAL_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.ADD_NPM]=[e.SRC_ALPHA,e.DST_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.SCREEN_NPM]=[e.SRC_ALPHA,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE_MINUS_SRC_ALPHA],t[ge.SRC_IN]=[e.DST_ALPHA,e.ZERO],t[ge.SRC_OUT]=[e.ONE_MINUS_DST_ALPHA,e.ZERO],t[ge.SRC_ATOP]=[e.DST_ALPHA,e.ONE_MINUS_SRC_ALPHA],t[ge.DST_OVER]=[e.ONE_MINUS_DST_ALPHA,e.ONE],t[ge.DST_IN]=[e.ZERO,e.SRC_ALPHA],t[ge.DST_OUT]=[e.ZERO,e.ONE_MINUS_SRC_ALPHA],t[ge.DST_ATOP]=[e.ONE_MINUS_DST_ALPHA,e.SRC_ALPHA],t[ge.SUBTRACT]=[e.ONE,e.ONE,e.ONE,e.ONE,e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD],t}(e),this.setState(this.defaultState),this.reset()},r.prototype.setState=function(e){if(e=e||this.defaultState,this.stateId!==e.data){for(var t=this.stateId^e.data,r=0;t;)1&t&&this.map[r].call(this,!!(e.data&1<<r)),t>>=1,r++;this.stateId=e.data}for(var i=0;i<this.checks.length;i++)this.checks[i](this,e)},r.prototype.forceState=function(e){e=e||this.defaultState;for(var t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(var r=0;r<this.checks.length;r++)this.checks[r](this,e);this.stateId=e.data},r.prototype.setBlend=function(e){this.updateCheck(r.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)},r.prototype.setOffset=function(e){this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},r.prototype.setDepthTest=function(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)},r.prototype.setCullFace=function(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)},r.prototype.setFrontFace=function(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])},r.prototype.setBlendMode=function(e){if(e!==this.blendMode){this.blendMode=e;var t=this.blendModes[e],r=this.gl;2===t.length?r.blendFunc(t[0],t[1]):r.blendFuncSeparate(t[0],t[1],t[2],t[3]),6===t.length?(this._blendEq=!0,r.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}},r.prototype.setPolygonOffset=function(e,t){this.gl.polygonOffset(e,t)},r.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(0),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},r.prototype.updateCheck=function(e,t){var r=this.checks.indexOf(e);t&&-1===r?this.checks.push(e):t||-1===r||this.checks.splice(r,1)},r.checkBlendMode=function(e,t){e.setBlendMode(t.blendMode)},r}(cr),ki=function(t){function e(e){t.call(this,e),this.count=0,this.checkCount=0,this.maxIdle=A.GC_MAX_IDLE,this.checkCountMax=A.GC_MAX_CHECK_COUNT,this.mode=A.GC_MODE}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.postrender=function(){this.count++,this.mode!==Ae.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,r=!1,i=0;i<t.length;i++){var n=t[i];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(e.destroyTexture(n,!0),r=!(t[i]=null))}if(r){for(var o=0,a=0;a<t.length;a++)null!==t[a]&&(t[o++]=t[a]);t.length=o}},e.prototype.unload=function(e){var t=this.renderer.textureSystem;e._texture&&e._texture._glRenderTargets&&t.destroyTexture(e._texture);for(var r=e.children.length-1;0<=r;r--)this.unload(e.children[r])},e}(cr),Ii=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},Ri=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ir}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var r=0;r<t;r++)this.boundTextures[r]=null;this.emptyTextures={};var i=new Ii(e.createTexture());e.bindTexture(e.TEXTURE_2D,i.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=i,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new Ii(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(var n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(var o=0;o<this.boundTextures.length;o++)this.bind(null,o)},e.prototype.bind=function(e,t){void 0===t&&(t=0);var r=this.gl;if(e){if((e=e.baseTexture||e).valid){e.touched=this.renderer.textureGC.count;var i=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.currentLocation!==t&&(this.currentLocation=t,r.activeTexture(r.TEXTURE0+t)),this.boundTextures[t]!==e&&r.bindTexture(e.target,i.texture),i.dirtyId!==e.dirtyId&&this.updateTexture(e),this.boundTextures[t]=e}}else this.currentLocation!==t&&(this.currentLocation=t,r.activeTexture(r.TEXTURE0+t)),r.bindTexture(r.TEXTURE_2D,this.emptyTextures[r.TEXTURE_2D].texture),this.boundTextures[t]=null},e.prototype.reset=function(){this._unknownBoundTextures=!0,this.currentLocation=-1;for(var e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture},e.prototype.unbind=function(e){var t=this.gl,r=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var i=0;i<r.length;i++)r[i]===this.unknownTexture&&this.bind(null,i)}for(var n=0;n<r.length;n++)r[n]===e&&(this.currentLocation!==n&&(t.activeTexture(t.TEXTURE0+n),this.currentLocation=n),t.bindTexture(t.TEXTURE_2D,this.emptyTextures[e.target].texture),r[n]=null)},e.prototype.initTexture=function(e){var t=new Ii(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID],r=this.renderer;if(e.resource&&e.resource.upload(r,e,t));else{var i=e.realWidth,n=e.realHeight,o=r.gl;(t.width!==i||t.height!==n||t.dirtyId<0)&&(t.width=i,t.height=n,o.texImage2D(e.target,0,e.format,i,n,0,e.format,e.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId},e.prototype.destroyTexture=function(e,t){var r=this.gl;if((e=e.baseTexture||e)._glTextures[this.renderer.CONTEXT_UID]&&(this.unbind(e),r.deleteTexture(e._glTextures[this.renderer.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.renderer.CONTEXT_UID],!t)){var i=this.managedTextures.indexOf(e);-1!==i&&ze(this.managedTextures,i,1)}},e.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&(e.mipmap!==Ee.POW2&&2===this.webGLVersion||e.isPowerOfTwo?(t.mipmap=1<=e.mipmap,t.wrapMode=e.wrapMode):(t.mipmap=0,t.wrapMode=Se.CLAMP),e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var r=this.gl;t.mipmap&&r.generateMipmap(e.target),r.texParameteri(e.target,r.TEXTURE_WRAP_S,t.wrapMode),r.texParameteri(e.target,r.TEXTURE_WRAP_T,t.wrapMode),t.mipmap?r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(e.target,r.TEXTURE_MAG_FILTER,e.scaleMode?r.LINEAR:r.NEAREST)},e}(cr),Oi={FilterSystem:Lr,BatchSystem:jr,ContextSystem:Nr,FramebufferSystem:Ur,GeometrySystem:qr,MaskSystem:wi,StencilSystem:xi,ProjectionSystem:Ti,RenderTextureSystem:Ei,ShaderSystem:Mi,StateSystem:Ci,TextureGCSystem:ki,TextureSystem:Ri},Di=new mt,Li=function(r){function e(e,t){r.call(this),(t=Object.assign({},A.RENDER_OPTIONS,t)).roundPixels&&(A.ROUND_PIXELS=t.roundPixels,at("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=t,this.type=be.UNKNOWN,this.screen=new Pt(0,0,t.width,t.height),this.view=t.view||document.createElement("canvas"),this.resolution=t.resolution||A.RESOLUTION,this.transparent=t.transparent,this.autoDensity=t.autoDensity||t.autoResize||!1,this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.clearBeforeRender=t.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=t.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new jt,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}r&&(e.__proto__=r);var t={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},t.width.get=function(){return this.view.width},t.height.get=function(){return this.view.height},e.prototype.resize=function(e,t){this.screen.width=e,this.screen.height=t,this.view.width=e*this.resolution,this.view.height=t*this.resolution,this.autoDensity&&(this.view.style.width=e+"px",this.view.style.height=t+"px")},e.prototype.generateTexture=function(e,t,r,i){0===(i=i||e.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=yr.create(0|i.width,0|i.height,t,r);return Di.tx=-i.x,Di.ty=-i.y,this.render(e,n,!1,Di,!!e.parent),n},e.prototype.destroy=function(e){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;e&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=be.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},t.backgroundColor.get=function(){return this._backgroundColor},t.backgroundColor.set=function(e){this._backgroundColor=e,this._backgroundColorString=Oe(e),Re(e,this._backgroundColorRgba)},Object.defineProperties(e.prototype,t),e}(v),Fi=function(r){function i(e){void 0===e&&(e={}),r.call(this,"WebGL",e),e=this.options,this.type=be.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new zt("destroy"),contextChange:new zt("contextChange",1),reset:new zt("reset"),update:new zt("update"),postrender:new zt("postrender"),prerender:new zt("prerender"),resize:new zt("resize",2)},this.globalUniforms=new Rr({projectionMatrix:new mt},!0),this.addSystem(wi,"mask").addSystem(Nr,"context").addSystem(Ci,"state").addSystem(Mi,"shader").addSystem(Ri,"texture").addSystem(qr,"geometry").addSystem(Ur,"framebuffer").addSystem(xi,"stencil").addSystem(Ti,"projection").addSystem(ki,"textureGC").addSystem(Lr,"filter").addSystem(Ei,"renderTexture").addSystem(jr,"batch"),this.initPlugins(i.__plugins),e.context?this.context.initFromContext(e.context):this.context.initFromOptions({alpha:this.transparent,antialias:e.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,ke(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return r&&(i.__proto__=r),((i.prototype=Object.create(r&&r.prototype)).constructor=i).create=function(e){if(Ie())return new i(e);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},i.prototype.addSystem=function(e,t){t||(t=e.name);var r=new e(this);if(this[t])throw new Error('Whoops! The name "'+t+'" is already in use');for(var i in this[t]=r,this.runners)this.runners[i].add(r);return this},i.prototype.render=function(e,t,r,i,n){if(this.renderingToScreen=!t,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(t||(this._lastObjectRendered=e),!n){var o=e.parent;e.parent=this._tempDisplayObjectParent,e.updateTransform(),e.parent=o}this.renderTexture.bind(t),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),t&&t.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},i.prototype.resize=function(e,t){r.prototype.resize.call(this,e,t),this.runners.resize.run(e,t)},i.prototype.reset=function(){return this.runners.reset.run(),this},i.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},i.prototype.destroy=function(e){this.runners.destroy.run(),r.prototype.destroy.call(this,e),this.gl=null},i.registerPlugin=function(e,t){(i.__plugins=i.__plugins||{})[e]=t},i}(Li);function ji(e){return Fi.create(e)}var Bi="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",Ni="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Ui=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),((r.prototype=Object.create(e&&e.prototype)).constructor=r).from=function(e,t){return new r(new ar(e,t))},r}(ir),zi=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new xr(null,e,!1),this._indexBuffer=new xr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,xe.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,xe.FLOAT).addAttribute("aColor",this._buffer,4,!0,xe.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,xe.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(Mr),Xi=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},qi=function(e){this.vertices=new ArrayBuffer(e),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var Hi=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),Gi={},Vi={};function Yi(e,t){if(!Vi[t]){for(var r=new Int32Array(t),i=0;i<t;i++)r[i]=i;Gi[t]=Rr.from({uSamplers:r},!0);var n=Hi;n=(n=n.replace(/%count%/gi,t)).replace(/%forloop%/gi,function(e){var t="";t+="\n",t+="\n";for(var r=0;r<e;r++)0<r&&(t+="\nelse "),r<e-1&&(t+="if(vTextureId < "+r+".5)"),t+="\n{",t+="\n\tcolor = texture2D(uSamplers["+r+"], vTextureCoord);",t+="\n}";return t+="\n",t+="\n"}(t)),Vi[t]=new ci("precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",n)}var o={tint:new Float32Array([1,1,1,1]),translationMatrix:new mt,default:Gi[t]};return new li(Vi[t],o)}var Wi=function(r){function e(e){r.call(this,e),this.vertSize=6,this.vertByteSize=4*this.vertSize,this.size=8e3,this.currentSize=0,this.currentIndexSize=0,this.attributeBuffers={},this.aBuffers={},this.iBuffers={},this.onlySprites=!1,this.shader=null,this.currentIndex=0,this.groups=[];for(var t=0;t<this.size/4;t++)this.groups[t]=new Xi;this.elements=[],this.vaos=[],this.vaoMax=2,this.vertexCount=0,this.renderer.on("prerender",this.onPrerender,this),this.state=pi.for2d()}return r&&(e.__proto__=r),((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.contextChange=function(){var e=this.renderer.gl;A.PREFER_ENV===ve.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),A.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=ai(this.MAX_TEXTURES,e)),this.shader=Yi(0,this.MAX_TEXTURES);for(var t=0;t<this.vaoMax;t++)this.vaos[t]=new zi},e.prototype.onPrerender=function(){this.vertexCount=0},e.prototype.render=function(e){e._texture.valid&&(this.currentSize+e.vertexData.length/2>this.size&&this.flush(),this.elements[this.currentIndex++]=e,this.currentSize+=e.vertexData.length/2,this.currentIndexSize+=e.indices.length)},e.prototype.getIndexBuffer=function(e){var t=Ge(Math.ceil(e/12)),r=Ye(t),i=12*t;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(e){var t=Ge(Math.ceil(e/8)),r=Ye(t),i=8*t;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var e,t,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),a=this.elements,s=this.groups,u=n.float32View,h=n.uint32View,c=this.renderer.textureGC.count,f=0,l=0,d=0,p=0,m=s[0],v=-1;m.textureCount=0,m.start=0,m.blend=v;var b,g=++ir._globalBatch;for(b=0;b<this.currentIndex;++b){var y=a[b];a[b]=null,e=y._texture.baseTexture;var _=Le[e.premultiplyAlpha?1:0][y.blendMode];v!==_&&(v=_,t=null,p=i,g++),t!==e&&(t=e)._batchEnabled!==g&&(p===i&&(g++,p=0,m.size=l-m.start,(m=s[d++]).textureCount=0,m.blend=v,m.start=l),e.touched=c,e._batchEnabled=g,e._id=p,m.textures[m.textureCount++]=e,p++),this.packGeometry(y,u,h,o,f,l),f+=y.vertexData.length/2*this.vertSize,l+=y.indices.length}ir._globalBatch=g,m.size=l-m.start,A.CAN_UPLOAD_SAME_BUFFER?(this.vaos[this.vertexCount]._buffer.update(n.vertices,0),this.vaos[this.vertexCount]._indexBuffer.update(o,0),this.renderer.geometry.updateBuffers()):(this.vaoMax<=this.vertexCount&&(this.vaoMax++,this.vaos[this.vertexCount]=new zi),this.vaos[this.vertexCount]._buffer.update(n.vertices,0),this.vaos[this.vertexCount]._indexBuffer.update(o,0),this.renderer.geometry.bind(this.vaos[this.vertexCount]),this.renderer.geometry.updateBuffers(),this.vertexCount++);var w=this.renderer.texture,x=this.renderer.state;for(b=0;b<d;b++){for(var T=s[b],S=T.textureCount,E=0;E<S;E++)w.bind(T.textures[E],E),T.textures[E]=null;x.setBlendMode(T.blend),r.drawElements(T.type,T.size,r.UNSIGNED_SHORT,2*T.start)}this.currentIndex=0,this.currentSize=0,this.currentIndexSize=0}},e.prototype.packGeometry=function(e,t,r,i,n,o){for(var a=n/this.vertSize,s=e.uvs,u=e.indices,h=e.vertexData,c=e._texture.baseTexture._id,f=Math.min(e.worldAlpha,1),l=f<1&&e._texture.baseTexture.premultiplyAlpha?Be(e._tintRGB,f):e._tintRGB+(255*f<<24),d=0;d<h.length;d+=2)t[n++]=h[d],t[n++]=h[d+1],t[n++]=s[d],t[n++]=s[d+1],r[n++]=l,t[n++]=c;for(var p=0;p<u.length;p++)i[o++]=a+u[p]},e.prototype.start=function(){this.renderer.state.setState(this.state),this.renderer.shader.bind(this.shader),A.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this.vaos[this.vertexCount])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this.vaoMax;e++)this.vaos[e]&&this.vaos[e].destroy();this.indexBuffer&&this.indexBuffer.destroy(),this.renderer.off("prerender",this.onPrerender,this),this.shader&&(this.shader.destroy(),this.shader=null),this.vaos=null,this.indexBuffer=null,this.indices=null,this.sprites=null,r.prototype.destroy.call(this)},e}(Fr),Ji=new Pt,Ki=function(e){(this.renderer=e).extract=this};Ki.prototype.image=function(e,t,r){var i=new Image;return i.src=this.base64(e,t,r),i},Ki.prototype.base64=function(e,t,r){return this.canvas(e).toDataURL(t,r)},Ki.prototype.canvas=function(e){var t,r,i,n=this.renderer,o=!1,a=!1;e&&(e instanceof yr?i=e:(i=this.renderer.generateTexture(e),a=!0)),i?(t=i.baseTexture.resolution,r=i.frame,o=!1,n.renderTexture.bind(i)):(t=this.renderer.resolution,o=!0,(r=Ji).width=this.renderer.width,r.height=this.renderer.height,n.renderTexture.bind(null));var s=r.width*t,u=r.height*t,h=new Qe(s,u,1),c=new Uint8Array(4*s*u),f=n.gl;f.readPixels(r.x*t,r.y*t,s,u,f.RGBA,f.UNSIGNED_BYTE,c);var l=h.context.getImageData(0,0,s,u);return l.data.set(c),h.context.putImageData(l,0,0),o&&(h.context.scale(1,-1),h.context.drawImage(h.canvas,0,-u)),a&&i.destroy(!0),h.canvas},Ki.prototype.pixels=function(e){var t,r,i,n=this.renderer,o=!1;e&&(e instanceof yr?i=e:(i=this.renderer.generateTexture(e),o=!0)),i?(t=i.baseTexture.resolution,r=i.frame,n.renderTexture.bind(i)):(t=n.resolution,(r=Ji).width=n.width,r.height=n.height,n.renderTexture.bind(null));var a=r.width*t,s=r.height*t,u=new Uint8Array(4*a*s),h=n.gl;return h.readPixels(r.x*t,r.y*t,a,s,h.RGBA,h.UNSIGNED_BYTE,u),o&&i.destroy(!0),u},Ki.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var Zi={Extract:Ki},Qi=function(){this.global=new ut,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0},$i={pointerId:{configurable:!0}};$i.pointerId.get=function(){return this.identifier},Qi.prototype.getLocalPosition=function(e,t,r){return e.worldTransform.applyInverse(r||this.global,t)},Qi.prototype.copyEvent=function(e){e.isPrimary&&(this.isPrimary=!0),this.button=e.button,this.buttons=Number.isInteger(e.buttons)?e.buttons:e.which,this.width=e.width,this.height=e.height,this.tiltX=e.tiltX,this.tiltY=e.tiltY,this.pointerType=e.pointerType,this.pressure=e.pressure,this.rotationAngle=e.rotationAngle,this.twist=e.twist||0,this.tangentialPressure=e.tangentialPressure||0},Qi.prototype.reset=function(){this.isPrimary=!1},Object.defineProperties(Qi.prototype,$i);var en=function(){this.stopped=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null};en.prototype.stopPropagation=function(){this.stopped=!0},en.prototype.reset=function(){this.stopped=!1,this.currentTarget=null,this.target=null};var tn=function e(t){this._pointerId=t,this._flags=e.FLAGS.NONE},rn={pointerId:{configurable:!0},flags:{configurable:!0},none:{configurable:!0},over:{configurable:!0},rightDown:{configurable:!0},leftDown:{configurable:!0}};tn.prototype._doSet=function(e,t){this._flags=t?this._flags|e:this._flags&~e},rn.pointerId.get=function(){return this._pointerId},rn.flags.get=function(){return this._flags},rn.flags.set=function(e){this._flags=e},rn.none.get=function(){return this._flags===this.constructor.FLAGS.NONE},rn.over.get=function(){return 0!=(this._flags&this.constructor.FLAGS.OVER)},rn.over.set=function(e){this._doSet(this.constructor.FLAGS.OVER,e)},rn.rightDown.get=function(){return 0!=(this._flags&this.constructor.FLAGS.RIGHT_DOWN)},rn.rightDown.set=function(e){this._doSet(this.constructor.FLAGS.RIGHT_DOWN,e)},rn.leftDown.get=function(){return 0!=(this._flags&this.constructor.FLAGS.LEFT_DOWN)},rn.leftDown.set=function(e){this._doSet(this.constructor.FLAGS.LEFT_DOWN,e)},Object.defineProperties(tn.prototype,rn),tn.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4});var nn={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(e){e?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Lt.mixin(nn);var on={target:null,data:{global:null}},an=function(r){function e(e,t){r.call(this),t=t||{},this.renderer=e,this.autoPreventDefault=void 0===t.autoPreventDefault||t.autoPreventDefault,this.interactionFrequency=t.interactionFrequency||10,this.mouse=new Qi,this.mouse.identifier=1,this.mouse.global.set(-999999),this.activeInteractionData={},this.activeInteractionData[1]=this.mouse,this.interactionDataPool=[],this.eventData=new en,this.interactionDOMElement=null,this.moveWhenInside=!1,this.eventsAdded=!1,this.mouseOverRenderer=!1,this.supportsTouchEvents="ontouchstart"in window,this.supportsPointerEvents=!!window.PointerEvent,this.onPointerUp=this.onPointerUp.bind(this),this.processPointerUp=this.processPointerUp.bind(this),this.onPointerCancel=this.onPointerCancel.bind(this),this.processPointerCancel=this.processPointerCancel.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.processPointerDown=this.processPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.processPointerMove=this.processPointerMove.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.processPointerOverOut=this.processPointerOverOut.bind(this),this.onPointerOver=this.onPointerOver.bind(this),this.cursorStyles={default:"inherit",pointer:"pointer"},this.currentCursorMode=null,this.cursor=null,this._tempPoint=new ut,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}return r&&(e.__proto__=r),((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.hitTest=function(e,t){return on.target=null,on.data.global=e,t||(t=this.renderer._lastObjectRendered),this.processInteractive(on,t,null,!0),on.target},e.prototype.setTargetElement=function(e,t){void 0===t&&(t=1),this.removeEvents(),this.interactionDOMElement=e,this.resolution=t,this.addEvents()},e.prototype.addEvents=function(){this.interactionDOMElement&&(Gt.system.add(this.update,this,qt.INTERACTION),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]="none"),this.supportsPointerEvents?(window.document.addEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,!0),window.addEventListener("pointercancel",this.onPointerCancel,!0),window.addEventListener("pointerup",this.onPointerUp,!0)):(window.document.addEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,!0),window.addEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,!0)),this.eventsAdded=!0)},e.prototype.removeEvents=function(){this.interactionDOMElement&&(Gt.system.remove(this.update,this),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]=""),this.supportsPointerEvents?(window.document.removeEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,!0),window.removeEventListener("pointercancel",this.onPointerCancel,!0),window.removeEventListener("pointerup",this.onPointerUp,!0)):(window.document.removeEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,!0),window.removeEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,!0)),this.interactionDOMElement=null,this.eventsAdded=!1)},e.prototype.update=function(e){if(this._deltaTime+=e,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.interactionDOMElement))if(this.didMove)this.didMove=!1;else{for(var t in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var r=this.activeInteractionData[t];if(r.originalEvent&&"touch"!==r.pointerType){var i=this.configureInteractionEventForDOMEvent(this.eventData,r.originalEvent,r);this.processInteractive(i,this.renderer._lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(e){if(e=e||"default",this.currentCursorMode!==e){this.currentCursorMode=e;var t=this.cursorStyles[e];if(t)switch(typeof t){case"string":this.interactionDOMElement.style.cursor=t;break;case"function":t(e);break;case"object":Object.assign(this.interactionDOMElement.style,t)}else"string"!=typeof e||Object.prototype.hasOwnProperty.call(this.cursorStyles,e)||(this.interactionDOMElement.style.cursor=e)}},e.prototype.dispatchEvent=function(e,t,r){r.stopped||(r.currentTarget=e,r.type=t,e.emit(t,r),e[t]&&e[t](r))},e.prototype.mapPositionToPoint=function(e,t,r){var i;i=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:0,height:0};var n=1/this.resolution;e.x=(t-i.left)*(this.interactionDOMElement.width/i.width)*n,e.y=(r-i.top)*(this.interactionDOMElement.height/i.height)*n},e.prototype.processInteractive=function(e,t,r,i,n){if(!t||!t.visible)return!1;var o=e.data.global,a=!1,s=n=t.interactive||n,u=!0;if(t.hitArea?(i&&(t.worldTransform.applyInverse(o,this._tempPoint),t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:u=i=!1),s=!1):t._mask&&i&&(t._mask.containsPoint&&t._mask.containsPoint(o)||(i=!1)),u&&t.interactiveChildren&&t.children)for(var h=t.children,c=h.length-1;0<=c;c--){var f=h[c],l=this.processInteractive(e,f,r,i,s);if(l){if(!f.parent)continue;s=!1,l&&(e.target&&(i=!1),a=!0)}}return n&&(i&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(a=!0),t.interactive&&(a&&!e.target&&(e.target=t),r&&r(e,t,!!a))),a},e.prototype.onPointerDown=function(e){if(!this.supportsTouchEvents||"touch"!==e.pointerType){var t=this.normalizeToPointerData(e);if(this.autoPreventDefault&&t[0].isNormalized)(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(var r=t.length,i=0;i<r;i++){var n=t[i],o=this.getInteractionDataForPointerId(n),a=this.configureInteractionEventForDOMEvent(this.eventData,n,o);if(a.data.originalEvent=e,this.processInteractive(a,this.renderer._lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",a),"touch"===n.pointerType)this.emit("touchstart",a);else if("mouse"===n.pointerType||"pen"===n.pointerType){var s=2===n.button;this.emit(s?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(e,t,r){var i=e.data,n=e.data.identifier;if(r)if(t.trackedPointers[n]||(t.trackedPointers[n]=new tn(n)),this.dispatchEvent(t,"pointerdown",e),"touch"===i.pointerType)this.dispatchEvent(t,"touchstart",e);else if("mouse"===i.pointerType||"pen"===i.pointerType){var o=2===i.button;o?t.trackedPointers[n].rightDown=!0:t.trackedPointers[n].leftDown=!0,this.dispatchEvent(t,o?"rightdown":"mousedown",e)}},e.prototype.onPointerComplete=function(e,t,r){for(var i=this.normalizeToPointerData(e),n=i.length,o=e.target!==this.interactionDOMElement?"outside":"",a=0;a<n;a++){var s=i[a],u=this.getInteractionDataForPointerId(s),h=this.configureInteractionEventForDOMEvent(this.eventData,s,u);if(h.data.originalEvent=e,this.processInteractive(h,this.renderer._lastObjectRendered,r,t||!o),this.emit(t?"pointercancel":"pointerup"+o,h),"mouse"===s.pointerType||"pen"===s.pointerType){var c=2===s.button;this.emit(c?"rightup"+o:"mouseup"+o,h)}else"touch"===s.pointerType&&(this.emit(t?"touchcancel":"touchend"+o,h),this.releaseInteractionDataForPointerId(s.pointerId,u))}},e.prototype.onPointerCancel=function(e){this.supportsTouchEvents&&"touch"===e.pointerType||this.onPointerComplete(e,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(e,t){var r=e.data,i=e.data.identifier;void 0!==t.trackedPointers[i]&&(delete t.trackedPointers[i],this.dispatchEvent(t,"pointercancel",e),"touch"===r.pointerType&&this.dispatchEvent(t,"touchcancel",e))},e.prototype.onPointerUp=function(e){this.supportsTouchEvents&&"touch"===e.pointerType||this.onPointerComplete(e,!1,this.processPointerUp)},e.prototype.processPointerUp=function(e,t,r){var i=e.data,n=e.data.identifier,o=t.trackedPointers[n],a="touch"===i.pointerType,s="mouse"===i.pointerType||"pen"===i.pointerType,u=!1;if(s){var h=2===i.button,c=tn.FLAGS,f=h?c.RIGHT_DOWN:c.LEFT_DOWN,l=void 0!==o&&o.flags&f;r?(this.dispatchEvent(t,h?"rightup":"mouseup",e),l&&(this.dispatchEvent(t,h?"rightclick":"click",e),u=!0)):l&&this.dispatchEvent(t,h?"rightupoutside":"mouseupoutside",e),o&&(h?o.rightDown=!1:o.leftDown=!1)}r?(this.dispatchEvent(t,"pointerup",e),a&&this.dispatchEvent(t,"touchend",e),o&&(s&&!u||this.dispatchEvent(t,"pointertap",e),a&&(this.dispatchEvent(t,"tap",e),o.over=!1))):o&&(this.dispatchEvent(t,"pointerupoutside",e),a&&this.dispatchEvent(t,"touchendoutside",e)),o&&o.none&&delete t.trackedPointers[n]},e.prototype.onPointerMove=function(e){if(!this.supportsTouchEvents||"touch"!==e.pointerType){var t=this.normalizeToPointerData(e);"mouse"!==t[0].pointerType&&"pen"!==t[0].pointerType||(this.didMove=!0,this.cursor=null);for(var r=t.length,i=0;i<r;i++){var n=t[i],o=this.getInteractionDataForPointerId(n),a=this.configureInteractionEventForDOMEvent(this.eventData,n,o);a.data.originalEvent=e;var s="touch"!==n.pointerType||this.moveWhenInside;this.processInteractive(a,this.renderer._lastObjectRendered,this.processPointerMove,s),this.emit("pointermove",a),"touch"===n.pointerType&&this.emit("touchmove",a),"mouse"!==n.pointerType&&"pen"!==n.pointerType||this.emit("mousemove",a)}"mouse"===t[0].pointerType&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(e,t,r){var i=e.data,n="touch"===i.pointerType,o="mouse"===i.pointerType||"pen"===i.pointerType;o&&this.processPointerOverOut(e,t,r),this.moveWhenInside&&!r||(this.dispatchEvent(t,"pointermove",e),n&&this.dispatchEvent(t,"touchmove",e),o&&this.dispatchEvent(t,"mousemove",e))},e.prototype.onPointerOut=function(e){if(!this.supportsTouchEvents||"touch"!==e.pointerType){var t=this.normalizeToPointerData(e)[0];"mouse"===t.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var r=this.getInteractionDataForPointerId(t),i=this.configureInteractionEventForDOMEvent(this.eventData,t,r);i.data.originalEvent=t,this.processInteractive(i,this.renderer._lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",i),"mouse"===t.pointerType||"pen"===t.pointerType?this.emit("mouseout",i):this.releaseInteractionDataForPointerId(r.identifier)}},e.prototype.processPointerOverOut=function(e,t,r){var i=e.data,n=e.data.identifier,o="mouse"===i.pointerType||"pen"===i.pointerType,a=t.trackedPointers[n];r&&!a&&(a=t.trackedPointers[n]=new tn(n)),void 0!==a&&(r&&this.mouseOverRenderer?(a.over||(a.over=!0,this.dispatchEvent(t,"pointerover",e),o&&this.dispatchEvent(t,"mouseover",e)),o&&null===this.cursor&&(this.cursor=t.cursor)):a.over&&(a.over=!1,this.dispatchEvent(t,"pointerout",this.eventData),o&&this.dispatchEvent(t,"mouseout",e),a.none&&delete t.trackedPointers[n]))},e.prototype.onPointerOver=function(e){var t=this.normalizeToPointerData(e)[0],r=this.getInteractionDataForPointerId(t),i=this.configureInteractionEventForDOMEvent(this.eventData,t,r);"mouse"===(i.data.originalEvent=t).pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",i),"mouse"!==t.pointerType&&"pen"!==t.pointerType||this.emit("mouseover",i)},e.prototype.getInteractionDataForPointerId=function(e){var t,r=e.pointerId;return 1===r||"mouse"===e.pointerType?t=this.mouse:this.activeInteractionData[r]?t=this.activeInteractionData[r]:((t=this.interactionDataPool.pop()||new Qi).identifier=r,this.activeInteractionData[r]=t),t.copyEvent(e),t},e.prototype.releaseInteractionDataForPointerId=function(e){var t=this.activeInteractionData[e];t&&(delete this.activeInteractionData[e],t.reset(),this.interactionDataPool.push(t))},e.prototype.configureInteractionEventForDOMEvent=function(e,t,r){return e.data=r,this.mapPositionToPoint(r.global,t.clientX,t.clientY),"touch"===t.pointerType&&(t.globalX=r.global.x,t.globalY=r.global.y),r.originalEvent=t,e.reset(),e},e.prototype.normalizeToPointerData=function(e){var t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(var r=0,i=e.changedTouches.length;r<i;r++){var n=e.changedTouches[r];void 0===n.button&&(n.button=e.touches.length?1:0),void 0===n.buttons&&(n.buttons=e.touches.length?1:0),void 0===n.isPrimary&&(n.isPrimary=1===e.touches.length&&"touchstart"===e.type),void 0===n.width&&(n.width=n.radiusX||1),void 0===n.height&&(n.height=n.radiusY||1),void 0===n.tiltX&&(n.tiltX=0),void 0===n.tiltY&&(n.tiltY=0),void 0===n.pointerType&&(n.pointerType="touch"),void 0===n.pointerId&&(n.pointerId=n.identifier||0),void 0===n.pressure&&(n.pressure=n.force||.5),void 0===n.twist&&(n.twist=0),void 0===n.tangentialPressure&&(n.tangentialPressure=0),void 0===n.layerX&&(n.layerX=n.offsetX=n.clientX),void 0===n.layerY&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,t.push(n)}else!(e instanceof MouseEvent)||this.supportsPointerEvents&&e instanceof window.PointerEvent||(void 0===e.isPrimary&&(e.isPrimary=!0),void 0===e.width&&(e.width=1),void 0===e.height&&(e.height=1),void 0===e.tiltX&&(e.tiltX=0),void 0===e.tiltY&&(e.tiltY=0),void 0===e.pointerType&&(e.pointerType="mouse"),void 0===e.pointerId&&(e.pointerId=1),void 0===e.pressure&&(e.pressure=.5),void 0===e.twist&&(e.twist=0),void 0===e.tangentialPressure&&(e.tangentialPressure=0),e.isNormalized=!0),t.push(e);return t},e.prototype.destroy=function(){this.removeEvents(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this._tempPoint=null},e}(v),sn={InteractionData:Qi,InteractionEvent:en,InteractionManager:an,InteractionTrackingData:tn,interactiveTarget:nn},un={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,_segmentsCount:function(e,t){if(void 0===t&&(t=20),!this.adaptive)return t;var r=Math.ceil(e/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}},hn=function(){this.reset()};hn.prototype.clone=function(){var e=new hn;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},hn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=br.WHITE,this.matrix=null,this.visible=!1},hn.prototype.destroy=function(){this.texture=null,this.matrix=null};var cn=function(e,t,r,i){void 0===t&&(t=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=e,this.lineStyle=r,this.fillStyle=t,this.matrix=i,this.type=e.type,this.points=[],this.holes=[]};cn.prototype.clone=function(){return new cn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},cn.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var fn={build:function(e){var t,r,i=e.shape,n=e.points,o=i.x,a=i.y;if(n.length=0,r=e.type===pt.CIRC?(t=i.radius,i.radius):(t=i.width,i.height),0!==t&&0!==r){var s=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));s/=2.3;for(var u=2*Math.PI/s,h=0;h<s;h++)n.push(o+Math.sin(-u*h)*t,a+Math.cos(-u*h)*r);n.push(n[0],n[1])}},triangulate:function(e,t){var r=e.points,i=t.points,n=t.indices,o=i.length/2,a=o;i.push(e.shape.x,e.shape.y);for(var s=0;s<r.length;s+=2)i.push(r[s],r[s+1]),n.push(o++,a,o)}};function ln(e,t){e.lineStyle.native?function(e,t){var r=0,i=e.points||e.shape.points;if(0===i.length)return;var n=t.points,o=t.indices,a=i.length/2,s=n.length/2;for(r=1;r<a;r++){var u=i[2*(r-1)],h=i[2*(r-1)+1],c=i[2*r],f=i[2*r+1];n.push(u,h),n.push(c,f),o.push(s++,s++)}}(e,t):function(e,t){var r=e.shape,i=e.points||r.points.slice();if(0===i.length)return;var n=e.lineStyle,o=new ut(i[0],i[1]),a=new ut(i[i.length-2],i[i.length-1]),s=r.type!==pt.POLY||r.closeStroke,u=o.x===a.x&&o.y===a.y;if(s){i=i.slice(),u&&(i.pop(),i.pop(),a.set(i[i.length-2],i[i.length-1]));var h=a.x+.5*(o.x-a.x),c=a.y+.5*(o.y-a.y);i.unshift(h,c),i.push(h,c)}var f=t.points,l=i.length/2,d=i.length,p=f.length/2,m=n.width/2,v=i[0],b=i[1],g=i[2],y=i[3],_=0,w=0,x=-(b-y),T=v-g,S=0,E=0,A=0,P=0,M=Math.sqrt(x*x+T*T);x/=M,T/=M,x*=m,T*=m;var C=n.alignment,k=2*(1-C),I=2*C;f.push(v-x*k,b-T*k),f.push(v+x*I,b+T*I);for(var R=1;R<l-1;++R){v=i[2*(R-1)],b=i[2*(R-1)+1],g=i[2*R],y=i[2*R+1],_=i[2*(R+1)],w=i[2*(R+1)+1],x=-(b-y),T=v-g,M=Math.sqrt(x*x+T*T),x/=M,T/=M,x*=m,T*=m,S=-(y-w),E=g-_,M=Math.sqrt(S*S+E*E),S/=M,E/=M;var O=-T+b-(-T+y),D=-x+g-(-x+v),L=(-x+v)*(-T+y)-(-x+g)*(-T+b),F=-(E*=m)+w-(-E+y),j=-(S*=m)+g-(-S+_),B=(-S+_)*(-E+y)-(-S+g)*(-E+w),N=O*j-F*D;if(Math.abs(N)<.1)N+=10.1,f.push(g-x*k,y-T*k),f.push(g+x*I,y+T*I);else{var U=(D*B-j*L)/N,z=(F*L-O*B)/N,X=(U-g)*(U-g)+(z-y)*(z-y);196*m*m<X?(A=x-S,P=T-E,M=Math.sqrt(A*A+P*P),A/=M,P/=M,A*=m,P*=m,f.push(g-A*k,y-P*k),f.push(g+A*I,y+P*I),f.push(g-A*I*k,y-P*k),d++):(f.push(g+(U-g)*k,y+(z-y)*k),f.push(g-(U-g)*I,y-(z-y)*I))}}v=i[2*(l-2)],b=i[2*(l-2)+1],g=i[2*(l-1)],y=i[2*(l-1)+1],x=-(b-y),T=v-g,M=Math.sqrt(x*x+T*T),x/=M,T/=M,x*=m,T*=m,f.push(g-x*k,y-T*k),f.push(g+x*I,y+T*I);for(var q=t.indices,H=0;H<d-2;++H)q.push(p,p+1,p+2),p++}(e,t)}var dn={build:function(e){e.points=e.shape.points.slice()},triangulate:function(e,t){var r=e.points,i=e.holes,n=t.points,o=t.indices;if(6<=r.length){for(var a=[],s=0;s<i.length;s++){var u=i[s];a.push(r.length/2),r=r.concat(u.points)}var h=b(r,a,2);if(!h)return;for(var c=n.length/2,f=0;f<h.length;f+=3)o.push(h[f]+c),o.push(h[f+1]+c),o.push(h[f+2]+c);for(var l=0;l<r.length;l++)n.push(r[l])}}},pn={build:function(e){var t=e.shape,r=e.points,i=t.x,n=t.y,o=t.width,a=t.height,s=t.radius;r.length=0,vn(i,n+s,i,n,i+s,n,r),vn(i+o-s,n,i+o,n,i+o,n+s,r),vn(i+o,n+a-s,i+o,n+a,i+o-s,n+a,r),vn(i+s,n+a,i,n+a,i,n+a-s,r)},triangulate:function(e,t){for(var r=e.points,i=t.points,n=t.indices,o=i.length/2,a=b(r,null,2),s=0,u=a.length;s<u;s+=3)n.push(a[s]+o),n.push(a[s+1]+o),n.push(a[s+2]+o);for(var h=0,c=r.length;h<c;h++)i.push(r[h],r[++h])}};function mn(e,t,r){return e+(t-e)*r}function vn(e,t,r,i,n,o,a){void 0===a&&(a=[]);for(var s=a,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0;p<=20;++p)u=mn(e,r,m=p/20),h=mn(t,i,m),c=mn(r,n,m),f=mn(i,o,m),l=mn(u,c,m),d=mn(h,f,m),s.push(l,d);return s}var bn=[],gn=[],yn={};yn[pt.POLY]=dn,yn[pt.CIRC]=fn,yn[pt.ELIP]=fn,yn[pt.RECT]={build:function(e){var t=e.shape,r=t.x,i=t.y,n=t.width,o=t.height,a=e.points;a.length=0,a.push(r,i,r+n,i,r+n,i+o,r,i+o)},triangulate:function(e,t){var r=e.points,i=t.points,n=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),t.indices.push(n,1+n,2+n,1+n,2+n,3+n)}},yn[pt.RREC]=pn;var _n=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},wn=function(r){function i(){r.call(this),this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.dirty=0,this.batchDirty=-1,this.cacheDirty=-1,this.clearDirty=0,this.drawCalls=[],this.batches=[],this.shapeIndex=0,this._bounds=new Dt,this.boundsDirty=-1,this.boundsPadding=0,this.batchable=!1,this.indicesUint16=null,this.uvsFloat32=null}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var e={bounds:{configurable:!0}};return e.bounds.get=function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},i.prototype.clear=function(){if(0<this.graphicsData.length){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0;for(var e=this.textureIds.length=0;e<this.drawCalls.length;e++)this.drawCalls[e].textures.length=0,gn.push(this.drawCalls[e]);for(var t=this.drawCalls.length=0;t<this.batches.length;t++){var r=this.batches[t];r.start=0,r.attribStart=0,r.style=null,bn.push(r)}this.batches.length=0}return this},i.prototype.drawShape=function(e,t,r,i){var n=new cn(e,t,r,i);return this.graphicsData.push(n),this.dirty++,this},i.prototype.drawHole=function(e,t){if(!this.graphicsData.length)return null;var r=new cn(e,null,null,t),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,r},i.prototype.destroy=function(e){r.prototype.destroy.call(this,e);for(var t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},i.prototype.containsPoint=function(e){for(var t=this.graphicsData,r=0;r<t.length;++r){var i=t[r];if(i.fillStyle.visible&&(i.shape&&i.shape.contains(e.x,e.y))){if(i.holes)for(var n=0;n<i.holes.length;n++){if(i.holes[n].shape.contains(e.x,e.y))return!1}return!0}}return!1},i.prototype.updateBatches=function(){if(this.dirty!==this.cacheDirty&&0!==this.graphicsData.length){if(this.dirty!==this.cacheDirty)for(var e=0;e<this.graphicsData.length;e++){var t=this.graphicsData[e];if(t.fillStyle&&!t.fillStyle.texture.baseTexture.valid)return;if(t.lineStyle&&!t.lineStyle.texture.baseTexture.valid)return}this.cacheDirty=this.dirty;var r=this.uvs,i=this.batches.pop()||bn.pop()||new _n;i.style=i.style||this.graphicsData[0].fillStyle||this.graphicsData[0].lineStyle;var n=i.style.texture.baseTexture,o=i.style.color+i.style.alpha;this.batches.push(i);for(var a=this.shapeIndex;a<this.graphicsData.length;a++){this.shapeIndex++;var s=this.graphicsData[a],u=yn[s.type],h=s.fillStyle,c=s.lineStyle;u.build(s),s.matrix&&this.transformPoints(s.points,s.matrix);for(var f=0;f<2;f++){var l=0===f?h:c;if(l.visible){var d=l.texture.baseTexture;if(n!==d||l.color+l.alpha!==o){d.wrapMode=10497,n=d,o=l.color+l.alpha;var p=this.indices.length,m=this.points.length/2;i.size=p-i.start,i.attribSize=m-i.attribStart,0<i.size&&(i=bn.pop()||new _n,this.batches.push(i)),i.style=l,i.start=p,i.attribStart=m}var v=this.points.length/2;if(0===f)s.holes.length?(this.processHoles(s.holes),dn.triangulate(s,this)):u.triangulate(s,this);else{ln(s,this);for(var b=0;b<s.holes.length;b++)ln(s.holes[b],this)}var g=this.points.length/2-v;this.addUvs(this.points,r,l.texture,v,g,l.matrix)}}}var y=this.indices.length,_=this.points.length/2;if(i.size=y-i.start,i.attribSize=_-i.attribStart,this.indicesUint16=new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var w=0;w<this.batches.length;w++)for(var x=this.batches[w],T=0;T<x.size;T++){var S=x.start+T;this.indicesUint16[S]=this.indicesUint16[S]-x.attribStart}}else this.buildDrawCalls()}},i.prototype.isBatchable=function(){for(var e=this.batches,t=0;t<e.length;t++)if(e[t].style.native)return!1;return this.points.length<2*i.BATCHABLE_SIZE},i.prototype.buildDrawCalls=function(){for(var e=++ir._globalBatch,t=0;t<this.drawCalls.length;t++)this.drawCalls[t].textures.length=0,gn.push(this.drawCalls[t]);this.drawCalls.length=0;var r=this.uvs,i=this.colors,n=this.textureIds,o=gn.pop()||new Xi;o.textureCount=0,o.start=0,o.size=0,o.type=ye.TRIANGLES;var a=0,s=null,u=0,h=!1,c=ye.TRIANGLES,f=0;this.drawCalls.push(o);for(var l=0;l<this.batches.length;l++){var d=this.batches[l],p=d.style,m=p.texture.baseTexture;h!==p.native&&(c=(h=p.native)?ye.LINES:ye.TRIANGLES,s=null,a=8,e++),s!==m&&(s=m)._batchEnabled!==e&&(8===a&&(e++,(a=0)<o.size&&(o=gn.pop()||new Xi,this.drawCalls.push(o)),o.start=f,o.size=0,o.textureCount=0,o.type=c),m.touched=1,m._batchEnabled=e,m._id=a,m.wrapMode=10497,o.textures[o.textureCount++]=m,a++),o.size+=d.size,f+=d.size,u=m._id,this.addColors(i,p.color,p.alpha,d.attribSize),this.addTextureIds(n,u,d.attribSize)}ir._globalBatch=e;for(var v=this.points,b=new ArrayBuffer(3*v.length*4),g=new Float32Array(b),y=new Uint32Array(b),_=0,w=0;w<v.length/2;w++)g[_++]=v[2*w],g[_++]=v[2*w+1],g[_++]=r[2*w],g[_++]=r[2*w+1],y[_++]=i[w],g[_++]=n[w];this._buffer.update(b),this._indexBuffer.update(this.indicesUint16)},i.prototype.processHoles=function(e){for(var t=0;t<e.length;t++){var r=e[t];yn[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}},i.prototype.calculateBounds=function(){var e=1/0,t=-1/0,r=1/0,i=-1/0;if(this.graphicsData.length)for(var n=null,o=0,a=0,s=0,u=0,h=0;h<this.graphicsData.length;h++){var c=this.graphicsData[h],f=c.type,l=c.lineStyle?c.lineStyle.width:0;if(n=c.shape,f===pt.RECT||f===pt.RREC)o=n.x-l/2,a=n.y-l/2,e=o<e?o:e,t=t<o+(s=n.width+l)?o+s:t,r=a<r?a:r,i=i<a+(u=n.height+l)?a+u:i;else if(f===pt.CIRC)o=n.x,a=n.y,e=o-(s=n.radius+l/2)<e?o-s:e,t=t<o+s?o+s:t,r=a-(u=n.radius+l/2)<r?a-u:r,i=i<a+u?a+u:i;else if(f===pt.ELIP)o=n.x,a=n.y,e=o-(s=n.width+l/2)<e?o-s:e,t=t<o+s?o+s:t,r=a-(u=n.height+l/2)<r?a-u:r,i=i<a+u?a+u:i;else for(var d=n.points,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0;x+2<d.length;x+=2)o=d[x],a=d[x+1],p=d[x+2],m=d[x+3],v=Math.abs(p-o),b=Math.abs(m-a),u=l,(s=Math.sqrt(v*v+b*b))<1e-9||(e=(_=(p+o)/2)-(g=(u/s*b+v)/2)<e?_-g:e,t=t<_+g?_+g:t,r=(w=(m+a)/2)-(y=(u/s*v+b)/2)<r?w-y:r,i=i<w+y?w+y:i)}else i=r=t=e=0;var T=this.boundsPadding;this._bounds.minX=e-T,this._bounds.maxX=t+T,this._bounds.minY=r-T,this._bounds.maxY=i+T},i.prototype.transformPoints=function(e,t){for(var r=0;r<e.length/2;r++){var i=e[2*r],n=e[2*r+1];e[2*r]=t.a*i+t.c*n+t.tx,e[2*r+1]=t.b*i+t.d*n+t.ty}},i.prototype.addColors=function(e,t,r,i){for(var n=Be((t>>16)+(65280&t)+((255&t)<<16),r);0<i--;)e.push(n)},i.prototype.addTextureIds=function(e,t,r){for(;0<r--;)e.push(t)},i.prototype.addUvs=function(e,t,r,i,n,o){for(var a=0,s=t.length,u=r.frame;a<n;){var h=e[2*(i+a)],c=e[2*(i+a)+1];if(o){var f=o.a*h+o.c*c+o.tx;c=o.b*h+o.d*c+o.ty,h=f}a++,t.push(h/u.width,c/u.height)}var l=r.baseTexture;(u.width<l.width||u.height<l.height)&&this.adjustUvs(t,r,s,n)},i.prototype.adjustUvs=function(e,t,r,i){for(var n=t.baseTexture,o=r+2*i,a=t.frame,s=a.width/n.width,u=a.height/n.height,h=a.x/a.width,c=a.y/a.width,f=Math.floor(e[r]+1e-6),l=Math.floor(e[r+1]+1e-6),d=r+2;d<o;d+=2)f=Math.min(f,Math.floor(e[d]+1e-6)),l=Math.min(l,Math.floor(e[d+1]+1e-6));h-=f,c-=l;for(var p=r;p<o;p+=2)e[p]=(e[p]+h)*s,e[p+1]=(e[p+1]+c)*u},Object.defineProperties(i.prototype,e),i}(zi);wn.BATCHABLE_SIZE=100;var xn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e},t.prototype.reset=function(){e.prototype.reset.call(this),this.color=0,this.width=0,this.alignment=.5,this.native=!1},t}(hn),Tn=function(){};Tn.curveLength=function(e,t,r,i,n,o,a,s){for(var u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=e,_=t,w=1;w<=10;++w)b=y-(m=(p=(d=(l=1-(h=w/10))*l)*l)*e+3*d*h*r+3*l*(c=h*h)*n+(f=c*h)*a),g=_-(v=p*t+3*d*h*i+3*l*c*o+f*s),y=m,_=v,u+=Math.sqrt(b*b+g*g);return u},Tn.curveTo=function(e,t,r,i,n,o,a){var s=a[a.length-2],u=a[a.length-1];a.length-=2;var h=un._segmentsCount(Tn.curveLength(s,u,e,t,r,i,n,o)),c=0,f=0,l=0,d=0,p=0;a.push(s,u);for(var m=1,v=0;m<=h;++m)l=(f=(c=1-(v=m/h))*c)*c,p=(d=v*v)*v,a.push(l*s+3*f*v*e+3*c*d*r+p*n,l*u+3*f*v*t+3*c*d*i+p*o)};var Sn=function(){};Sn.curveLength=function(e,t,r,i,n,o){var a=e-2*r+n,s=t-2*i+o,u=2*r-2*e,h=2*i-2*t,c=4*(a*a+s*s),f=4*(a*u+s*h),l=u*u+h*h,d=2*Math.sqrt(c+f+l),p=Math.sqrt(c),m=2*c*p,v=2*Math.sqrt(l),b=f/p;return(m*d+p*f*(d-v)+(4*l*c-f*f)*Math.log((2*p+b+d)/(b+v)))/(4*m)},Sn.curveTo=function(e,t,r,i,n){for(var o=n[n.length-2],a=n[n.length-1],s=un._segmentsCount(Sn.curveLength(o,a,e,t,r,i)),u=0,h=0,c=1;c<=s;++c){var f=c/s;u=o+(e-o)*f,h=a+(t-a)*f,n.push(u+(e+(r-e)*f-u)*f,h+(t+(i-t)*f-h)*f)}};var En=function(){};En.curveTo=function(e,t,r,i,n,o){var a=o[o.length-2],s=o[o.length-1]-t,u=a-e,h=i-t,c=r-e,f=Math.abs(s*c-u*h);if(f<1e-8||0===n)return o[o.length-2]===e&&o[o.length-1]===t||o.push(e,t),null;var l=s*s+u*u,d=h*h+c*c,p=s*h+u*c,m=n*Math.sqrt(l)/f,v=n*Math.sqrt(d)/f,b=m*p/l,g=v*p/d,y=m*c+v*u,_=m*h+v*s,w=u*(v+b),x=s*(v+b),T=c*(m+g),S=h*(m+g);return{cx:y+e,cy:_+t,radius:n,startAngle:Math.atan2(x-_,w-y),endAngle:Math.atan2(S-_,T-y),anticlockwise:c*s<u*h}},En.arc=function(e,t,r,i,n,o,a,s,u){for(var h=a-o,c=un._segmentsCount(Math.abs(h)*n,40*Math.ceil(Math.abs(h)/ft)),f=h/(2*c),l=2*f,d=Math.cos(f),p=Math.sin(f),m=c-1,v=m%1/m,b=0;b<=m;++b){var g=f+o+l*(b+v*b),y=Math.cos(g),_=-Math.sin(g);u.push((d*y+p*_)*n+r,(d*-_+p*y)*n+i)}};var An=function(d){function e(e,t,r,i,n,o){n=n||i/2;for(var a=-1*Math.PI/2+o,s=2*r,u=ft/s,h=[],c=0;c<s;c++){var f=c%2?n:i,l=c*u+a;h.push(e+f*Math.cos(l),t+f*Math.sin(l))}d.call(this,h)}return d&&(e.__proto__=d),(e.prototype=Object.create(d&&d.prototype)).constructor=e}(Rt),Pn=new Float32Array(3),Mn=null,Cn=function(t){function r(e){void 0===e&&(e=null),t.call(this),this.geometry=e||new wn,this.geometry.refCount++,this.shader=null,this.state=pi.for2d(),this._fillStyle=new hn,this._lineStyle=new xn,this._matrix=null,this._holeMode=!1,this.currentPath=null,this.batches=[],this.batchTint=-1,this.vertexData=null,this._transformID=-1,this.batchDirty=-1,this.tint=16777215,this.blendMode=ge.NORMAL}t&&(r.__proto__=t);var e={blendMode:{configurable:!0},tint:{configurable:!0},fill:{configurable:!0},line:{configurable:!0}};return((r.prototype=Object.create(t&&t.prototype)).constructor=r).prototype.clone=function(){return this.finishPoly(),new r(this.geometry)},e.blendMode.set=function(e){this.state.blendMode=e},e.blendMode.get=function(){return this.state.blendMode},e.tint.get=function(){return this._tint},e.tint.set=function(e){this._tint=e},e.fill.get=function(){return this._fillStyle},e.line.get=function(){return this._lineStyle},r.prototype.lineStyle=function(e,t,r,i,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=1),void 0===i&&(i=.5),void 0===n&&(n=!1),this.lineTextureStyle(e,br.WHITE,t,r,null,i,n),this},r.prototype.lineTextureStyle=function(e,t,r,i,n,o,a){void 0===e&&(e=0),void 0===t&&(t=br.WHITE),void 0===r&&(r=16777215),void 0===i&&(i=1),void 0===n&&(n=null),void 0===o&&(o=.5),void 0===a&&(a=!1),this.currentPath&&this.startPoly();var s=0<e&&0<i;return s?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:e,alpha:i,matrix:n,texture:t,alignment:o,native:a,visible:s})):this._lineStyle.reset(),this},r.prototype.startPoly=function(){if(this.currentPath){var e=this.currentPath.points,t=this.currentPath.points.length;2<t&&(this.drawShape(this.currentPath),this.currentPath=new Rt,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new Rt,this.currentPath.closeStroke=!1},r.prototype.finishPoly=function(){this.currentPath&&(2<this.currentPath.points.length?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},r.prototype.moveTo=function(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this},r.prototype.lineTo=function(e,t){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===e&&n===t||r.push(e,t),this},r.prototype._initCurve=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[e,t]):this.moveTo(e,t)},r.prototype.quadraticCurveTo=function(e,t,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Sn.curveTo(e,t,r,i,n),this},r.prototype.bezierCurveTo=function(e,t,r,i,n,o){return this._initCurve(),Tn.curveTo(e,t,r,i,n,o,this.currentPath.points),this},r.prototype.arcTo=function(e,t,r,i,n){this._initCurve(e,t);var o=this.currentPath.points,a=En.curveTo(e,t,r,i,n,o);if(a){var s=a.cx,u=a.cy,h=a.radius,c=a.startAngle,f=a.endAngle,l=a.anticlockwise;this.arc(s,u,h,c,f,l)}return this},r.prototype.arc=function(e,t,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=ft:o&&i<=n&&(i+=ft),0==n-i)return this;var a=e+Math.cos(i)*r,s=t+Math.sin(i)*r,u=this.currentPath?this.currentPath.points:null;if(u){var h=Math.abs(u[u.length-2]-a),c=Math.abs(u[u.length-1]-s);h<.001&&c<.001||u.push(a,s)}else this.moveTo(a,s),u=this.currentPath.points;return En.arc(a,s,e,t,r,i,n,o,u),this},r.prototype.beginFill=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=1),this.beginTextureFill(br.WHITE,e,t)},r.prototype.beginTextureFill=function(e,t,r,i){void 0===e&&(e=br.WHITE),void 0===t&&(t=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=0<r;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:t,alpha:r,texture:e,matrix:i,visible:n})):this._fillStyle.reset(),this},r.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},r.prototype.drawRect=function(e,t,r,i){return this.drawShape(new Pt(e,t,r,i))},r.prototype.drawRoundedRect=function(e,t,r,i,n){return this.drawShape(new Ot(e,t,r,i,n))},r.prototype.drawCircle=function(e,t,r){return this.drawShape(new kt(e,t,r))},r.prototype.drawEllipse=function(e,t,r,i){return this.drawShape(new It(e,t,r,i))},r.prototype.drawPolygon=function(e){var t=arguments,r=e,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n<r.length;++n)r[n]=t[n]}var o=new Rt(r);return o.closeStroke=i,this.drawShape(o),this},r.prototype.drawShape=function(e){return this._holeMode?this.geometry.drawHole(e,this._matrix):this.geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},r.prototype.drawStar=function(e,t,r,i,n,o){return void 0===o&&(o=0),this.drawPolygon(new An(e,t,r,i,n,o))},r.prototype.clear=function(){return this.geometry.clear(),this._matrix=null,this._holeMode=!1,this.currentPath=null,this._spriteRect=null,this},r.prototype.isFastRect=function(){return!1},r.prototype._render=function(e){this.finishPoly();var t=this.geometry;if(t.updateBatches(),t.batchable){if(this.batchDirty!==t.batchDirty){this.batches=[],this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.vertexData=new Float32Array(t.points);for(var r=this.blendMode,i=0;i<t.batches.length;i++){var n=t.batches[i],o=n.style.color,a=new Float32Array(this.vertexData.buffer,4*n.attribStart*2,2*n.attribSize),s=new Float32Array(t.uvsFloat32.buffer,4*n.attribStart*2,2*n.attribSize),u={vertexData:a,blendMode:r,indices:new Uint16Array(t.indicesUint16.buffer,2*n.start,n.size),uvs:s,_batchRGB:Re(o),_tintRGB:o,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[i]=u}}if(e.batch.setObjectRenderer(e.plugins.batch),this.batches.length){this.calculateVertices(),this.calculateTints();for(var h=0;h<this.batches.length;h++){var c=this.batches[h];c.worldAlpha=this.worldAlpha*c.alpha,e.plugins.batch.render(c)}}}else{if(e.batch.flush(),!this.shader){if(!Mn){for(var f=new Int32Array(16),l=0;l<16;l++)f[l]=l;var d={tint:new Float32Array([1,1,1,1]),translationMatrix:new mt,default:Rr.from({uSamplers:f},!0)},p=e.plugins.batch.shader.program;Mn=new li(p,d)}this.shader=Mn}var m=this.shader.uniforms;m.translationMatrix=this.transform.worldTransform;var v=this.tint,b=this.worldAlpha;m.tint[0]=(v>>16&255)/255*b,m.tint[1]=(v>>8&255)/255*b,m.tint[2]=(255&v)/255*b,m.tint[3]=b,e.shader.bind(this.shader),e.geometry.bind(t,this.shader),e.state.setState(this.state);for(var g=0;g<t.drawCalls.length;g++){for(var y=t.drawCalls[g],_=y.textureCount,w=0;w<_;w++)e.texture.bind(y.textures[w],w);e.geometry.draw(y.type,y.size,y.start)}}},r.prototype._calculateBounds=function(){this.finishPoly();var e=this.geometry.bounds;this._bounds.addFrame(this.transform,e.minX,e.minY,e.maxX,e.maxY)},r.prototype.containsPoint=function(e){return this.worldTransform.applyInverse(e,r._TEMP_POINT),this.geometry.containsPoint(r._TEMP_POINT)},r.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var e=Re(this.tint,Pn),t=0;t<this.batches.length;t++){var r=this.batches[t],i=r._batchRGB,n=(e[0]*i[0]*255<<16)+(e[1]*i[1]*255<<8)+(0|e[2]*i[2]*255);r._tintRGB=(n>>16)+(65280&n)+((255&n)<<16)}}},r.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var e=this.transform.worldTransform,t=e.a,r=e.b,i=e.c,n=e.d,o=e.tx,a=e.ty,s=this.geometry.points,u=this.vertexData,h=0,c=0;c<s.length;c+=2){var f=s[c],l=s[c+1];u[h++]=t*f+i*l+o,u[h++]=n*l+r*f+a}}},r.prototype.closePath=function(){var e=this.currentPath;return e&&(e.closeStroke=!0),this},r.prototype.setMatrix=function(e){return this._matrix=e,this},r.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},r.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},r.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.geometry.refCount--,0===this.geometry.refCount&&this.geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this.geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,t.prototype.destroy.call(this,e)},Object.defineProperties(r.prototype,e),r}(jt);Cn._TEMP_POINT=new ut;var kn=new ut,In=new Uint16Array([0,1,2,0,2,3]),Rn=function(r){function i(e){r.call(this),this._anchor=new ht(this._onAnchorUpdate,this,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tint=null,this._tintRGB=null,this.tint=16777215,this.blendMode=ge.NORMAL,this.shader=null,this.cachedTint=16777215,this.uvs=null,this.texture=e||br.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=In,this.size=4,this.start=0,this.pluginName="batch",this.isSprite=!0,this._roundPixels=A.ROUND_PIXELS}r&&(i.__proto__=r);var e={roundPixels:{configurable:!0},width:{configurable:!0},height:{configurable:!0},anchor:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return((i.prototype=Object.create(r&&r.prototype)).constructor=i).prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this.cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this._width&&(this.scale.x=He(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=He(this.scale.y)*this._height/this._texture.orig.height)},i.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},i.prototype.calculateVertices=function(){var e=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==e._updateID){this._transformID=this.transform._worldID,this._textureID=e._updateID;var t=this.transform.worldTransform,r=t.a,i=t.b,n=t.c,o=t.d,a=t.tx,s=t.ty,u=this.vertexData,h=e.trim,c=e.orig,f=this._anchor,l=0,d=0,p=0,m=0;if(p=h?(l=(d=h.x-f._x*c.width)+h.width,(m=h.y-f._y*c.height)+h.height):(l=(d=-f._x*c.width)+c.width,(m=-f._y*c.height)+c.height),u[0]=r*d+n*m+a,u[1]=o*m+i*d+s,u[2]=r*l+n*m+a,u[3]=o*m+i*l+s,u[4]=r*l+n*p+a,u[5]=o*p+i*l+s,u[6]=r*d+n*p+a,u[7]=o*p+i*d+s,this._roundPixels)for(var v=0;v<8;v++)u[v]=Math.round(u[v])}},i.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var e=this._texture,t=this.vertexTrimmedData,r=e.orig,i=this._anchor,n=this.transform.worldTransform,o=n.a,a=n.b,s=n.c,u=n.d,h=n.tx,c=n.ty,f=-i._x*r.width,l=f+r.width,d=-i._y*r.height,p=d+r.height;t[0]=o*f+s*d+h,t[1]=u*d+a*f+c,t[2]=o*l+s*d+h,t[3]=u*d+a*l+c,t[4]=o*l+s*p+h,t[5]=u*p+a*l+c,t[6]=o*f+s*p+h,t[7]=u*p+a*f+c},i.prototype._render=function(e){this.calculateVertices(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this)},i.prototype._calculateBounds=function(){var e=this._texture.trim,t=this._texture.orig;!e||e.width===t.width&&e.height===t.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},i.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new Pt),e=this._localBoundsRect),this._bounds.getRectangle(e)):r.prototype.getLocalBounds.call(this,e)},i.prototype.containsPoint=function(e){this.worldTransform.applyInverse(e,kn);var t=this._texture.orig.width,r=this._texture.orig.height,i=-t*this.anchor.x,n=0;return kn.x>=i&&kn.x<i+t&&(n=-r*this.anchor.y,kn.y>=n&&kn.y<n+r)},i.prototype.destroy=function(e){if(r.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var t="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!t)}this._texture=null,this.shader=null},i.from=function(e,t){return new i(e instanceof br?e:new br.from(e,t))},e.roundPixels.set=function(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e},e.roundPixels.get=function(){return this._roundPixels},e.width.get=function(){return Math.abs(this.scale.x)*this._texture.orig.width},e.width.set=function(e){var t=He(this.scale.x)||1;this.scale.x=t*e/this._texture.orig.width,this._width=e},e.height.get=function(){return Math.abs(this.scale.y)*this._texture.orig.height},e.height.set=function(e){var t=He(this.scale.y)||1;this.scale.y=t*e/this._texture.orig.height,this._height=e},e.anchor.get=function(){return this._anchor},e.anchor.set=function(e){this._anchor.copyFrom(e)},e.tint.get=function(){return this._tint},e.tint.set=function(e){this._tint=e,this._tintRGB=(e>>16)+(65280&e)+((255&e)<<16)},e.texture.get=function(){return this._texture},e.texture.set=function(e){this._texture!==e&&(this._texture=e||br.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))},Object.defineProperties(i.prototype,e),i}(jt),On={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},Dn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:On.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Ln=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Fn=function(e){this.styleID=0,this.reset(),Un(this,e,e)},jn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Bn(e){return"number"==typeof e?Oe(e):("string"==typeof e&&0===e.indexOf("0x")&&(e=e.replace("0x","#")),e)}function Nn(e){if(Array.isArray(e)){for(var t=0;t<e.length;++t)e[t]=Bn(e[t]);return e}return Bn(e)}function Un(e,t,r){for(var i in r)Array.isArray(t[i])?e[i]=t[i].slice():e[i]=t[i]}Fn.prototype.clone=function(){var e={};return Un(e,this,Dn),new Fn(e)},Fn.prototype.reset=function(){Un(this,Dn,Dn)},jn.align.get=function(){return this._align},jn.align.set=function(e){this._align!==e&&(this._align=e,this.styleID++)},jn.breakWords.get=function(){return this._breakWords},jn.breakWords.set=function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},jn.dropShadow.get=function(){return this._dropShadow},jn.dropShadow.set=function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},jn.dropShadowAlpha.get=function(){return this._dropShadowAlpha},jn.dropShadowAlpha.set=function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},jn.dropShadowAngle.get=function(){return this._dropShadowAngle},jn.dropShadowAngle.set=function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},jn.dropShadowBlur.get=function(){return this._dropShadowBlur},jn.dropShadowBlur.set=function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},jn.dropShadowColor.get=function(){return this._dropShadowColor},jn.dropShadowColor.set=function(e){var t=Nn(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},jn.dropShadowDistance.get=function(){return this._dropShadowDistance},jn.dropShadowDistance.set=function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},jn.fill.get=function(){return this._fill},jn.fill.set=function(e){var t=Nn(e);this._fill!==t&&(this._fill=t,this.styleID++)},jn.fillGradientType.get=function(){return this._fillGradientType},jn.fillGradientType.set=function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},jn.fillGradientStops.get=function(){return this._fillGradientStops},jn.fillGradientStops.set=function(e){(function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0})(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)},jn.fontFamily.get=function(){return this._fontFamily},jn.fontFamily.set=function(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)},jn.fontSize.get=function(){return this._fontSize},jn.fontSize.set=function(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)},jn.fontStyle.get=function(){return this._fontStyle},jn.fontStyle.set=function(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)},jn.fontVariant.get=function(){return this._fontVariant},jn.fontVariant.set=function(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)},jn.fontWeight.get=function(){return this._fontWeight},jn.fontWeight.set=function(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)},jn.letterSpacing.get=function(){return this._letterSpacing},jn.letterSpacing.set=function(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)},jn.lineHeight.get=function(){return this._lineHeight},jn.lineHeight.set=function(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)},jn.leading.get=function(){return this._leading},jn.leading.set=function(e){this._leading!==e&&(this._leading=e,this.styleID++)},jn.lineJoin.get=function(){return this._lineJoin},jn.lineJoin.set=function(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)},jn.miterLimit.get=function(){return this._miterLimit},jn.miterLimit.set=function(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)},jn.padding.get=function(){return this._padding},jn.padding.set=function(e){this._padding!==e&&(this._padding=e,this.styleID++)},jn.stroke.get=function(){return this._stroke},jn.stroke.set=function(e){var t=Nn(e);this._stroke!==t&&(this._stroke=t,this.styleID++)},jn.strokeThickness.get=function(){return this._strokeThickness},jn.strokeThickness.set=function(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)},jn.textBaseline.get=function(){return this._textBaseline},jn.textBaseline.set=function(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)},jn.trim.get=function(){return this._trim},jn.trim.set=function(e){this._trim!==e&&(this._trim=e,this.styleID++)},jn.whiteSpace.get=function(){return this._whiteSpace},jn.whiteSpace.set=function(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)},jn.wordWrap.get=function(){return this._wordWrap},jn.wordWrap.set=function(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)},jn.wordWrapWidth.get=function(){return this._wordWrapWidth},jn.wordWrapWidth.set=function(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)},Fn.prototype.toFontString=function(){var e="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(var r=t.length-1;0<=r;r--){var i=t[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Ln.indexOf(i)<0&&(i='"'+i+'"'),t[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},Object.defineProperties(Fn.prototype,jn);var zn=function(e,t,r,i,n,o,a,s,u){this.text=e,this.style=t,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=s,this.fontProperties=u};zn.measureText=function(e,t,r,i){void 0===i&&(i=zn._canvas),r=null==r?t.wordWrap:r;var n=t.toFontString(),o=zn.measureFont(n);0===o.fontSize&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);var a=i.getContext("2d");a.font=n;for(var s=(r?zn.wordWrap(e,t,i):e).split(/(?:\r\n|\r|\n)/),u=new Array(s.length),h=0,c=0;c<s.length;c++){var f=a.measureText(s[c]).width+(s[c].length-1)*t.letterSpacing;u[c]=f,h=Math.max(h,f)}var l=h+t.strokeThickness;t.dropShadow&&(l+=t.dropShadowDistance);var d=t.lineHeight||o.fontSize+t.strokeThickness,p=Math.max(d,o.fontSize+t.strokeThickness)+(s.length-1)*(d+t.leading);return t.dropShadow&&(p+=t.dropShadowDistance),new zn(e,t,l,p,s,u,d+t.leading,h,o)},zn.wordWrap=function(e,t,r){void 0===r&&(r=zn._canvas);for(var i=r.getContext("2d"),n=0,o="",a="",s={},u=t.letterSpacing,h=t.whiteSpace,c=zn.collapseSpaces(h),f=zn.collapseNewlines(h),l=!c,d=t.wordWrapWidth+u,p=zn.tokenize(e),m=0;m<p.length;m++){var v=p[m];if(zn.isNewline(v)){if(!f){a+=zn.addLine(o),l=!c,o="",n=0;continue}v=" "}if(c){var b=zn.isBreakingSpace(v),g=zn.isBreakingSpace(o[o.length-1]);if(b&&g)continue}var y=zn.getFromCache(v,u,s,i);if(d<y)if(""!==o&&(a+=zn.addLine(o),o="",n=0),zn.canBreakWords(v,t.breakWords))for(var _=v.split(""),w=0;w<_.length;w++){for(var x=_[w],T=1;_[w+T];){var S=_[w+T],E=x[x.length-1];if(zn.canBreakChars(E,S,v,w,t.breakWords))break;x+=S,T++}w+=x.length-1;var A=zn.getFromCache(x,u,s,i);d<A+n&&(a+=zn.addLine(o),l=!1,o="",n=0),o+=x,n+=A}else{0<o.length&&(a+=zn.addLine(o),o="",n=0);var P=m===p.length-1;a+=zn.addLine(v,!P),l=!1,o="",n=0}else d<y+n&&(l=!1,a+=zn.addLine(o),o="",n=0),(0<o.length||!zn.isBreakingSpace(v)||l)&&(o+=v,n+=y)}return a+=zn.addLine(o,!1)},zn.addLine=function(e,t){return void 0===t&&(t=!0),e=zn.trimRight(e),e=t?e+"\n":e},zn.getFromCache=function(e,t,r,i){var n=r[e];if(void 0===n){var o=e.length*t;n=i.measureText(e).width+o,r[e]=n}return n},zn.collapseSpaces=function(e){return"normal"===e||"pre-line"===e},zn.collapseNewlines=function(e){return"normal"===e},zn.trimRight=function(e){if("string"!=typeof e)return"";for(var t=e.length-1;0<=t;t--){var r=e[t];if(!zn.isBreakingSpace(r))break;e=e.slice(0,-1)}return e},zn.isNewline=function(e){return"string"==typeof e&&0<=zn._newlines.indexOf(e.charCodeAt(0))},zn.isBreakingSpace=function(e){return"string"==typeof e&&0<=zn._breakingSpaces.indexOf(e.charCodeAt(0))},zn.tokenize=function(e){var t=[],r="";if("string"!=typeof e)return t;for(var i=0;i<e.length;i++){var n=e[i];zn.isBreakingSpace(n)||zn.isNewline(n)?(""!==r&&(t.push(r),r=""),t.push(n)):r+=n}return""!==r&&t.push(r),t},zn.canBreakWords=function(e,t){return t},zn.canBreakChars=function(e,t,r,i,n){return!0},zn.measureFont=function(e){if(zn._fonts[e])return zn._fonts[e];var t={},r=zn._canvas,i=zn._context;i.font=e;var n=zn.METRICS_STRING+zn.BASELINE_SYMBOL,o=Math.ceil(i.measureText(n).width),a=Math.ceil(i.measureText(zn.BASELINE_SYMBOL).width),s=2*a;a=a*zn.BASELINE_MULTIPLIER|0,r.width=o,r.height=s,i.fillStyle="#f00",i.fillRect(0,0,o,s),i.font=e,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(n,0,a);var u=i.getImageData(0,0,o,s).data,h=u.length,c=4*o,f=0,l=0,d=!1;for(f=0;f<a;++f){for(var p=0;p<c;p+=4)if(255!==u[l+p]){d=!0;break}if(d)break;l+=c}for(t.ascent=a-f,l=h-c,d=!1,f=s;a<f;--f){for(var m=0;m<c;m+=4)if(255!==u[l+m]){d=!0;break}if(d)break;l-=c}return t.descent=f-a,t.fontSize=t.ascent+t.descent,zn._fonts[e]=t},zn.clearMetrics=function(e){void 0===e&&(e=""),e?delete zn._fonts[e]:zn._fonts={}};var Xn=document.createElement("canvas");Xn.width=Xn.height=10,zn._canvas=Xn,zn._context=Xn.getContext("2d"),zn._fonts={},zn.METRICS_STRING="|ÉqÅ",zn.BASELINE_SYMBOL="M",zn.BASELINE_MULTIPLIER=1.4,zn._newlines=[10,13];var qn={texture:!0,children:!(zn._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]),baseTexture:!0},Hn=function(n){function e(e,t,r){(r=r||document.createElement("canvas")).width=3,r.height=3;var i=br.from(r);i.orig=new Pt,i.trim=new Pt,n.call(this,i),this.canvas=r,this.context=this.canvas.getContext("2d"),this._resolution=A.RESOLUTION,this._autoResolution=!0,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=e,this.style=t,this.localStyleID=-1}n&&(e.__proto__=n);var t={width:{configurable:!0},height:{configurable:!0},style:{configurable:!0},text:{configurable:!0},resolution:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.updateText=function(e){var t=this._style;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),this.dirty||!e){this._font=this._style.toFontString();var r,i,n=this.context,o=zn.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),a=o.width,s=o.height,u=o.lines,h=o.lineHeight,c=o.lineWidths,f=o.maxLineWidth,l=o.fontProperties;if(this.canvas.width=Math.ceil((Math.max(1,a)+2*t.padding)*this._resolution),this.canvas.height=Math.ceil((Math.max(1,s)+2*t.padding)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.strokeStyle=t.stroke,n.lineWidth=t.strokeThickness,n.textBaseline=t.textBaseline,n.lineJoin=t.lineJoin,n.miterLimit=t.miterLimit,t.dropShadow){var d=t.dropShadowColor,p=Re("number"==typeof d?d:De(d));n.shadowColor="rgba("+255*p[0]+","+255*p[1]+","+255*p[2]+","+t.dropShadowAlpha+")",n.shadowBlur=t.dropShadowBlur,n.shadowOffsetX=Math.cos(t.dropShadowAngle)*t.dropShadowDistance,n.shadowOffsetY=Math.sin(t.dropShadowAngle)*t.dropShadowDistance}else n.shadowColor=0,n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;n.fillStyle=this._generateFillStyle(t,u);for(var m=0;m<u.length;m++)r=t.strokeThickness/2,i=t.strokeThickness/2+m*h+l.ascent,"right"===t.align?r+=f-c[m]:"center"===t.align&&(r+=(f-c[m])/2),t.stroke&&t.strokeThickness&&this.drawLetterSpacing(u[m],r+t.padding,i+t.padding,!0),t.fill&&this.drawLetterSpacing(u[m],r+t.padding,i+t.padding);this.updateTexture()}},e.prototype.drawLetterSpacing=function(e,t,r,i){void 0===i&&(i=!1);var n=this._style.letterSpacing;if(0!==n)for(var o=t,a=Array.from?Array.from(e):e.split(""),s=0;s<a.length;++s){var u=a[s];i?this.context.strokeText(u,o,r):this.context.fillText(u,o,r),o+=this.context.measureText(u).width+n}else i?this.context.strokeText(e,t,r):this.context.fillText(e,t,r)},e.prototype.updateTexture=function(){var e=this.canvas;if(this._style.trim){var t=Ze(e);t.data&&(e.width=t.width,e.height=t.height,this.context.putImageData(t.data,0,0))}var r=this._texture,i=this._style,n=i.trim?0:i.padding,o=r.baseTexture;r.trim.width=r._frame.width=e.width/this._resolution,r.trim.height=r._frame.height=e.height/this._resolution,r.trim.x=-n,r.trim.y=-n,r.orig.width=r._frame.width-2*n,r.orig.height=r._frame.height-2*n,this._onTextureUpdate(),o.setRealSize(e.width,e.height,this._resolution),this.dirty=!1},e.prototype.render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),n.prototype.render.call(this,e)},e.prototype._renderCanvas=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),n.prototype._renderCanvas.call(this,e)},e.prototype.getLocalBounds=function(e){return this.updateText(!0),n.prototype.getLocalBounds.call(this,e)},e.prototype._calculateBounds=function(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._onStyleChange=function(){this.dirty=!0},e.prototype._generateFillStyle=function(e,t){if(!Array.isArray(e.fill))return e.fill;var r,i,n,o,a=this.canvas.width/this._resolution,s=this.canvas.height/this._resolution,u=e.fill.slice(),h=e.fillGradientStops.slice();if(!h.length)for(var c=u.length+1,f=1;f<c;++f)h.push(f/c);if(u.unshift(e.fill[0]),h.unshift(0),u.push(e.fill[e.fill.length-1]),h.push(1),e.fillGradientType===On.LINEAR_VERTICAL){r=this.context.createLinearGradient(a/2,0,a/2,s),i=(u.length+1)*t.length;for(var l=n=0;l<t.length;l++){n+=1;for(var d=0;d<u.length;d++)o="number"==typeof h[d]?h[d]/t.length+l/t.length:n/i,r.addColorStop(o,u[d]),n++}}else{r=this.context.createLinearGradient(0,s/2,a,s/2),i=u.length+1,n=1;for(var p=0;p<u.length;p++)o="number"==typeof h[p]?h[p]:n/i,r.addColorStop(o,u[p]),n++}return r},e.prototype.destroy=function(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},qn,e),n.prototype.destroy.call(this,e),this.context=null,this.canvas=null,this._style=null},t.width.get=function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},t.width.set=function(e){this.updateText(!0);var t=He(this.scale.x)||1;this.scale.x=t*e/this._texture.orig.width,this._width=e},t.height.get=function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},t.height.set=function(e){this.updateText(!0);var t=He(this.scale.y)||1;this.scale.y=t*e/this._texture.orig.height,this._height=e},t.style.get=function(){return this._style},t.style.set=function(e){e=e||{},this._style=e instanceof Fn?e:new Fn(e),this.localStyleID=-1,this.dirty=!0},t.text.get=function(){return this._text},t.text.set=function(e){e=String(null==e?"":e),this._text!==e&&(this._text=e,this.dirty=!0)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)},Object.defineProperties(e.prototype,t),e}(Rn);A.UPLOADS_PER_FRAME=4;var Gn=function(e){this.maxItemsPerFrame=e,this.itemsLeft=0};Gn.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},Gn.prototype.allowedToUpload=function(){return 0<this.itemsLeft--};var Vn=function(e){var t=this;this.limiter=new Gn(A.UPLOADS_PER_FRAME),this.renderer=e,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){t.queue&&t.prepareItems()},this.registerFindHook(Qn),this.registerFindHook($n),this.registerFindHook(Yn),this.registerFindHook(Wn),this.registerFindHook(Jn),this.registerUploadHook(Kn),this.registerUploadHook(Zn)};function Yn(e,t){var r=!1;if(e&&e._textures&&e._textures.length)for(var i=0;i<e._textures.length;i++)if(e._textures[i]instanceof br){var n=e._textures[i].baseTexture;-1===t.indexOf(n)&&(t.push(n),r=!0)}return r}function Wn(e,t){return e instanceof ir&&(-1===t.indexOf(e)&&t.push(e),!0)}function Jn(e,t){if(e._texture&&e._texture instanceof br){var r=e._texture.baseTexture;return-1===t.indexOf(r)&&t.push(r),!0}return!1}function Kn(e,t){return t instanceof Hn&&(t.updateText(!0),!0)}function Zn(e,t){if(t instanceof Fn){var r=t.toFontString();return zn.measureFont(r),!0}return!1}function Qn(e,t){if(e instanceof Hn){-1===t.indexOf(e.style)&&t.push(e.style),-1===t.indexOf(e)&&t.push(e);var r=e._texture.baseTexture;return-1===t.indexOf(r)&&t.push(r),!0}return!1}function $n(e,t){return e instanceof Fn&&(-1===t.indexOf(e)&&t.push(e),!0)}Vn.prototype.upload=function(e,t){"function"==typeof e&&(t=e,e=null),e&&this.add(e),this.queue.length?(t&&this.completes.push(t),this.ticking||(this.ticking=!0,Gt.system.addOnce(this.tick,this,qt.UTILITY))):t&&t()},Vn.prototype.tick=function(){setTimeout(this.delayedTick,0)},Vn.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var e=this.queue[0],t=!1;if(e&&!e._destroyed)for(var r=0,i=this.uploadHooks.length;r<i;r++)if(this.uploadHooks[r](this.uploadHookHelper,e)){this.queue.shift(),t=!0;break}t||this.queue.shift()}if(this.queue.length)Gt.system.addOnce(this.tick,this,qt.UTILITY);else{this.ticking=!1;for(var n=this.completes.slice(0),o=this.completes.length=0,a=n.length;o<a;o++)n[o]()}},Vn.prototype.registerFindHook=function(e){return e&&this.addHooks.push(e),this},Vn.prototype.registerUploadHook=function(e){return e&&this.uploadHooks.push(e),this},Vn.prototype.add=function(e){for(var t=0,r=this.addHooks.length;t<r&&!this.addHooks[t](e,this.queue);t++);if(e instanceof jt)for(var i=e.children.length-1;0<=i;i--)this.add(e.children[i]);return this},Vn.prototype.destroy=function(){this.ticking&&Gt.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var eo=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(io),this.registerUploadHook(to),this.registerUploadHook(ro)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(Vn);function to(e,t){return t instanceof ir&&(t._glTextures[e.CONTEXT_UID]||e.textureManager.updateTexture(t),!0)}function ro(e,t){return t instanceof Cn&&((t.dirty||t.clearDirty||!t._webGL[e.plugins.graphics.CONTEXT_UID])&&e.plugins.graphics.updateGraphics(t),!0)}function io(e,t){return e instanceof Cn&&(t.push(e),!0)}var no=function(e){this.maxMilliseconds=e,this.frameStart=0};no.prototype.beginFrame=function(){this.frameStart=Date.now()},no.prototype.allowedToUpload=function(){return Date.now()-this.frameStart<this.maxMilliseconds};var oo={BasePrepare:Vn,CountLimiter:Gn,Prepare:eo,TimeLimiter:no},ao=function e(t){var r=this;t=Object.assign({forceCanvas:!1},t),this.renderer=ji(t),this.stage=new jt,e._plugins.forEach(function(e){e.init.call(r,t)})},so={view:{configurable:!0},screen:{configurable:!0}};ao.registerPlugin=function(e){ao._plugins.push(e)},ao.prototype.render=function(){this.renderer.render(this.stage)},so.view.get=function(){return this.renderer.view},so.screen.get=function(){return this.renderer.screen},ao.prototype.destroy=function(e){var t=this,r=ao._plugins.slice(0);r.reverse(),r.forEach(function(e){e.destroy.call(t)}),this.stage.destroy(),this.stage=null,this.renderer.destroy(e),this.renderer=null,this._options=null},Object.defineProperties(ao.prototype,so),ao._plugins=[];var uo=function(){};uo.init=function(e){var t=this;Object.defineProperty(this,"resizeTo",{set:function(e){window.removeEventListener("resize",this.resize),(this._resizeTo=e)&&(window.addEventListener("resize",this.resize),this.resize())},get:function(){return this._resizeTo}}),this.resize=function(){t._resizeTo&&(t._resizeTo===window?t.renderer.resize(window.innerWidth,window.innerHeight):t.renderer.resize(t._resizeTo.clientWidth,t._resizeTo.clientHeight))},this._resizeTo=null,this.resizeTo=e.resizeTo||null},uo.destroy=function(){this.resizeTo=null,this.resize=null},ao.registerPlugin(uo);var ho=r(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}}();function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function i(e,t,r){void 0===t&&(t=!1),n(this,i),this._fn=e,this._once=t,this._thisArg=r,this._next=this._prev=this._owner=null}return r(i,[{key:"detach",value:function(){return null!==this._owner&&(this._owner.detach(this),!0)}}]),i}();function o(e,t){return e._head?(e._tail._next=t)._prev=e._tail:e._head=t,(e._tail=t)._owner=e,t}var a=function(){function e(){n(this,e),this._head=this._tail=void 0}return r(e,[{key:"handlers",value:function(){var e=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=this._head;if(e)return!!t;for(var r=[];t;)r.push(t),t=t._next;return r}},{key:"has",value:function(e){if(!(e instanceof i))throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");return e._owner===this}},{key:"dispatch",value:function(){var e=arguments,t=this._head;if(!t)return!1;for(;t;)t._once&&this.detach(t),t._fn.apply(t._thisArg,e),t=t._next;return!0}},{key:"add",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof e)throw new Error("MiniSignal#add(): First arg must be a Function.");return o(this,new i(e,!1,t))}},{key:"once",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof e)throw new Error("MiniSignal#once(): First arg must be a Function.");return o(this,new i(e,!0,t))}},{key:"detach",value:function(e){if(!(e instanceof i))throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");return e._owner!==this||(e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e===this._head?(this._head=e._next,null===e._next&&(this._tail=null)):e===this._tail&&(this._tail=e._prev,this._tail._next=null),e._owner=null),this}},{key:"detachAll",value:function(){var e=this._head;if(!e)return this;for(this._head=this._tail=null;e;)e._owner=null,e=e._next;return this}}]),e}();a.MiniSignalBinding=i,t.default=a,e.exports=t.default}),co=(t(ho),function(e,t){t=t||{};for(var i={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},r=i.parser[t.strictMode?"strict":"loose"].exec(e),n={},o=14;o--;)n[i.key[o]]=r[o]||"";return n[i.q.name]={},n[i.key[12]].replace(i.q.parser,function(e,t,r){t&&(n[i.q.name][t]=r)}),n}),fo=r(function(e,t){function a(){}function s(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}t.__esModule=!0,t.eachSeries=function(r,i,n,o){var a=0,s=r.length;!function e(t){t||a===s?n&&n(t):o?setTimeout(function(){i(r[a++],e)},1):i(r[a++],e)}()},t.queue=function(t,e){if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var r=0,n={_tasks:[],concurrency:e,saturated:a,unsaturated:a,buffer:e/4,empty:a,drain:a,error:a,started:!1,paused:!1,push:function(e,t){i(e,!1,t)},kill:function(){r=0,n.drain=a,n.started=!1,n._tasks=[]},unshift:function(e,t){i(e,!0,t)},process:function(){for(;!n.paused&&r<n.concurrency&&n._tasks.length;){var e=n._tasks.shift();0===n._tasks.length&&n.empty(),(r+=1)===n.concurrency&&n.saturated(),t(e.data,s(o(e)))}},length:function(){return n._tasks.length},running:function(){return r},idle:function(){return n._tasks.length+r===0},pause:function(){!0!==n.paused&&(n.paused=!0)},resume:function(){if(!1!==n.paused){n.paused=!1;for(var e=1;e<=n.concurrency;e++)n.process()}}};function i(e,t,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(n.started=!0,null==e&&n.idle())setTimeout(function(){return n.drain()},1);else{var i={data:e,callback:"function"==typeof r?r:a};t?n._tasks.unshift(i):n._tasks.push(i),setTimeout(function(){return n.process()},1)}}function o(e){return function(){r-=1,e.callback.apply(e,arguments),null!=arguments[0]&&n.error(arguments[0],e.data),r<=n.concurrency-n.buffer&&n.unsaturated(),n.idle()&&n.drain(),n.process()}}return n}}),lo=(t(fo),fo.eachSeries,fo.queue,r(function(e,t){t.__esModule=!0,t.Resource=void 0;var r=function(){function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}}(),n=o(co),i=o(ho);function o(e){return e&&e.__esModule?e:{default:e}}var a=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),s=null;function u(){}var h=t.Resource=function(){function o(e,t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),"string"!=typeof e||"string"!=typeof t)throw new Error("Both name and url are required for constructing a resource.");r=r||{},this._flags=0,this._setFlag(o.STATUS_FLAGS.DATA_URL,0===t.indexOf("data:")),this.name=e,this.url=t,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===r.crossOrigin?"anonymous":r.crossOrigin,this.timeout=r.timeout||0,this.loadType=r.loadType||this._determineLoadType(),this.xhrType=r.xhrType,this.metadata=r.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=o.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=u,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new i.default,this.onProgress=new i.default,this.onComplete=new i.default,this.onAfterMiddleware=new i.default}return o.setExtensionLoadType=function(e,t){c(o._loadTypeMap,e,t)},o.setExtensionXhrType=function(e,t){c(o._xhrTypeMap,e,t)},o.prototype.complete=function(){this._clearEvents(),this._finish()},o.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=o.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},o.prototype.load=function(e){var t=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout(function(){return e(t)},1);else switch(e&&this.onComplete.once(e),this._setFlag(o.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case o.LOAD_TYPE.IMAGE:this.type=o.TYPE.IMAGE,this._loadElement("image");break;case o.LOAD_TYPE.AUDIO:this.type=o.TYPE.AUDIO,this._loadSourceElement("audio");break;case o.LOAD_TYPE.VIDEO:this.type=o.TYPE.VIDEO,this._loadSourceElement("video");break;case o.LOAD_TYPE.XHR:default:a&&this.crossOrigin?this._loadXdr():this._loadXhr()}},o.prototype._hasFlag=function(e){return 0!=(this._flags&e)},o.prototype._setFlag=function(e,t){this._flags=t?this._flags|e:this._flags&~e},o.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},o.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(o.STATUS_FLAGS.COMPLETE,!0),this._setFlag(o.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},o.prototype._loadElement=function(e){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===e&&void 0!==window.Image?this.data=new Image:this.data=document.createElement(e),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},o.prototype._loadSourceElement=function(e){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===e&&void 0!==window.Audio?this.data=new Audio:this.data=document.createElement(e),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var t=this.metadata.mimeType,r=0;r<this.url.length;++r)this.data.appendChild(this._createSource(e,this.url[r],Array.isArray(t)?t[r]:t));else{var i=this.metadata.mimeType;this.data.appendChild(this._createSource(e,this.url,Array.isArray(i)?i[0]:i))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+e)},o.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===o.XHR_RESPONSE_TYPE.JSON||this.xhrType===o.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=o.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},o.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XDomainRequest;e.timeout=this.timeout||5e3,e.onerror=this._boundXhrOnError,e.ontimeout=this._boundXhrOnTimeout,e.onprogress=this._boundOnProgress,e.onload=this._boundXhrOnLoad,e.open("GET",this.url,!0),setTimeout(function(){return e.send()},1)},o.prototype._createSource=function(e,t,r){r||(r=e+"/"+this._getExtension(t));var i=document.createElement("source");return i.src=t,i.type=r,i},o.prototype._onError=function(e){this.abort("Failed to load element using: "+e.target.nodeName)},o.prototype._onProgress=function(e){e&&e.lengthComputable&&this.onProgress.dispatch(this,e.loaded/e.total)},o.prototype._onTimeout=function(){this.abort("Load timed out.")},o.prototype._xhrOnError=function(){var e=this.xhr;this.abort(f(e)+" Request failed. Status: "+e.status+', text: "'+e.statusText+'"')},o.prototype._xhrOnTimeout=function(){var e=this.xhr;this.abort(f(e)+" Request timed out.")},o.prototype._xhrOnAbort=function(){var e=this.xhr;this.abort(f(e)+" Request was aborted by the user.")},o.prototype._xhrOnLoad=function(){var e=this.xhr,t="",r=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(t=e.responseText),0===r&&(0<t.length||e.responseType===o.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2==(r/100|0)){if(this.xhrType===o.XHR_RESPONSE_TYPE.TEXT)this.data=t,this.type=o.TYPE.TEXT;else if(this.xhrType===o.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t),this.type=o.TYPE.JSON}catch(e){return void this.abort("Error trying to parse loaded json: "+e)}else if(this.xhrType===o.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var i=new DOMParser;this.data=i.parseFromString(t,"text/xml")}else{var n=document.createElement("div");n.innerHTML=t,this.data=n}this.type=o.TYPE.XML}catch(e){return void this.abort("Error trying to parse loaded xml: "+e)}else this.data=e.response||t;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},o.prototype._determineCrossOrigin=function(e,t){if(0===e.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";t=t||window.location,s||(s=document.createElement("a")),s.href=e;var r=!(e=(0,n.default)(s.href,{strictMode:!0})).port&&""===t.port||e.port===t.port,i=e.protocol?e.protocol+":":"";return e.host===t.hostname&&r&&i===t.protocol?"":"anonymous"},o.prototype._determineXhrType=function(){return o._xhrTypeMap[this.extension]||o.XHR_RESPONSE_TYPE.TEXT},o.prototype._determineLoadType=function(){return o._loadTypeMap[this.extension]||o.LOAD_TYPE.XHR},o.prototype._getExtension=function(){var e=this.url,t="";if(this.isDataUrl){var r=e.indexOf("/");t=e.substring(r+1,e.indexOf(";",r))}else{var i=e.indexOf("?"),n=e.indexOf("#"),o=Math.min(-1<i?i:e.length,-1<n?n:e.length);t=(e=e.substring(0,o)).substring(e.lastIndexOf(".")+1)}return t.toLowerCase()},o.prototype._getMimeFromXhrType=function(e){switch(e){case o.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case o.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case o.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case o.XHR_RESPONSE_TYPE.JSON:return"application/json";case o.XHR_RESPONSE_TYPE.DEFAULT:case o.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(o,[{key:"isDataUrl",get:function(){return this._hasFlag(o.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(o.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(o.STATUS_FLAGS.LOADING)}}]),o}();function c(e,t,r){t&&0===t.indexOf(".")&&(t=t.substring(1)),t&&(e[t]=r)}function f(e){return e.toString().replace("object ","")}h.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},h.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},h.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},h.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},h._loadTypeMap={gif:h.LOAD_TYPE.IMAGE,png:h.LOAD_TYPE.IMAGE,bmp:h.LOAD_TYPE.IMAGE,jpg:h.LOAD_TYPE.IMAGE,jpeg:h.LOAD_TYPE.IMAGE,tif:h.LOAD_TYPE.IMAGE,tiff:h.LOAD_TYPE.IMAGE,webp:h.LOAD_TYPE.IMAGE,tga:h.LOAD_TYPE.IMAGE,svg:h.LOAD_TYPE.IMAGE,"svg+xml":h.LOAD_TYPE.IMAGE,mp3:h.LOAD_TYPE.AUDIO,ogg:h.LOAD_TYPE.AUDIO,wav:h.LOAD_TYPE.AUDIO,mp4:h.LOAD_TYPE.VIDEO,webm:h.LOAD_TYPE.VIDEO},h._xhrTypeMap={xhtml:h.XHR_RESPONSE_TYPE.DOCUMENT,html:h.XHR_RESPONSE_TYPE.DOCUMENT,htm:h.XHR_RESPONSE_TYPE.DOCUMENT,xml:h.XHR_RESPONSE_TYPE.DOCUMENT,tmx:h.XHR_RESPONSE_TYPE.DOCUMENT,svg:h.XHR_RESPONSE_TYPE.DOCUMENT,tsx:h.XHR_RESPONSE_TYPE.DOCUMENT,gif:h.XHR_RESPONSE_TYPE.BLOB,png:h.XHR_RESPONSE_TYPE.BLOB,bmp:h.XHR_RESPONSE_TYPE.BLOB,jpg:h.XHR_RESPONSE_TYPE.BLOB,jpeg:h.XHR_RESPONSE_TYPE.BLOB,tif:h.XHR_RESPONSE_TYPE.BLOB,tiff:h.XHR_RESPONSE_TYPE.BLOB,webp:h.XHR_RESPONSE_TYPE.BLOB,tga:h.XHR_RESPONSE_TYPE.BLOB,json:h.XHR_RESPONSE_TYPE.JSON,text:h.XHR_RESPONSE_TYPE.TEXT,txt:h.XHR_RESPONSE_TYPE.TEXT,ttf:h.XHR_RESPONSE_TYPE.BUFFER,otf:h.XHR_RESPONSE_TYPE.BUFFER},h.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",e.exports.default=h})),po=(t(lo),lo.Resource,r(function(e,t){t.__esModule=!0,t.Loader=void 0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}}(),a=i(ho),n=i(co),s=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}}(fo);function i(e){return e&&e.__esModule?e:{default:e}}var u=/(#[\w-]+)?$/,o=t.Loader=function(){function o(){var r=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:10;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.baseUrl=e,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(e,t){return r._loadResource(e,t)},this._queue=s.queue(this._boundLoadResource,t),this._queue.pause(),this.resources={},this.onProgress=new a.default,this.onError=new a.default,this.onLoad=new a.default,this.onStart=new a.default,this.onComplete=new a.default;for(var i=0;i<o._defaultBeforeMiddleware.length;++i)this.pre(o._defaultBeforeMiddleware[i]);for(var n=0;n<o._defaultAfterMiddleware.length;++n)this.use(o._defaultAfterMiddleware[n])}return o.prototype.add=function(e,t,r,i){if(Array.isArray(e)){for(var n=0;n<e.length;++n)this.add(e[n]);return this}if("object"===(void 0===e?"undefined":c(e))&&(i=t||e.callback||e.onComplete,t=(r=e).url,e=e.name||e.key||e.url),"string"!=typeof t&&(i=r,r=t,t=e),"string"!=typeof t)throw new Error("No url passed to add resource to loader.");if("function"==typeof r&&(i=r,r=null),this.loading&&(!r||!r.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[e])throw new Error('Resource named "'+e+'" already exists.');if(t=this._prepareUrl(t),this.resources[e]=new lo.Resource(e,t,r),"function"==typeof i&&this.resources[e].onAfterMiddleware.once(i),this.loading){for(var o=r.parentResource,a=[],s=0;s<o.children.length;++s)o.children[s].isComplete||a.push(o.children[s]);var u=o.progressChunk*(a.length+1)/(a.length+2);o.children.push(this.resources[e]),o.progressChunk=u;for(var h=0;h<a.length;++h)a[h].progressChunk=u;this.resources[e].progressChunk=u}return this._queue.push(this.resources[e]),this},o.prototype.pre=function(e){return this._beforeMiddleware.push(e),this},o.prototype.use=function(e){return this._afterMiddleware.push(e),this},o.prototype.reset=function(){for(var e in this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause(),this.resources){var t=this.resources[e];t._onLoadBinding&&t._onLoadBinding.detach(),t.isLoading&&t.abort()}return this.resources={},this},o.prototype.load=function(e){if("function"==typeof e&&this.onComplete.once(e),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var t=100/this._queue._tasks.length,r=0;r<this._queue._tasks.length;++r)this._queue._tasks[r].data.progressChunk=t;this._onStart(),this._queue.resume()}return this},o.prototype._prepareUrl=function(e){var t=(0,n.default)(e,{strictMode:!0}),r=void 0;if(r=t.protocol||!t.path||0===e.indexOf("//")?e:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==e.charAt(0)?this.baseUrl+"/"+e:this.baseUrl+e,this.defaultQueryString){var i=u.exec(r)[0];-1!==(r=r.substr(0,r.length-i.length)).indexOf("?")?r+="&"+this.defaultQueryString:r+="?"+this.defaultQueryString,r+=i}return r},o.prototype._loadResource=function(r,e){var i=this;r._dequeue=e,s.eachSeries(this._beforeMiddleware,function(e,t){e.call(i,r,function(){t(r.isComplete?{}:null)})},function(){r.isComplete?i._onLoad(r):(r._onLoadBinding=r.onComplete.once(i._onLoad,i),r.load())},!0)},o.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},o.prototype._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},o.prototype._onLoad=function(r){var i=this;r._onLoadBinding=null,this._resourcesParsing.push(r),r._dequeue(),s.eachSeries(this._afterMiddleware,function(e,t){e.call(i,r,t)},function(){r.onAfterMiddleware.dispatch(r),i.progress=Math.min(100,i.progress+r.progressChunk),i.onProgress.dispatch(i,r),r.error?i.onError.dispatch(r.error,i,r):i.onLoad.dispatch(i,r),i._resourcesParsing.splice(i._resourcesParsing.indexOf(r),1),i._queue.idle()&&0===i._resourcesParsing.length&&i._onComplete()},!0)},r(o,[{key:"concurrency",get:function(){return this._queue.concurrency},set:function(e){this._queue.concurrency=e}}]),o}();o._defaultBeforeMiddleware=[],o._defaultAfterMiddleware=[],o.pre=function(e){return o._defaultBeforeMiddleware.push(e),o},o.use=function(e){return o._defaultAfterMiddleware.push(e),o}})),mo=(t(po),po.Loader,r(function(e,t){t.__esModule=!0,t.encodeBinary=r;var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(e){for(var t="",r=0;r<e.length;){for(var i=[0,0,0],n=[0,0,0,0],o=0;o<i.length;++o)r<e.length?i[o]=255&e.charCodeAt(r++):i[o]=0;switch(n[0]=i[0]>>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(e.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var a=0;a<n.length;++a)t+=s.charAt(n[a])}return t}e.exports.default=r})),vo=(t(mo),mo.encodeBinary,po.Loader),bo=lo.Resource;vo.Resource=bo,vo.async=fo,vo.encodeBinary=mo,vo.base64=mo;var go=vo,yo=vo,_o=vo,wo=go.Resource;function xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function To(e,t){return e(t={exports:{}},t.exports),t.exports}go.Loader=yo,go.default=_o;var So=function(e,t){t=t||{};for(var i={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},r=i.parser[t.strictMode?"strict":"loose"].exec(e),n={},o=14;o--;)n[i.key[o]]=r[o]||"";return n[i.q.name]={},n[i.key[12]].replace(i.q.parser,function(e,t,r){t&&(n[i.q.name][t]=r)}),n},Eo=To(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}}();function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function i(e,t,r){void 0===t&&(t=!1),n(this,i),this._fn=e,this._once=t,this._thisArg=r,this._next=this._prev=this._owner=null}return r(i,[{key:"detach",value:function(){return null!==this._owner&&(this._owner.detach(this),!0)}}]),i}();function o(e,t){return e._head?(e._tail._next=t)._prev=e._tail:e._head=t,(e._tail=t)._owner=e,t}var a=function(){function e(){n(this,e),this._head=this._tail=void 0}return r(e,[{key:"handlers",value:function(){var e=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=this._head;if(e)return!!t;for(var r=[];t;)r.push(t),t=t._next;return r}},{key:"has",value:function(e){if(!(e instanceof i))throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");return e._owner===this}},{key:"dispatch",value:function(){var e=arguments,t=this._head;if(!t)return!1;for(;t;)t._once&&this.detach(t),t._fn.apply(t._thisArg,e),t=t._next;return!0}},{key:"add",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof e)throw new Error("MiniSignal#add(): First arg must be a Function.");return o(this,new i(e,!1,t))}},{key:"once",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof e)throw new Error("MiniSignal#once(): First arg must be a Function.");return o(this,new i(e,!0,t))}},{key:"detach",value:function(e){if(!(e instanceof i))throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");return e._owner!==this||(e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e===this._head?(this._head=e._next,null===e._next&&(this._tail=null)):e===this._tail&&(this._tail=e._prev,this._tail._next=null),e._owner=null),this}},{key:"detachAll",value:function(){var e=this._head;if(!e)return this;for(this._head=this._tail=null;e;)e._owner=null,e=e._next;return this}}]),e}();a.MiniSignalBinding=i,t.default=a,e.exports=t.default});xo(Eo);var Ao=To(function(e,t){t.__esModule=!0,t.Resource=void 0;var r=function(){function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}}(),n=o(So),i=o(Eo);function o(e){return e&&e.__esModule?e:{default:e}}var a=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),s=null;function u(){}var h=t.Resource=function(){function o(e,t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),"string"!=typeof e||"string"!=typeof t)throw new Error("Both name and url are required for constructing a resource.");r=r||{},this._flags=0,this._setFlag(o.STATUS_FLAGS.DATA_URL,0===t.indexOf("data:")),this.name=e,this.url=t,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===r.crossOrigin?"anonymous":r.crossOrigin,this.timeout=r.timeout||0,this.loadType=r.loadType||this._determineLoadType(),this.xhrType=r.xhrType,this.metadata=r.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=o.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=u,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new i.default,this.onProgress=new i.default,this.onComplete=new i.default,this.onAfterMiddleware=new i.default}return o.setExtensionLoadType=function(e,t){c(o._loadTypeMap,e,t)},o.setExtensionXhrType=function(e,t){c(o._xhrTypeMap,e,t)},o.prototype.complete=function(){this._clearEvents(),this._finish()},o.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=o.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},o.prototype.load=function(e){var t=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout(function(){return e(t)},1);else switch(e&&this.onComplete.once(e),this._setFlag(o.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case o.LOAD_TYPE.IMAGE:this.type=o.TYPE.IMAGE,this._loadElement("image");break;case o.LOAD_TYPE.AUDIO:this.type=o.TYPE.AUDIO,this._loadSourceElement("audio");break;case o.LOAD_TYPE.VIDEO:this.type=o.TYPE.VIDEO,this._loadSourceElement("video");break;case o.LOAD_TYPE.XHR:default:a&&this.crossOrigin?this._loadXdr():this._loadXhr()}},o.prototype._hasFlag=function(e){return 0!=(this._flags&e)},o.prototype._setFlag=function(e,t){this._flags=t?this._flags|e:this._flags&~e},o.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},o.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(o.STATUS_FLAGS.COMPLETE,!0),this._setFlag(o.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},o.prototype._loadElement=function(e){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===e&&void 0!==window.Image?this.data=new Image:this.data=document.createElement(e),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},o.prototype._loadSourceElement=function(e){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===e&&void 0!==window.Audio?this.data=new Audio:this.data=document.createElement(e),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var t=this.metadata.mimeType,r=0;r<this.url.length;++r)this.data.appendChild(this._createSource(e,this.url[r],Array.isArray(t)?t[r]:t));else{var i=this.metadata.mimeType;this.data.appendChild(this._createSource(e,this.url,Array.isArray(i)?i[0]:i))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+e)},o.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===o.XHR_RESPONSE_TYPE.JSON||this.xhrType===o.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=o.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},o.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XDomainRequest;e.timeout=this.timeout||5e3,e.onerror=this._boundXhrOnError,e.ontimeout=this._boundXhrOnTimeout,e.onprogress=this._boundOnProgress,e.onload=this._boundXhrOnLoad,e.open("GET",this.url,!0),setTimeout(function(){return e.send()},1)},o.prototype._createSource=function(e,t,r){r||(r=e+"/"+this._getExtension(t));var i=document.createElement("source");return i.src=t,i.type=r,i},o.prototype._onError=function(e){this.abort("Failed to load element using: "+e.target.nodeName)},o.prototype._onProgress=function(e){e&&e.lengthComputable&&this.onProgress.dispatch(this,e.loaded/e.total)},o.prototype._onTimeout=function(){this.abort("Load timed out.")},o.prototype._xhrOnError=function(){var e=this.xhr;this.abort(f(e)+" Request failed. Status: "+e.status+', text: "'+e.statusText+'"')},o.prototype._xhrOnTimeout=function(){var e=this.xhr;this.abort(f(e)+" Request timed out.")},o.prototype._xhrOnAbort=function(){var e=this.xhr;this.abort(f(e)+" Request was aborted by the user.")},o.prototype._xhrOnLoad=function(){var e=this.xhr,t="",r=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(t=e.responseText),0===r&&(0<t.length||e.responseType===o.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2==(r/100|0)){if(this.xhrType===o.XHR_RESPONSE_TYPE.TEXT)this.data=t,this.type=o.TYPE.TEXT;else if(this.xhrType===o.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t),this.type=o.TYPE.JSON}catch(e){return void this.abort("Error trying to parse loaded json: "+e)}else if(this.xhrType===o.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var i=new DOMParser;this.data=i.parseFromString(t,"text/xml")}else{var n=document.createElement("div");n.innerHTML=t,this.data=n}this.type=o.TYPE.XML}catch(e){return void this.abort("Error trying to parse loaded xml: "+e)}else this.data=e.response||t;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},o.prototype._determineCrossOrigin=function(e,t){if(0===e.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";t=t||window.location,s||(s=document.createElement("a")),s.href=e;var r=!(e=(0,n.default)(s.href,{strictMode:!0})).port&&""===t.port||e.port===t.port,i=e.protocol?e.protocol+":":"";return e.host===t.hostname&&r&&i===t.protocol?"":"anonymous"},o.prototype._determineXhrType=function(){return o._xhrTypeMap[this.extension]||o.XHR_RESPONSE_TYPE.TEXT},o.prototype._determineLoadType=function(){return o._loadTypeMap[this.extension]||o.LOAD_TYPE.XHR},o.prototype._getExtension=function(){var e=this.url,t="";if(this.isDataUrl){var r=e.indexOf("/");t=e.substring(r+1,e.indexOf(";",r))}else{var i=e.indexOf("?"),n=e.indexOf("#"),o=Math.min(-1<i?i:e.length,-1<n?n:e.length);t=(e=e.substring(0,o)).substring(e.lastIndexOf(".")+1)}return t.toLowerCase()},o.prototype._getMimeFromXhrType=function(e){switch(e){case o.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case o.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case o.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case o.XHR_RESPONSE_TYPE.JSON:return"application/json";case o.XHR_RESPONSE_TYPE.DEFAULT:case o.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r(o,[{key:"isDataUrl",get:function(){return this._hasFlag(o.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(o.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(o.STATUS_FLAGS.LOADING)}}]),o}();function c(e,t,r){t&&0===t.indexOf(".")&&(t=t.substring(1)),t&&(e[t]=r)}function f(e){return e.toString().replace("object ","")}h.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},h.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},h.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},h.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},h._loadTypeMap={gif:h.LOAD_TYPE.IMAGE,png:h.LOAD_TYPE.IMAGE,bmp:h.LOAD_TYPE.IMAGE,jpg:h.LOAD_TYPE.IMAGE,jpeg:h.LOAD_TYPE.IMAGE,tif:h.LOAD_TYPE.IMAGE,tiff:h.LOAD_TYPE.IMAGE,webp:h.LOAD_TYPE.IMAGE,tga:h.LOAD_TYPE.IMAGE,svg:h.LOAD_TYPE.IMAGE,"svg+xml":h.LOAD_TYPE.IMAGE,mp3:h.LOAD_TYPE.AUDIO,ogg:h.LOAD_TYPE.AUDIO,wav:h.LOAD_TYPE.AUDIO,mp4:h.LOAD_TYPE.VIDEO,webm:h.LOAD_TYPE.VIDEO},h._xhrTypeMap={xhtml:h.XHR_RESPONSE_TYPE.DOCUMENT,html:h.XHR_RESPONSE_TYPE.DOCUMENT,htm:h.XHR_RESPONSE_TYPE.DOCUMENT,xml:h.XHR_RESPONSE_TYPE.DOCUMENT,tmx:h.XHR_RESPONSE_TYPE.DOCUMENT,svg:h.XHR_RESPONSE_TYPE.DOCUMENT,tsx:h.XHR_RESPONSE_TYPE.DOCUMENT,gif:h.XHR_RESPONSE_TYPE.BLOB,png:h.XHR_RESPONSE_TYPE.BLOB,bmp:h.XHR_RESPONSE_TYPE.BLOB,jpg:h.XHR_RESPONSE_TYPE.BLOB,jpeg:h.XHR_RESPONSE_TYPE.BLOB,tif:h.XHR_RESPONSE_TYPE.BLOB,tiff:h.XHR_RESPONSE_TYPE.BLOB,webp:h.XHR_RESPONSE_TYPE.BLOB,tga:h.XHR_RESPONSE_TYPE.BLOB,json:h.XHR_RESPONSE_TYPE.JSON,text:h.XHR_RESPONSE_TYPE.TEXT,txt:h.XHR_RESPONSE_TYPE.TEXT,ttf:h.XHR_RESPONSE_TYPE.BUFFER,otf:h.XHR_RESPONSE_TYPE.BUFFER},h.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",e.exports.default=h});xo(Ao);Ao.Resource;var Po=To(function(e,t){t.__esModule=!0,t.encodeBinary=r;var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(e){for(var t="",r=0;r<e.length;){for(var i=[0,0,0],n=[0,0,0,0],o=0;o<i.length;++o)r<e.length?i[o]=255&e.charCodeAt(r++):i[o]=0;switch(n[0]=i[0]>>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(e.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var a=0;a<n.length;++a)t+=s.charAt(n[a])}return t}e.exports.default=r});xo(Po);Po.encodeBinary;var Mo=To(function(e,t){t.__esModule=!0,t.blobMiddlewareFactory=function(){return function(e,t){if(e.data){if(e.xhr&&e.xhrType===Ao.Resource.XHR_RESPONSE_TYPE.BLOB)if(window.Blob&&"string"!=typeof e.data){if(0===e.data.type.indexOf("image")){var r=n.createObjectURL(e.data);return e.blob=e.data,e.data=new Image,e.data.src=r,e.type=Ao.Resource.TYPE.IMAGE,void(e.data.onload=function(){n.revokeObjectURL(r),e.data.onload=null,t()})}}else{var i=e.xhr.getResponseHeader("content-type");if(i&&0===i.indexOf("image"))return e.data=new Image,e.data.src="data:"+i+";base64,"+(0,Po.encodeBinary)(e.xhr.responseText),e.type=Ao.Resource.TYPE.IMAGE,void(e.data.onload=function(){e.data.onload=null,t()})}t()}else t()}};var n=window.URL||window.webkitURL});xo(Mo);var Co=Mo.blobMiddlewareFactory,ko=function(){};ko.use=function(e,t){e.data&&e.type===wo.TYPE.IMAGE&&(e.texture=br.fromLoader(e.data,e.url,e.name)),t()};var Io=function(s){function u(e,t){var i=this;s.call(this,e,t),v.call(this);for(var r=0;r<u._plugins.length;++r){var n=u._plugins[r],o=n.pre,a=n.use;o&&this.pre(o),a&&this.use(a)}this.onStart.add(function(e){return i.emit("start",e)}),this.onProgress.add(function(e,t){return i.emit("progress",e,t)}),this.onError.add(function(e,t,r){return i.emit("error",e,t,r)}),this.onLoad.add(function(e,t){return i.emit("load",e,t)}),this.onComplete.add(function(e,t){return i.emit("complete",e,t)}),this._protected=!1}s&&(u.__proto__=s);var e={shared:{configurable:!0}};return((u.prototype=Object.create(s&&s.prototype)).constructor=u).prototype.destroy=function(){this._protected||(this.removeAllListeners(),this.reset())},e.shared.get=function(){var e=u._shared;return e||((e=new u)._protected=!0,u._shared=e),e},Object.defineProperties(u,e),u}(go);Object.assign(Io.prototype,v.prototype),Io._plugins=[],Io.registerPlugin=function(e){return Io._plugins.push(e),e.add&&e.add(),Io},Io.registerPlugin({use:Co()}),Io.registerPlugin(ko);var Ro=function(){};Ro.init=function(e){e=Object.assign({sharedLoader:!1},e),this.loader=e.sharedLoader?Io.shared:new Io},Ro.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)};var Oo=wo,Do=function(n){function e(e,t,r,i){void 0===e&&(e=1500),void 0===r&&(r=16384),void 0===i&&(i=!1),n.call(this);16384<r&&(r=16384),e<r&&(r=e),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=r,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=ge.NORMAL,this.autoResize=i,this.roundPixels=!0,this.baseTexture=null,this.setProperties(t),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}n&&(e.__proto__=n);var t={tint:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.setProperties=function(e){e&&(this._properties[0]="vertices"in e||"scale"in e?!!e.vertices||!!e.scale:this._properties[0],this._properties[1]="position"in e?!!e.position:this._properties[1],this._properties[2]="rotation"in e?!!e.rotation:this._properties[2],this._properties[3]="uvs"in e?!!e.uvs:this._properties[3],this._properties[4]="tint"in e||"alpha"in e?!!e.tint||!!e.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},t.tint.get=function(){return this._tint},t.tint.set=function(e){Re(this._tint=e,this.tintRgb)},e.prototype.render=function(e){var t=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return t.onChildrenChange(0)})),e.batch.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))},e.prototype.onChildrenChange=function(e){for(var t=Math.floor(e/this._batchSize);this._bufferUpdateIDs.length<t;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[t]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var e=0;e<this._buffers.length;++e)this._buffers[e].destroy();this._buffers=null}},e.prototype.destroy=function(e){n.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},Object.defineProperties(e.prototype,t),e}(jt),Lo=function(e,t,r){this.geometry=new Mr,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(var i=0;i<e.length;++i){var n=e[i];n={attributeName:n.attributeName,size:n.size,uploadFunction:n.uploadFunction,type:n.type||xe.FLOAT,offset:n.offset},t[i]?this.dynamicProperties.push(n):this.staticProperties.push(n)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()};Lo.prototype.initBuffers=function(){var e=this.geometry,t=0;this.indexBuffer=new xr(Ue(this.size),!0,!0),e.addIndex(this.indexBuffer);for(var r=this.dynamicStride=0;r<this.dynamicProperties.length;++r){var i=this.dynamicProperties[r];i.offset=t,t+=i.size,this.dynamicStride+=i.size}var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new xr(this.dynamicData,!1,!1);for(var o=0,a=this.staticStride=0;a<this.staticProperties.length;++a){var s=this.staticProperties[a];s.offset=o,o+=s.size,this.staticStride+=s.size}var u=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(u),this.staticDataUint32=new Uint32Array(u),this.staticBuffer=new xr(this.staticData,!0,!1);for(var h=0;h<this.dynamicProperties.length;++h){var c=this.dynamicProperties[h];e.addAttribute(c.attributeName,this.dynamicBuffer,0,c.type===xe.UNSIGNED_BYTE,c.type,4*this.dynamicStride,4*c.offset)}for(var f=0;f<this.staticProperties.length;++f){var l=this.staticProperties[f];e.addAttribute(l.attributeName,this.staticBuffer,0,l.type===xe.UNSIGNED_BYTE,l.type,4*this.staticStride,4*l.offset)}},Lo.prototype.uploadDynamic=function(e,t,r){for(var i=0;i<this.dynamicProperties.length;i++){var n=this.dynamicProperties[i];n.uploadFunction(e,t,r,n.type===xe.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++},Lo.prototype.uploadStatic=function(e,t,r){for(var i=0;i<this.staticProperties.length;i++){var n=this.staticProperties[i];n.uploadFunction(e,t,r,n.type===xe.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++},Lo.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()};var Fo=function(t){function e(e){t.call(this,e),this.shader=null,this.properties=null,this.tempMatrix=new mt,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:xe.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=li.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}",{})}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.render=function(e){var t=e.children,r=e._maxSize,i=e._batchSize,n=this.renderer,o=t.length;if(0!==o){r<o&&(o=r);var a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));var s=t[0]._texture.baseTexture;this.renderer.state.setBlendMode(Fe(e.blendMode,s.premultiplyAlpha));var u=n.gl,h=e.worldTransform.copyTo(this.tempMatrix);h.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=h.toArray(!0),this.shader.uniforms.uColor=je(e.tintRgb,e.worldAlpha,this.shader.uniforms.uColor,s.premultiplyAlpha),this.shader.uniforms.uSampler=s,this.renderer.shader.bind(this.shader);for(var c=!1,f=0,l=0;f<o;f+=i,l+=1){var d=o-f;if(i<d&&(d=i),l>=a.length){if(!e.autoResize)break;a.push(this._generateOneMoreBuffer(e))}var p=a[l];p.uploadDynamic(t,f,d);var m=e._bufferUpdateIDs[l]||0;(c=c||p._updateID<m)&&(p._updateID=e._updateID,p.uploadStatic(t,f,d)),n.geometry.bind(p.geometry),u.drawElements(u.TRIANGLES,6*d,u.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(e){for(var t=[],r=e._maxSize,i=e._batchSize,n=e._properties,o=0;o<r;o+=i)t.push(new Lo(this.properties,n,i));return t},e.prototype._generateOneMoreBuffer=function(e){var t=e._batchSize,r=e._properties;return new Lo(this.properties,r,t)},e.prototype.uploadVertices=function(e,t,r,i,n,o){for(var a=0,s=0,u=0,h=0,c=0;c<r;++c){var f=e[t+c],l=f._texture,d=f.scale.x,p=f.scale.y,m=l.trim,v=l.orig;m?(a=(s=m.x-f.anchor.x*v.width)+m.width,u=(h=m.y-f.anchor.y*v.height)+m.height):(a=v.width*(1-f.anchor.x),s=v.width*-f.anchor.x,u=v.height*(1-f.anchor.y),h=v.height*-f.anchor.y),i[o]=s*d,i[o+1]=h*p,i[o+n]=a*d,i[o+n+1]=h*p,i[o+2*n]=a*d,i[o+2*n+1]=u*p,i[o+3*n]=s*d,i[o+3*n+1]=u*p,o+=4*n}},e.prototype.uploadPosition=function(e,t,r,i,n,o){for(var a=0;a<r;a++){var s=e[t+a].position;i[o]=s.x,i[o+1]=s.y,i[o+n]=s.x,i[o+n+1]=s.y,i[o+2*n]=s.x,i[o+2*n+1]=s.y,i[o+3*n]=s.x,i[o+3*n+1]=s.y,o+=4*n}},e.prototype.uploadRotation=function(e,t,r,i,n,o){for(var a=0;a<r;a++){var s=e[t+a].rotation;i[o]=s,i[o+n]=s,i[o+2*n]=s,i[o+3*n]=s,o+=4*n}},e.prototype.uploadUvs=function(e,t,r,i,n,o){for(var a=0;a<r;++a){var s=e[t+a]._texture._uvs;s?(i[o]=s.x0,i[o+1]=s.y0,i[o+n]=s.x1,i[o+n+1]=s.y1,i[o+2*n]=s.x2,i[o+2*n+1]=s.y2,i[o+3*n]=s.x3,i[o+3*n+1]=s.y3):(i[o]=0,i[o+1]=0,i[o+n]=0,i[o+n+1]=0,i[o+2*n]=0,i[o+2*n+1]=0,i[o+3*n]=0,i[o+3*n+1]=0),o+=4*n}},e.prototype.uploadTint=function(e,t,r,i,n,o){for(var a=0;a<r;++a){var s=e[t+a],u=s._texture.baseTexture.premultiplyAlpha,h=s.alpha,c=h<1&&u?Be(s._tintRGB,h):s._tintRGB+(255*h<<24);i[o]=c,i[o+n]=c,i[o+2*n]=c,i[o+3*n]=c,o+=4*n}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e}(Fr),jo=function(e,t,r){void 0===r&&(r=null),this.baseTexture=e,this.textures={},this.animations={},this.data=t,this.resolution=this._updateResolution(r||(this.baseTexture.resource?this.baseTexture.resource.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null},Bo={BATCH_SIZE:{configurable:!0}};Bo.BATCH_SIZE.get=function(){return 1e3},jo.prototype._updateResolution=function(e){var t=this.data.meta.scale,r=nt(e,null);return null===r&&(r=void 0!==t?parseFloat(t):1),1!==r&&this.baseTexture.setResolution(r),r},jo.prototype.parse=function(e){this._batchIndex=0,this._callback=e,this._frameKeys.length<=jo.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},jo.prototype._processFrames=function(e){for(var t=e,r=jo.BATCH_SIZE;t-e<r&&t<this._frameKeys.length;){var i=this._frameKeys[t],n=this._frames[i],o=n.frame;if(o){var a=null,s=null,u=!1!==n.trimmed&&n.sourceSize?n.sourceSize:n.frame,h=new Pt(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);a=n.rotated?new Pt(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):new Pt(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),!1!==n.trimmed&&n.spriteSourceSize&&(s=new Pt(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[i]=new br(this.baseTexture,a,h,s,n.rotated?2:0,n.anchor),br.addToCache(this.textures[i],i)}t++}},jo.prototype._processAnimations=function(){var e=this.data.animations||{};for(var t in e){this.animations[t]=[];for(var r=0;r<e[t].length;r++){var i=e[t][r];this.animations[t].push(this.textures[i])}}},jo.prototype._parseComplete=function(){var e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)},jo.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*jo.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*jo.BATCH_SIZE<e._frameKeys.length?e._nextBatch():(e._processAnimations(),e._parseComplete())},0)},jo.prototype.destroy=function(e){for(var t in void 0===e&&(e=!1),this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&this.baseTexture.destroy(),this.baseTexture=null},Object.defineProperties(jo,Bo);var No=function(){};No.use=function(r,i){var e=r.name+"_image";if(r.data&&r.type===Oo.TYPE.JSON&&r.data.frames&&!this.resources[e]){var t={crossOrigin:r.crossOrigin,metadata:r.metadata.imageMetadata,parentResource:r},n=No.getResourcePath(r,this.baseUrl);this.add(e,n,t,function(e){if(e.error)i(e.error);else{var t=new jo(e.texture.baseTexture,r.data,r.url);t.parse(function(){r.spritesheet=t,r.textures=t.textures,i()})}})}else i()},No.getResourcePath=function(e,t){return e.isDataUrl?e.data.meta.image:me.resolve(e.url.replace(t,""),e.data.meta.image)};var Uo=new ut,zo=function(i){function n(e,t,r){void 0===t&&(t=100),void 0===r&&(r=100),i.call(this,e),this.tileTransform=new Et,this._width=t,this._height=r,this._canvasPattern=null,this.uvMatrix=e.uvMatrix||new gi(e),this.pluginName="tilingSprite",this.uvRespectAnchor=!1}i&&(n.__proto__=i),(n.prototype=Object.create(i&&i.prototype)).constructor=n;var e={clampMargin:{configurable:!0},tileScale:{configurable:!0},tilePosition:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return e.clampMargin.get=function(){return this.uvMatrix.clampMargin},e.clampMargin.set=function(e){this.uvMatrix.clampMargin=e,this.uvMatrix.update(!0)},e.tileScale.get=function(){return this.tileTransform.scale},e.tileScale.set=function(e){this.tileTransform.scale.copyFrom(e)},e.tilePosition.get=function(){return this.tileTransform.position},e.tilePosition.set=function(e){this.tileTransform.position.copyFrom(e)},n.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this.cachedTint=16777215},n.prototype._render=function(e){var t=this._texture;t&&t.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this))},n.prototype._calculateBounds=function(){var e=this._width*-this._anchor._x,t=this._height*-this._anchor._y,r=this._width*(1-this._anchor._x),i=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,e,t,r,i)},n.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new Pt),e=this._localBoundsRect),this._bounds.getRectangle(e)):i.prototype.getLocalBounds.call(this,e)},n.prototype.containsPoint=function(e){this.worldTransform.applyInverse(e,Uo);var t=this._width,r=this._height,i=-t*this.anchor._x;if(Uo.x>=i&&Uo.x<i+t){var n=-r*this.anchor._y;if(Uo.y>=n&&Uo.y<n+r)return!0}return!1},n.prototype.destroy=function(e){i.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},n.from=function(e,t,r){return new n(br.from(e),t,r)},n.fromFrame=function(e,t,r){var i=Je[e];if(!i)throw new Error('The frameId "'+e+'" does not exist in the texture cache '+this);return new n(i,t,r)},n.fromImage=function(e,t,r,i){return i&&"object"!=typeof i&&(i={scaleMode:arguments[4],resourceOptions:{crossorigin:arguments[3]}}),new n(br.from(e,i),t,r)},e.width.get=function(){return this._width},e.width.set=function(e){this._width=e},e.height.get=function(){return this._height},e.height.set=function(e){this._height=e},Object.defineProperties(n.prototype,e),n}(Rn),Xo="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",qo=new mt,Ho=function(r){function e(e){r.call(this,e);var t={globals:this.renderer.globalUniforms};this.shader=li.from(Xo,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 sample = texture2D(uSampler, coord);\n gl_FragColor = sample * uColor;\n}\n",t),this.simpleShader=li.from(Xo,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n",t),this.quad=new kr}return r&&(e.__proto__=r),((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.render=function(e){var t=this.renderer,r=this.quad,i=r.vertices;i[0]=i[6]=e._width*-e.anchor.x,i[1]=i[3]=e._height*-e.anchor.y,i[2]=i[4]=e._width*(1-e.anchor.x),i[5]=i[7]=e._height*(1-e.anchor.y),e.uvRespectAnchor&&((i=r.uvs)[0]=i[6]=-e.anchor.x,i[1]=i[3]=-e.anchor.y,i[2]=i[4]=1-e.anchor.x,i[5]=i[7]=1-e.anchor.y),r.invalidate();var n=e._texture,o=n.baseTexture,a=e.tileTransform.localTransform,s=e.uvMatrix,u=o.isPowerOfTwo&&n.frame.width===o.width&&n.frame.height===o.height;u&&(o._glTextures[t.CONTEXT_UID]?u=o.wrapMode!==Se.CLAMP:o.wrapMode===Se.CLAMP&&(o.wrapMode=Se.REPEAT));var h=u?this.simpleShader:this.shader,c=n.width,f=n.height,l=e._width,d=e._height;qo.set(a.a*c/l,a.b*c/d,a.c*f/l,a.d*f/d,a.tx/l,a.ty/d),qo.invert(),u?qo.prepend(s.mapCoord):(h.uniforms.uMapCoord=s.mapCoord.toArray(!0),h.uniforms.uClampFrame=s.uClampFrame,h.uniforms.uClampOffset=s.uClampOffset),h.uniforms.uTransform=qo.toArray(!0),h.uniforms.uColor=Ne(e.tint,e.worldAlpha,h.uniforms.uColor,o.premultiplyAlpha),h.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),h.uniforms.uSampler=n,t.shader.bind(h),t.geometry.bind(r),t.state.setBlendMode(Fe(e.blendMode,o.premultiplyAlpha)),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}(Fr),Go=function(i){function k(e,t){var r=this;void 0===t&&(t={}),i.call(this),this._textWidth=0,this._textHeight=0,this._glyphs=[],this._font={tint:void 0!==t.tint?t.tint:16777215,align:t.align||"left",name:null,size:0},this.font=t.font,this._text=e,this._maxWidth=0,this._maxLineHeight=0,this._letterSpacing=0,this._anchor=new ht(function(){r.dirty=!0},this,0,0),this.dirty=!1,this.roundPixels=A.ROUND_PIXELS,this.updateText()}i&&(k.__proto__=i);var e={tint:{configurable:!0},align:{configurable:!0},anchor:{configurable:!0},font:{configurable:!0},text:{configurable:!0},maxWidth:{configurable:!0},maxLineHeight:{configurable:!0},textWidth:{configurable:!0},letterSpacing:{configurable:!0},textHeight:{configurable:!0}};return((k.prototype=Object.create(i&&i.prototype)).constructor=k).prototype.updateText=function(){for(var e=k.fonts[this._font.name],t=this._font.size/e.size,r=new ut,i=[],n=[],o=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",a=o.length,s=this._maxWidth*e.size/this._font.size,u=null,h=0,c=0,f=0,l=-1,d=0,p=0,m=0,v=0;v<a;v++){var b=o.charCodeAt(v),g=o.charAt(v);if(/(?:\s)/.test(g)&&(l=v,d=h),"\r"!==g&&"\n"!==g){var y=e.chars[b];y&&(u&&y.kerning[u]&&(r.x+=y.kerning[u]),i.push({texture:y.texture,line:f,charCode:b,position:new ut(r.x+y.xOffset+this._letterSpacing/2,r.y+y.yOffset)}),r.x+=y.xAdvance+this._letterSpacing,h=r.x,m=Math.max(m,y.yOffset+y.texture.height),u=b,-1!==l&&0<s&&r.x>s&&(ze(i,1+l-++p,1+v-l),v=l,l=-1,n.push(d),c=Math.max(c,d),f++,r.x=0,r.y+=e.lineHeight,u=null))}else n.push(h),c=Math.max(c,h),++f,++p,r.x=0,r.y+=e.lineHeight,u=null}var _=o.charAt(o.length-1);"\r"!==_&&"\n"!==_&&(/(?:\s)/.test(_)&&(h=d),n.push(h),c=Math.max(c,h));for(var w=[],x=0;x<=f;x++){var T=0;"right"===this._font.align?T=c-n[x]:"center"===this._font.align&&(T=(c-n[x])/2),w.push(T)}for(var S=i.length,E=this.tint,A=0;A<S;A++){var P=this._glyphs[A];P?P.texture=i[A].texture:((P=new Rn(i[A].texture)).roundPixels=this.roundPixels,this._glyphs.push(P)),P.position.x=(i[A].position.x+w[i[A].line])*t,P.position.y=i[A].position.y*t,P.scale.x=P.scale.y=t,P.tint=E,P.parent||this.addChild(P)}for(var M=S;M<this._glyphs.length;++M)this.removeChild(this._glyphs[M]);if(this._textWidth=c*t,this._textHeight=(r.y+e.lineHeight)*t,0!==this.anchor.x||0!==this.anchor.y)for(var C=0;C<S;C++)this._glyphs[C].x-=this._textWidth*this.anchor.x,this._glyphs[C].y-=this._textHeight*this.anchor.y;this._maxLineHeight=m*t},k.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},k.prototype.getLocalBounds=function(){return this.validate(),i.prototype.getLocalBounds.call(this)},k.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},e.tint.get=function(){return this._font.tint},e.tint.set=function(e){this._font.tint="number"==typeof e&&0<=e?e:16777215,this.dirty=!0},e.align.get=function(){return this._font.align},e.align.set=function(e){this._font.align=e||"left",this.dirty=!0},e.anchor.get=function(){return this._anchor},e.anchor.set=function(e){"number"==typeof e?this._anchor.set(e):this._anchor.copyFrom(e)},e.font.get=function(){return this._font},e.font.set=function(e){e&&("string"==typeof e?(e=e.split(" "),this._font.name=1===e.length?e[0]:e.slice(1).join(" "),this._font.size=2<=e.length?parseInt(e[0],10):k.fonts[this._font.name].size):(this._font.name=e.name,this._font.size="number"==typeof e.size?e.size:parseInt(e.size,10)),this.dirty=!0)},e.text.get=function(){return this._text},e.text.set=function(e){e=String(null==e?"":e),this._text!==e&&(this._text=e,this.dirty=!0)},e.maxWidth.get=function(){return this._maxWidth},e.maxWidth.set=function(e){this._maxWidth!==e&&(this._maxWidth=e,this.dirty=!0)},e.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},e.textWidth.get=function(){return this.validate(),this._textWidth},e.letterSpacing.get=function(){return this._letterSpacing},e.letterSpacing.set=function(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.dirty=!0)},e.textHeight.get=function(){return this.validate(),this._textHeight},k.registerFont=function(e,t){var r={},i=e.getElementsByTagName("info")[0],n=e.getElementsByTagName("common")[0],o=e.getElementsByTagName("page"),a=nt(o[0].getAttribute("file"),A.RESOLUTION),s={};r.font=i.getAttribute("face"),r.size=parseInt(i.getAttribute("size"),10),r.lineHeight=parseInt(n.getAttribute("lineHeight"),10)/a,r.chars={},t instanceof br&&(t=[t]);for(var u=0;u<o.length;u++){var h=o[u].getAttribute("id"),c=o[u].getAttribute("file");s[h]=t instanceof Array?t[u]:t[c]}for(var f=e.getElementsByTagName("char"),l=0;l<f.length;l++){var d=f[l],p=parseInt(d.getAttribute("id"),10),m=d.getAttribute("page")||0,v=new Pt(parseInt(d.getAttribute("x"),10)/a+s[m].frame.x/a,parseInt(d.getAttribute("y"),10)/a+s[m].frame.y/a,parseInt(d.getAttribute("width"),10)/a,parseInt(d.getAttribute("height"),10)/a);r.chars[p]={xOffset:parseInt(d.getAttribute("xoffset"),10)/a,yOffset:parseInt(d.getAttribute("yoffset"),10)/a,xAdvance:parseInt(d.getAttribute("xadvance"),10)/a,kerning:{},texture:new br(s[m].baseTexture,v),page:m}}for(var b=e.getElementsByTagName("kerning"),g=0;g<b.length;g++){var y=b[g],_=parseInt(y.getAttribute("first"),10)/a,w=parseInt(y.getAttribute("second"),10)/a,x=parseInt(y.getAttribute("amount"),10)/a;r.chars[w]&&(r.chars[w].kerning[_]=x)}return k.fonts[r.font]=r},Object.defineProperties(k.prototype,e),k}(jt);Go.fonts={};var Vo=function(){};Vo.parse=function(e,t){e.bitmapFont=Go.registerFont(e.data,t)},Vo.add=function(){Oo.setExtensionXhrType("fnt",Oo.XHR_RESPONSE_TYPE.DOCUMENT)},Vo.dirname=function(e){var t=e.replace(/\/$/,"").replace(/\/[^\/]*$/,"");return t===e?".":""===t?"/":t},Vo.use=function(t,r){if(t.data&&t.type===Oo.TYPE.XML)if(0!==t.data.getElementsByTagName("page").length&&0!==t.data.getElementsByTagName("info").length&&null!==t.data.getElementsByTagName("info")[0].getAttribute("face")){var e=t.isDataUrl?"":Vo.dirname(t.url);t.isDataUrl&&("."===e&&(e=""),this.baseUrl&&e&&"/"===this.baseUrl.charAt(this.baseUrl.length-1)&&(e+="/")),(e=e.replace(this.baseUrl,""))&&"/"!==e.charAt(e.length-1)&&(e+="/");for(var i=t.data.getElementsByTagName("page"),n={},o=function(e){n[e.metadata.pageFile]=e.texture,Object.keys(n).length===i.length&&(Vo.parse(t,n),r())},a=0;a<i.length;++a){var s=i[a].getAttribute("file"),u=e+s,h=!1;for(var c in this.resources){var f=this.resources[c];if(f.url===u){f.metadata.pageFile=s,f.texture?o(f):f.onAfterMiddleware.add(o),h=!0;break}}if(!h){var l={crossOrigin:t.crossOrigin,loadType:Oo.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:s},t.metadata.imageMetadata),parentResource:t};this.add(u,l,o)}}}else r();else r()};var Yo=function(t){function e(e){void 0===e&&(e=1),t.call(this,Bi,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n",{uAlpha:1}),this.alpha=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={alpha:{configurable:!0}};return r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(e){this.uniforms.uAlpha=e},Object.defineProperties(e.prototype,r),e}(vi),Wo="\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n \n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n \n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n \n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }";var Jo={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},Ko=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join("\n");var Zo=function(s){function e(e,t,r,i,n){var o=function(e,t){var r,i=Math.ceil(e/2),n=Wo,o="";r=t?"vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var a=0;a<e;a++){var s=r.replace("%index%",a);o+=s=s.replace("%sampleIndex%",a-(i-1)+".0"),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",e)}(n=n||5,e),a=function(e){for(var t,r=Jo[e],i=r.length,n=Ko,o="",a=0;a<e;a++){var s="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",a);i<=(t=a)&&(t=e-a-1),o+=s=s.replace("%value%",r[t]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",e)}(n);s.call(this,o,a),this.horizontal=e,this.resolution=i||A.RESOLUTION,this._quality=0,this.quality=r||4,this.blur=t||8}s&&(e.__proto__=s);var t={blur:{configurable:!0},quality:{configurable:!0}};return((e.prototype=Object.create(s&&s.prototype)).constructor=e).prototype.apply=function(e,t,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/t.width):this.uniforms.strength=1/r.height*(r.height/t.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/t.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/t.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)e.applyFilter(this,t,r,i);else{var n=e.getFilterTexture(),o=e.renderer,a=t,s=n;this.state.blend=!1,e.applyFilter(this,a,s,!1);for(var u=1;u<this.passes-1;u++){o.renderTexture.bind(a,a.filterFrame);var h=this.uniforms.uSampler=s;s=a,a=h,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,e.applyFilter(this,s,r,i),e.returnFilterTexture(n)}},t.blur.get=function(){return this.strength},t.blur.set=function(e){this.padding=1+2*Math.abs(e),this.strength=e},t.quality.get=function(){return this._quality},t.quality.set=function(e){this._quality=e,this.passes=e},Object.defineProperties(e.prototype,t),e}(vi),Qo=function(n){function e(e,t,r,i){n.call(this),this.blurXFilter=new Zo(!0,e,t,r,i),this.blurYFilter=new Zo(!1,e,t,r,i),this.resolution=r||A.RESOLUTION,this.quality=t||4,this.blur=e||8,this.repeatEdgePixels=!1}n&&(e.__proto__=n);var t={blur:{configurable:!0},quality:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0},blendMode:{configurable:!0},repeatEdgePixels:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(n&&o){var a=e.getFilterTexture();this.blurXFilter.apply(e,t,a,!0),this.blurYFilter.apply(e,a,r,i),e.returnFilterTexture(a)}else o?this.blurYFilter.apply(e,t,r,i):this.blurXFilter.apply(e,t,r,i)},e.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))},t.blur.get=function(){return this.blurXFilter.blur},t.blur.set=function(e){this.blurXFilter.blur=this.blurYFilter.blur=e,this.updatePadding()},t.quality.get=function(){return this.blurXFilter.quality},t.quality.set=function(e){this.blurXFilter.quality=this.blurYFilter.quality=e},t.blurX.get=function(){return this.blurXFilter.blur},t.blurX.set=function(e){this.blurXFilter.blur=e,this.updatePadding()},t.blurY.get=function(){return this.blurYFilter.blur},t.blurY.set=function(e){this.blurYFilter.blur=e,this.updatePadding()},t.blendMode.get=function(){return this.blurYFilter.blendMode},t.blendMode.set=function(e){this.blurYFilter.blendMode=e},t.repeatEdgePixels.get=function(){return this._repeatEdgePixels},t.repeatEdgePixels.set=function(e){this._repeatEdgePixels=e,this.updatePadding()},Object.defineProperties(e.prototype,t),e}(vi),$o=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,Ni,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",e),this.alpha=1}t&&(e.__proto__=t);var r={matrix:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype._loadMatrix=function(e,t){void 0===t&&(t=!1);var r=e;t&&(this._multiply(r,this.uniforms.m,e),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(e,t,r){return e[0]=t[0]*r[0]+t[1]*r[5]+t[2]*r[10]+t[3]*r[15],e[1]=t[0]*r[1]+t[1]*r[6]+t[2]*r[11]+t[3]*r[16],e[2]=t[0]*r[2]+t[1]*r[7]+t[2]*r[12]+t[3]*r[17],e[3]=t[0]*r[3]+t[1]*r[8]+t[2]*r[13]+t[3]*r[18],e[4]=t[0]*r[4]+t[1]*r[9]+t[2]*r[14]+t[3]*r[19]+t[4],e[5]=t[5]*r[0]+t[6]*r[5]+t[7]*r[10]+t[8]*r[15],e[6]=t[5]*r[1]+t[6]*r[6]+t[7]*r[11]+t[8]*r[16],e[7]=t[5]*r[2]+t[6]*r[7]+t[7]*r[12]+t[8]*r[17],e[8]=t[5]*r[3]+t[6]*r[8]+t[7]*r[13]+t[8]*r[18],e[9]=t[5]*r[4]+t[6]*r[9]+t[7]*r[14]+t[8]*r[19]+t[9],e[10]=t[10]*r[0]+t[11]*r[5]+t[12]*r[10]+t[13]*r[15],e[11]=t[10]*r[1]+t[11]*r[6]+t[12]*r[11]+t[13]*r[16],e[12]=t[10]*r[2]+t[11]*r[7]+t[12]*r[12]+t[13]*r[17],e[13]=t[10]*r[3]+t[11]*r[8]+t[12]*r[13]+t[13]*r[18],e[14]=t[10]*r[4]+t[11]*r[9]+t[12]*r[14]+t[13]*r[19]+t[14],e[15]=t[15]*r[0]+t[16]*r[5]+t[17]*r[10]+t[18]*r[15],e[16]=t[15]*r[1]+t[16]*r[6]+t[17]*r[11]+t[18]*r[16],e[17]=t[15]*r[2]+t[16]*r[7]+t[17]*r[12]+t[18]*r[17],e[18]=t[15]*r[3]+t[16]*r[8]+t[17]*r[13]+t[18]*r[18],e[19]=t[15]*r[4]+t[16]*r[9]+t[17]*r[14]+t[18]*r[19]+t[19],e},e.prototype._colorMatrix=function(e){var t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t},e.prototype.brightness=function(e,t){var r=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},e.prototype.greyscale=function(e,t){var r=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},e.prototype.blackAndWhite=function(e){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],e)},e.prototype.hue=function(e,t){e=(e||0)/180*Math.PI;var r=Math.cos(e),i=Math.sin(e),n=(0,Math.sqrt)(1/3),o=[r+1/3*(1-r),1/3*(1-r)-n*i,1/3*(1-r)+n*i,0,0,1/3*(1-r)+n*i,r+1/3*(1-r),1/3*(1-r)-n*i,0,0,1/3*(1-r)-n*i,1/3*(1-r)+n*i,r+1/3*(1-r),0,0,0,0,0,1,0];this._loadMatrix(o,t)},e.prototype.contrast=function(e,t){var r=(e||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.saturate=function(e,t){void 0===e&&(e=0);var r=2*e/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,t)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(e){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],e)},e.prototype.sepia=function(e){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],e)},e.prototype.technicolor=function(e){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],e)},e.prototype.polaroid=function(e){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],e)},e.prototype.toBGR=function(e){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],e)},e.prototype.kodachrome=function(e){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],e)},e.prototype.browni=function(e){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],e)},e.prototype.vintage=function(e){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],e)},e.prototype.colorTone=function(e,t,r,i,n){var o=((r=r||16770432)>>16&255)/255,a=(r>>8&255)/255,s=(255&r)/255,u=((i=i||3375104)>>16&255)/255,h=(i>>8&255)/255,c=(255&i)/255,f=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,u,h,c,t=t||.15,0,o-u,a-h,s-c,0,0];this._loadMatrix(f,n)},e.prototype.night=function(e,t){var r=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},e.prototype.predator=function(e,t){var r=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(r,t)},e.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(e){this.uniforms.m=e},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(e){this.uniforms.uAlpha=e},Object.defineProperties(e.prototype,r),e}(vi);$o.prototype.grayscale=$o.prototype.greyscale;var ea=function(i){function e(e,t){var r=new mt;e.renderable=!1,i.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=r,null==t&&(t=20),this.scale=new ut(t,t)}i&&(e.__proto__=i);var t={map:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),a=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/a,this.uniforms.rotation[3]=n.d/a),e.applyFilter(this,t,r,i)},t.map.get=function(){return this.uniforms.mapSampler},t.map.set=function(e){this.uniforms.mapSampler=e},Object.defineProperties(e.prototype,t),e}(vi),ta=function(e){function t(){e.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(vi),ra=function(r){function e(e,t){void 0===e&&(e=.5),void 0===t&&(t=Math.random()),r.call(this,Ni,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0}),this.noise=e,this.seed=t}r&&(e.__proto__=r),(e.prototype=Object.create(r&&r.prototype)).constructor=e;var t={noise:{configurable:!0},seed:{configurable:!0}};return t.noise.get=function(){return this.uniforms.uNoise},t.noise.set=function(e){this.uniforms.uNoise=e},t.seed.get=function(){return this.uniforms.uSeed},t.seed.set=function(e){this.uniforms.uSeed=e},Object.defineProperties(e.prototype,t),e}(vi),ia=new mt;Lt.prototype._cacheAsBitmap=!1,Lt.prototype._cacheData=!1;var na=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Lt.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(e){var t;this._cacheAsBitmap!==e&&((this._cacheAsBitmap=e)?(this._cacheData||(this._cacheData=new na),(t=this._cacheData).originalRender=this.render,t.originalRenderCanvas=this.renderCanvas,t.originalUpdateTransform=this.updateTransform,t.originalCalculateBounds=this.calculateBounds,t.originalGetLocalBounds=this.getLocalBounds,t.originalDestroy=this.destroy,t.originalContainsPoint=this.containsPoint,t.originalMask=this._mask,t.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((t=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=t.originalRender,this.renderCanvas=t.originalRenderCanvas,this.calculateBounds=t.originalCalculateBounds,this.getLocalBounds=t.originalGetLocalBounds,this.destroy=t.originalDestroy,this.updateTransform=t.originalUpdateTransform,this.containsPoint=t.originalContainsPoint,this._mask=t.originalMask,this.filterArea=t.originalFilterArea))}}}),Lt.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))},Lt.prototype._initCachedDisplayObject=function(e){if(!this._cacheData||!this._cacheData.sprite){var t=this.alpha;this.alpha=1,e.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(A.RESOLUTION);var n=e._activeRenderTarget,o=yr.create(r.width,r.height),a="cacheAsBitmap_"+qe();this._cacheData.textureCacheId=a,ir.addToCache(o.baseTexture,a),br.addToCache(o,a);var s=ia;s.tx=-r.x,s.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,e.render(this,o,!0,s,!0),e.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var u=new Rn(o);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-r.x/r.width,u.anchor.y=-r.y/r.height,u.alpha=t,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=u.containsPoint.bind(u)}},Lt.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))},Lt.prototype._initCachedDisplayObjectCanvas=function(e){if(!this._cacheData||!this._cacheData.sprite){var t=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=e.context;t.ceil(A.RESOLUTION);var n=yr.create(t.width,t.height),o="cacheAsBitmap_"+qe();this._cacheData.textureCacheId=o,ir.addToCache(n.baseTexture,o),br.addToCache(n,o);var a=ia;this.transform.localTransform.copyTo(a),a.invert(),a.tx-=t.x,a.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,n,!0,a,!1),e.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var s=new Rn(n);s.transform.worldTransform=this.transform.worldTransform,s.anchor.x=-t.x/t.width,s.anchor.y=-t.y/t.height,s.alpha=r,s._bounds=this._bounds,this._cacheData.sprite=s,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=s.containsPoint.bind(s)}},Lt.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Lt.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Lt.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ir.removeFromCache(this._cacheData.textureCacheId),br.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Lt.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)},Lt.prototype.name=null,jt.prototype.getChildByName=function(e){for(var t=0;t<this.children.length;t++)if(this.children[t].name===e)return this.children[t];return null},Lt.prototype.getGlobalPosition=function(e,t){return void 0===e&&(e=new ut),void 0===t&&(t=!1),this.parent?this.parent.toGlobal(this.position,e,t):(e.x=this.position.x,e.y=this.position.y),e};var oa="5.0.0";var aa=function(e,t){this.uvBuffer=e,this.uvMatrix=t,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0};aa.prototype.update=function(e){if(e||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var t=this.uvBuffer.data;this.data&&this.data.length===t.length||(this.data=new Float32Array(t.length)),this.uvMatrix.multiplyUvs(t,this.data),this._updateID++}};var sa=new ut,ua=new Rt,ha=function(n){function r(e,t,r,i){void 0===i&&(i=ye.TRIANGLES),n.call(this),(this.geometry=e).refCount++,this.shader=t,this.state=r||pi.for2d(),this.drawMode=i,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=0,this._transformID=-1,this.tint=16777215,this.blendMode=ge.NORMAL,this._roundPixels=A.ROUND_PIXELS,this.batchUvs=null}n&&(r.__proto__=n),(r.prototype=Object.create(n&&n.prototype)).constructor=r;var e={uvBuffer:{configurable:!0},verticesBuffer:{configurable:!0},material:{configurable:!0},blendMode:{configurable:!0},roundPixels:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return e.uvBuffer.get=function(){return this.geometry.buffers[1]},e.verticesBuffer.get=function(){return this.geometry.buffers[0]},e.material.set=function(e){this.shader=e},e.material.get=function(){return this.shader},e.blendMode.set=function(e){this.state.blendMode=e},e.blendMode.get=function(){return this.state.blendMode},e.roundPixels.set=function(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e},e.roundPixels.get=function(){return this._roundPixels},e.tint.get=function(){return this.shader.tint},e.tint.set=function(e){this.shader.tint=e},e.texture.get=function(){return this.shader.texture},e.texture.set=function(e){this.shader.texture=e},r.prototype._render=function(e){var t=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===ye.TRIANGLES&&t.length<2*r.BATCHABLE_SIZE?this._renderToBatch(e):this._renderDefault(e)},r.prototype._renderDefault=function(e){var t=this.shader;t.alpha=this.worldAlpha,t.update&&t.update(),e.batch.flush(),t.program.uniformData.translationMatrix&&(t.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0)),e.shader.bind(t),e.state.setState(this.state),e.geometry.bind(this.geometry,t),e.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},r.prototype._renderToBatch=function(e){var t=this.geometry;this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=t.indexBuffer.data,this._tintRGB=this.shader._tintRGB,this._texture=this.shader.texture;var r=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[r]),e.plugins[r].render(this)},r.prototype.calculateVertices=function(){var e=this.geometry,t=e.buffers[0].data;if(e.vertexDirtyId!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==t.length&&(this.vertexData=new Float32Array(t.length));for(var r=this.transform.worldTransform,i=r.a,n=r.b,o=r.c,a=r.d,s=r.tx,u=r.ty,h=this.vertexData,c=0;c<h.length/2;c++){var f=t[2*c],l=t[2*c+1];h[2*c]=i*f+o*l+s,h[2*c+1]=n*f+a*l+u}if(this._roundPixels)for(var d=0;d<h.length;d++)h[d]=Math.round(h[d]);this.vertexDirty=e.vertexDirtyId}},r.prototype.calculateUvs=function(){var e=this.geometry.buffers[1];this.shader.uvMatrix.isSimple?this.uvs=e.data:(this.batchUvs||(this.batchUvs=new aa(e,this.shader.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},r.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},r.prototype.containsPoint=function(e){if(!this.getBounds().contains(e.x,e.y))return!1;this.worldTransform.applyInverse(e,sa);for(var t=this.geometry.getBuffer("aVertexPosition").data,r=ua.points,i=this.geometry.getIndex().data,n=i.length,o=4===this.drawMode?3:1,a=0;a+2<n;a+=o){var s=2*i[a],u=2*i[a+1],h=2*i[a+2];if(r[0]=t[s],r[1]=t[1+s],r[2]=t[u],r[3]=t[1+u],r[4]=t[h],r[5]=t[1+h],ua.contains(sa.x,sa.y))return!0}return!1},r.prototype.destroy=function(e){n.prototype.destroy.call(this,e),this.geometry.refCount--,0===this.geometry.refCount&&this.geometry.dispose(),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},Object.defineProperties(r.prototype,e),r}(jt);ha.BATCHABLE_SIZE=100;var ca=function(i){function e(e,t){var r={uSampler:e,alpha:1,uTextureMatrix:mt.IDENTITY,uColor:new Float32Array([1,1,1,1])};(t=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},t)).uniforms&&Object.assign(r,t.uniforms),i.call(this,t.program||ci.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"),r),this._colorDirty=!1,this.uvMatrix=new gi(e),this.batchable=void 0===t.program,this.pluginName=t.pluginName,this.tint=t.tint,this.alpha=t.alpha}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={texture:{configurable:!0},alpha:{configurable:!0},tint:{configurable:!0}};return t.texture.get=function(){return this.uniforms.uSampler},t.texture.set=function(e){this.uniforms.uSampler!==e&&(this.uniforms.uSampler=e,this.uvMatrix.texture=e)},t.alpha.set=function(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)},t.alpha.get=function(){return this._alpha},t.tint.set=function(e){e!==this._tint&&(this._tint=e,this._tintRGB=(e>>16)+(65280&e)+((255&e)<<16),this._colorDirty=!0)},t.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var e=this.texture.baseTexture;Ne(this._tint,this._alpha,this.uniforms.uColor,e.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,t),e}(li),fa=function(a){function e(e,t,r){a.call(this);var i=new xr(e),n=new xr(t,!0),o=new xr(r,!0,!0);this.addAttribute("aVertexPosition",i,2,!1,xe.FLOAT).addAttribute("aTextureCoord",n,2,!1,xe.FLOAT).addIndex(o),this._updateId=-1}a&&(e.__proto__=a),(e.prototype=Object.create(a&&a.prototype)).constructor=e;var t={vertexDirtyId:{configurable:!0}};return t.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,t),e}(Mr),la=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=100),void 0===r&&(r=10),void 0===i&&(i=10),n.call(this),this.segWidth=r,this.segHeight=i,this.width=e,this.height=t,this.build()}return n&&(e.__proto__=n),((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.build=function(){for(var e=this.segWidth*this.segHeight,t=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,a=this.width/n,s=this.height/o,u=0;u<e;u++){var h=u%this.segWidth,c=u/this.segWidth|0;t.push(h*a,c*s),r.push(h/n,c/o)}for(var f=n*o,l=0;l<f;l++){var d=l%n,p=l/n|0,m=p*this.segWidth+d,v=p*this.segWidth+d+1,b=(1+p)*this.segWidth+d,g=(1+p)*this.segWidth+d+1;i.push(m,v,b,v,g,b)}this.buffers[0].data=new Float32Array(t),this.buffers[1].data=new Float32Array(r),this.indexBuffer.data=new Uint16Array(i),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},e}(fa),da=function(r){function e(e,t){void 0===e&&(e=200),r.call(this,new Float32Array(4*t.length),new Float32Array(4*t.length),new Uint16Array(6*(t.length-1))),this.points=t,this.width=e,this.build()}return r&&(e.__proto__=r),((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.build=function(){var e=this.points;if(e){var t=this.getBuffer("aVertexPosition"),r=this.getBuffer("aTextureCoord"),i=this.getIndex();if(!(e.length<1)){t.data.length/4!==e.length&&(t.data=new Float32Array(4*e.length),r.data=new Float32Array(4*e.length),i.data=new Uint16Array(6*(e.length-1)));var n=r.data,o=i.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;for(var a=e.length,s=0;s<a;s++){var u=4*s,h=s/(a-1);n[u]=h,n[1+u]=0,n[2+u]=h,n[3+u]=1}for(var c=0,f=0;f<a-1;f++){var l=2*f;o[c++]=l,o[c++]=1+l,o[c++]=2+l,o[c++]=2+l,o[c++]=1+l,o[c++]=3+l}r.update(),i.update(),this.updateVertices()}}},e.prototype.updateVertices=function(){var e=this.points;if(!(e.length<1)){for(var t,r=e[0],i=0,n=0,o=this.buffers[0].data,a=e.length,s=0;s<a;s++){var u=e[s],h=4*s;n=-((t=s<e.length-1?e[s+1]:u).x-r.x),i=t.y-r.y;var c=Math.sqrt(i*i+n*n),f=this.width/2;i/=c,n/=c,i*=f,n*=f,o[h]=u.x+i,o[1+h]=u.y+n,o[2+h]=u.x-i,o[3+h]=u.y-n,r=u}this.buffers[0].update()}},e.prototype.update=function(){this.updateVertices()},e}(fa),pa=function(n){function e(e,t){var r=new da(e.height,t),i=new ca(e);n.call(this,r,i),this.autoUpdate=!0}return n&&(e.__proto__=n),((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype._render=function(e){(this.autoUpdate||this.geometry.width!==this.shader.texture.height)&&(this.geometry.width=this.shader.texture.height,this.geometry.update()),n.prototype._render.call(this,e)},e}(ha),ma=function(o){function e(e,t,r){var i=new la(e.width,e.height,t,r),n=new ca(br.WHITE);o.call(this,i,n),this.texture=e}o&&(e.__proto__=o);var t={texture:{configurable:!0}};return((e.prototype=Object.create(o&&o.prototype)).constructor=e).prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this.geometry.width=this.shader.texture.width,this.geometry.height=this.shader.texture.height,this.geometry.build()},t.texture.set=function(e){this.shader.texture!==e&&(this.shader.texture=e,this._textureID=-1,e.baseTexture.valid?this.textureUpdated():e.once("update",this.textureUpdated,this))},t.texture.get=function(){return this.shader.texture},e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),o.prototype._render.call(this,e)},Object.defineProperties(e.prototype,t),e}(ha),va=function(s){function e(e,t,r,i,n){void 0===e&&(e=br.EMPTY);var o=new fa(t,r,i);o.getBuffer("aVertexPosition").static=!1;var a=new ca(e);s.call(this,o,a,null,n),this.autoUpdate=!0}s&&(e.__proto__=s),(e.prototype=Object.create(s&&s.prototype)).constructor=e;var t={vertices:{configurable:!0}};return t.vertices.get=function(){return this.geometry.getBuffer("aVertexPosition").data},t.vertices.set=function(e){this.geometry.getBuffer("aVertexPosition").data=e},e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),s.prototype._render.call(this,e)},Object.defineProperties(e.prototype,t),e}(ha),ba=function(o){function e(e,t,r,i,n){o.call(this,br.WHITE,4,4),this._origWidth=e.orig.width,this._origHeight=e.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=void 0!==t?t:10,this._rightWidth=void 0!==i?i:10,this._topHeight=void 0!==r?r:10,this._bottomHeight=void 0!==n?n:10,this.texture=e}o&&(e.__proto__=o);var t={vertices:{configurable:!0},width:{configurable:!0},height:{configurable:!0},leftWidth:{configurable:!0},rightWidth:{configurable:!0},topHeight:{configurable:!0},bottomHeight:{configurable:!0}};return((e.prototype=Object.create(o&&o.prototype)).constructor=e).prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},t.vertices.get=function(){return this.geometry.getBuffer("aVertexPosition").data},t.vertices.set=function(e){this.geometry.getBuffer("aVertexPosition").data=e},e.prototype.updateHorizontalVertices=function(){var e=this.vertices,t=this._topHeight+this._bottomHeight,r=this._height>t?1:this._height/t;e[9]=e[11]=e[13]=e[15]=this._topHeight*r,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*r,e[25]=e[27]=e[29]=e[31]=this._height},e.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._leftWidth+this._rightWidth,r=this._width>t?1:this._width/t;e[2]=e[10]=e[18]=e[26]=this._leftWidth*r,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*r,e[6]=e[14]=e[22]=e[30]=this._width},t.width.get=function(){return this._width},t.width.set=function(e){this._width=e,this._refresh()},t.height.get=function(){return this._height},t.height.set=function(e){this._height=e,this._refresh()},t.leftWidth.get=function(){return this._leftWidth},t.leftWidth.set=function(e){this._leftWidth=e,this._refresh()},t.rightWidth.get=function(){return this._rightWidth},t.rightWidth.set=function(e){this._rightWidth=e,this._refresh()},t.topHeight.get=function(){return this._topHeight},t.topHeight.set=function(e){this._topHeight=e,this._refresh()},t.bottomHeight.get=function(){return this._bottomHeight},t.bottomHeight.set=function(e){this._bottomHeight=e,this._refresh()},e.prototype._refresh=function(){var e=this.texture,t=this.geometry.buffers[1].data;this._origWidth=e.orig.width,this._origHeight=e.orig.height;var r=1/this._origWidth,i=1/this._origHeight;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1,t[2]=t[10]=t[18]=t[26]=r*this._leftWidth,t[4]=t[12]=t[20]=t[28]=1-r*this._rightWidth,t[9]=t[11]=t[13]=t[15]=i*this._topHeight,t[17]=t[19]=t[21]=t[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,t),e}(ma),ga=function(r){function i(e,t){r.call(this,e[0]instanceof br?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==t,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}r&&(i.__proto__=r);var e={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return((i.prototype=Object.create(r&&r.prototype)).constructor=i).prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&Gt.shared.remove(this.update,this))},i.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&Gt.shared.add(this.update,this,qt.HIGH))},i.prototype.gotoAndStop=function(e){this.stop();var t=this.currentFrame;this._currentTime=e,t!==this.currentFrame&&this.updateTexture()},i.prototype.gotoAndPlay=function(e){var t=this.currentFrame;this._currentTime=e,t!==this.currentFrame&&this.updateTexture(),this.play()},i.prototype.update=function(e){var t=this.animationSpeed*e,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=t/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=t;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(0<this.animationSpeed&&this.currentFrame<r?this.onLoop():this.animationSpeed<0&&this.currentFrame>r&&this.onLoop()),this.updateTexture())},i.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this.cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},i.prototype.destroy=function(e){this.stop(),r.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},i.fromFrames=function(e){for(var t=[],r=0;r<e.length;++r)t.push(br.from(e[r]));return new i(t)},i.fromImages=function(e){for(var t=[],r=0;r<e.length;++r)t.push(br.from(e[r]));return new i(t)},e.totalFrames.get=function(){return this._textures.length},e.textures.get=function(){return this._textures},e.textures.set=function(e){if(e[0]instanceof br)this._textures=e,this._durations=null;else{this._textures=[],this._durations=[];for(var t=0;t<e.length;t++)this._textures.push(e[t].texture),this._durations.push(e[t].time)}this.gotoAndStop(0),this.updateTexture()},e.currentFrame.get=function(){var e=Math.floor(this._currentTime)%this._textures.length;return e<0&&(e+=this._textures.length),e},Object.defineProperties(i.prototype,e),i}(Rn);Fi.registerPlugin("accessibility",Nt),Fi.registerPlugin("extract",Ki),Fi.registerPlugin("interaction",an),Fi.registerPlugin("particle",Fo),Fi.registerPlugin("prepare",eo),Fi.registerPlugin("batch",Wi),Fi.registerPlugin("tilingSprite",Ho),Io.registerPlugin(Vo),Io.registerPlugin(No),ao.registerPlugin(Wt),ao.registerPlugin(Ro);var ya={AlphaFilter:Yo,BlurFilter:Qo,BlurFilterPass:Zo,ColorMatrixFilter:$o,DisplacementFilter:ea,FXAAFilter:ta,NoiseFilter:ra};return e.AbstractRenderer=Li,e.AnimatedSprite=ga,e.AppLoaderPlugin=Ro,e.Application=ao,e.Attribute=_r,e.BLEND_MODES=ge,e.BaseRenderTexture=pr,e.BaseTexture=ir,e.BatchDrawCall=Xi,e.BatchGeometry=zi,e.BatchRenderer=Wi,e.BitmapFontLoader=Vo,e.BitmapText=Go,e.Bounds=Dt,e.Buffer=xr,e.Circle=kt,e.Container=jt,e.CubeTexture=Ui,e.DEG_TO_RAD=dt,e.DRAW_MODES=ye,e.DisplayObject=Lt,e.ENV=ve,e.Ellipse=It,e.FORMATS=_e,e.FillStyle=hn,e.Filter=vi,e.Framebuffer=lr,e.GC_MODES=Ae,e.GLProgram=Ai,e.GLTexture=ir,e.GRAPHICS_CURVES=un,e.Geometry=Mr,e.Graphics=Cn,e.GraphicsData=cn,e.GraphicsGeometry=wn,e.GroupD8=St,e.LineStyle=xn,e.Loader=Io,e.LoaderResource=Oo,e.MIPMAP_MODES=Ee,e.Matrix=mt,e.Mesh=ha,e.MeshBatchUvs=aa,e.MeshGeometry=fa,e.MeshMaterial=ca,e.NineSlicePlane=ba,e.ObjectRenderer=Fr,e.ObservablePoint=ht,e.PI_2=ft,e.PRECISION=Pe,e.ParticleContainer=Do,e.ParticleRenderer=Fo,e.PlaneGeometry=la,e.Point=ut,e.Polygon=Rt,e.Program=ci,e.Quad=Cr,e.QuadUv=kr,e.RAD_TO_DEG=lt,e.RENDERER_TYPE=be,e.Rectangle=Pt,e.RenderTexture=yr,e.Renderer=Fi,e.RopeGeometry=da,e.RoundedRectangle=Ot,e.Runner=zt,e.SCALE_MODES=Te,e.SHAPES=pt,e.Shader=li,e.SimpleMesh=va,e.SimplePlane=ma,e.SimpleRope=pa,e.Sprite=Rn,e.SpriteMaskFilter=_i,e.Spritesheet=jo,e.SpritesheetLoader=No,e.State=pi,e.System=cr,e.TARGETS=we,e.TEXT_GRADIENT=On,e.TYPES=xe,e.Text=Hn,e.TextMetrics=zn,e.TextStyle=Fn,e.Texture=br,e.TextureLoader=ko,e.TextureMatrix=gi,e.TextureUvs=mr,e.Ticker=Gt,e.TickerPlugin=Wt,e.TilingSprite=zo,e.TilingSpriteRenderer=Ho,e.Transform=Et,e.UPDATE_PRIORITY=qt,e.UniformGroup=Rr,e.VERSION="5.0.0-rc.3",e.WRAP_MODES=Se,e.accessibility=Ut,e.autoDetectRenderer=ji,e.checkMaxIfStatementsInShader=ai,e.defaultFilterVertex=Ni,e.defaultVertex=Bi,e.extract=Zi,e.filters=ya,e.generateMultiTextureShader=Yi,e.interaction=sn,e.isMobile=m,e.prepare=oo,e.resources=hr,e.settings=A,e.systems=Oi,e.useDeprecated=function(){var r=this;Object.defineProperties(r,{SVG_SIZE:{get:function(){return at(oa,"PIXI.utils.SVG_SIZE property has moved to PIXI.resources.SVGResource.SVG_SIZE"),r.SVGResource.SVG_SIZE}},TransformStatic:{get:function(){return at(oa,"PIXI.TransformStatic class has been removed, use PIXI.Transform"),r.Transform}},TransformBase:{get:function(){return at(oa,"PIXI.TransformBase class has been removed, use PIXI.Transform"),r.Transform}},TRANSFORM_MODE:{get:function(){return at(oa,"PIXI.TRANSFORM_MODE property has been removed"),{STATIC:0,DYNAMIC:1}}},WebGLRenderer:{get:function(){return at(oa,"PIXI.WebGLRenderer class has moved to PIXI.Renderer"),r.Renderer}},CanvasRenderTarget:{get:function(){return at(oa,"PIXI.CanvasRenderTarget class has moved to PIXI.utils.CanvasRenderTarget"),r.utils.CanvasRenderTarget}},loader:{get:function(){return at(oa,"PIXI.loader instance has moved to PIXI.Loader.shared"),r.Loader.shared}},FilterManager:{get:function(){return at(oa,"PIXI.FilterManager class has moved to PIXI.systems.FilterSystem"),r.systems.FilterSystem}}}),r.extras={},Object.defineProperties(r.extras,{TilingSprite:{get:function(){return at(oa,"PIXI.extras.TilingSprite class has moved to PIXI.TilingSprite"),r.TilingSprite}},TilingSpriteRenderer:{get:function(){return at(oa,"PIXI.extras.TilingSpriteRenderer class has moved to PIXI.TilingSpriteRenderer"),r.TilingSpriteRenderer}},AnimatedSprite:{get:function(){return at(oa,"PIXI.extras.AnimatedSprite class has moved to PIXI.AnimatedSprite"),r.AnimatedSprite}},BitmapText:{get:function(){return at(oa,"PIXI.extras.BitmapText class has moved to PIXI.BitmapText"),r.BitmapText}}}),Object.defineProperties(r.utils,{getSvgSize:{get:function(){return at(oa,"PIXI.utils.getSvgSize function has moved to PIXI.resources.SVGResource.getSize"),r.SVGResource.getSize}}}),r.mesh={},Object.defineProperties(r.mesh,{Mesh:{get:function(){return at(oa,"PIXI.mesh.Mesh class has moved to PIXI.SimpleMesh"),r.SimpleMesh}},NineSlicePlane:{get:function(){return at(oa,"PIXI.mesh.NineSlicePlane class has moved to PIXI.NineSlicePlane"),r.NineSlicePlane}},Plane:{get:function(){return at(oa,"PIXI.mesh.Plane class has moved to PIXI.SimplePlane"),r.SimplePlane}},Rope:{get:function(){return at(oa,"PIXI.mesh.Rope class has moved to PIXI.SimpleRope"),r.SimpleRope}},RawMesh:{get:function(){return at(oa,"PIXI.mesh.RawMesh class has moved to PIXI.Mesh"),r.Mesh}},CanvasMeshRenderer:{get:function(){return at(oa,"PIXI.mesh.CanvasMeshRenderer class has moved to PIXI.CanvasMeshRenderer"),r.CanvasMeshRenderer}},MeshRenderer:{get:function(){return at(oa,"PIXI.mesh.MeshRenderer class has moved to PIXI.MeshRenderer"),r.MeshRenderer}}}),r.particles={},Object.defineProperties(r.particles,{ParticleContainer:{get:function(){return at(oa,"PIXI.particles.ParticleContainer class has moved to PIXI.ParticleContainer"),r.ParticleContainer}},ParticleRenderer:{get:function(){return at(oa,"PIXI.particles.ParticleRenderer class has moved to PIXI.ParticleRenderer"),r.ParticleRenderer}}}),r.ticker={},Object.defineProperties(r.ticker,{Ticker:{get:function(){return at(oa,"PIXI.ticker.Ticker class has moved to PIXI.Ticker"),r.Ticker}},shared:{get:function(){return at(oa,"PIXI.ticker.shared instance has moved to PIXI.Ticker.shared"),r.Ticker.shared}}}),r.loaders={},Object.defineProperties(r.loaders,{Loader:{get:function(){return at(oa,"PIXI.loaders.Loader class has moved to PIXI.Loader"),r.Loader}},Resource:{get:function(){return at(oa,"PIXI.loaders.Resource class has moved to PIXI.LoaderResource"),r.LoaderResource}},bitmapFontParser:{get:function(){return at(oa,"PIXI.loaders.bitmapFontParser function has moved to PIXI.BitmapFontLoader.use"),r.BitmapFontLoader.use}},parseBitmapFontData:{get:function(){return at(oa,"PIXI.loaders.parseBitmapFontData function has moved to PIXI.BitmapFontLoader.parse"),r.BitmapFontLoader.parse}},spritesheetParser:{get:function(){return at(oa,"PIXI.loaders.spritesheetParser function has moved to PIXI.SpritesheetLoader.use"),r.SpritesheetLoader.use}},getResourcePath:{get:function(){return at(oa,"PIXI.loaders.getResourcePath property has moved to PIXI.SpritesheetLoader.getResourcePath"),r.SpritesheetLoader.getResourcePath}}}),r.Loader.addPixiMiddleware=function(e){return at(oa,"PIXI.loaders.Loader.addPixiMiddleware function is deprecated, use PIXI.loaders.Loader.registerPlugin"),r.loaders.Loader.registerPlugin({use:e()})},Object.defineProperty(r.extract,"WebGLExtract",{get:function(){return at(oa,"PIXI.extract.WebGLExtract method has moved to PIXI.extract.Extract"),r.extract.Extract}}),Object.defineProperty(r.prepare,"WebGLPrepare",{get:function(){return at(oa,"PIXI.prepare.WebGLPrepare class has moved to PIXI.prepare.Prepare"),r.prepare.Prepare}}),r.Container.prototype._renderWebGL=function(e){at(oa,"PIXI.Container._renderWebGL method has moved to PIXI.Container._render"),this._render(e)},r.Container.prototype.renderWebGL=function(e){at(oa,"PIXI.Container.renderWebGL method has moved to PIXI.Container.render"),this.render(e)},r.DisplayObject.prototype.renderWebGL=function(e){at(oa,"PIXI.DisplayObject.renderWebGL method has moved to PIXI.DisplayObject.render"),this.render(e)},r.Container.prototype.renderAdvancedWebGL=function(e){at(oa,"PIXI.Container.renderAdvancedWebGL method has moved to PIXI.Container.renderAdvanced"),this.renderAdvanced(e)},Object.defineProperties(r.settings,{TRANSFORM_MODE:{get:function(){return at(oa,"PIXI.settings.TRANSFORM_MODE property has been removed"),0},set:function(){at(oa,"PIXI.settings.TRANSFORM_MODE property has been removed")}}});var o=r.BaseTexture;o.prototype.loadSource=function(e){at(oa,"PIXI.BaseTexture.loadSource method has been deprecated");var t=r.resources.autoDetectResource(e);t.internal=!0,this.setResource(t),this.update()},Object.defineProperties(o.prototype,{hasLoaded:{get:function(){return at(oa,"PIXI.BaseTexture.hasLoaded property has been removed, use PIXI.BaseTexture.valid"),this.valid}},imageUrl:{get:function(){return at(oa,"PIXI.BaseTexture.imageUrl property has been removed, use resource.url"),this.resource&&this.resource.url}}}),o.fromImage=function(e,t,r,i){at(oa,"PIXI.BaseTexture.fromImage method has been replaced with PIXI.BaseTexture.from");var n={scale:i,crossorigin:t};return o.from(e,{scaleMode:r,resourceOptions:n})},o.fromCanvas=function(e,t){return at(oa,"PIXI.BaseTexture.fromCanvas method has been replaced with PIXI.BaseTexture.from"),o.from(e,{scaleMode:t})},o.fromSVG=function(e,t,r,i){at(oa,"PIXI.BaseTexture.fromSVG method has been replaced with PIXI.BaseTexture.from");var n={scale:i,crossorigin:t};return o.from(e,{scaleMode:r,resourceOptions:n})},r.Point.prototype.copy=function(e){return at(oa,"PIXI.Point.copy method has been replaced with PIXI.Point.copyFrom"),this.copyFrom(e)},r.ObservablePoint.prototype.copy=function(e){return at(oa,"PIXI.ObservablePoint.copy method has been replaced with PIXI.ObservablePoint.copyFrom"),this.copyFrom(e)},r.Rectangle.prototype.copy=function(e){return at(oa,"PIXI.Rectangle.copy method has been replaced with PIXI.Rectangle.copyFrom"),this.copyFrom(e)},r.Matrix.prototype.copy=function(e){return at(oa,"PIXI.Matrix.copy method has been replaced with PIXI.Matrix.copyTo"),this.copyTo(e)},Object.assign(r.systems.FilterSystem.prototype,{getRenderTarget:function(e,t){return at(oa,"PIXI.FilterManager.getRenderTarget method has been replaced with PIXI.systems.FilterSystem#getFilterTexture"),this.getFilterTexture(t)},returnRenderTarget:function(e){at(oa,"PIXI.FilterManager.returnRenderTarget method has been replaced with PIXI.systems.FilterSystem.returnFilterTexture"),this.returnFilterTexture(e)},calculateScreenSpaceMatrix:function(e){at(oa,"PIXI.systems.FilterSystem.calculateScreenSpaceMatrix method is removed, use `(vTextureCoord * inputSize.xy) + outputFrame.xy` instead");var t=e.identity(),r=this.activeState,i=r.sourceFrame,n=r.destinationFrame;return t.translate(i.x/n.width,i.y/n.height),t.scale(n.width,n.height),t},calculateNormalizedScreenSpaceMatrix:function(e){at(oa,"PIXI.systems.FilterManager.calculateNormalizedScreenSpaceMatrix method is removed, use `((vTextureCoord * inputSize.xy) + outputFrame.xy) / outputFrame.zw` instead.");var t=this.activeState,r=t.sourceFrame,i=t.destinationFrame,n=e.identity();n.translate(r.x/i.width,r.y/i.height);var o=i.width/r.width,a=i.height/r.height;return n.scale(o,a),n}}),Object.defineProperties(r.RenderTexture.prototype,{sourceFrame:{get:function(){return at(oa,"PIXI.RenderTexture.sourceFrame property has been removed"),this.filterFrame}},size:{get:function(){return at(oa,"PIXI.RenderTexture.size property has been removed"),this._frame}}});var e=function(n){function e(e,t,r,i){at(oa,"PIXI.filters.BlurXFilter class is deprecated, use PIXI.filters.BlurFilterPass"),n.call(this,!0,e,t,r,i)}return n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e}(r.filters.BlurFilterPass),t=function(n){function e(e,t,r,i){at(oa,"PIXI.filters.BlurYFilter class is deprecated, use PIXI.filters.BlurFilterPass"),n.call(this,!1,e,t,r,i)}return n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e}(r.filters.BlurFilterPass);Object.assign(r.filters,{BlurXFilter:e,BlurYFilter:t});var n=r.Sprite,a=r.Texture,i=r.Graphics;function s(e,t,r,i){return at(oa,"PIXI.Sprite."+e+" method is deprecated, use PIXI.Sprite.from"),n.from(t,{resourceOptions:{scale:i,crossorigin:r}})}function u(e,t,r,i){return at(oa,"PIXI.Texture."+e+" method is deprecated, use PIXI.Texture.from"),a.from(t,{resourceOptions:{scale:i,crossorigin:r}})}i.prototype.generateCanvasTexture||(i.prototype.generateCanvasTexture=function(){at(oa,'PIXI.Graphics.generateCanvasTexture method is only available in "pixi.js-legacy"')}),n.fromImage=s.bind(null,"fromImage"),n.fromSVG=s.bind(null,"fromSVG"),n.fromCanvas=s.bind(null,"fromCanvas"),n.fromVideo=s.bind(null,"fromVideo"),n.fromFrame=s.bind(null,"fromFrame"),a.fromImage=u.bind(null,"fromImage"),a.fromSVG=u.bind(null,"fromSVG"),a.fromCanvas=u.bind(null,"fromCanvas"),a.fromVideo=u.bind(null,"fromVideo"),a.fromFrame=u.bind(null,"fromFrame"),Object.defineProperty(r.AbstractRenderer.prototype,"autoResize",{get:function(){return at(oa,"PIXI.AbstractRenderer.autoResize property is deprecated, use autoDensity"),this.autoDensity},set:function(e){at(oa,"PIXI.AbstractRenderer.autoResize property is deprecated, use autoDensity"),this.autoDensity=e}}),r.utils.mixins={mixin:function(){at(oa,"PIXI.utils.mixins.mixin function is no longer available")},delayMixin:function(){at(oa,"PIXI.utils.mixins.delayMixin function is no longer available")},performMixins:function(){at(oa,"PIXI.utils.mixins.performMixins function is no longer available")}}},e.utils=st,e}({}),e;PIXI.useDeprecated(),e||(e=eval("(function() { try { return Module || {} } catch(e) { return {} } })()"));var aa={},k;for(k in e)e.hasOwnProperty(k)&&(aa[k]=e[k]);var ba="object"==typeof window,ca="function"==typeof importScripts,da="object"==typeof process&&"function"==typeof require&&!ba&&!ca,ea=!ba&&!da&&!ca;if(da){e.print||(e.print=function(e){process.stdout.write(e+"\n")}),e.printErr||(e.printErr=function(e){process.stderr.write(e+"\n")});var fa=require("fs"),ga=require("path");e.read=function(e,t){e=ga.normalize(e);var r=fa.readFileSync(e);return r||e==ga.resolve(e)||(e=path.join(__dirname,"..","src",e),r=fa.readFileSync(e)),r&&!t&&(r=r.toString()),r},e.readBinary=function(t){return(t=e.read(t,!0)).buffer||(t=new Uint8Array(t)),assert(t.buffer),t},e.load=function(e){ha(read(e))},e.thisProgram||(e.thisProgram=1<process.argv.length?process.argv[1].replace(/\\/g,"/"):"unknown-program"),e.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=e),process.on("uncaughtException",function(e){if(!(e instanceof ia))throw e}),e.inspect=function(){return"[Emscripten Module object]"}}else if(ea)e.print||(e.print=print),"undefined"!=typeof printErr&&(e.printErr=printErr),e.read="undefined"!=typeof read?read:function(){throw"no read() available (jsc?)"},e.readBinary=function(e){return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(assert("object"==typeof(e=read(e,"binary"))),e)},"undefined"!=typeof scriptArgs?e.arguments=scriptArgs:"undefined"!=typeof arguments&&(e.arguments=arguments),eval("if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t<n.Z.length;t++)if(!n.Z[t])return n.Z[t]=e,2*(1+t);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},nb:function(e){n.Z[(e-2)/2]=null},O:function(t){n.O.ta||(n.O.ta={}),n.O.ta[t]||(n.O.ta[t]=1,e.W(t))},ma:{},Hd:function(e,t){assert(t),n.ma[t]||(n.ma[t]={});var r=n.ma[t];return r[e]||(r[e]=function(){return n.L(t,e,arguments)}),r[e]},Fd:function(){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},aa:function(e){var t=m;return m=(m=m+e|0)+15&-16,t},Ra:function(e){var t=la;return la=(la=la+e|0)+15&-16,t},R:function(e){var i=r;return t<=(r=(r=r+e|0)+15&-16)&&!ma()?(r=i,0):i},ja:function(e,t){return Math.ceil(e/(t||16))*(t||16)},Nd:function(e,t,r){return r?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0<oa?(0|ya(+za(oa/4294967296),4294967295))>>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,h="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,h?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i<e;i+=4)C[i>>2]=0;for(e=r+a;i<e;)y[i++>>0]=0;return r}if("i8"===h)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i<a;){var c=e[i];"function"==typeof c&&(c=n.Id(c)),0===(o=h||t[i])?i++:("i64"==o&&(o="i32"),wa(r+i,c,o),u!==o&&(s=n.Ka(o),u=o),i+=s)}return r}function va(t,r){if(0===r||!t)return"";for(var i,n=0,o=0;(n|=i=E[t+o>>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0<r;)n=String.fromCharCode.apply(String,E.subarray(t,t+Math.min(r,1024))),i=i?i+n:n,t+=1024,r-=1024;return i}return e.UTF8ToString(t)}function Ja(e,t){for(var r,i,n,o,a,s="";;){if(!(r=e[t++]))return s;128&r?(i=63&e[t++],192==(224&r)?s+=String.fromCharCode((31&r)<<6|i):(n=63&e[t++],(r=224==(240&r)?(15&r)<<12|i<<6|n:(o=63&e[t++],240==(248&r)?(7&r)<<18|i<<12|n<<6|o:(a=63&e[t++],248==(252&r)?(3&r)<<24|i<<18|n<<12|o<<6|a:(1&r)<<30|i<<24|n<<18|o<<12|a<<6|63&e[t++])))<65536?s+=String.fromCharCode(r):(r-=65536,s+=String.fromCharCode(55296|r>>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0<i))return 0;var n=r;i=r+i-1;for(var o=0;o<e.length;++o){var a=e.charCodeAt(o);if(55296<=a&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(i<=r)break;t[r++]=a}else{if(a<=2047){if(i<=r+1)break;t[r++]=192|a>>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);55296<=i&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++r)),i<=127?++t:t=i<=2047?t+2:i<=65535?t+3:i<=2097151?t+4:i<=67108863?t+5:t+6}return t}function Ma(c){var t=!!e.___cxa_demangle;if(t)try{var r=Ea(c.length);ua(c.substr(1),r);var i=Ea(4),o=e.___cxa_demangle(r,0,0,i);if(0===Da(i,"i32")&&o)return va(o)}catch(e){}finally{r&&Na(r),i&&Na(i),o&&Na(o)}var f=3,l={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},d=[],p=!0;r=c;try{if("Object._main"==c||"_main"==c)return"main()";if("number"==typeof c&&(c=va(c)),"_"!==c[0]||"_"!==c[1]||"Z"!==c[2])return c;switch(c[3]){case"n":return"operator new()";case"d":return"operator delete()"}r=function e(t,r,i){r=r||1/0;var n,o="",a=[];if("N"===c[f]){for("K"===c[++f]&&f++,n=[];"E"!==c[f];)if("S"===c[f]){f++;var s=c.indexOf("_",f);n.push(d[c.substring(f,s)||0]||"?"),f=s+1}else if("C"===c[f])n.push(n[n.length-1]),f+=2;else{var u=(s=parseInt(c.substr(f))).toString().length;if(!s||!u){f--;break}var h=c.substr(f+u,s);n.push(h),d.push(h),f+=u+s}if(f++,n=n.join("::"),0==--r)return t?[n]:n}else("K"===c[f]||p&&"L"===c[f])&&f++,(s=parseInt(c.substr(f)))&&(u=s.toString().length,n=c.substr(f+u,s),f+=u+s);p=!1,"I"===c[f]?(f++,s=e(!0),o+=(u=e(!0,1,!0))[0]+" "+n+"<"+s.join(", ")+">"):o=n;e:for(;f<c.length&&0<r--;)if(n=c[f++],n in l)a.push(l[n]);else switch(n){case"P":a.push(e(!0,1,!0)[0]+"*");break;case"R":a.push(e(!0,1,!0)[0]+"&");break;case"L":f++,s=c.indexOf("E",f)-f,a.push(c.substr(f,s)),f+=s+2;break;case"A":if(s=parseInt(c.substr(f)),f+=s.toString().length,"_"!==c[f])throw"?";f++,a.push(e(!0,1,!0)[0]+" ["+s+"]");break;case"E":break e;default:o+="?"+n;break e}return i||1!==a.length||"void"!==a[0]||(a=[]),t?(o&&a.push(o+"?"),a):o+"("+a.join(", ")+")"}()}catch(e){r+="?"}return 0<=r.indexOf("?")&&!t&&n.O("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),r}function Oa(){return Pa().replace(/__Z[\w\d_]+/g,function(e){var t=Ma(e);return e===t?e:e+" ["+t+"]"})}function Pa(){var t=Error();if(!t.stack){try{throw Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function Qa(e){return 0<e%4096&&(e+=4096-e%4096),e}!function(){function a(e){return{arguments:(e=e.toString().match(d).slice(1))[0],body:e[1],returnValue:e[2]}}var b={stackSave:function(){n.ua()},stackRestore:function(){n.ba()},arrayToC:function(e){var t=n.aa(e.length);return ta(e,t),t},stringToC:function(e){var t=0;return null!=e&&0!==e&&ua(e,t=n.aa(1+(e.length<<2))),t}},c={string:b.stringToC,array:b.arrayToC};sa=function(e,t,r,i,o){e=qa(e);var a=[],s=0;if(i)for(var u=0;u<i.length;u++){var h=c[r[u]];h?(0===s&&(s=n.ua()),a[u]=h(i[u])):a[u]=i[u]}if(r=e.apply(null,a),"string"===t&&(r=va(r)),0!==s){if(o&&o.async)return void EmterpreterAsync.yd.push(function(){n.ba(s)});n.ba(s)}return r};var d=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,f={},g;for(g in b)b.hasOwnProperty(g)&&(f[g]=a(b[g]));ra=function(b,c,d){d=d||[];var g=qa(b);b=d.every(function(e){return"number"===e});var q="string"!==c;if(q&&b)return g;var v=d.map(function(e,t){return"$"+t});c="(function("+v.join(",")+") {";var B=d.length;if(!b){c+="var stack = "+f.stackSave.body+";";for(var G=0;G<B;G++){var O=v[G],ja=d[G];"number"!==ja&&(ja=f[ja+"ToC"],c+="var "+ja.arguments+" = "+O+";",c+=ja.body+";",c+=O+"="+ja.returnValue+";")}}return d=a(function(){return g}).returnValue,c+="var ret = "+d+"("+v.join(",")+");",q||(d=a(function(){return va}).returnValue,c+="ret = "+d+"(ret);"),b||(c+=f.stackRestore.body.replace("()","(stack)")+";"),eval(c+"return ret})")}}(),e.ccall=sa,e.cwrap=ra,e.setValue=wa,e.getValue=Da,e.ALLOC_NORMAL=0,e.ALLOC_STACK=1,e.ALLOC_STATIC=2,e.ALLOC_DYNAMIC=3,e.ALLOC_NONE=4,e.allocate=D,e.getMemory=function(e){return Fa?void 0!==Ga&&!Ga.p||!Ha?n.R(e):Ea(e):n.Ra(e)},e.Pointer_stringify=va,e.AsciiToString=function(e){for(var t="";;){var r=y[e++>>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n<r;++n)z[t>>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n<e.length;++n){if(55296<=(o=e.charCodeAt(n))&&o<=57343)var o=65536+((1023&o)<<10)|1023&e.charCodeAt(++n);if(C[t>>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);55296<=i&&i<=57343&&++r,t+=4}return t},e.stackTrace=function(){return Oa()};var y,E,z,Ra,C,Sa,Ba,Ca,Ta=0,la=0,Fa=!1,Ua=0,m=0,Va=0,Wa=0,r=0,Ya,buffer;function ma(){var i=Math.pow(2,31);if(i<=r)return!1;for(;t<=r;)if(t<i/2)t=Qa(2*t);else{var n=t;if((t=Qa((3*t+i)/4))<=n)return!1}if(i<=(t=Math.max(t,16777216)))return!1;try{if(ArrayBuffer.p)buffer=ArrayBuffer.p(buffer,t);else{var o=y;buffer=new ArrayBuffer(t)}}catch(e){return!1}return!!Xa(buffer)&&(e.buffer=buffer,e.HEAP8=y=new Int8Array(buffer),e.HEAP16=z=new Int16Array(buffer),e.HEAP32=C=new Int32Array(buffer),e.HEAPU8=E=new Uint8Array(buffer),e.HEAPU16=Ra=new Uint16Array(buffer),e.HEAPU32=Sa=new Uint32Array(buffer),e.HEAPF32=Ba=new Float32Array(buffer),e.HEAPF64=Ca=new Float64Array(buffer),ArrayBuffer.p||y.set(o),!0)}try{Ya=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),Ya(new ArrayBuffer(4))}catch(e){Ya=function(e){return e.byteLength}}for(var $a=e.TOTAL_STACK||5242880,t=e.TOTAL_MEMORY||16777216,F=65536;F<t||F<2*$a;)F=F<16777216?2*F:F+16777216;function ab(e){for(;0<e.length;){var t=e.shift();if("function"==typeof t)t();else{var r=t.ab;"number"==typeof r?void 0===t.X?n.L("v",r):n.L("vi",r,[t.X]):r(void 0===t.X?null:t.X)}}}F=Math.max(F,16777216),F!==t&&(t=F),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"JS engine does not provide full typed array support"),buffer=new ArrayBuffer(t),y=new Int8Array(buffer),z=new Int16Array(buffer),C=new Int32Array(buffer),E=new Uint8Array(buffer),Ra=new Uint16Array(buffer),Sa=new Uint32Array(buffer),Ba=new Float32Array(buffer),Ca=new Float64Array(buffer),C[0]=255,assert(255===E[0]&&0===E[3],"Typed arrays 2 must be run on a little-endian system"),e.HEAP=void 0,e.buffer=buffer,e.HEAP8=y,e.HEAP16=z,e.HEAP32=C,e.HEAPU8=E,e.HEAPU16=Ra,e.HEAPU32=Sa,e.HEAPF32=Ba,e.HEAPF64=Ca;var bb=[],cb=[],db=[],H=[],eb=[],Ha=!1;function fb(e){bb.unshift(e)}function gb(e){eb.unshift(e)}function hb(e,t,r){return e=Ka(e,r=Array(0<r?r:La(e)+1),0,r.length),t&&(r.length=e),r}function ua(e,t,r){for(e=hb(e,r),r=0;r<e.length;)y[t+r>>0]=e[r],r+=1}function ta(e,t){for(var r=0;r<e.length;r++)y[t++>>0]=e[r]}function Ia(e,t,r){for(var i=0;i<e.length;++i)y[t++>>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r];255<i&&(i&=255),t.push(String.fromCharCode(i))}return t.join("")},e.writeStringToMemory=ua,e.writeArrayToMemory=ta,e.writeAsciiToMemory=Ia,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){var r=65535&e,i=65535&t;return r*i+((e>>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;o<i;o++){var a;try{a=e.tty.N.La(e.tty)}catch(e){throw new L(J.H)}if(void 0===a&&0===n)throw new L(J.va);if(null==a)break;n++,t[r+o]=a}return n&&(e.g.timestamp=Date.now()),n},write:function(e,t,r,i){if(!e.tty||!e.tty.N.qa)throw new L(J.Aa);for(var n=0;n<i;n++)try{e.tty.N.qa(e.tty,t[r+n])}catch(e){throw new L(J.H)}return i&&(e.g.timestamp=Date.now()),n}},Ib={La:function(e){if(!e.input.length){var t=null;if(da){var r,i=new Buffer(256),n=process.stdin.fd,o=!1;try{n=fs.openSync("/dev/stdin","r"),o=!0}catch(e){}r=fs.readSync(n,i,0,256,null),o&&fs.closeSync(n),t=0<r?i.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&(null!==(t=readline())&&(t+="\n"));if(!t)return null;e.input=hb(t,!0)}return e.input.shift()},qa:function(t,r){null===r||10===r?(e.print(Ja(t.output,0)),t.output=[]):0!=r&&t.output.push(r)},flush:function(t){t.output&&0<t.output.length&&(e.print(Ja(t.output,0)),t.output=[])}},Jb={qa:function(t,r){null===r||10===r?(e.printErr(Ja(t.output,0)),t.output=[]):0!=r&&t.output.push(r)},flush:function(t){t.output&&0<t.output.length&&(e.printErr(Ja(t.output,0)),t.output=[])}},M={C:null,A:function(){return M.createNode(null,"/",16895,0)},createNode:function(e,t,r,i){if(24576==(61440&r)||4096==(61440&r))throw new L(J.I);return M.C||(M.C={dir:{g:{D:M.k.D,u:M.k.u,lookup:M.k.lookup,T:M.k.T,rename:M.k.rename,unlink:M.k.unlink,rmdir:M.k.rmdir,readdir:M.k.readdir,symlink:M.k.symlink},stream:{G:M.n.G}},file:{g:{D:M.k.D,u:M.k.u},stream:{G:M.n.G,read:M.n.read,write:M.n.write,Ba:M.n.Ba,Na:M.n.Na,Pa:M.n.Pa}},link:{g:{D:M.k.D,u:M.k.u,readlink:M.k.readlink},stream:{}},Ea:{g:{D:M.k.D,u:M.k.u},stream:Kb}}),N((r=Lb(e,t,r,i)).mode)?(r.k=M.C.dir.g,r.n=M.C.dir.stream,r.e={}):32768==(61440&r.mode)?(r.k=M.C.file.g,r.n=M.C.file.stream,r.o=0,r.e=null):40960==(61440&r.mode)?(r.k=M.C.link.g,r.n=M.C.link.stream):8192==(61440&r.mode)&&(r.k=M.C.Ea.g,r.n=M.C.Ea.stream),r.timestamp=Date.now(),e&&(e.e[t]=r),r},cb:function(e){if(e.e&&e.e.subarray){for(var t=[],r=0;r<e.o;++r)t.push(e.e[r]);return t}return e.e},Gd:function(e){return e.e?e.e.subarray?e.e.subarray(0,e.o):new Uint8Array(e.e):new Uint8Array},Ga:function(e,t){if(e.e&&e.e.subarray&&t>e.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0<e.o&&e.e.set(r.subarray(0,e.o),0))}else for(!e.e&&0<t&&(e.e=[]);e.e.length<t;)e.e.push(0)},ob:function(e,t){if(e.o!=t)if(0==t)e.e=null,e.o=0;else{if(!e.e||e.e.subarray){var r=e.e;e.e=new Uint8Array(new ArrayBuffer(t)),r&&e.e.set(r.subarray(0,Math.min(t,e.o)))}else if(e.e||(e.e=[]),e.e.length>t)e.e.length=t;else for(;e.e.length<t;)e.e.push(0);e.o=t}},k:{D:function(e){var t={};return t.dev=8192==(61440&e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,N(e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.o:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.K=4096,t.blocks=Math.ceil(t.size/t.K),t},u:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&M.ob(e,t.size)},lookup:function(){throw Mb[J.F]},T:function(e,t,r,i){return M.createNode(e,t,r,i)},rename:function(e,t,r){if(N(e.mode)){var i;try{i=Nb(t,r)}catch(e){}if(i)for(var n in i.e)throw new L(J.za)}delete e.parent.e[e.name],e.name=r,(t.e[r]=e).parent=t},unlink:function(e,t){delete e.e[t]},rmdir:function(e,t){var r,i=Nb(e,t);for(r in i.e)throw new L(J.za);delete e.e[t]},readdir:function(e){var t,r=[".",".."];for(t in e.e)e.e.hasOwnProperty(t)&&r.push(t);return r},symlink:function(e,t,r){return(e=M.createNode(e,t,41471,0)).link=r,e},readlink:function(e){if(40960!=(61440&e.mode))throw new L(J.q);return e.link}},n:{read:function(e,t,r,i,n){var o=e.g.e;if(n>=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8<e&&o.subarray)t.set(o.subarray(n,n+e),r);else for(i=0;i<e;i++)t[r+i]=o[n+i];return e},write:function(e,t,r,i,n,o){if(!i)return 0;if((e=e.g).timestamp=Date.now(),t.subarray&&(!e.e||e.e.subarray)){if(o)return e.e=t.subarray(r,r+i),e.o=i;if(0===e.o&&0===n)return e.e=new Uint8Array(t.subarray(r,r+i)),e.o=i;if(n+i<=e.o)return e.e.set(t.subarray(r,r+i),n),i}if(M.Ga(e,n+i),e.e.subarray&&t.subarray)e.e.set(t.subarray(r,r+i),n);else for(o=0;o<i;o++)e.e[n+o]=t[r+o];return e.o=Math.max(e.o,n+i),i},G:function(e,t,r){if(1===r?t+=e.position:2===r&&32768==(61440&e.g.mode)&&(t+=e.g.o),t<0)throw new L(J.q);return t},Ba:function(e,t,r){M.Ga(e.g,t+r),e.g.o=Math.max(e.g.o,t+r)},Na:function(e,t,r,i,n,o,a){if(32768!=(61440&e.g.mode))throw new L(J.ha);if(r=e.g.e,2&a||r.buffer!==t&&r.buffer!==t.buffer){if((0<n||n+i<e.g.o)&&(r=r.subarray?r.subarray(n,n+i):Array.prototype.slice.call(r,n,n+i)),e=!0,!(i=Ea(i)))throw new L(J.Ta);t.set(r,i)}else e=!1,i=r.byteOffset;return{Rd:i,xd:e}},Pa:function(e,t,r,i,n){if(32768!=(61440&e.g.mode))throw new L(J.ha);return 2&n||M.n.write(e,t,0,i,r,!1),0}}},P={$:!1,sb:function(){P.$=!!process.platform.match(/^win/)},A:function(e){return assert(da),P.createNode(null,"/",P.Ja(e.pa.root),0)},createNode:function(e,t,r){if(!N(r)&&32768!=(61440&r)&&40960!=(61440&r))throw new L(J.q);return(e=Lb(e,t,r)).k=P.k,e.n=P.n,e},Ja:function(e){var t;try{t=fs.lstatSync(e),P.$&&(t.mode=t.mode|(146&t.mode)>>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0<o)for(e=0;e<o;e++)t[r+e]=a[e];return o},write:function(e,t,r,i,n){var o;t=new Buffer(t.subarray(r,r+i));try{o=fs.writeSync(e.V,t,0,i,n)}catch(e){throw new L(J[e.code])}return o},G:function(e,t,r){if(1===r)t+=e.position;else if(2===r&&32768==(61440&e.g.mode))try{t+=fs.fstatSync(e.V).size}catch(e){throw new L(J[e.code])}if(t<0)throw new L(J.q);return t}}};D(1,"i32*",2),D(1,"i32*",2),D(1,"i32*",2);var Pb=null,Qb=[null],Rb=[],Sb=1,Q=null,Tb=!0,R={},L=null,Mb={};function S(e,t){if(t=t||{},!(e=Db("/",e)))return{path:"",g:null};var r,i={Ia:!0,ra:0};for(r in i)void 0===t[r]&&(t[r]=i[r]);if(8<t.ra)throw new L(J.ga);i=yb(e.split("/").filter(function(e){return!!e}),!1);var n=Pb;r="/";for(var o=0;o<i.length;o++){var a=o===i.length-1;if(a&&t.parent)break;if(n=Nb(n,i[o]),r=K(r,i[o]),n.U&&(!a||a&&t.Ia)&&(n=n.U.root),!a||t.la)for(a=0;40960==(61440&n.mode);)if(n=Vb(r),n=S(r=Db(Ab(r),n),{ra:t.ra}).g,40<a++)throw new L(J.ga)}return{path:r,g:n}}function T(e){for(var t;;){if(e===e.parent)return e=e.A.Oa,t?"/"!==e[e.length-1]?e+"/"+t:e+t:e;t=t?e.name+"/"+t:e.name,e=e.parent}}function Wb(e,t){for(var r=0,i=0;i<t.length;i++)r=(r<<5)-r+t.charCodeAt(i)|0;return(e+r>>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack="<generic error, no stack>"}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t<a;++t)e[t]=r.charCodeAt(t);r=e}jc(n,146|i),oc(e=kc(n,"w"),r,0,r.length,0,o),mc(e),jc(n,i)}return n}function W(e,t,s,o){e=K("string"==typeof e?e:T(e),t),t=rc(!!s,!!o),W.Ma||(W.Ma=64);var r=W.Ma++<<8|0;return Gb(r,{open:function(e){e.seekable=!1},close:function(){o&&o.buffer&&o.buffer.length&&o(10)},read:function(e,t,r,i){for(var n=0,o=0;o<i;o++){var a;try{a=s()}catch(e){throw new L(J.H)}if(void 0===a&&0===n)throw new L(J.va);if(null==a)break;n++,t[r+o]=a}return n&&(e.g.timestamp=Date.now()),n},write:function(e,t,r,i){for(var n=0;n<i;n++)try{o(t[r+n])}catch(e){throw new L(J.H)}return i&&(e.g.timestamp=Date.now()),n}}),hc(e,t,r)}function uc(t){if(t.jb||t.kb||t.link||t.e)return!0;var r=!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!e.read)throw Error("Cannot load without read() or XMLHttpRequest.");try{t.e=hb(e.read(t.url),!0),t.o=t.e.length}catch(e){r=!1}return r||ob(J.H),r}var vc={},Zb,dc,lc,wc=0;function X(){return C[(wc+=4)-4>>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0<Mc.length){var t=Date.now(),r=Mc.shift();if(r.ab(r.X),Nc){var i=Nc,o=0==i%1?i-1:Math.floor(i);Nc=r.Bd?o:(8*i+(o+.5))/9}console.log('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),Oc(),setTimeout(Gc,0)}else u<Lc||(Pc=Pc+1|0,1==Dc&&1<Ec&&0!=Pc%Ec?Y():("timeout"===Hc&&e.ka&&(e.W("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Hc=""),Qc(function(){void 0!==s?n.L("vi",a,[s]):n.L("v",a)}),u<Lc||("object"==typeof SDL&&SDL.audio&&SDL.audio.mb&&SDL.audio.mb(),Y())))},i||(t&&0<t?Cc(0,1e3/t):Cc(1,1),Y()),r)throw"SimulateInfiniteLoop"}e._memcpy=Bc;var Y=null,Hc="",Lc=0,Fc=null,Kc=0,Dc=0,Ec=0,Pc=0,Mc=[];function Oc(){if(e.setStatus){var t=e.statusMessage||"Please wait...",r=Nc,i=Rc.Dd;r?r<i?e.setStatus(t+" ("+(i-r)+"/"+i+")"):e.setStatus(t):e.setStatus("")}}function Qc(t){if(!(na||e.preMainLoop&&!1===e.preMainLoop())){try{t()}catch(t){if(t instanceof ia)return;throw t&&"object"==typeof t&&t.stack&&e.W("exception thrown: "+[t,t.stack]),t}e.postMainLoop&&e.postMainLoop()}}var Rc={},Gc,Nc,Sc=!1,Tc=!1,Uc=[];function Vc(){function t(){Tc=document.pointerLockElement===r||document.mozPointerLockElement===r||document.webkitPointerLockElement===r||document.msPointerLockElement===r}if(e.preloadPlugins||(e.preloadPlugins=[]),!Wc){Wc=!0;try{Xc=!0}catch(e){Xc=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Yc="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Xc?null:console.log("warning: no BlobBuilder"),Zc="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,e.Qa||void 0!==Zc||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),e.Qa=!0),e.preloadPlugins.push({canHandle:function(t){return!e.Qa&&/\.(jpg|jpeg|png|bmp)$/i.test(t)},handle:function(r,i,o,t){var a=null;if(Xc)try{(a=new Blob([r],{type:$c(i)})).size!==r.length&&(a=new Blob([new Uint8Array(r).buffer],{type:$c(i)}))}catch(e){n.O("Blob constructor present but fails: "+e+"; falling back to blob builder")}a||((a=new Yc).append(new Uint8Array(r).buffer),a=a.getBlob());var s=Zc.createObjectURL(a),u=new Image;u.onload=function(){assert(u.complete,"Image "+i+" could not be decoded");var t=document.createElement("canvas");t.width=u.width,t.height=u.height,t.getContext("2d").drawImage(u,0,0),e.preloadedImages[i]=t,Zc.revokeObjectURL(s),o&&o(r)},u.onerror=function(){console.log("Image "+s+" could not be decoded"),t&&t()},u.src=s}}),e.preloadPlugins.push({canHandle:function(t){return!e.Pd&&t.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(o,a,r,t){function s(t){u||(u=!0,e.preloadedAudios[a]=t,r&&r(o))}function i(){u||(u=!0,e.preloadedAudios[a]=new Audio,t&&t())}var u=!1;if(!Xc)return i();try{var n=new Blob([o],{type:$c(a)})}catch(e){return i()}n=Zc.createObjectURL(n);var h=new Audio;h.addEventListener("canplaythrough",function(){s(h)},!1),h.onerror=function(){if(!u){console.log("warning: browser could not fully decode audio "+a+", trying slower base64 approach");for(var e="",t=0,r=0,i=0;i<o.length;i++)for(t=t<<8|o[i],r+=8;6<=r;){var n=t>>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),h.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(h)}},h.src=n,ad(function(){s(h)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0<e.forcedAspectRatio&&(n/o<e.forcedAspectRatio?n=Math.round(o*e.forcedAspectRatio):o=Math.round(n/e.forcedAspectRatio)),(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t.parentNode&&"undefined"!=typeof screen){var a=Math.min(screen.width/n,screen.height/o);n=Math.round(n*a),o=Math.round(o*a)}ed?(t.width!=n&&(t.width=n),t.height!=o&&(t.height=o),void 0!==t.style&&(t.style.removeProperty("width"),t.style.removeProperty("height"))):(t.width!=r&&(t.width=r),t.height!=i&&(t.height=i),void 0!==t.style&&(n!=r||o!=i?(t.style.setProperty("width",n+"px","important"),t.style.setProperty("height",o+"px","important")):(t.style.removeProperty("width"),t.style.removeProperty("height"))))}if(pc(),Q=Array(4096),ec(M,"/"),V("/tmp"),V("/home"),V("/home/web_user"),function(){var e;if(V("/dev"),Gb(259,{read:function(){return 0},write:function(e,t,r,i){return i}}),hc("/dev/null",259),Fb(1280,Ib),Fb(1536,Jb),hc("/dev/tty",1280),hc("/dev/tty1",1536),"undefined"!=typeof crypto){var t=new Uint8Array(1);e=function(){return crypto.getRandomValues(t),t[0]}}else e=da?function(){return require("crypto").randomBytes(1)[0]}:function(){return 256*Math.random()|0};W("/dev","random",e),W("/dev","urandom",e),V("/dev/shm"),V("/dev/shm/tmp")}(),V("/proc"),V("/proc/self"),V("/proc/self/fd"),ec({A:function(){var e=Lb("/proc/self","fd",16895,73);return e.k={lookup:function(e,t){var r=Rb[+t];if(!r)throw new L(J.ea);var i={parent:null,A:{Oa:"fake"},k:{readlink:function(){return r.path}}};return i.parent=i}},e}},"/proc/self/fd"),cb.unshift(function(){if(!e.noFSInit&&!qc){assert(!qc,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),qc=!0,pc(),e.stdin=e.stdin,e.stdout=e.stdout,e.stderr=e.stderr,e.stdin?W("/dev","stdin",e.stdin):ic("/dev/tty","/dev/stdin"),e.stdout?W("/dev","stdout",null,e.stdout):ic("/dev/tty","/dev/stdout"),e.stderr?W("/dev","stderr",null,e.stderr):ic("/dev/tty1","/dev/stderr");var t=kc("/dev/stdin","r");assert(0===t.fd,"invalid handle for stdin ("+t.fd+")"),assert(1===(t=kc("/dev/stdout","w")).fd,"invalid handle for stdout ("+t.fd+")"),assert(2===(t=kc("/dev/stderr","w")).fd,"invalid handle for stderr ("+t.fd+")")}}),db.push(function(){Tb=!1}),H.push(function(){qc=!1;var t=e._fflush;for(t&&t(0),t=0;t<Rb.length;t++){var r=Rb[t];r&&mc(r)}}),e.FS_createFolder=function(e,t,r,i){return V(e=K("string"==typeof e?e:T(e),t),rc(r,i))},e.FS_createPath=function(e,t){e="string"==typeof e?e:T(e);for(var r=t.split("/").reverse();r.length;){var i=r.pop();if(i){var n=K(e,i);try{V(n)}catch(e){}e=n}}return n},e.FS_createDataFile=tc,e.FS_createPreloadedFile=function(n,o,t,a,s,u,h,c,f,l){function r(t){function r(e){l&&l(),c||tc(n,o,e,a,s,f),u&&u(),lb()}var i=!1;e.preloadPlugins.forEach(function(e){!i&&e.canHandle(d)&&(e.handle(t,d,r,function(){h&&h(),lb()}),i=!0)}),i||r(t)}Vc();var d=o?Db(K(n,o)):n;kb(),"string"==typeof t?nd(t,function(e){r(e)},h):r(t)},e.FS_createLazyFile=function(e,t,u,r,i){var n,o;function a(){this.oa=!1,this.Y=[]}if(a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r<t)throw Error("invalid range ("+t+", "+r+") or no bytes requested!");if(o-1<r)throw Error("only "+o+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",u,!1),o!==a&&n.setRequestHeader("Range","bytes="+t+"-"+r),"undefined"!=typeof Uint8Array&&(n.responseType="arraybuffer"),n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.send(null),!(200<=n.status&&n.status<300||304===n.status))throw Error("Couldn't load "+u+". Status: "+n.status);t=void 0!==n.response?new Uint8Array(n.response||[]):hb(n.responseText||"",!0),i[e]=t}if(void 0===s.Y[e])throw Error("doXHR failed!");return s.Y[e]}),this.Wa=o,this.Va=a,this.oa=!0},"undefined"!=typeof XMLHttpRequest){if(!ca)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";n=new a,Object.defineProperty(n,"length",{get:function(){return this.oa||this.Ca(),this.Wa}}),Object.defineProperty(n,"chunkSize",{get:function(){return this.oa||this.Ca(),this.Va}}),o=void 0}else o=u,n=void 0;var s=sc(e,t,r,i);n?s.e=n:o&&(s.e=null,s.url=o),Object.defineProperty(s,"usedBytes",{get:function(){return this.e.length}});var h={};return Object.keys(s.n).forEach(function(e){var t=s.n[e];h[e]=function(){if(!uc(s))throw new L(J.H);return t.apply(null,arguments)}}),h.read=function(e,t,r,i,n){if(!uc(s))throw new L(J.H);if(n>=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o<i;o++)t[r+o]=e[n+o];else for(o=0;o<i;o++)t[r+o]=e.get(n+o);return i},s.n=h,s},e.FS_createLink=function(e,t,r){return ic(r,e=K("string"==typeof e?e:T(e),t))},e.FS_createDevice=W,e.FS_unlink=function(t){var r,e=S(t,{parent:!0}).g,i=Bb(t),n=Nb(e,i);e:{try{r=Nb(e,i)}catch(e){r=e.S;break e}var o=Yb(e,"wx");r=o||(N(r.mode)?J.P:0)}if(r)throw r===J.P&&(r=J.I),new L(r);if(!e.k.unlink)throw new L(J.I);if(n.U)throw new L(J.fa);try{R.willDeletePath&&R.willDeletePath(t)}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+t+"') threw an exception: "+e.message)}if(e.k.unlink(e,i),e=Wb(n.parent.id,n.name),Q[e]===n)Q[e]=n.M;else for(e=Q[e];e;){if(e.M===n){e.M=n.M;break}e=e.M}try{R.onDeletePath&&R.onDeletePath(t)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+t+"') threw an exception: "+e.message)}},cb.unshift(function(){}),H.push(function(){}),da){var fs=require("fs"),Ob=require("path");P.sb()}e.requestFullScreen=function(e,t,r){fd(e,t,r)},e.requestAnimationFrame=function(e){Ic(e)},e.setCanvasSize=function(t,r,i){id(e.canvas,t,r),i||pd()},e.pauseMainLoop=function(){Y=null,Lc++},e.resumeMainLoop=function(){Lc++;var e=Dc,t=Ec;Jc(Fc,0,!1,Kc,!(Fc=null)),Cc(e,t),Y()},e.getUserMedia=function(){window.p||(window.p=navigator.getUserMedia||navigator.mozGetUserMedia),window.p(void 0)},e.createContext=function(e,t,r,i){return bd(e,t,r,i)},Ua=m=n.ja(la),Fa=!0,Va=Ua+$a,Wa=r=n.ja(Va),assert(Wa<t,"TOTAL_MEMORY not big enough for stack");var qd=D([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",3);e.Ya={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:Ya},e.Za={abort:x,assert:assert,invoke_iiii:function(t,r,i,n){try{return e.dynCall_iiii(t,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_viiiii:function(t,r,i,n,o,a){try{e.dynCall_viiiii(t,r,i,n,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_vi:function(t,r){try{e.dynCall_vi(t,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_ii:function(t,r){try{return e.dynCall_ii(t,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_viii:function(t,r,i,n){try{e.dynCall_viii(t,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_v:function(t){try{e.dynCall_v(t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_viiiiii:function(t,r,i,n,o,a,s){try{e.dynCall_viiiiii(t,r,i,n,o,a,s)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_iiiiii:function(t,r,i,n,o,a){try{return e.dynCall_iiiiii(t,r,i,n,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_viiii:function(t,r,i,n,o){try{e.dynCall_viiii(t,r,i,n,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},_pthread_cleanup_pop:function(){assert(pb.level==H.length,"cannot pop if something else added meanwhile!"),H.pop(),pb.level=H.length},___syscall54:function(e,t){wc=t;try{var r=xc(),i=X();switch(i){case 21505:case 21506:return r.tty?0:-J.Q;case 21519:if(!r.tty)return-J.Q;var n=X();return C[n>>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s<o;s++){var u=oc(i,y,C[n+8*s>>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var h=e.Float32Array;var c=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var me=new a(r);var ve=new s(r);var f=new u(r);var l=new h(r);var ee=new c(r);var d=e.byteLength;var be=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var m=t.ABORT|0;var v=t.cttz_i8|0;var b=0;var g=0;var y=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,A=0,P=0.0,M=0,C=0,k=0,I=0.0;var re=0;var R=0;var O=0;var D=0;var L=0;var F=0;var j=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var q=e.Math.sqrt;var H=e.Math.pow;var G=e.Math.cos;var V=e.Math.sin;var Y=e.Math.tan;var W=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ge=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var he=t.invoke_iiii;var ce=t.invoke_viiiii;var fe=t.invoke_vi;var le=t.invoke_ii;var ye=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Ae=t.___syscall6;var Pe=t._emscripten_set_main_loop_timing;var Me=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var ke=t._sbrk;var Ie=t.___cxa_begin_catch;var Re=t._emscripten_memcpy_big;var Oe=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var Fe=t._pthread_once;var je=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var qe=t._pthread_cleanup_push;var He=t._time;var Ge=t.___syscall140;var Ve=t.___syscall146;var Ye=0.0;function We(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);me=new a(e);ve=new s(e);f=new u(e);l=new h(e);ee=new c(e);r=e;return true}function Je(e){e=e|0;var t=0;t=be;be=be+e|0;be=be+15&-16;return t|0}function Ke(){return be|0}function Ze(e){e=e|0;be=e}function Qe(e,t){e=e|0;t=t|0;be=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!b){b=e;g=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0;m=be;be=be+608|0;l=m+88|0;f=m+72|0;u=m+64|0;s=m+48|0;a=m+24|0;o=m;c=m+96|0;d=m+92|0;h=e+4|0;p=e+8|0;if((pe[h>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(c,1100,o)|0;yr(c,m+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(c,1100,a)|0;yr(c,m+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;be=m;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(c,1100,s)|0;yr(c,u)|0}r=ge(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;be=m;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;be=m;return p|0}ki[n&0](a,pe[e>>2]|0,pe[h>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Oi[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(c,1100,f)|0;yr(c,l)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;be=m;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0;h=be;be=be+592|0;u=h+48|0;o=h+24|0;n=h;s=h+72|0;a=h+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;yr(s,h+16|0)|0;u=0;be=h;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;yr(s,h+40|0)|0;u=0;be=h;return u|0}pe[a>>2]=t;i=Oi[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;be=h;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;yr(s,h+64|0)|0;u=i;be=h;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;yr(o,u+16|0)|0;s=0;be=u;return s|0}pe[n>>2]=i;r=Oi[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0<i>>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;yr(o,u+40|0)|0;s=0;be=u;return s|0}if(!(r&7)){s=r;be=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;yr(o,u+64|0)|0;s=r;be=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0;B=be;be=be+960|0;L=B+232|0;D=B+216|0;O=B+208|0;R=B+192|0;I=B+184|0;k=B+168|0;C=B+160|0;M=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;y=B+88|0;g=B+72|0;b=B+64|0;v=B+48|0;f=B+40|0;d=B+24|0;l=B+16|0;c=B;P=B+440|0;F=B+376|0;j=B+304|0;m=B+236|0;if((t|0)==0|i>>>0>11){e=0;be=B;return e|0}pe[e>>2]=t;n=j;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){A=j+((n&255)<<2)|0;pe[A>>2]=(pe[A>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;h=1;a=0;s=-1;u=0;while(1){n=pe[j+(h<<2)>>2]|0;if(!n)pe[e+28+(h+-1<<2)>>2]=0;else{A=h+-1|0;pe[F+(A<<2)>>2]=o;o=n+o|0;w=16-h|0;pe[e+28+(A<<2)>>2]=(o+-1<<w|(1<<w)+-1)+1;pe[e+96+(A<<2)>>2]=u;pe[m+(h<<2)>>2]=u;a=a>>>0>h>>>0?a:h;s=s>>>0<h>>>0?s:h;u=n+u|0}h=h+1|0;if((h|0)==17){A=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[c>>2]=1154;pe[c+4>>2]=644;pe[c+8>>2]=1863;_r(P,1100,c)|0;yr(P,l)|0}if(!(n&7)){Oi[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(P,1100,d)|0;yr(P,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=A;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[j+(n<<2)>>2]|0)){pe[v>>2]=1154;pe[v+4>>2]=2273;pe[v+8>>2]=1261;_r(P,1100,v)|0;yr(P,b)|0}_=m+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[g>>2]=1154;pe[g+4>>2]=2277;pe[g+8>>2]=1274;_r(P,1100,g)|0;yr(P,y)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;y=(n&255)>>>0<i>>>0?i:0;_=e+8|0;pe[_>>2]=y;g=(y|0)!=0;if(g){b=1<<y;n=e+164|0;do{if(b>>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=b;a=e+168|0;n=pe[a>>2]|0;do{if(n){v=pe[n+-4>>2]|0;n=n+-8|0;if(!((v|0)!=0?(v|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(P,1100,x)|0;yr(P,T)|0}if(!(n&7)){Oi[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(P,1100,S)|0;yr(P,E)|0;break}}}while(0);n=b<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=b;pe[o>>2]=~b;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=b<<2;a=o;o=pe[o>>2]|0}}while(0);Wr(o|0,-1,n|0)|0;p=e+176|0;v=1;do{if(pe[j+(v<<2)>>2]|0){t=y-v|0;m=1<<t;o=v+-1|0;s=pe[F+(o<<2)>>2]|0;if(o>>>0>=16){pe[M>>2]=1154;pe[M+4>>2]=1953;pe[M+8>>2]=1737;_r(P,1100,M)|0;yr(P,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-v|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;l=v<<16;do{n=ve[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((me[r+n>>0]|0|0)!=(v|0)){pe[k>>2]=1154;pe[k+4>>2]=2319;pe[k+8>>2]=1303;_r(P,1100,k)|0;yr(P,I)|0}c=s<<t;o=n|l;h=0;do{u=h+c|0;if(u>>>0>=b>>>0){pe[R>>2]=1154;pe[R+4>>2]=2325;pe[R+8>>2]=1337;_r(P,1100,R)|0;yr(P,O)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(P,1100,D)|0;yr(P,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;h=h+1|0}while(h>>>0<m>>>0);s=s+1|0}while(s>>>0<=d>>>0)}}v=v+1|0}while(y>>>0>=v>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(g){while(1){if(!i)break t;n=i+-1|0;if(!(pe[j+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=y+1|0;pe[a>>2]=n;if(n>>>0<=A>>>0){while(1){if(pe[j+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>A>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;be=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=qr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=qr(o)|0;pe[r>>2]=t;r=n;return r|0}function ht(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((me[e>>0]|0)<<8|(me[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((me[e+2>>0]|0)<<8|(me[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((me[e+7>>0]|0)<<16|(me[e+6>>0]|0)<<24|(me[e+8>>0]|0)<<8|(me[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(me[e+12>>0]|0)<<8|(me[e+13>>0]|0);pe[r+8>>2]=(me[e+14>>0]|0)<<8|(me[e+15>>0]|0);pe[r+12>>2]=me[e+16>>0];pe[r+16>>2]=me[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=me[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(me[e+26>>0]|0)<<16|(me[e+25>>0]|0)<<24|(me[e+27>>0]|0)<<8|(me[e+28>>0]|0);pe[r+28>>2]=(me[e+30>>0]|0)<<16|(me[e+29>>0]|0)<<24|(me[e+31>>0]|0)<<8|(me[e+32>>0]|0);r=1;return r|0}function ct(e){e=e|0;Ie(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=be;be=be+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)lt(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;be=o;return}if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;yr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;be=o;return}function lt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0;d=be;be=be+640|0;l=d+112|0;f=d+96|0;c=d+88|0;h=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){be=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;yr(a,n)|0}if(!(t&7)){Oi[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;yr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;yr(a,u)|0}if(!(t&7)){Oi[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[h>>2]=1154;pe[h+4>>2]=2499;pe[h+8>>2]=1516;_r(a,1100,h)|0;yr(a,c)|0;break}}}while(0);if(!(e&7)){Oi[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;be=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;yr(a,l)|0;be=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0;c=be;be=be+560|0;a=c+40|0;s=c+24|0;t=c;o=c+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;yr(o,c+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{h=t+164|0;pe[h>>2]=0;pe[h+4>>2]=0;pe[h+8>>2]=0;pe[h+12>>2]=0}pe[i>>2]=t;h=t;u=pe[e>>2]|0}else{h=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;yr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;h=st(h,u,n,e)|0;be=c;return h|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<<r>>>0<o>>>0&1)|0;e=e>>>0<11?e&255:11;h=st(h,u,n,e)|0;be=c;return h|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0;L=be;be=be+800|0;k=L+256|0;C=L+240|0;M=L+232|0;P=L+216|0;A=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;y=L+120|0;g=L+112|0;b=L+96|0;v=L+88|0;m=L+72|0;f=L+64|0;c=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;O=L+288|0;D=L+264|0;I=mt(e,14)|0;if(!I){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Oi[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(O,1100,n)|0;yr(O,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;be=L;return t|0}lt(i);pe[r>>2]=0;t=1;be=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(I|0)){if(r>>>0<=I>>>0){do{if((pe[t+12>>2]|0)>>>0<I>>>0){if(nt(d,I,(r+1|0)==(I|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;be=L;return t|0}}while(0);Wr((pe[d>>2]|0)+r|0,0,I-r|0)|0}pe[p>>2]=I}Wr(pe[d>>2]|0,0,I|0)|0;l=e+20|0;r=pe[l>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=me[i>>0]|0}r=r+8|0;pe[l>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(O,1100,u)|0;yr(O,s)|0;r=pe[l>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}h=i>>>27;pe[n>>2]=i<<5;pe[l>>2]=r+-5;if((h+-1|0)>>>0>20){t=0;be=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Wr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(h){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[l>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=me[i>>0]|0}r=r+8|0;pe[l>>2]=r;if((r|0)>=33){pe[c>>2]=1154;pe[c+4>>2]=3199;pe[c+8>>2]=1650;_r(O,1100,c)|0;yr(O,f)|0;r=pe[l>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[l>>2]=r+-3;de[u+(me[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(h|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;h=e+16|0;i=0;t:while(1){a=I-i|0;r=vt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[m>>2]=1154;pe[m+4>>2]=903;pe[m+8>>2]=1781;_r(O,1100,m)|0;yr(O,v)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[l>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=me[n>>0]|0}r=r+8|0;pe[l>>2]=r;if((r|0)>=33){pe[b>>2]=1154;pe[b+4>>2]=3199;pe[b+8>>2]=1650;_r(O,1100,b)|0;yr(O,g)|0;r=pe[l>>2]|0}n=n<<32-r|pe[h>>2];pe[h>>2]=n}while((r|0)<3);else n=pe[h>>2]|0;pe[h>>2]=n<<3;pe[l>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[l>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=me[n>>0]|0}r=r+8|0;pe[l>>2]=r;if((r|0)>=33){pe[y>>2]=1154;pe[y+4>>2]=3199;pe[y+8>>2]=1650;_r(O,1100,y)|0;yr(O,_)|0;r=pe[l>>2]|0}n=n<<32-r|pe[h>>2];pe[h>>2]=n}while((r|0)<7);else n=pe[h>>2]|0;pe[h>>2]=n<<7;pe[l>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){R=90;break t}o=pe[l>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=me[r>>0]|0}r=n+8|0;pe[l>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(O,1100,w)|0;yr(O,x)|0;r=pe[l>>2]|0}n=o<<32-r|pe[h>>2];pe[h>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[h>>2]|0;r=o}pe[h>>2]=n<<2;pe[l>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=me[r>>0]|0}r=n+8|0;pe[l>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(O,1100,T)|0;yr(O,S)|0;r=pe[l>>2]|0}n=o<<32-r|pe[h>>2];pe[h>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[h>>2]|0;r=o}pe[h>>2]=n<<6;pe[l>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(O,1100,E)|0;yr(O,A)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[P>>2]=1154;pe[P+4>>2]=903;pe[P+8>>2]=1781;_r(O,1100,P)|0;yr(O,M)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(I>>>0>r>>>0)i=r;else break}if((R|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(O,1100,C)|0;yr(O,k)|0;r=0;break}if((I|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;be=L;return t|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0;c=be;be=be+544|0;s=c+16|0;a=c;o=c+24|0;if(!t){h=0;be=c;return h|0}if(t>>>0<=16){h=bt(e,t)|0;be=c;return h|0}u=bt(e,t+-16|0)|0;h=e+20|0;t=pe[h>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=me[e>>0]|0}t=t+8|0;pe[h>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;yr(o,s)|0;t=pe[h>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[h>>2]=t+-16;h=e>>>16|u<<16;be=c;return h|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0;y=be;be=be+608|0;m=y+88|0;p=y+72|0;l=y+64|0;f=y+48|0;c=y+40|0;d=y+24|0;h=y+16|0;u=y;b=y+96|0;v=pe[t+20>>2]|0;g=e+20|0;s=pe[g>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0<n>>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=me[i>>0]|0}else r=0;pe[g>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(me[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0<n>>>0){i=me[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[g>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[v+16>>2]|0)>>>0){i=pe[(pe[v+168>>2]|0)+(o>>>(32-(pe[v+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(b,1100,u)|0;yr(b,h)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(b,1100,d)|0;yr(b,c)|0}if((me[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(b,1100,f)|0;yr(b,l)|0}}else{i=pe[v+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[v+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[v+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=ve[(pe[v+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(b,1100,p)|0;yr(b,m)|0;g=0;be=y;return g|0}}while(0);pe[a>>2]=pe[a>>2]<<i;pe[g>>2]=(pe[g>>2]|0)-i;g=r;be=y;return g|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0;c=be;be=be+560|0;s=c+40|0;u=c+24|0;r=c;a=c+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;yr(a,c+16|0)|0}h=e+20|0;r=pe[h>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<<t;pe[a>>2]=o;t=s-t|0;pe[h>>2]=t;be=c;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=me[e>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;yr(a,s)|0;r=pe[h>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<<t;pe[i>>2]=s;t=r-t|0;pe[h>>2]=t;be=c;return u|0}function gt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0;p=be;be=be+544|0;l=p+16|0;f=p;c=p+24|0;if((e|0)==0|t>>>0<62){d=0;be=p;return d|0}h=at(300,0)|0;if(!h){d=0;be=p;return d|0}pe[h>>2]=519686845;r=h+4|0;pe[r>>2]=0;i=h+8|0;pe[i>>2]=0;u=h+88|0;n=h+136|0;o=h+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;m=h+184|0;a=h+208|0;s=h+232|0;v=h+252|0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;de[v+12>>0]=0;v=h+268|0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;de[v+12>>0]=0;v=h+284|0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;de[v+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;pe[m+12>>2]=0;pe[m+16>>2]=0;de[m+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((me[e>>0]|0)<<8|(me[e+1>>0]|0)|0)==18552:0)?((me[e+2>>0]|0)<<8|(me[e+3>>0]|0))>>>0>=74:0)?((me[e+7>>0]|0)<<16|(me[e+6>>0]|0)<<24|(me[e+8>>0]|0)<<8|(me[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Pt(h)|0){r=pe[u>>2]|0;if((me[r+39>>0]|0)<<8|(me[r+40>>0]|0)){if(!(Mt(h)|0))break;if(!(Ct(h)|0))break;r=pe[u>>2]|0}if(!((me[r+55>>0]|0)<<8|(me[r+56>>0]|0))){v=h;be=p;return v|0}if(kt(h)|0?It(h)|0:0){v=h;be=p;return v|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;Ft(h);if(!(h&7)){Oi[pe[104>>2]&1](h,0,0,1,pe[27]|0)|0;v=0;be=p;return v|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(c,1100,f)|0;yr(c,l)|0;v=0;be=p;return v|0}return 0}function yt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,h=0,c=0;c=be;be=be+544|0;h=c;u=c+24|0;o=pe[e+88>>2]|0;s=(me[o+70+(n<<2)+1>>0]|0)<<16|(me[o+70+(n<<2)>>0]|0)<<24|(me[o+70+(n<<2)+2>>0]|0)<<8|(me[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(me[o+16>>0]|0)>>>0)o=(me[o+70+(a<<2)+1>>0]|0)<<16|(me[o+70+(a<<2)>>0]|0)<<24|(me[o+70+(a<<2)+2>>0]|0)<<8|(me[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;h=o-s|0;h=_t(e,u,h,t,r,i,n)|0;be=c;return h|0}pe[h>>2]=1154;pe[h+4>>2]=3704;pe[h+8>>2]=1792;_r(u,1100,h)|0;yr(u,c+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;h=o-s|0;h=_t(e,u,h,t,r,i,n)|0;be=c;return h|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,h=0,c=0;c=pe[e+88>>2]|0;u=((me[c+12>>0]|0)<<8|(me[c+13>>0]|0))>>>a;h=((me[c+14>>0]|0)<<8|(me[c+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;h=h>>>0>1?(h+3|0)>>>2:1;c=c+18|0;a=de[c>>0]|0;a=ge(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ge(a,h)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(h+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(me[c>>0]|0|0){case 0:{Rt(e,i,n,a,u,h,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Ot(e,i,n,a,u,h,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,h,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,h,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ht(e,t,r)|0;be=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ht(e,t,r)|0;be=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ht(e,t,r)|0;be=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ht(e,t,r)|0;be=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,h=0;u=be;be=be+576|0;a=u+56|0;o=u+40|0;n=u+64|0;h=u;pe[h>>2]=40;ht(e,t,h)|0;i=(((pe[h+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[h+8>>2]|0)>>>r)+3|0)>>>2;r=h+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;yr(n,a)|0;e=0}h=ge(ge(t,i)|0,e)|0;be=u;return h|0}function At(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0;p=be;be=be+608|0;l=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;c=p+88|0;m=p;f=p+84|0;pe[m>>2]=40;ht(e,t,m)|0;u=(((pe[m+4>>2]|0)>>>n)+3|0)>>>2;m=m+32|0;o=pe[m+4>>2]|0;do{switch(pe[m>>2]|0){case 0:{if(!o)o=8;else h=13;break}case 1:{if(!o)h=12;else h=13;break}case 2:{if(!o)h=12;else h=13;break}case 3:{if(!o)h=12;else h=13;break}case 4:{if(!o)h=12;else h=13;break}case 5:{if(!o)h=12;else h=13;break}case 6:{if(!o)h=12;else h=13;break}case 7:{if(!o)h=12;else h=13;break}case 8:{if(!o)h=12;else h=13;break}case 9:{if(!o)o=8;else h=13;break}default:h=13}}while(0);if((h|0)==12)o=16;else if((h|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(c,1100,a)|0;yr(c,s)|0;o=0}s=ge(o,u)|0;a=gt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)yt(a,f,i,s,n)|0;if(o){be=p;return}if((pe[a>>2]|0)!=519686845){be=p;return}Ft(a);if(!(a&7)){Oi[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;be=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(c,1100,d)|0;yr(c,l)|0;be=p;return}}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(me[n+68>>0]|0)<<8|(me[n+67>>0]|0)<<16|(me[n+69>>0]|0);r=i+t|0;n=(me[n+65>>0]|0)<<8|(me[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((me[t+39>>0]|0)<<8|(me[t+40>>0]|0))){if(!((me[t+55>>0]|0)<<8|(me[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((me[t+55>>0]|0)<<8|(me[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function Mt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0;p=be;be=be+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;l=(me[t+39>>0]|0)<<8|(me[t+40>>0]|0);c=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(l|0)){if(r>>>0<=l>>>0){do{if((pe[e+244>>2]|0)>>>0<l>>>0){if(nt(c,l,(r+1|0)==(l|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;be=p;return d|0}else t=r}while(0);Wr((pe[c>>2]|0)+(t<<2)|0,0,l-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=l}h=e+92|0;r=pe[e+4>>2]|0;i=(me[t+34>>0]|0)<<8|(me[t+33>>0]|0)<<16|(me[t+35>>0]|0);n=r+i|0;t=(me[t+37>>0]|0)<<8|(me[t+36>>0]|0)<<16|(me[t+38>>0]|0);if(!t){d=0;be=p;return d|0}pe[h>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(h,d)|0?(f=d+24|0,pt(h,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;yr(a,u)|0}if(!l)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[c>>2]|0;while(1){i=(vt(h,d)|0)+i&31;n=(vt(h,f)|0)+n&63;o=(vt(h,d)|0)+o&31;t=(vt(h,d)|0)+t|0;a=(vt(h,f)|0)+a&63;e=(vt(h,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(l|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;be=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0;E=be;be=be+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(me[n+47>>0]|0)<<8|(me[n+48>>0]|0);y=e+92|0;t=pe[e+4>>2]|0;r=(me[n+42>>0]|0)<<8|(me[n+41>>0]|0)<<16|(me[n+43>>0]|0);i=t+r|0;n=(me[n+45>>0]|0)<<8|(me[n+44>>0]|0)<<16|(me[n+46>>0]|0);if(!n){S=0;be=E;return S|0}pe[y>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(y,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));g=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(g,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Wr((pe[g>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;yr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;h=w+32|0;c=w+36|0;f=w+40|0;l=w+44|0;d=w+48|0;p=w+52|0;m=w+56|0;v=w+60|0;b=0;r=pe[g>>2]|0;while(1){t=0;do{A=vt(y,S)|0;g=t<<1;P=w+(g<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(A<<2)>>2]|0)&3;g=w+((g|1)<<2)|0;pe[g>>2]=(pe[g>>2]|0)+(pe[T+(A<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(me[1725+(pe[i>>2]|0)>>0]|0)<<2|(me[1725+(pe[w>>2]|0)>>0]|0)|(me[1725+(pe[n>>2]|0)>>0]|0)<<4|(me[1725+(pe[e>>2]|0)>>0]|0)<<6|(me[1725+(pe[o>>2]|0)>>0]|0)<<8|(me[1725+(pe[a>>2]|0)>>0]|0)<<10|(me[1725+(pe[s>>2]|0)>>0]|0)<<12|(me[1725+(pe[u>>2]|0)>>0]|0)<<14|(me[1725+(pe[h>>2]|0)>>0]|0)<<16|(me[1725+(pe[c>>2]|0)>>0]|0)<<18|(me[1725+(pe[f>>2]|0)>>0]|0)<<20|(me[1725+(pe[l>>2]|0)>>0]|0)<<22|(me[1725+(pe[d>>2]|0)>>0]|0)<<24|(me[1725+(pe[p>>2]|0)>>0]|0)<<26|(me[1725+(pe[m>>2]|0)>>0]|0)<<28|(me[1725+(pe[v>>2]|0)>>0]|0)<<30;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0;l=be;be=be+560|0;u=l+16|0;s=l;a=l+48|0;f=l+24|0;n=pe[e+88>>2]|0;c=(me[n+55>>0]|0)<<8|(me[n+56>>0]|0);h=e+92|0;t=pe[e+4>>2]|0;r=(me[n+50>>0]|0)<<8|(me[n+49>>0]|0)<<16|(me[n+51>>0]|0);i=t+r|0;n=(me[n+53>>0]|0)<<8|(me[n+52>>0]|0)<<16|(me[n+54>>0]|0);if(!n){f=0;be=l;return f|0}pe[h>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(h,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(c|0)){if(t>>>0<=c>>>0){do{if((pe[e+276>>2]|0)>>>0<c>>>0)if(nt(o,c,(t+1|0)==(c|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Wr((pe[o>>2]|0)+(t<<1)|0,0,c-t<<1|0)|0}pe[r>>2]=c}if(!c){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;yr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=vt(h,f)|0;r=u+r&255;i=(vt(h,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(c|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;be=l;return f|0}function It(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0;E=be;be=be+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(me[n+63>>0]|0)<<8|(me[n+64>>0]|0);y=e+92|0;t=pe[e+4>>2]|0;r=(me[n+58>>0]|0)<<8|(me[n+57>>0]|0)<<16|(me[n+59>>0]|0);i=t+r|0;n=(me[n+61>>0]|0)<<8|(me[n+60>>0]|0)<<16|(me[n+62>>0]|0);if(!n){S=0;be=E;return S|0}pe[y>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(y,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));g=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0<r>>>0)if(nt(g,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Wr((pe[g>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;yr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;h=w+32|0;c=w+36|0;f=w+40|0;l=w+44|0;d=w+48|0;p=w+52|0;m=w+56|0;v=w+60|0;b=0;r=pe[g>>2]|0;while(1){t=0;do{A=vt(y,S)|0;g=t<<1;P=w+(g<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(A<<2)>>2]|0)&7;g=w+((g|1)<<2)|0;pe[g>>2]=(pe[g>>2]|0)+(pe[T+(A<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);A=me[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(me[1729+(pe[i>>2]|0)>>0]|0)<<3|(me[1729+(pe[w>>2]|0)>>0]|0)|(me[1729+(pe[n>>2]|0)>>0]|0)<<6|(me[1729+(pe[e>>2]|0)>>0]|0)<<9|(me[1729+(pe[o>>2]|0)>>0]|0)<<12|A<<15;P=me[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(me[1729+(pe[s>>2]|0)>>0]|0)<<2|A>>>1|(me[1729+(pe[u>>2]|0)>>0]|0)<<5|(me[1729+(pe[h>>2]|0)>>0]|0)<<8|(me[1729+(pe[c>>2]|0)>>0]|0)<<11|P<<14;$[r+4>>1]=(me[1729+(pe[l>>2]|0)>>0]|0)<<1|P>>>2|(me[1729+(pe[d>>2]|0)>>0]|0)<<4|(me[1729+(pe[p>>2]|0)>>0]|0)<<7|(me[1729+(pe[m>>2]|0)>>0]|0)<<10|(me[1729+(pe[v>>2]|0)>>0]|0)<<13;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0,N=0,U=0,z=0,X=0,q=0,H=0,G=0,V=0,Y=0,W=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,he=0,ce=0,fe=0,le=0;ce=be;be=be+720|0;he=ce+184|0;se=ce+168|0;ae=ce+160|0;oe=ce+144|0;ne=ce+136|0;ie=ce+120|0;re=ce+112|0;ee=ce+96|0;$=ce+88|0;Q=ce+72|0;Z=ce+64|0;K=ce+48|0;J=ce+40|0;ue=ce+24|0;te=ce+16|0;W=ce;V=ce+208|0;Y=ce+192|0;N=e+240|0;U=pe[N>>2]|0;q=e+256|0;H=pe[q>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;G=i>>>2;if(!(r<<24>>24)){be=ce;return 1}z=(s|0)==0;X=s+-1|0;R=(o&1|0)!=0;O=i<<1;D=e+92|0;L=e+116|0;F=e+140|0;j=e+236|0;B=a+-1|0;I=(n&1|0)!=0;k=e+188|0;E=e+252|0;A=G+1|0;P=G+2|0;M=G+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){g=x&1;u=(g|0)==0;b=(g<<5^32)+-16|0;g=(g<<1^2)+-1|0;_=u?a:-1;h=u?0:B;e=(x|0)==(X|0);y=R&e;if((h|0)!=(_|0)){v=R&e^1;m=u?w:w+C|0;while(1){if((n|0)==1)n=vt(D,L)|0|512;p=n&7;n=n>>>3;u=me[1823+p>>0]|0;e=0;do{l=(vt(D,F)|0)+o|0;d=l-U|0;o=d>>31;o=o&l|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[W>>2]=1154;pe[W+4>>2]=903;pe[W+8>>2]=1781;_r(V,1100,W)|0;yr(V,te)|0}pe[Y+(e<<2)>>2]=pe[(pe[j>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0<u>>>0);d=I&(h|0)==(B|0);if(y|d){l=0;do{c=ge(l,i)|0;e=m+c|0;u=(l|0)==0|v;f=l<<1;le=(vt(D,k)|0)+r|0;fe=le-H|0;r=fe>>31;r=r&le|fe&~r;do{if(d){if(!u){fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;break}pe[e>>2]=pe[Y+((me[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(V,1100,oe)|0;yr(V,ae)|0}pe[m+(c+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r}else{if(!u){fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;break}pe[e>>2]=pe[Y+((me[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(V,1100,ie)|0;yr(V,ne)|0}pe[m+(c+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;pe[m+(c+8)>>2]=pe[Y+((me[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(V,1100,se)|0;yr(V,he)|0}pe[m+(c+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);l=l+1|0}while((l|0)!=2)}else{pe[m>>2]=pe[Y+((me[1831+(p<<2)>>0]|0)<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(V,1100,ue)|0;yr(V,J)|0}pe[m+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[m+8>>2]=pe[Y+((me[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(V,1100,K)|0;yr(V,Z)|0}pe[m+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[m+(G<<2)>>2]=pe[Y+((me[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(V,1100,Q)|0;yr(V,$)|0}pe[m+(A<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[m+(P<<2)>>2]=pe[Y+((me[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(V,1100,ee)|0;yr(V,re)|0}pe[m+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}h=h+g|0;if((h|0)==(_|0))break;else m=m+b|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+O|0}}S=S+1|0}while((S|0)!=(T|0));be=ce;return 1}function Ot(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0,N=0,U=0,z=0,X=0,q=0,H=0,G=0,V=0,Y=0,W=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,he=0,ce=0,fe=0,le=0;fe=be;be=be+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;ce=fe+24|0;he=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;q=e+256|0;Z=pe[q>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(me[r+63>>0]|0)<<8|(me[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=fe;return 1}X=(s|0)==0;H=s+-1|0;G=i<<1;V=e+92|0;Y=e+116|0;W=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;j=(o&1|0)==0;I=e+288|0;R=e+284|0;O=e+252|0;D=e+140|0;L=e+236|0;F=e+164|0;C=e+268|0;k=W<<5;P=r&255;r=0;n=0;o=0;e=0;u=1;M=0;do{if(!X){E=pe[t+(M<<2)>>2]|0;A=0;while(1){T=A&1;h=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=h?a:-1;c=h?0:W;if((c|0)!=(S|0)){w=j|(A|0)!=(H|0);_=h?E:E+k|0;while(1){if((u|0)==1)u=vt(V,Y)|0|512;y=u&7;u=u>>>3;f=me[1823+y>>0]|0;h=0;do{b=(vt(V,F)|0)+n|0;g=b-$|0;n=g>>31;n=n&b|g&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;yr(te,he)|0}pe[ee+(h<<2)>>2]=ve[(pe[C>>2]|0)+(n<<1)>>1];h=h+1|0}while(h>>>0<f>>>0);h=0;do{b=(vt(V,D)|0)+e|0;g=b-U|0;e=g>>31;e=e&b|g&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[ce>>2]=1154;pe[ce+4>>2]=903;pe[ce+8>>2]=1781;_r(te,1100,ce)|0;yr(te,ne)|0}pe[re+(h<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];h=h+1|0}while(h>>>0<f>>>0);g=B|(c|0)!=(W|0);v=0;b=_;while(1){m=w|(v|0)==0;p=v<<1;l=0;d=b;while(1){f=(vt(V,J)|0)+r|0;h=f-z|0;r=h>>31;r=r&f|h&~r;h=(vt(V,K)|0)+o|0;f=h-Z|0;o=f>>31;o=o&h|f&~o;if((g|(l|0)==0)&m){h=me[l+p+(1831+(y<<2))>>0]|0;f=r*3|0;if((pe[I>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;yr(te,ae)|0}le=pe[R>>2]|0;pe[d>>2]=(ve[le+(f<<1)>>1]|0)<<16|pe[ee+(h<<2)>>2];pe[d+4>>2]=(ve[le+(f+2<<1)>>1]|0)<<16|(ve[le+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(h<<2)>>2];if((pe[q>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;yr(te,ue)|0}pe[d+12>>2]=pe[(pe[O>>2]|0)+(o<<2)>>2]}l=l+1|0;if((l|0)==2)break;else d=d+16|0}v=v+1|0;if((v|0)==2)break;else b=b+i|0}c=c+T|0;if((c|0)==(S|0))break;else _=_+x|0}}A=A+1|0;if((A|0)==(s|0))break;else E=E+G|0}}M=M+1|0}while((M|0)!=(P|0));be=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0,N=0,U=0,z=0,X=0,q=0,H=0,G=0,V=0,Y=0,W=0,J=0,K=0,Z=0;Z=be;be=be+608|0;W=Z+64|0;Y=Z+48|0;V=Z+40|0;K=Z+24|0;J=Z+16|0;G=Z;H=Z+88|0;q=Z+72|0;O=e+272|0;D=pe[O>>2]|0;r=pe[e+88>>2]|0;L=(me[r+63>>0]|0)<<8|(me[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=Z;return 1}F=(s|0)==0;j=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;R=(o&1|0)==0;C=e+288|0;k=e+284|0;I=e+164|0;P=e+268|0;M=z<<4;A=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!F){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;y=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){g=R|(T|0)!=(j|0);b=n?x:x+M|0;while(1){if((e|0)==1)e=vt(N,U)|0|512;v=e&7;e=e>>>3;h=me[1823+v>>0]|0;n=0;do{p=(vt(N,I)|0)+o|0;m=p-D|0;o=m>>31;o=o&p|m&~o;if((pe[O>>2]|0)>>>0<=o>>>0){pe[G>>2]=1154;pe[G+4>>2]=903;pe[G+8>>2]=1781;_r(H,1100,G)|0;yr(H,J)|0}pe[q+(n<<2)>>2]=ve[(pe[P>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0<h>>>0);m=(u|0)==(z|0)&E;d=0;p=b;while(1){l=g|(d|0)==0;f=d<<1;n=(vt(N,X)|0)+r|0;c=n-L|0;h=c>>31;h=h&n|c&~h;if(l){r=me[1831+(v<<2)+f>>0]|0;n=h*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(H,1100,K)|0;yr(H,V)|0}c=pe[k>>2]|0;pe[p>>2]=(ve[c+(n<<1)>>1]|0)<<16|pe[q+(r<<2)>>2];pe[p+4>>2]=(ve[c+(n+2<<1)>>1]|0)<<16|(ve[c+(n+1<<1)>>1]|0)}c=p+8|0;n=(vt(N,X)|0)+h|0;h=n-L|0;r=h>>31;r=r&n|h&~r;if(!(m|l^1)){n=me[(f|1)+(1831+(v<<2))>>0]|0;h=r*3|0;if((pe[C>>2]|0)>>>0<=h>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(H,1100,Y)|0;yr(H,W)|0}l=pe[k>>2]|0;pe[c>>2]=(ve[l+(h<<1)>>1]|0)<<16|pe[q+(n<<2)>>2];pe[p+12>>2]=(ve[l+(h+2<<1)>>1]|0)<<16|(ve[l+(h+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else b=b+y|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(A|0));be=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0,N=0,U=0,z=0,X=0,q=0,H=0,G=0,V=0,Y=0,W=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=be;be=be+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(me[r+63>>0]|0)<<8|(me[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=ae;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;W=e+212|0;B=(n&1|0)==0;j=(o&1|0)==0;D=e+288|0;L=e+284|0;F=e+164|0;R=e+268|0;O=Y<<5;k=r&255;r=0;n=0;o=0;e=0;u=1;I=0;do{if(!X){M=pe[t+(I<<2)>>2]|0;C=0;while(1){A=C&1;h=(A|0)==0;E=(A<<6^64)+-32|0;A=(A<<1^2)+-1|0;P=h?a:-1;c=h?0:Y;if((c|0)!=(P|0)){S=j|(C|0)!=(q|0);T=h?M:M+O|0;while(1){if((u|0)==1)u=vt(G,V)|0|512;x=u&7;u=u>>>3;f=me[1823+x>>0]|0;h=0;do{_=(vt(G,F)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;yr(Z,ne)|0}pe[J+(h<<2)>>2]=ve[(pe[R>>2]|0)+(e<<1)>>1];h=h+1|0}while(h>>>0<f>>>0);h=0;do{_=(vt(G,F)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;yr(Z,$)|0}pe[K+(h<<2)>>2]=ve[(pe[R>>2]|0)+(n<<1)>>1];h=h+1|0}while(h>>>0<f>>>0);w=B|(c|0)!=(Y|0);y=0;_=T;while(1){g=S|(y|0)==0;b=y<<1;m=0;v=_;while(1){p=(vt(G,W)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(vt(G,W)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(m|0)==0)&g){d=me[m+b+(1831+(x<<2))>>0]|0;p=o*3|0;h=pe[D>>2]|0;if(h>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;yr(Z,te)|0;h=pe[D>>2]|0}f=pe[L>>2]|0;l=r*3|0;if(h>>>0>l>>>0)h=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;yr(Z,ie)|0;h=pe[L>>2]|0}pe[v>>2]=(ve[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[v+4>>2]=(ve[f+(p+2<<1)>>1]|0)<<16|(ve[f+(p+1<<1)>>1]|0);pe[v+8>>2]=(ve[h+(l<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[v+12>>2]=(ve[h+(l+2<<1)>>1]|0)<<16|(ve[h+(l+1<<1)>>1]|0)}m=m+1|0;if((m|0)==2)break;else v=v+16|0}y=y+1|0;if((y|0)==2)break;else _=_+i|0}c=c+A|0;if((c|0)==(P|0))break;else T=T+E|0}}C=C+1|0;if((C|0)==(s|0))break;else M=M+H|0}}I=I+1|0}while((I|0)!=(k|0));be=ae;return 1}function Ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0;l=be;be=be+608|0;f=l+88|0;c=l+72|0;u=l+64|0;s=l+48|0;o=l+40|0;a=l+24|0;n=l+16|0;i=l;h=l+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(h,1100,i)|0;yr(h,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(h,1100,a)|0;yr(h,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(h,1100,s)|0;yr(h,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=l;return}if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(h,1100,c)|0;yr(h,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=l;return}function jt(e,t){e=e|0;t=t|0;var r=0;r=be;be=be+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;br(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=be;be=be+16|0;if(!(Fe(200,2)|0)){t=De(pe[49]|0)|0;be=e;return t|0}else jt(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=be;be=be+16|0;Ii[e&3]();jt(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;return}function Vt(e){e=e|0;Nt(e);return}function Yt(e){e=e|0;Nt(e);return}function Wt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=be;be=be+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;be=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0;d=be;be=be+64|0;l=d;f=pe[e>>2]|0;c=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[l>>2]=r;pe[l+4>>2]=e;pe[l+8>>2]=t;pe[l+12>>2]=i;i=l+16|0;e=l+20|0;t=l+24|0;n=l+28|0;o=l+32|0;a=l+40|0;s=(f|0)==(r|0);u=i;h=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(h|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[l+48>>2]=1;Ri[pe[(pe[r>>2]|0)+20>>2]&3](r,l,c,c,1,0);i=(pe[t>>2]|0)==1?c:0}else{Pi[pe[(pe[f>>2]|0)+24>>2]&3](f,l,c,1,0);switch(pe[l+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);be=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Pi[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ri[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ri[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+16|0;i=n;pe[i>>2]=pe[r>>2];e=Ai[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];be=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=be;be=be+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];jt(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Ai[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;jt(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;jt(2327,s)}}jt(2406,a)}function sr(){var e=0;e=be;be=be+16|0;if(!(je(196,6)|0)){be=e;return}else jt(2179,e)}function ur(e){e=e|0;var t=0;t=be;be=be+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){be=t;return}else jt(2229,t)}function hr(e){e=e|0;var t=0,r=0;t=0;while(1){if((me[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function cr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=cr()|0;pe[t>>2]=0-e;e=-1}return e|0}function lr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+lr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +lr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=cr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function mr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function vr(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Or(e)|0;break}r=(Sr(e)|0)==0;t=Or(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=vr(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Or(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function br(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Ar(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Ar(t,e)|0}}while(0);return r|0}function gr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Ir(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0<t>>>0){i=Ai[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Ai[pe[r+36>>2]&7](r,e,i)|0)>>>0<i>>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function yr(e,t){e=e|0;t=t|0;var r=0,i=0;r=be;be=be+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;be=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=be;be=be+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;be=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0;m=be;be=be+224|0;f=m+120|0;p=m+80|0;d=m;l=m+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)h=Sr(e)|0;else h=0;r=pe[e>>2]|0;c=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=l;a=e+28|0;pe[a>>2]=l;s=e+20|0;pe[s>>2]=l;pe[r>>2]=80;u=e+16|0;pe[u>>2]=l+80;i=Dr(e,t,f,d,p)|0;if(o){Ai[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|c;if(h)Er(e);r=(r&32|0)==0?i:-1}be=m;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0,c=0;c=be;be=be+128|0;n=c+112|0;h=c;o=h;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=cr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[h+48>>2]=u;e=h+20|0;pe[e>>2]=n;pe[h+44>>2]=n;t=n+u|0;n=h+16|0;pe[n>>2]=t;pe[h+28>>2]=t;t=wr(h,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}be=c;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Ar(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Ir(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0<n>>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Ai[pe[e+36>>2]&7](e,s,1)|0)==1)r=me[s>>0]|0;else r=-1}}while(0);be=u;return r|0}function Pr(e){e=e|0;var t=0,r=0;t=be;be=be+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Ae(6,r|0)|0)|0;be=t;return e|0}function Mr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=be;be=be+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(Ge(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;be=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0;p=be;be=be+48|0;f=p+16|0;c=p;i=p+32|0;l=e+28|0;n=pe[l>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;h=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ve(146,f|0)|0)|0}else{qe(7,e|0);pe[c>>2]=pe[u>>2];pe[c+4>>2]=i;pe[c+8>>2]=t;a=fr(Ve(146,c|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[l>>2]=(pe[l>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[h>>2]|0;pe[l>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[h>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[l>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[l>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}be=p;return r|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;be=n;return i|0}function Ir(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Rr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ge(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Or(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Ai[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0<n>>>0)Ai[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,h=0.0,c=0,f=0,l=0,d=0,p=0.0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0,N=0,U=0,z=0,X=0,q=0,H=0,G=0,V=0,Y=0,W=0,J=0,K=0,Z=0,Q=0;Q=be;be=be+624|0;Y=Q+24|0;J=Q+16|0;W=Q+588|0;X=Q+576|0;V=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;k=(e|0)!=0;I=N+40|0;B=I;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;q=W;H=z;G=H-q|0;R=-2-q|0;O=H+2|0;D=Y+288|0;L=W+9|0;F=L;j=W+8|0;o=0;m=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=cr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[m>>0]|0;if(!(a<<24>>24)){C=245;break}else s=m;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}M=s+1|0;a=de[M>>0]|0;s=M}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);b=s-m|0;if(k?(pe[e>>2]&32|0)==0:0)gr(m,b,e)|0;if((s|0)!=(m|0)){m=a;a=b;continue}c=a+1|0;s=de[c>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){M=(de[a+2>>0]|0)==36;c=M?a+3|0:c;s=de[c>>0]|0;d=M?u:-1;t=M?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<<a+-32&75913)){f=u;a=c;break t}u=1<<(s<<24>>24)+-32|u;c=c+1|0;s=de[c>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=c;break}}}else{f=0;a=c}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!k){v=f;a=u;t=0;M=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){v=f|8192;M=0-s|0}else{v=f;M=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{v=f;M=s}}else{v=f;M=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){c=(s<<24>>24)+-48|0;if(c>>>0<10){a=u;s=0}else{a=u;c=0;break}while(1){s=(s*10|0)+c|0;a=a+1|0;c=(de[a>>0]|0)+-48|0;if(c>>>0>=10){c=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;c=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(k){a=(pe[r>>2]|0)+(4-1)&~(4-1);c=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;c=0}}else c=-1}while(0);l=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(l*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;l=f}else{P=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;E=i+(d<<3)|0;A=pe[E+4>>2]|0;C=V;pe[C>>2]=pe[E>>2];pe[C+4>>2]=A;C=52;break}if(!k){o=0;break e}jr(V,f,r)}}while(0);if((C|0)==52?(C=0,!k):0){m=P;a=b;continue}d=de[a>>0]|0;d=(l|0)!=0&(d&15|0)==3?d&-33:d;u=v&-65537;A=(v&8192|0)==0?v:u;t:do{switch(d|0){case 110:switch(l|0){case 0:{pe[pe[V>>2]>>2]=o;m=P;a=b;continue e}case 1:{pe[pe[V>>2]>>2]=o;m=P;a=b;continue e}case 2:{m=pe[V>>2]|0;pe[m>>2]=o;pe[m+4>>2]=((o|0)<0)<<31>>31;m=P;a=b;continue e}case 3:{$[pe[V>>2]>>1]=o;m=P;a=b;continue e}case 4:{de[pe[V>>2]>>0]=o;m=P;a=b;continue e}case 6:{pe[pe[V>>2]>>2]=o;m=P;a=b;continue e}case 7:{m=pe[V>>2]|0;pe[m>>2]=o;pe[m+4>>2]=((o|0)<0)<<31>>31;m=P;a=b;continue e}default:{m=P;a=b;continue e}}case 112:{l=A|8;c=c>>>0>8?c:8;d=120;C=64;break}case 88:case 120:{l=A;C=64;break}case 111:{u=V;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=I;else{a=I;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(A&8)){s=A;l=0;f=5839;C=77}else{l=B-a+1|0;s=A;c=(c|0)<(l|0)?l:c;l=0;f=5839;C=77}break}case 105:case 100:{s=V;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Yr(0,0,a|0,s|0)|0;s=re;u=V;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(A&2048)){f=A&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=V;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[V>>2];m=N;s=1;l=0;d=5839;a=I;break}case 109:{a=cr()|0;a=hr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[V>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[V>>2];pe[U>>2]=0;pe[V>>2]=Z;c=-1;C=86;break}case 83:{if(!c){Nr(e,32,M,0,A);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{h=+ee[V>>3];pe[J>>2]=0;ee[te>>3]=h;if((pe[te+4>>2]|0)>=0)if(!(A&2048)){E=A&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{h=-h;S=1;E=5856}ee[te>>3]=h;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(h,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){m=d&32;b=(m|0)==0?E:E+9|0;v=S|2;a=12-c|0;do{if(!(c>>>0>11|(a|0)==0)){h=8.0;do{a=a+-1|0;h=h*16.0}while((a|0)!=0);if((de[b>>0]|0)==45){h=-(h+(-p-h));break}else{h=p+h-h;break}}else h=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;l=a+-2|0;de[l>>0]=d+15;f=(c|0)<1;u=(A&8|0)==0;s=W;while(1){E=~~h;a=s+1|0;de[s>>0]=me[5823+E>>0]|m;h=(h-+(E|0))*16.0;do{if((a-q|0)==1){if(u&(f&h==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(h!=0.0))break;else s=a}c=(c|0)!=0&(R+a|0)<(c|0)?O+c-l|0:G-l+a|0;u=c+v|0;Nr(e,32,M,u,A);if(!(pe[e>>2]&32))gr(b,v,e)|0;Nr(e,48,M,u,A^65536);a=a-q|0;if(!(pe[e>>2]&32))gr(W,a,e)|0;s=H-l|0;Nr(e,48,c-(a+s)|0,0,0);if(!(pe[e>>2]&32))gr(l,s,e)|0;Nr(e,32,M,u,A^8192);a=(u|0)<(M|0)?M:u;break}a=(c|0)<0?6:c;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;h=p*268435456.0}else{h=p;s=pe[J>>2]|0}T=(s|0)<0?Y:D;x=T;s=T;do{_=~~h>>>0;pe[s>>2]=_;s=s+4|0;h=(h-+(_>>>0))*1.0e9}while(h!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){l=(s|0)>29?29:s;c=u+-4|0;do{if(c>>>0<f>>>0)c=f;else{s=0;do{_=Kr(pe[c>>2]|0,0,l|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;y=ai(_|0,s|0,1e9,0)|0;pe[c>>2]=y;s=oi(_|0,s|0,1e9,0)|0;c=c+-4|0}while(c>>>0>=f>>>0);if(!s){c=f;break}c=f+-4|0;pe[c>>2]=s}}while(0);while(1){if(u>>>0<=c>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-l|0;pe[J>>2]=s;if((s|0)>0)f=c;else break}}else c=T;if((s|0)<0){b=((a+25|0)/9|0)+1|0;g=(w|0)==102;m=c;while(1){v=0-s|0;v=(v|0)>9?9:v;do{if(m>>>0<u>>>0){s=(1<<v)+-1|0;f=1e9>>>v;c=0;l=m;do{_=pe[l>>2]|0;pe[l>>2]=(_>>>v)+c;c=ge(_&s,f)|0;l=l+4|0}while(l>>>0<u>>>0);s=(pe[m>>2]|0)==0?m+4|0:m;if(!c){c=s;break}pe[u>>2]=c;c=s;u=u+4|0}else c=(pe[m>>2]|0)==0?m+4|0:m}while(0);s=g?T:c;u=(u-s>>2|0)>(b|0)?s+(b<<2)|0:u;s=(pe[J>>2]|0)+v|0;pe[J>>2]=s;if((s|0)>=0){m=c;break}else m=c}}else m=c;do{if(m>>>0<u>>>0){s=(x-m>>2)*9|0;f=pe[m>>2]|0;if(f>>>0<10)break;else c=10;do{c=c*10|0;s=s+1|0}while(f>>>0>=c>>>0)}else s=0}while(0);y=(w|0)==103;_=(a|0)!=0;c=a-((w|0)!=102?s:0)+((_&y)<<31>>31)|0;if((c|0)<(((u-x>>2)*9|0)+-9|0)){l=c+9216|0;g=(l|0)/9|0;c=T+(g+-1023<<2)|0;l=((l|0)%9|0)+1|0;if((l|0)<9){f=10;do{f=f*10|0;l=l+1|0}while((l|0)!=9)}else f=10;v=pe[c>>2]|0;b=(v>>>0)%(f>>>0)|0;if((b|0)==0?(T+(g+-1022<<2)|0)==(u|0):0)f=m;else C=163;do{if((C|0)==163){C=0;p=(((v>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;l=(f|0)/2|0;do{if(b>>>0<l>>>0)h=.5;else{if((b|0)==(l|0)?(T+(g+-1022<<2)|0)==(u|0):0){h=1.0;break}h=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;h=-h}}while(0);l=v-b|0;pe[c>>2]=l;if(!(p+h!=p)){f=m;break}w=l+f|0;pe[c>>2]=w;if(w>>>0>999999999){s=m;while(1){f=c+-4|0;pe[c>>2]=0;if(f>>>0<s>>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)c=f;else{m=s;c=f;break}}}s=(x-m>>2)*9|0;l=pe[m>>2]|0;if(l>>>0<10){f=m;break}else f=10;do{f=f*10|0;s=s+1|0}while(l>>>0>=f>>>0);f=m}}while(0);w=c+4|0;m=f;u=u>>>0>w>>>0?w:u}b=0-s|0;while(1){if(u>>>0<=m>>>0){g=0;w=u;break}c=u+-4|0;if(!(pe[c>>2]|0))u=c;else{g=1;w=u;break}}do{if(y){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=A&8;if(u)break;do{if(g){u=pe[w+-4>>2]|0;if(!u){c=9;break}if(!((u>>>0)%10|0)){f=10;c=0}else{c=0;break}do{f=f*10|0;c=c+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else c=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-c|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-c|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=A&8}while(0);v=a|u;f=(v|0)!=0&1;l=(d|32|0)==102;if(l){s=(s|0)>0?s:0;d=0}else{c=(s|0)<0?b:s;c=Br(c,((c|0)<0)<<31>>31,z)|0;if((H-c|0)<2)do{c=c+-1|0;de[c>>0]=48}while((H-c|0)<2);de[c+-1>>0]=(s>>31&2)+43;x=c+-2|0;de[x>>0]=d;s=H-x|0;d=x}b=S+1+a+f+s|0;Nr(e,32,M,b,A);if(!(pe[e>>2]&32))gr(E,S,e)|0;Nr(e,48,M,b,A^65536);do{if(l){c=m>>>0>T>>>0?T:m;s=c;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(c|0)){if((u|0)!=(L|0))break;de[j>>0]=48;u=j}else{if(u>>>0<=W>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>W>>>0)}}while(0);if(!(pe[e>>2]&32))gr(u,F-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(v){if(pe[e>>2]&32)break;gr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0<w>>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>W>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>W>>>0);if(!(pe[e>>2]&32))gr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0<w>>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{l=g?w:m+4|0;if((a|0)>-1){f=(u|0)==0;c=m;do{s=Br(pe[c>>2]|0,0,L)|0;if((s|0)==(L|0)){de[j>>0]=48;s=j}do{if((c|0)==(m|0)){u=s+1|0;if(!(pe[e>>2]&32))gr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}gr(5891,1,e)|0;s=u}else{if(s>>>0<=W>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>W>>>0)}}while(0);u=F-s|0;if(!(pe[e>>2]&32))gr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;c=c+4|0}while(c>>>0<l>>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;gr(d,H-d|0,e)|0}}while(0);Nr(e,32,M,b,A^8192);a=(b|0)<(M|0)?M:b}else{l=(d&32|0)!=0;f=h!=h|0.0!=0.0;s=f?0:S;c=s+3|0;Nr(e,32,M,c,u);a=pe[e>>2]|0;if(!(a&32)){gr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))gr(f?l?5883:5887:l?5875:5879,3,e)|0;Nr(e,32,M,c,A^8192);a=(c|0)<(M|0)?M:c}}while(0);m=P;continue e}default:{u=A;s=c;l=0;d=5839;a=I}}}while(0);t:do{if((C|0)==64){u=V;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=I;do{a=a+-1|0;de[a>>0]=me[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=V;if((l&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=l;l=0;f=5839;C=77}else{s=l;l=2;f=5839+(d>>4)|0;C=77}}else{a=I;s=l;l=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,I)|0;s=A;l=u;C=77}else if((C|0)==82){C=0;A=Rr(a,0,c)|0;E=(A|0)==0;m=a;s=E?c:A-a|0;l=0;d=5839;a=E?a+c|0:A}else if((C|0)==86){C=0;s=0;a=0;f=pe[V>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=mr(K,u)|0;if((a|0)<0|a>>>0>(c-s|0)>>>0)break;s=a+s|0;if(c>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,M,s,A);if(!s){a=0;C=98}else{u=0;c=pe[V>>2]|0;while(1){a=pe[c>>2]|0;if(!a){a=s;C=98;break t}a=mr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))gr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else c=c+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,M,a,A^8192);m=P;a=(M|0)>(a|0)?M:a;continue}if((C|0)==77){C=0;u=(c|0)>-1?s&-65537:s;s=V;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((c|0)!=0|s){s=(s&1^1)+(B-a)|0;m=a;s=(c|0)>(s|0)?c:s;d=f;a=I}else{m=I;s=0;d=f;a=I}}f=a-m|0;s=(s|0)<(f|0)?f:s;c=l+s|0;a=(M|0)<(c|0)?c:M;Nr(e,32,a,c,u);if(!(pe[e>>2]&32))gr(d,l,e)|0;Nr(e,48,a,c,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))gr(m,f,e)|0;Nr(e,32,a,c,u^8192);m=P}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;jr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);be=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=be;be=be+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Wr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){gr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;gr(a,n,e)|0}}while(0);be=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<<e)}while(0);j=e<<3;pe[n+4>>2]=j|3;j=n+(j|4)|0;pe[j>>2]=pe[j>>2]|1;j=o;return j|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<<e;i=r<<e&(i|0-i);i=(i&0-i)+-1|0;u=i>>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;h=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<<e);h=a}}while(0);j=e<<3;a=j-d|0;pe[o+4>>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+j>>2]=a;if(h){n=pe[156]|0;r=h>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<<r;if(e&r){e=644+(t+2<<2)|0;t=pe[e>>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{c=e;f=t}}else{pe[151]=e|r;c=644+(t+2<<2)|0;f=i}pe[c>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;j=u;return j|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;F=r>>>12&16;r=r>>>F;L=r>>>5&8;r=r>>>L;j=r>>>2&4;r=r>>>j;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|F|j|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;j=e>>>0<r>>>0;r=j?e:r;e=t;i=j?t:i}o=pe[155]|0;if(i>>>0<o>>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){l=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0<o>>>0)Xe();else{pe[e>>2]=0;l=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0<o>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;l=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=l;if(!l){pe[152]=pe[152]&~(1<<t);break}}else{if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=l;else pe[a+20>>2]=l;if(!l)break}e=pe[155]|0;if(l>>>0<e>>>0)Xe();pe[l+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0<e>>>0)Xe();else{pe[l+16>>2]=t;pe[t+24>>2]=l;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=t;pe[t+24>>2]=l;break}}}while(0);if(u>>>0<16){j=u+d|0;pe[i+4>>2]=j|3;j=i+(j+4)|0;pe[j>>2]=pe[j>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<<r;if(e&r){t=644+(t+2<<2)|0;e=pe[t>>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;m=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;m=n}pe[p>>2]=o;pe[m+12>>2]=o;pe[o+8>>2]=m;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}j=i+8|0;return j|0}else m=d}else m=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;c=pe[152]|0;if(c){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)h=31;else{m=(e+1048320|0)>>>16&8;_=e<<m;p=(_+520192|0)>>>16&4;_=_<<p;h=(_+245760|0)>>>16&2;h=14-(p|m|h)+(_<<h>>>15)|0;h=f>>>(h+7|0)&1|h<<1}else h=0;e=pe[908+(h<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((h|0)==31?0:25-(h>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0<a>>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<<h;e=c&(e|0-e);if(!e){m=f;break}e=(e&0-e)+-1|0;l=e>>>12&16;e=e>>>l;c=e>>>5&8;e=e>>>c;p=e>>>2&4;e=e>>>p;m=e>>>1&2;e=e>>>m;n=e>>>1&1;n=pe[908+((c|l|p|m|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;m=(pe[o+4>>2]&-8)-f|0;n=m>>>0<r>>>0;r=n?m:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0<n>>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0<n>>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0<n>>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<<t);break}}else{if(o>>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0<e>>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0<e>>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<<t;if(r&t){t=644+(e+2<<2)|0;e=pe[t>>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{b=t;g=e}}else{pe[151]=r|t;b=644+(e+2<<2)|0;g=i}pe[b>>2]=a;pe[g+12>>2]=a;pe[u+(f+8)>>2]=g;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{F=(t+1048320|0)>>>16&8;j=t<<F;L=(j+520192|0)>>>16&4;j=j<<L;i=(j+245760|0)>>>16&2;i=14-(L|F|i)+(j<<i>>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<<i;if(!(e&r)){pe[152]=e|r;pe[t>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&T>>>0>=j>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{j=s+f|0;pe[u+4>>2]=j|3;j=u+(j+4)|0;pe[j>>2]=pe[j>>2]|1}}while(0);j=u+8|0;return j|0}else m=f}else m=f}else m=-1}while(0);r=pe[153]|0;if(r>>>0>=m>>>0){t=r-m|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+m;pe[153]=t;pe[e+(m+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=m|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;j=e+(r+4)|0;pe[j>>2]=pe[j>>2]|1}j=e+8|0;return j|0}e=pe[154]|0;if(e>>>0>m>>>0){F=e-m|0;pe[154]=F;j=pe[157]|0;pe[157]=j+m;pe[j+(m+4)>>2]=F|1;pe[j+4>>2]=m|3;j=j+8|0;return j|0}do{if(!(pe[269]|0)){e=Oe(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(He(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=m+48|0;s=pe[271]|0;h=m+47|0;a=s+h|0;s=0-s|0;c=a&s;if(c>>>0<=m>>>0){j=0;return j|0}e=pe[261]|0;if((e|0)!=0?(g=pe[259]|0,T=g+c|0,T>>>0<=g>>>0|T>>>0>e>>>0):0){j=0;return j|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(v=n+4|0,(r+(pe[v>>2]|0)|0)>>>0>e>>>0):0){o=n;e=v;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=ke(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=ke(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=c;else r=c-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>m>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=ke(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(y=pe[271]|0,y=h-r+y&0-y,y>>>0<2147483647):0)if((ke(y|0)|0)==(-1|0)){ke(o|0)|0;break t}else{r=y+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?c>>>0<2147483647:0)?(w=ke(c|0)|0,x=ke(0)|0,w>>>0<x>>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(m+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){A=e;P=r;M=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0<w>>>0&a>>>0>=A>>>0:0){pe[P>>2]=M+p;j=(pe[154]|0)+p|0;F=a+8|0;F=(F&7|0)==0?0:0-F&7;L=j-F|0;pe[157]=a+F;pe[154]=L;pe[a+(F+4)>>2]=L|1;pe[a+(j+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0<e>>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;l=r+4|0;pe[l>>2]=(pe[l>>2]|0)+p;l=w+8|0;l=(l&7|0)==0?0:0-l&7;h=w+(p+8)|0;h=(h&7|0)==0?0:0-h&7;t=w+(h+p)|0;f=l+m|0;d=w+f|0;c=t-(w+l)-m|0;pe[w+(l+4)>>2]=m|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){j=(pe[153]|0)+c|0;pe[153]=j;pe[156]=d;pe[w+(f+4)>>2]=j|1;pe[w+(j+f)>>2]=j;break}s=p+4|0;r=pe[w+(s+h)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((h|24)+p)>>2]|0;i=pe[w+(p+12+h)>>2]|0;do{if((i|0)==(t|0)){n=h|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<e>>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((h|8)+p)>>2]|0;if(n>>>0<e>>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+h)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<<e);break r}}while(0);r=pe[155]|0;if(D>>>0<r>>>0)Xe();pe[D+24>>2]=a;t=h|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0<r>>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((h|8)+p)>>2]|0;n=pe[w+(p+12+h)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0<e>>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<<o);break}do{if((n|0)==(r|0))k=n+8|0;else{if(n>>>0<e>>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){k=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[k>>2]=i}}while(0);t=w+((u|h)+p)|0;n=u+c|0}else n=c;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<<t;do{if(!(r&t)){pe[151]=r|t;L=644+(e+2<<2)|0;F=i}else{t=644+(e+2<<2)|0;e=pe[t>>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;F=e;break}Xe()}}while(0);pe[L>>2]=d;pe[F+12>>2]=d;pe[w+(f+8)>>2]=F;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;F=t<<L;D=(F+520192|0)>>>16&4;F=F<<D;i=(F+245760|0)>>>16&2;i=14-(D|L|i)+(F<<i>>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<<i;if(!(e&r)){pe[152]=e|r;pe[t>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){j=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else j=t}while(0);t=j+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&j>>>0>=F>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=j;pe[w+(f+24)>>2]=0;break}else Xe()}else{j=(pe[154]|0)+c|0;pe[154]=j;pe[157]=d;pe[w+(f+4)>>2]=j|1}}while(0);j=w+(l|8)|0;return j|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0<n>>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;j=p+-40-r|0;pe[157]=w+r;pe[154]=j;pe[w+(r+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0<i>>>0)do{j=t;t=t+4|0;pe[t>>2]=7}while((j+8|0)>>>0<i>>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<<t;if(r&t){t=644+(e+2<<2)|0;e=pe[t>>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{I=t;R=e}}else{pe[151]=r|t;I=644+(e+2<<2)|0;R=i}pe[I>>2]=a;pe[R+12>>2]=a;pe[a+8>>2]=R;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{F=(t+1048320|0)>>>16&8;j=t<<F;L=(j+520192|0)>>>16&4;j=j<<L;i=(j+245760|0)>>>16&2;i=14-(L|F|i)+(j<<i>>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<<i;if(!(t&e)){pe[152]=t|e;pe[r>>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){O=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else O=t}while(0);t=O+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&O>>>0>=j>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=O;pe[a+24>>2]=0;break}else Xe()}}else{j=pe[155]|0;if((j|0)==0|w>>>0<j>>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{j=t<<1;F=644+(j<<2)|0;pe[644+(j+3<<2)>>2]=F;pe[644+(j+2<<2)>>2]=F;t=t+1|0}while((t|0)!=32);j=w+8|0;j=(j&7|0)==0?0:0-j&7;F=p+-40-j|0;pe[157]=w+j;pe[154]=F;pe[w+(j+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>m>>>0){F=t-m|0;pe[154]=F;j=pe[157]|0;pe[157]=j+m;pe[j+(m+4)>>2]=F|1;pe[j+4>>2]=m|3;j=j+8|0;return j|0}}j=cr()|0;pe[j>>2]=12;j=0;return j|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0<s>>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;m=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;c=e+u|0;f=t+d|0;if(c>>>0<s>>>0)Xe();if((c|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){y=c;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[m>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<s>>>0)Xe();if((pe[i+12>>2]|0)!=(c|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<<n);y=c;o=f;break}if((r|0)!=(t|0)){if(r>>>0<s>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(c|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;y=c;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(c|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){h=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<s>>>0)Xe();else{pe[r>>2]=0;h=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0<s>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(c|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(c|0)){pe[t>>2]=i;pe[r>>2]=n;h=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((c|0)==(pe[r>>2]|0)){pe[r>>2]=h;if(!h){pe[152]=pe[152]&~(1<<t);y=c;o=f;break}}else{if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(c|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h){y=c;o=f;break}}r=pe[155]|0;if(h>>>0<r>>>0)Xe();pe[h+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0<r>>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;y=c;o=f;break}else{y=c;o=f}}else{y=c;o=f}}else{y=t;o=d}}while(0);if(y>>>0>=m>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((m|0)==(pe[157]|0)){g=(pe[154]|0)+o|0;pe[154]=g;pe[157]=y;pe[y+4>>2]=g|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((m|0)==(pe[156]|0)){g=(pe[153]|0)+o|0;pe[153]=g;pe[156]=y;pe[y+4>>2]=g|1;pe[y+g>>2]=g;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(m|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(m|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(m|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((m|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<<t);break}}else{if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(m|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0<r>>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0<r>>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(m|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<<n);break}if((r|0)!=(t|0)){if(r>>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(m|0))l=t;else Xe()}else l=r+8|0;pe[i+12>>2]=r;pe[l>>2]=i}}while(0);pe[y+4>>2]=o|1;pe[y+o>>2]=o;if((y|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[y+4>>2]=o|1;pe[y+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<<t;if(i&t){t=644+(r+2<<2)|0;r=pe[t>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{v=t;b=r}}else{pe[151]=i|t;v=644+(r+2<<2)|0;b=n}pe[v>>2]=y;pe[b+12>>2]=y;pe[y+8>>2]=b;pe[y+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{v=(t+1048320|0)>>>16&8;b=t<<v;m=(b+520192|0)>>>16&4;b=b<<m;n=(b+245760|0)>>>16&2;n=14-(m|v|n)+(b<<n>>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[y+28>>2]=n;pe[y+20>>2]=0;pe[y+16>>2]=0;r=pe[152]|0;i=1<<n;e:do{if(r&i){t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){g=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=y;pe[y+24>>2]=t;pe[y+12>>2]=y;pe[y+8>>2]=y;break e}}else g=t}while(0);t=g+8|0;r=pe[t>>2]|0;b=pe[155]|0;if(r>>>0>=b>>>0&g>>>0>=b>>>0){pe[r+12>>2]=y;pe[t>>2]=y;pe[y+8>>2]=r;pe[y+12>>2]=g;pe[y+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=y;pe[y+24>>2]=t;pe[y+12>>2]=y;pe[y+8>>2]=y}}while(0);y=(pe[159]|0)+-1|0;pe[159]=y;if(!y)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=cr()|0;pe[e>>2]=12;e=0;return e|0}r=Hr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0<t>>>0?i:t)|0)|0;zr(e);e=r;return e|0}function qr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;c=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0<c>>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Gr(e+t|0,r);return e|0}if((c|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}l=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=l|1;pe[157]=e+t;pe[154]=l;return e|0}if((c|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0<t>>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0<t>>>0){e=0;return e|0}l=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(c|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){h=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<s>>>0)Xe();else{pe[i>>2]=0;h=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0<s>>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(c|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(c|0)){pe[r>>2]=o;pe[i>>2]=n;h=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((c|0)==(pe[i>>2]|0)){pe[i>>2]=h;if(!h){pe[152]=pe[152]&~(1<<r);break}}else{if(a>>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(c|0))pe[r>>2]=h;else pe[a+20>>2]=h;if(!h)break}i=pe[155]|0;if(h>>>0<i>>>0)Xe();pe[h+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0<i>>>0)Xe();else{pe[h+16>>2]=r;pe[r+24>>2]=h;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=r;pe[r+24>>2]=h;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<s>>>0)Xe();if((pe[n+12>>2]|0)!=(c|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<<o);break}if((i|0)!=(r|0)){if(i>>>0<s>>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(c|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(l>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=l|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Gr(e+t|0,l);return e|0}return 0}function Gr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0;m=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){h=pe[e>>2]|0;if(!(r&3))return;l=e+(0-h)|0;f=h+t|0;u=pe[155]|0;if(l>>>0<u>>>0)Xe();if((l|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){g=l;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-h)>>2]=f|1;pe[m>>2]=f;return}o=h>>>3;if(h>>>0<256){n=pe[e+(8-h)>>2]|0;i=pe[e+(12-h)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<u>>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<<o);g=l;a=f;break}if((i|0)!=(r|0)){if(i>>>0<u>>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;g=l;a=f;break}s=pe[e+(24-h)>>2]|0;n=pe[e+(12-h)>>2]|0;do{if((n|0)==(l|0)){n=16-h|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<u>>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{o=pe[e+(8-h)>>2]|0;if(o>>>0<u>>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=n;pe[i>>2]=o;c=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-h)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<<r);g=l;a=f;break}}else{if(s>>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[s+20>>2]=c;if(!c){g=l;a=f;break}}n=pe[155]|0;if(c>>>0<n>>>0)Xe();pe[c+24>>2]=s;r=16-h|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0<n>>>0)Xe();else{pe[c+16>>2]=i;pe[i+24>>2]=c;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;g=l;a=f;break}else{g=l;a=f}}else{g=l;a=f}}else{g=e;a=t}}while(0);u=pe[155]|0;if(m>>>0<u>>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((m|0)==(pe[157]|0)){b=(pe[154]|0)+a|0;pe[154]=b;pe[157]=g;pe[g+4>>2]=b|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((m|0)==(pe[156]|0)){b=(pe[153]|0)+a|0;pe[153]=b;pe[156]=g;pe[g+4>>2]=b|1;pe[g+b>>2]=b;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(m|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<u>>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0<u>>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(m|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(m|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((m|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<<r);break}}else{if(s>>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(m|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0<i>>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0<i>>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<u>>>0)Xe();if((pe[n+12>>2]|0)!=(m|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<<o);break}if((i|0)!=(r|0)){if(i>>>0<u>>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(m|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[g+4>>2]=a|1;pe[g+a>>2]=a;if((g|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[g+4>>2]=a|1;pe[g+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<<r;if(n&r){r=644+(i+2<<2)|0;i=pe[r>>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{v=r;b=i}}else{pe[151]=n|r;v=644+(i+2<<2)|0;b=o}pe[v>>2]=g;pe[b+12>>2]=g;pe[g+8>>2]=b;pe[g+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{v=(r+1048320|0)>>>16&8;b=r<<v;m=(b+520192|0)>>>16&4;b=b<<m;o=(b+245760|0)>>>16&2;o=14-(m|v|o)+(b<<o>>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[g+28>>2]=o;pe[g+20>>2]=0;pe[g+16>>2]=0;i=pe[152]|0;n=1<<o;if(!(i&n)){pe[152]=i|n;pe[r>>2]=g;pe[g+24>>2]=r;pe[g+12>>2]=g;pe[g+8>>2]=g;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=g;pe[g+24>>2]=r;pe[g+12>>2]=g;pe[g+8>>2]=g;return}}while(0);i=r+8|0;n=pe[i>>2]|0;b=pe[155]|0;if(!(n>>>0>=b>>>0&r>>>0>=b>>>0))Xe();pe[n+12>>2]=g;pe[i>>2]=g;pe[g+8>>2]=n;pe[g+12>>2]=r;pe[g+24>>2]=0;return}function Vr(){}function Yr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<<r)-1)<<32-r}re=0;return t>>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<<r|(e&(1<<r)-1<<32-r)>>>32-r;return e<<r}re=e<<r-32;return 0}function Zr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;r=e+r>>>0;return(re=t+i+(r>>>0<e>>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Re(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<<r)-1)<<32-r}re=(t|0)<0?-1:0;return t>>r-32|0}function ei(e){e=e|0;var t=0;t=de[v+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[v+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[v+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[v+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ge(n,o)|0;i=e>>>16;e=(r>>>16)+(ge(n,i)|0)|0;n=t>>>16;t=ge(n,o)|0;return(re=(e>>>16)+(ge(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0;h=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Yr(h^e,u^t,h,u)|0;a=re;e=o^h;t=n^u;return Yr((si(s,a,Yr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0;n=be;be=be+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;h=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Yr(a^e,o^t,a,o)|0;t=re;si(e,t,Yr(h^r,u^i,h,u)|0,re,s)|0;i=Yr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;be=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ge(t,o)|0)+(ge(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=be;be=be+16|0;n=o|0;si(e,t,r,i,n)|0;be=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0;c=e;u=t;h=u;a=r;l=i;s=l;if(!h){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}l=0;n=(c>>>0)/(a>>>0)>>>0;return(re=l,n)|0}else{if(!o){l=0;n=0;return(re=l,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;l=0;n=0;return(re=l,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(h|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=c>>>(f>>>0)&t|h<<s;t=h>>>(f>>>0)&t;o=0;s=c<<s;break}if(!n){l=0;n=0;return(re=l,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=u|t&0;l=0;n=0;return(re=l,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(h|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&h>>>(d>>>0)|(h<<f|c>>>(s>>>0))&t;t=t&h>>>(s>>>0);o=c<<p&u;s=(h<<p|c>>>(d>>>0))&u|c<<f&s-33>>31;break}if(n){pe[n>>2]=o&c;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=h>>>(p>>>0)|0;p=h<<32-p|c>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(h>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(h>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!c){if(n){pe[n>>2]=0;pe[n+4>>2]=(h>>>0)%(s>>>0)}d=0;p=(h>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&h|t&0}d=0;p=h>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(h|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=h<<s|c>>>(t>>>0);t=h>>>(t>>>0);o=0;s=c<<s;break}if(!n){d=0;p=0;return(re=d,p)|0}pe[n>>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){h=s;u=0;s=0}else{f=r|0|0;c=l|i&0;h=Zr(f|0,c|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;l=e>>>31|t<<1|0;Yr(h,r,i,l)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Yr(i,l,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&c)|0;t=re;a=a-1|0}while((a|0)!=0);h=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(h|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Ai[e&7](t|0,r|0,i|0)|0}function hi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Pi[e&3](t|0,r|0,i|0,n|0,o|0)}function ci(e,t){e=e|0;t=t|0;Mi[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function li(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;ki[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Ii[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ri[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function mi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Oi[e&1](t|0,r|0,i|0,n|0,o|0)|0}function vi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function bi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function gi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function yi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Ai=[bi,Wt,Fr,Cr,Mr,kr,bi,bi];var Pi=[gi,tr,er,gi];var Mi=[yi,qt,Vt,Ht,Gt,Yt,ur,Lr];var Ci=[_i,Pr];var ki=[wi];var Ii=[xi,ar,sr,xi];var Ri=[Ti,ir,rr,Ti];var Oi=[Si,ut];var Di=[Ei,Kt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:At,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Yr,_memset:Wr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:vr,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:cr,_crn_get_dxt_format:St,runPostSets:Vr,_emscripten_replace_memory:We,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:hi,dynCall_vi:ci,dynCall_ii:fi,dynCall_viii:li,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:mi,dynCall_viiii:vi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0<I)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)fb(e.preRun.shift());ab(bb),0<I||e.calledRun||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),r()},1)):r())}}function ud(t,r){if(!r||!e.noExitRuntime)throw!e.noExitRuntime&&(na=!0,m=void 0,ab(H),e.onExit)&&e.onExit(t),da?(process.stdout.once("drain",function(){process.exit(t)}),console.log(" "),setTimeout(function(){process.exit(t)},500)):ea&&"function"==typeof quit&&quit(t),new ia(t)}e.callMain=e.zd=function(t){function r(){for(var e=0;e<3;e++)n.push(0)}assert(0==I,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(0==bb.length,"cannot call main when preRun functions remain to be called"),t=t||[],Ha||(Ha=!0,ab(cb));var i=t.length+1,n=[D(hb(e.thisProgram),"i8",0)];r();for(var o=0;o<i-1;o+=1)n.push(D(hb(t[o]),"i8",0)),r();n.push(0),n=D(n,"i32",0);try{ud(e._main(i,n,0),!0)}catch(t){if(!(t instanceof ia)){if("SimulateInfiniteLoop"!=t)throw t&&"object"==typeof t&&t.stack&&e.W("exception thrown: "+[t,t.stack]),t;e.noExitRuntime=!0}}},e.run=e.run=td,e.exit=e.exit=ud;var wd=[];function x(t){t=void 0!==t?(e.print(t),e.W(t),JSON.stringify(t)):"",na=!0;var r="abort("+t+") at "+Oa()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";throw wd&&wd.forEach(function(e){r=e(r,t)}),r}if(e.abort=e.abort=x,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();var vd=!0;e.noInitialRun&&(vd=!1),td(),window.Module=e,function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pixiCompressedTextures=e()}}(function(){var define,module,exports;return function o(a,s,u){function h(r,e){if(!s[r]){if(!a[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(c)return c(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};a[r][0].call(n.exports,function(e){var t=a[r][1][e];return h(t||e)},n,n.exports,o,a,s,u)}return s[r].exports}for(var c="function"==typeof require&&require,e=0;e<u.length;e++)h(u[e]);return h}({1:[function(require,module,exports){(function(process,Buffer,__dirname){var e;e||(e=eval("(function() { try { return Module || {} } catch(e) { return {} } })()"));var aa={},k;for(k in e)e.hasOwnProperty(k)&&(aa[k]=e[k]);var ba="object"==typeof window,ca="function"==typeof importScripts,da="object"==typeof process&&"function"==typeof require&&!ba&&!ca,ea=!ba&&!da&&!ca;if(da){e.print||(e.print=function(e){process.stdout.write(e+"\n")}),e.printErr||(e.printErr=function(e){process.stderr.write(e+"\n")});var fa=require("fs"),ga=require("path");e.read=function(e,t){e=ga.normalize(e);var r=fa.readFileSync(e);return r||e==ga.resolve(e)||(e=path.join(__dirname,"..","src",e),r=fa.readFileSync(e)),r&&!t&&(r=r.toString()),r},e.readBinary=function(t){return(t=e.read(t,!0)).buffer||(t=new Uint8Array(t)),assert(t.buffer),t},e.load=function(e){ha(read(e))},e.thisProgram||(e.thisProgram=1<process.argv.length?process.argv[1].replace(/\\/g,"/"):"unknown-program"),e.arguments=process.argv.slice(2),void 0!==module&&(module.exports=e),process.on("uncaughtException",function(e){if(!(e instanceof ia))throw e}),e.inspect=function(){return"[Emscripten Module object]"}}else if(ea)e.print||(e.print=print),"undefined"!=typeof printErr&&(e.printErr=printErr),e.read="undefined"!=typeof read?read:function(){throw"no read() available (jsc?)"},e.readBinary=function(e){return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(assert("object"==typeof(e=read(e,"binary"))),e)},"undefined"!=typeof scriptArgs?e.arguments=scriptArgs:void 0!==arguments&&(e.arguments=arguments),eval("if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},void 0!==arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t<n.Z.length;t++)if(!n.Z[t])return n.Z[t]=e,2*(1+t);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},nb:function(e){n.Z[(e-2)/2]=null},O:function(t){n.O.ta||(n.O.ta={}),n.O.ta[t]||(n.O.ta[t]=1,e.W(t))},ma:{},Hd:function(e,t){assert(t),n.ma[t]||(n.ma[t]={});var r=n.ma[t];return r[e]||(r[e]=function(){return n.L(t,e,arguments)}),r[e]},Fd:function(){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},aa:function(e){var t=m;return m=(m=m+e|0)+15&-16,t},Ra:function(e){var t=la;return la=(la=la+e|0)+15&-16,t},R:function(e){var i=r;return t<=(r=(r=r+e|0)+15&-16)&&!ma()?(r=i,0):i},ja:function(e,t){return Math.ceil(e/(t||16))*(t||16)},Nd:function(e,t,r){return r?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0<oa?(0|ya(+za(oa/4294967296),4294967295))>>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,h="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,h?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i<e;i+=4)C[i>>2]=0;for(e=r+a;i<e;)y[i++>>0]=0;return r}if("i8"===h)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i<a;){var c=e[i];"function"==typeof c&&(c=n.Id(c)),0===(o=h||t[i])?i++:("i64"==o&&(o="i32"),wa(r+i,c,o),u!==o&&(s=n.Ka(o),u=o),i+=s)}return r}function va(t,r){if(0===r||!t)return"";for(var i,n=0,o=0;(n|=i=E[t+o>>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0<r;)n=String.fromCharCode.apply(String,E.subarray(t,t+Math.min(r,1024))),i=i?i+n:n,t+=1024,r-=1024;return i}return e.UTF8ToString(t)}function Ja(e,t){for(var r,i,n,o,a,s="";;){if(!(r=e[t++]))return s;128&r?(i=63&e[t++],192==(224&r)?s+=String.fromCharCode((31&r)<<6|i):(n=63&e[t++],(r=224==(240&r)?(15&r)<<12|i<<6|n:(o=63&e[t++],240==(248&r)?(7&r)<<18|i<<12|n<<6|o:(a=63&e[t++],248==(252&r)?(3&r)<<24|i<<18|n<<12|o<<6|a:(1&r)<<30|i<<24|n<<18|o<<12|a<<6|63&e[t++])))<65536?s+=String.fromCharCode(r):(r-=65536,s+=String.fromCharCode(55296|r>>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0<i))return 0;var n=r;i=r+i-1;for(var o=0;o<e.length;++o){var a=e.charCodeAt(o);if(55296<=a&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(i<=r)break;t[r++]=a}else{if(a<=2047){if(i<=r+1)break;t[r++]=192|a>>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);55296<=i&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++r)),i<=127?++t:t=i<=2047?t+2:i<=65535?t+3:i<=2097151?t+4:i<=67108863?t+5:t+6}return t}function Ma(c){var t=!!e.___cxa_demangle;if(t)try{var r=Ea(c.length);ua(c.substr(1),r);var i=Ea(4),o=e.___cxa_demangle(r,0,0,i);if(0===Da(i,"i32")&&o)return va(o)}catch(e){}finally{r&&Na(r),i&&Na(i),o&&Na(o)}var f=3,l={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},d=[],p=!0;r=c;try{if("Object._main"==c||"_main"==c)return"main()";if("number"==typeof c&&(c=va(c)),"_"!==c[0]||"_"!==c[1]||"Z"!==c[2])return c;switch(c[3]){case"n":return"operator new()";case"d":return"operator delete()"}r=function e(t,r,i){r=r||1/0;var n,o="",a=[];if("N"===c[f]){for("K"===c[++f]&&f++,n=[];"E"!==c[f];)if("S"===c[f]){f++;var s=c.indexOf("_",f);n.push(d[c.substring(f,s)||0]||"?"),f=s+1}else if("C"===c[f])n.push(n[n.length-1]),f+=2;else{var u=(s=parseInt(c.substr(f))).toString().length;if(!s||!u){f--;break}var h=c.substr(f+u,s);n.push(h),d.push(h),f+=u+s}if(f++,n=n.join("::"),0==--r)return t?[n]:n}else("K"===c[f]||p&&"L"===c[f])&&f++,(s=parseInt(c.substr(f)))&&(u=s.toString().length,n=c.substr(f+u,s),f+=u+s);p=!1,"I"===c[f]?(f++,s=e(!0),o+=(u=e(!0,1,!0))[0]+" "+n+"<"+s.join(", ")+">"):o=n;e:for(;f<c.length&&0<r--;)if(n=c[f++],n in l)a.push(l[n]);else switch(n){case"P":a.push(e(!0,1,!0)[0]+"*");break;case"R":a.push(e(!0,1,!0)[0]+"&");break;case"L":f++,s=c.indexOf("E",f)-f,a.push(c.substr(f,s)),f+=s+2;break;case"A":if(s=parseInt(c.substr(f)),f+=s.toString().length,"_"!==c[f])throw"?";f++,a.push(e(!0,1,!0)[0]+" ["+s+"]");break;case"E":break e;default:o+="?"+n;break e}return i||1!==a.length||"void"!==a[0]||(a=[]),t?(o&&a.push(o+"?"),a):o+"("+a.join(", ")+")"}()}catch(e){r+="?"}return 0<=r.indexOf("?")&&!t&&n.O("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),r}function Oa(){return Pa().replace(/__Z[\w\d_]+/g,function(e){var t=Ma(e);return e===t?e:e+" ["+t+"]"})}function Pa(){var t=Error();if(!t.stack){try{throw Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function Qa(e){return 0<e%4096&&(e+=4096-e%4096),e}!function(){function a(e){return{arguments:(e=e.toString().match(d).slice(1))[0],body:e[1],returnValue:e[2]}}var b={stackSave:function(){n.ua()},stackRestore:function(){n.ba()},arrayToC:function(e){var t=n.aa(e.length);return ta(e,t),t},stringToC:function(e){var t=0;return null!=e&&0!==e&&ua(e,t=n.aa(1+(e.length<<2))),t}},c={string:b.stringToC,array:b.arrayToC};sa=function(e,t,r,i,o){e=qa(e);var a=[],s=0;if(i)for(var u=0;u<i.length;u++){var h=c[r[u]];h?(0===s&&(s=n.ua()),a[u]=h(i[u])):a[u]=i[u]}if(r=e.apply(null,a),"string"===t&&(r=va(r)),0!==s){if(o&&o.async)return void EmterpreterAsync.yd.push(function(){n.ba(s)});n.ba(s)}return r};var d=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,f={},g;for(g in b)b.hasOwnProperty(g)&&(f[g]=a(b[g]));ra=function(b,c,d){d=d||[];var g=qa(b);b=d.every(function(e){return"number"===e});var q="string"!==c;if(q&&b)return g;var v=d.map(function(e,t){return"$"+t});c="(function("+v.join(",")+") {";var B=d.length;if(!b){c+="var stack = "+f.stackSave.body+";";for(var G=0;G<B;G++){var O=v[G],ja=d[G];"number"!==ja&&(ja=f[ja+"ToC"],c+="var "+ja.arguments+" = "+O+";",c+=ja.body+";",c+=O+"="+ja.returnValue+";")}}return d=a(function(){return g}).returnValue,c+="var ret = "+d+"("+v.join(",")+");",q||(d=a(function(){return va}).returnValue,c+="ret = "+d+"(ret);"),b||(c+=f.stackRestore.body.replace("()","(stack)")+";"),eval(c+"return ret})")}}(),e.ccall=sa,e.cwrap=ra,e.setValue=wa,e.getValue=Da,e.ALLOC_NORMAL=0,e.ALLOC_STACK=1,e.ALLOC_STATIC=2,e.ALLOC_DYNAMIC=3,e.ALLOC_NONE=4,e.allocate=D,e.getMemory=function(e){return Fa?void 0!==Ga&&!Ga.p||!Ha?n.R(e):Ea(e):n.Ra(e)},e.Pointer_stringify=va,e.AsciiToString=function(e){for(var t="";;){var r=y[e++>>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n<r;++n)z[t>>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n<e.length;++n){if(55296<=(o=e.charCodeAt(n))&&o<=57343)var o=65536+((1023&o)<<10)|1023&e.charCodeAt(++n);if(C[t>>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);55296<=i&&i<=57343&&++r,t+=4}return t},e.stackTrace=function(){return Oa()};var y,E,z,Ra,C,Sa,Ba,Ca,Ta=0,la=0,Fa=!1,Ua=0,m=0,Va=0,Wa=0,r=0,Ya,buffer;function ma(){var i=Math.pow(2,31);if(i<=r)return!1;for(;t<=r;)if(t<i/2)t=Qa(2*t);else{var n=t;if((t=Qa((3*t+i)/4))<=n)return!1}if(i<=(t=Math.max(t,16777216)))return!1;try{if(ArrayBuffer.p)buffer=ArrayBuffer.p(buffer,t);else{var o=y;buffer=new ArrayBuffer(t)}}catch(e){return!1}return!!Xa(buffer)&&(e.buffer=buffer,e.HEAP8=y=new Int8Array(buffer),e.HEAP16=z=new Int16Array(buffer),e.HEAP32=C=new Int32Array(buffer),e.HEAPU8=E=new Uint8Array(buffer),e.HEAPU16=Ra=new Uint16Array(buffer),e.HEAPU32=Sa=new Uint32Array(buffer),e.HEAPF32=Ba=new Float32Array(buffer),e.HEAPF64=Ca=new Float64Array(buffer),ArrayBuffer.p||y.set(o),!0)}try{Ya=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),Ya(new ArrayBuffer(4))}catch(e){Ya=function(e){return e.byteLength}}for(var $a=e.TOTAL_STACK||5242880,t=e.TOTAL_MEMORY||16777216,F=65536;F<t||F<2*$a;)F=F<16777216?2*F:F+16777216;function ab(e){for(;0<e.length;){var t=e.shift();if("function"==typeof t)t();else{var r=t.ab;"number"==typeof r?void 0===t.X?n.L("v",r):n.L("vi",r,[t.X]):r(void 0===t.X?null:t.X)}}}F=Math.max(F,16777216),F!==t&&(t=F),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"JS engine does not provide full typed array support"),buffer=new ArrayBuffer(t),y=new Int8Array(buffer),z=new Int16Array(buffer),C=new Int32Array(buffer),E=new Uint8Array(buffer),Ra=new Uint16Array(buffer),Sa=new Uint32Array(buffer),Ba=new Float32Array(buffer),Ca=new Float64Array(buffer),C[0]=255,assert(255===E[0]&&0===E[3],"Typed arrays 2 must be run on a little-endian system"),e.HEAP=void 0,e.buffer=buffer,e.HEAP8=y,e.HEAP16=z,e.HEAP32=C,e.HEAPU8=E,e.HEAPU16=Ra,e.HEAPU32=Sa,e.HEAPF32=Ba,e.HEAPF64=Ca;var bb=[],cb=[],db=[],H=[],eb=[],Ha=!1;function fb(e){bb.unshift(e)}function gb(e){eb.unshift(e)}function hb(e,t,r){return e=Ka(e,r=Array(0<r?r:La(e)+1),0,r.length),t&&(r.length=e),r}function ua(e,t,r){for(e=hb(e,r),r=0;r<e.length;)y[t+r>>0]=e[r],r+=1}function ta(e,t){for(var r=0;r<e.length;r++)y[t++>>0]=e[r]}function Ia(e,t,r){for(var i=0;i<e.length;++i)y[t++>>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r];255<i&&(i&=255),t.push(String.fromCharCode(i))}return t.join("")},e.writeStringToMemory=ua,e.writeArrayToMemory=ta,e.writeAsciiToMemory=Ia,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){var r=65535&e,i=65535&t;return r*i+((e>>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;o<i;o++){var a;try{a=e.tty.N.La(e.tty)}catch(e){throw new L(J.H)}if(void 0===a&&0===n)throw new L(J.va);if(null==a)break;n++,t[r+o]=a}return n&&(e.g.timestamp=Date.now()),n},write:function(e,t,r,i){if(!e.tty||!e.tty.N.qa)throw new L(J.Aa);for(var n=0;n<i;n++)try{e.tty.N.qa(e.tty,t[r+n])}catch(e){throw new L(J.H)}return i&&(e.g.timestamp=Date.now()),n}},Ib={La:function(e){if(!e.input.length){var t=null;if(da){var r,i=new Buffer(256),n=process.stdin.fd,o=!1;try{n=fs.openSync("/dev/stdin","r"),o=!0}catch(e){}r=fs.readSync(n,i,0,256,null),o&&fs.closeSync(n),t=0<r?i.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&(null!==(t=readline())&&(t+="\n"));if(!t)return null;e.input=hb(t,!0)}return e.input.shift()},qa:function(t,r){null===r||10===r?(e.print(Ja(t.output,0)),t.output=[]):0!=r&&t.output.push(r)},flush:function(t){t.output&&0<t.output.length&&(e.print(Ja(t.output,0)),t.output=[])}},Jb={qa:function(t,r){null===r||10===r?(e.printErr(Ja(t.output,0)),t.output=[]):0!=r&&t.output.push(r)},flush:function(t){t.output&&0<t.output.length&&(e.printErr(Ja(t.output,0)),t.output=[])}},M={C:null,A:function(){return M.createNode(null,"/",16895,0)},createNode:function(e,t,r,i){if(24576==(61440&r)||4096==(61440&r))throw new L(J.I);return M.C||(M.C={dir:{g:{D:M.k.D,u:M.k.u,lookup:M.k.lookup,T:M.k.T,rename:M.k.rename,unlink:M.k.unlink,rmdir:M.k.rmdir,readdir:M.k.readdir,symlink:M.k.symlink},stream:{G:M.n.G}},file:{g:{D:M.k.D,u:M.k.u},stream:{G:M.n.G,read:M.n.read,write:M.n.write,Ba:M.n.Ba,Na:M.n.Na,Pa:M.n.Pa}},link:{g:{D:M.k.D,u:M.k.u,readlink:M.k.readlink},stream:{}},Ea:{g:{D:M.k.D,u:M.k.u},stream:Kb}}),N((r=Lb(e,t,r,i)).mode)?(r.k=M.C.dir.g,r.n=M.C.dir.stream,r.e={}):32768==(61440&r.mode)?(r.k=M.C.file.g,r.n=M.C.file.stream,r.o=0,r.e=null):40960==(61440&r.mode)?(r.k=M.C.link.g,r.n=M.C.link.stream):8192==(61440&r.mode)&&(r.k=M.C.Ea.g,r.n=M.C.Ea.stream),r.timestamp=Date.now(),e&&(e.e[t]=r),r},cb:function(e){if(e.e&&e.e.subarray){for(var t=[],r=0;r<e.o;++r)t.push(e.e[r]);return t}return e.e},Gd:function(e){return e.e?e.e.subarray?e.e.subarray(0,e.o):new Uint8Array(e.e):new Uint8Array},Ga:function(e,t){if(e.e&&e.e.subarray&&t>e.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0<e.o&&e.e.set(r.subarray(0,e.o),0))}else for(!e.e&&0<t&&(e.e=[]);e.e.length<t;)e.e.push(0)},ob:function(e,t){if(e.o!=t)if(0==t)e.e=null,e.o=0;else{if(!e.e||e.e.subarray){var r=e.e;e.e=new Uint8Array(new ArrayBuffer(t)),r&&e.e.set(r.subarray(0,Math.min(t,e.o)))}else if(e.e||(e.e=[]),e.e.length>t)e.e.length=t;else for(;e.e.length<t;)e.e.push(0);e.o=t}},k:{D:function(e){var t={};return t.dev=8192==(61440&e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,N(e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.o:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.K=4096,t.blocks=Math.ceil(t.size/t.K),t},u:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&M.ob(e,t.size)},lookup:function(){throw Mb[J.F]},T:function(e,t,r,i){return M.createNode(e,t,r,i)},rename:function(e,t,r){if(N(e.mode)){var i;try{i=Nb(t,r)}catch(e){}if(i)for(var n in i.e)throw new L(J.za)}delete e.parent.e[e.name],e.name=r,(t.e[r]=e).parent=t},unlink:function(e,t){delete e.e[t]},rmdir:function(e,t){var r,i=Nb(e,t);for(r in i.e)throw new L(J.za);delete e.e[t]},readdir:function(e){var t,r=[".",".."];for(t in e.e)e.e.hasOwnProperty(t)&&r.push(t);return r},symlink:function(e,t,r){return(e=M.createNode(e,t,41471,0)).link=r,e},readlink:function(e){if(40960!=(61440&e.mode))throw new L(J.q);return e.link}},n:{read:function(e,t,r,i,n){var o=e.g.e;if(n>=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8<e&&o.subarray)t.set(o.subarray(n,n+e),r);else for(i=0;i<e;i++)t[r+i]=o[n+i];return e},write:function(e,t,r,i,n,o){if(!i)return 0;if((e=e.g).timestamp=Date.now(),t.subarray&&(!e.e||e.e.subarray)){if(o)return e.e=t.subarray(r,r+i),e.o=i;if(0===e.o&&0===n)return e.e=new Uint8Array(t.subarray(r,r+i)),e.o=i;if(n+i<=e.o)return e.e.set(t.subarray(r,r+i),n),i}if(M.Ga(e,n+i),e.e.subarray&&t.subarray)e.e.set(t.subarray(r,r+i),n);else for(o=0;o<i;o++)e.e[n+o]=t[r+o];return e.o=Math.max(e.o,n+i),i},G:function(e,t,r){if(1===r?t+=e.position:2===r&&32768==(61440&e.g.mode)&&(t+=e.g.o),t<0)throw new L(J.q);return t},Ba:function(e,t,r){M.Ga(e.g,t+r),e.g.o=Math.max(e.g.o,t+r)},Na:function(e,t,r,i,n,o,a){if(32768!=(61440&e.g.mode))throw new L(J.ha);if(r=e.g.e,2&a||r.buffer!==t&&r.buffer!==t.buffer){if((0<n||n+i<e.g.o)&&(r=r.subarray?r.subarray(n,n+i):Array.prototype.slice.call(r,n,n+i)),e=!0,!(i=Ea(i)))throw new L(J.Ta);t.set(r,i)}else e=!1,i=r.byteOffset;return{Rd:i,xd:e}},Pa:function(e,t,r,i,n){if(32768!=(61440&e.g.mode))throw new L(J.ha);return 2&n||M.n.write(e,t,0,i,r,!1),0}}},P={$:!1,sb:function(){P.$=!!process.platform.match(/^win/)},A:function(e){return assert(da),P.createNode(null,"/",P.Ja(e.pa.root),0)},createNode:function(e,t,r){if(!N(r)&&32768!=(61440&r)&&40960!=(61440&r))throw new L(J.q);return(e=Lb(e,t,r)).k=P.k,e.n=P.n,e},Ja:function(e){var t;try{t=fs.lstatSync(e),P.$&&(t.mode=t.mode|(146&t.mode)>>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0<o)for(e=0;e<o;e++)t[r+e]=a[e];return o},write:function(e,t,r,i,n){var o;t=new Buffer(t.subarray(r,r+i));try{o=fs.writeSync(e.V,t,0,i,n)}catch(e){throw new L(J[e.code])}return o},G:function(e,t,r){if(1===r)t+=e.position;else if(2===r&&32768==(61440&e.g.mode))try{t+=fs.fstatSync(e.V).size}catch(e){throw new L(J[e.code])}if(t<0)throw new L(J.q);return t}}};D(1,"i32*",2),D(1,"i32*",2),D(1,"i32*",2);var Pb=null,Qb=[null],Rb=[],Sb=1,Q=null,Tb=!0,R={},L=null,Mb={};function S(e,t){if(t=t||{},!(e=Db("/",e)))return{path:"",g:null};var r,i={Ia:!0,ra:0};for(r in i)void 0===t[r]&&(t[r]=i[r]);if(8<t.ra)throw new L(J.ga);i=yb(e.split("/").filter(function(e){return!!e}),!1);var n=Pb;r="/";for(var o=0;o<i.length;o++){var a=o===i.length-1;if(a&&t.parent)break;if(n=Nb(n,i[o]),r=K(r,i[o]),n.U&&(!a||a&&t.Ia)&&(n=n.U.root),!a||t.la)for(a=0;40960==(61440&n.mode);)if(n=Vb(r),n=S(r=Db(Ab(r),n),{ra:t.ra}).g,40<a++)throw new L(J.ga)}return{path:r,g:n}}function T(e){for(var t;;){if(e===e.parent)return e=e.A.Oa,t?"/"!==e[e.length-1]?e+"/"+t:e+t:e;t=t?e.name+"/"+t:e.name,e=e.parent}}function Wb(e,t){for(var r=0,i=0;i<t.length;i++)r=(r<<5)-r+t.charCodeAt(i)|0;return(e+r>>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack="<generic error, no stack>"}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t<a;++t)e[t]=r.charCodeAt(t);r=e}jc(n,146|i),oc(e=kc(n,"w"),r,0,r.length,0,o),mc(e),jc(n,i)}return n}function W(e,t,s,o){e=K("string"==typeof e?e:T(e),t),t=rc(!!s,!!o),W.Ma||(W.Ma=64);var r=W.Ma++<<8|0;return Gb(r,{open:function(e){e.seekable=!1},close:function(){o&&o.buffer&&o.buffer.length&&o(10)},read:function(e,t,r,i){for(var n=0,o=0;o<i;o++){var a;try{a=s()}catch(e){throw new L(J.H)}if(void 0===a&&0===n)throw new L(J.va);if(null==a)break;n++,t[r+o]=a}return n&&(e.g.timestamp=Date.now()),n},write:function(e,t,r,i){for(var n=0;n<i;n++)try{o(t[r+n])}catch(e){throw new L(J.H)}return i&&(e.g.timestamp=Date.now()),n}}),hc(e,t,r)}function uc(t){if(t.jb||t.kb||t.link||t.e)return!0;var r=!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!e.read)throw Error("Cannot load without read() or XMLHttpRequest.");try{t.e=hb(e.read(t.url),!0),t.o=t.e.length}catch(e){r=!1}return r||ob(J.H),r}var vc={},Zb,dc,lc,wc=0;function X(){return C[(wc+=4)-4>>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0<Mc.length){var t=Date.now(),r=Mc.shift();if(r.ab(r.X),Nc){var i=Nc,o=0==i%1?i-1:Math.floor(i);Nc=r.Bd?o:(8*i+(o+.5))/9}console.log('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),Oc(),setTimeout(Gc,0)}else u<Lc||(Pc=Pc+1|0,1==Dc&&1<Ec&&0!=Pc%Ec?Y():("timeout"===Hc&&e.ka&&(e.W("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Hc=""),Qc(function(){void 0!==s?n.L("vi",a,[s]):n.L("v",a)}),u<Lc||("object"==typeof SDL&&SDL.audio&&SDL.audio.mb&&SDL.audio.mb(),Y())))},i||(t&&0<t?Cc(0,1e3/t):Cc(1,1),Y()),r)throw"SimulateInfiniteLoop"}e._memcpy=Bc;var Y=null,Hc="",Lc=0,Fc=null,Kc=0,Dc=0,Ec=0,Pc=0,Mc=[];function Oc(){if(e.setStatus){var t=e.statusMessage||"Please wait...",r=Nc,i=Rc.Dd;r?r<i?e.setStatus(t+" ("+(i-r)+"/"+i+")"):e.setStatus(t):e.setStatus("")}}function Qc(t){if(!(na||e.preMainLoop&&!1===e.preMainLoop())){try{t()}catch(t){if(t instanceof ia)return;throw t&&"object"==typeof t&&t.stack&&e.W("exception thrown: "+[t,t.stack]),t}e.postMainLoop&&e.postMainLoop()}}var Rc={},Gc,Nc,Sc=!1,Tc=!1,Uc=[];function Vc(){function t(){Tc=document.pointerLockElement===r||document.mozPointerLockElement===r||document.webkitPointerLockElement===r||document.msPointerLockElement===r}if(e.preloadPlugins||(e.preloadPlugins=[]),!Wc){Wc=!0;try{Xc=!0}catch(e){Xc=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Yc="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Xc?null:console.log("warning: no BlobBuilder"),Zc="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,e.Qa||void 0!==Zc||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),e.Qa=!0),e.preloadPlugins.push({canHandle:function(t){return!e.Qa&&/\.(jpg|jpeg|png|bmp)$/i.test(t)},handle:function(r,i,o,t){var a=null;if(Xc)try{(a=new Blob([r],{type:$c(i)})).size!==r.length&&(a=new Blob([new Uint8Array(r).buffer],{type:$c(i)}))}catch(e){n.O("Blob constructor present but fails: "+e+"; falling back to blob builder")}a||((a=new Yc).append(new Uint8Array(r).buffer),a=a.getBlob());var s=Zc.createObjectURL(a),u=new Image;u.onload=function(){assert(u.complete,"Image "+i+" could not be decoded");var t=document.createElement("canvas");t.width=u.width,t.height=u.height,t.getContext("2d").drawImage(u,0,0),e.preloadedImages[i]=t,Zc.revokeObjectURL(s),o&&o(r)},u.onerror=function(){console.log("Image "+s+" could not be decoded"),t&&t()},u.src=s}}),e.preloadPlugins.push({canHandle:function(t){return!e.Pd&&t.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(o,a,r,t){function s(t){u||(u=!0,e.preloadedAudios[a]=t,r&&r(o))}function i(){u||(u=!0,e.preloadedAudios[a]=new Audio,t&&t())}var u=!1;if(!Xc)return i();try{var n=new Blob([o],{type:$c(a)})}catch(e){return i()}n=Zc.createObjectURL(n);var h=new Audio;h.addEventListener("canplaythrough",function(){s(h)},!1),h.onerror=function(){if(!u){console.log("warning: browser could not fully decode audio "+a+", trying slower base64 approach");for(var e="",t=0,r=0,i=0;i<o.length;i++)for(t=t<<8|o[i],r+=8;6<=r;){var n=t>>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),h.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(h)}},h.src=n,ad(function(){s(h)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0<e.forcedAspectRatio&&(n/o<e.forcedAspectRatio?n=Math.round(o*e.forcedAspectRatio):o=Math.round(n/e.forcedAspectRatio)),(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t.parentNode&&"undefined"!=typeof screen){var a=Math.min(screen.width/n,screen.height/o);n=Math.round(n*a),o=Math.round(o*a)}ed?(t.width!=n&&(t.width=n),t.height!=o&&(t.height=o),void 0!==t.style&&(t.style.removeProperty("width"),t.style.removeProperty("height"))):(t.width!=r&&(t.width=r),t.height!=i&&(t.height=i),void 0!==t.style&&(n!=r||o!=i?(t.style.setProperty("width",n+"px","important"),t.style.setProperty("height",o+"px","important")):(t.style.removeProperty("width"),t.style.removeProperty("height"))))}if(pc(),Q=Array(4096),ec(M,"/"),V("/tmp"),V("/home"),V("/home/web_user"),function(){var e;if(V("/dev"),Gb(259,{read:function(){return 0},write:function(e,t,r,i){return i}}),hc("/dev/null",259),Fb(1280,Ib),Fb(1536,Jb),hc("/dev/tty",1280),hc("/dev/tty1",1536),"undefined"!=typeof crypto){var t=new Uint8Array(1);e=function(){return crypto.getRandomValues(t),t[0]}}else e=da?function(){return require("crypto").randomBytes(1)[0]}:function(){return 256*Math.random()|0};W("/dev","random",e),W("/dev","urandom",e),V("/dev/shm"),V("/dev/shm/tmp")}(),V("/proc"),V("/proc/self"),V("/proc/self/fd"),ec({A:function(){var e=Lb("/proc/self","fd",16895,73);return e.k={lookup:function(e,t){var r=Rb[+t];if(!r)throw new L(J.ea);var i={parent:null,A:{Oa:"fake"},k:{readlink:function(){return r.path}}};return i.parent=i}},e}},"/proc/self/fd"),cb.unshift(function(){if(!e.noFSInit&&!qc){assert(!qc,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),qc=!0,pc(),e.stdin=e.stdin,e.stdout=e.stdout,e.stderr=e.stderr,e.stdin?W("/dev","stdin",e.stdin):ic("/dev/tty","/dev/stdin"),e.stdout?W("/dev","stdout",null,e.stdout):ic("/dev/tty","/dev/stdout"),e.stderr?W("/dev","stderr",null,e.stderr):ic("/dev/tty1","/dev/stderr");var t=kc("/dev/stdin","r");assert(0===t.fd,"invalid handle for stdin ("+t.fd+")"),assert(1===(t=kc("/dev/stdout","w")).fd,"invalid handle for stdout ("+t.fd+")"),assert(2===(t=kc("/dev/stderr","w")).fd,"invalid handle for stderr ("+t.fd+")")}}),db.push(function(){Tb=!1}),H.push(function(){qc=!1;var t=e._fflush;for(t&&t(0),t=0;t<Rb.length;t++){var r=Rb[t];r&&mc(r)}}),e.FS_createFolder=function(e,t,r,i){return V(e=K("string"==typeof e?e:T(e),t),rc(r,i))},e.FS_createPath=function(e,t){e="string"==typeof e?e:T(e);for(var r=t.split("/").reverse();r.length;){var i=r.pop();if(i){var n=K(e,i);try{V(n)}catch(e){}e=n}}return n},e.FS_createDataFile=tc,e.FS_createPreloadedFile=function(n,o,t,a,s,u,h,c,f,l){function r(t){function r(e){l&&l(),c||tc(n,o,e,a,s,f),u&&u(),lb()}var i=!1;e.preloadPlugins.forEach(function(e){!i&&e.canHandle(d)&&(e.handle(t,d,r,function(){h&&h(),lb()}),i=!0)}),i||r(t)}Vc();var d=o?Db(K(n,o)):n;kb(),"string"==typeof t?nd(t,function(e){r(e)},h):r(t)},e.FS_createLazyFile=function(e,t,u,r,i){var n,o;function a(){this.oa=!1,this.Y=[]}if(a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r<t)throw Error("invalid range ("+t+", "+r+") or no bytes requested!");if(o-1<r)throw Error("only "+o+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",u,!1),o!==a&&n.setRequestHeader("Range","bytes="+t+"-"+r),"undefined"!=typeof Uint8Array&&(n.responseType="arraybuffer"),n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.send(null),!(200<=n.status&&n.status<300||304===n.status))throw Error("Couldn't load "+u+". Status: "+n.status);t=void 0!==n.response?new Uint8Array(n.response||[]):hb(n.responseText||"",!0),i[e]=t}if(void 0===s.Y[e])throw Error("doXHR failed!");return s.Y[e]}),this.Wa=o,this.Va=a,this.oa=!0},"undefined"!=typeof XMLHttpRequest){if(!ca)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";n=new a,Object.defineProperty(n,"length",{get:function(){return this.oa||this.Ca(),this.Wa}}),Object.defineProperty(n,"chunkSize",{get:function(){return this.oa||this.Ca(),this.Va}}),o=void 0}else o=u,n=void 0;var s=sc(e,t,r,i);n?s.e=n:o&&(s.e=null,s.url=o),Object.defineProperty(s,"usedBytes",{get:function(){return this.e.length}});var h={};return Object.keys(s.n).forEach(function(e){var t=s.n[e];h[e]=function(){if(!uc(s))throw new L(J.H);return t.apply(null,arguments)}}),h.read=function(e,t,r,i,n){if(!uc(s))throw new L(J.H);if(n>=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o<i;o++)t[r+o]=e[n+o];else for(o=0;o<i;o++)t[r+o]=e.get(n+o);return i},s.n=h,s},e.FS_createLink=function(e,t,r){return ic(r,e=K("string"==typeof e?e:T(e),t))},e.FS_createDevice=W,e.FS_unlink=function(t){var r,e=S(t,{parent:!0}).g,i=Bb(t),n=Nb(e,i);e:{try{r=Nb(e,i)}catch(e){r=e.S;break e}var o=Yb(e,"wx");r=o||(N(r.mode)?J.P:0)}if(r)throw r===J.P&&(r=J.I),new L(r);if(!e.k.unlink)throw new L(J.I);if(n.U)throw new L(J.fa);try{R.willDeletePath&&R.willDeletePath(t)}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+t+"') threw an exception: "+e.message)}if(e.k.unlink(e,i),e=Wb(n.parent.id,n.name),Q[e]===n)Q[e]=n.M;else for(e=Q[e];e;){if(e.M===n){e.M=n.M;break}e=e.M}try{R.onDeletePath&&R.onDeletePath(t)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+t+"') threw an exception: "+e.message)}},cb.unshift(function(){}),H.push(function(){}),da){var fs=require("fs"),Ob=require("path");P.sb()}e.requestFullScreen=function(e,t,r){fd(e,t,r)},e.requestAnimationFrame=function(e){Ic(e)},e.setCanvasSize=function(t,r,i){id(e.canvas,t,r),i||pd()},e.pauseMainLoop=function(){Y=null,Lc++},e.resumeMainLoop=function(){Lc++;var e=Dc,t=Ec;Jc(Fc,0,!1,Kc,!(Fc=null)),Cc(e,t),Y()},e.getUserMedia=function(){window.p||(window.p=navigator.getUserMedia||navigator.mozGetUserMedia),window.p(void 0)},e.createContext=function(e,t,r,i){return bd(e,t,r,i)},Ua=m=n.ja(la),Fa=!0,Va=Ua+$a,Wa=r=n.ja(Va),assert(Wa<t,"TOTAL_MEMORY not big enough for stack");var qd=D([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",3);e.Ya={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:Ya},e.Za={abort:x,assert:assert,invoke_iiii:function(t,r,i,n){try{return e.dynCall_iiii(t,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_viiiii:function(t,r,i,n,o,a){try{e.dynCall_viiiii(t,r,i,n,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_vi:function(t,r){try{e.dynCall_vi(t,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_ii:function(t,r){try{return e.dynCall_ii(t,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_viii:function(t,r,i,n){try{e.dynCall_viii(t,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_v:function(t){try{e.dynCall_v(t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_viiiiii:function(t,r,i,n,o,a,s){try{e.dynCall_viiiiii(t,r,i,n,o,a,s)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_iiiiii:function(t,r,i,n,o,a){try{return e.dynCall_iiiiii(t,r,i,n,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_viiii:function(t,r,i,n,o){try{e.dynCall_viiii(t,r,i,n,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},_pthread_cleanup_pop:function(){assert(pb.level==H.length,"cannot pop if something else added meanwhile!"),H.pop(),pb.level=H.length},___syscall54:function(e,t){wc=t;try{var r=xc(),i=X();switch(i){case 21505:case 21506:return r.tty?0:-J.Q;case 21519:if(!r.tty)return-J.Q;var n=X();return C[n>>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s<o;s++){var u=oc(i,y,C[n+8*s>>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var h=e.Float32Array;var c=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var me=new a(r);var ve=new s(r);var f=new u(r);var l=new h(r);var ee=new c(r);var d=e.byteLength;var be=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var m=t.ABORT|0;var v=t.cttz_i8|0;var b=0;var g=0;var y=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,A=0,P=0.0,M=0,C=0,k=0,I=0.0;var re=0;var R=0;var O=0;var D=0;var L=0;var F=0;var j=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var q=e.Math.sqrt;var H=e.Math.pow;var G=e.Math.cos;var V=e.Math.sin;var Y=e.Math.tan;var W=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ge=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var he=t.invoke_iiii;var ce=t.invoke_viiiii;var fe=t.invoke_vi;var le=t.invoke_ii;var ye=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Ae=t.___syscall6;var Pe=t._emscripten_set_main_loop_timing;var Me=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var ke=t._sbrk;var Ie=t.___cxa_begin_catch;var Re=t._emscripten_memcpy_big;var Oe=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var Fe=t._pthread_once;var je=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var qe=t._pthread_cleanup_push;var He=t._time;var Ge=t.___syscall140;var Ve=t.___syscall146;var Ye=0.0;function We(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);me=new a(e);ve=new s(e);f=new u(e);l=new h(e);ee=new c(e);r=e;return true}function Je(e){e=e|0;var t=0;t=be;be=be+e|0;be=be+15&-16;return t|0}function Ke(){return be|0}function Ze(e){e=e|0;be=e}function Qe(e,t){e=e|0;t=t|0;be=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!b){b=e;g=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0;m=be;be=be+608|0;l=m+88|0;f=m+72|0;u=m+64|0;s=m+48|0;a=m+24|0;o=m;c=m+96|0;d=m+92|0;h=e+4|0;p=e+8|0;if((pe[h>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(c,1100,o)|0;yr(c,m+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(c,1100,a)|0;yr(c,m+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;be=m;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(c,1100,s)|0;yr(c,u)|0}r=ge(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;be=m;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;be=m;return p|0}ki[n&0](a,pe[e>>2]|0,pe[h>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Oi[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(c,1100,f)|0;yr(c,l)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;be=m;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0;h=be;be=be+592|0;u=h+48|0;o=h+24|0;n=h;s=h+72|0;a=h+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;yr(s,h+16|0)|0;u=0;be=h;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;yr(s,h+40|0)|0;u=0;be=h;return u|0}pe[a>>2]=t;i=Oi[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;be=h;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;yr(s,h+64|0)|0;u=i;be=h;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;yr(o,u+16|0)|0;s=0;be=u;return s|0}pe[n>>2]=i;r=Oi[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0<i>>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;yr(o,u+40|0)|0;s=0;be=u;return s|0}if(!(r&7)){s=r;be=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;yr(o,u+64|0)|0;s=r;be=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0;B=be;be=be+960|0;L=B+232|0;D=B+216|0;O=B+208|0;R=B+192|0;I=B+184|0;k=B+168|0;C=B+160|0;M=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;y=B+88|0;g=B+72|0;b=B+64|0;v=B+48|0;f=B+40|0;d=B+24|0;l=B+16|0;c=B;P=B+440|0;F=B+376|0;j=B+304|0;m=B+236|0;if((t|0)==0|i>>>0>11){e=0;be=B;return e|0}pe[e>>2]=t;n=j;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){A=j+((n&255)<<2)|0;pe[A>>2]=(pe[A>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;h=1;a=0;s=-1;u=0;while(1){n=pe[j+(h<<2)>>2]|0;if(!n)pe[e+28+(h+-1<<2)>>2]=0;else{A=h+-1|0;pe[F+(A<<2)>>2]=o;o=n+o|0;w=16-h|0;pe[e+28+(A<<2)>>2]=(o+-1<<w|(1<<w)+-1)+1;pe[e+96+(A<<2)>>2]=u;pe[m+(h<<2)>>2]=u;a=a>>>0>h>>>0?a:h;s=s>>>0<h>>>0?s:h;u=n+u|0}h=h+1|0;if((h|0)==17){A=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[c>>2]=1154;pe[c+4>>2]=644;pe[c+8>>2]=1863;_r(P,1100,c)|0;yr(P,l)|0}if(!(n&7)){Oi[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(P,1100,d)|0;yr(P,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=A;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[j+(n<<2)>>2]|0)){pe[v>>2]=1154;pe[v+4>>2]=2273;pe[v+8>>2]=1261;_r(P,1100,v)|0;yr(P,b)|0}_=m+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[g>>2]=1154;pe[g+4>>2]=2277;pe[g+8>>2]=1274;_r(P,1100,g)|0;yr(P,y)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;y=(n&255)>>>0<i>>>0?i:0;_=e+8|0;pe[_>>2]=y;g=(y|0)!=0;if(g){b=1<<y;n=e+164|0;do{if(b>>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=b;a=e+168|0;n=pe[a>>2]|0;do{if(n){v=pe[n+-4>>2]|0;n=n+-8|0;if(!((v|0)!=0?(v|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(P,1100,x)|0;yr(P,T)|0}if(!(n&7)){Oi[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(P,1100,S)|0;yr(P,E)|0;break}}}while(0);n=b<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=b;pe[o>>2]=~b;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=b<<2;a=o;o=pe[o>>2]|0}}while(0);Wr(o|0,-1,n|0)|0;p=e+176|0;v=1;do{if(pe[j+(v<<2)>>2]|0){t=y-v|0;m=1<<t;o=v+-1|0;s=pe[F+(o<<2)>>2]|0;if(o>>>0>=16){pe[M>>2]=1154;pe[M+4>>2]=1953;pe[M+8>>2]=1737;_r(P,1100,M)|0;yr(P,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-v|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;l=v<<16;do{n=ve[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((me[r+n>>0]|0|0)!=(v|0)){pe[k>>2]=1154;pe[k+4>>2]=2319;pe[k+8>>2]=1303;_r(P,1100,k)|0;yr(P,I)|0}c=s<<t;o=n|l;h=0;do{u=h+c|0;if(u>>>0>=b>>>0){pe[R>>2]=1154;pe[R+4>>2]=2325;pe[R+8>>2]=1337;_r(P,1100,R)|0;yr(P,O)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(P,1100,D)|0;yr(P,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;h=h+1|0}while(h>>>0<m>>>0);s=s+1|0}while(s>>>0<=d>>>0)}}v=v+1|0}while(y>>>0>=v>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[F+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(g){while(1){if(!i)break t;n=i+-1|0;if(!(pe[j+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=y+1|0;pe[a>>2]=n;if(n>>>0<=A>>>0){while(1){if(pe[j+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>A>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;be=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=qr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=qr(o)|0;pe[r>>2]=t;r=n;return r|0}function ht(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((me[e>>0]|0)<<8|(me[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((me[e+2>>0]|0)<<8|(me[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((me[e+7>>0]|0)<<16|(me[e+6>>0]|0)<<24|(me[e+8>>0]|0)<<8|(me[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(me[e+12>>0]|0)<<8|(me[e+13>>0]|0);pe[r+8>>2]=(me[e+14>>0]|0)<<8|(me[e+15>>0]|0);pe[r+12>>2]=me[e+16>>0];pe[r+16>>2]=me[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=me[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(me[e+26>>0]|0)<<16|(me[e+25>>0]|0)<<24|(me[e+27>>0]|0)<<8|(me[e+28>>0]|0);pe[r+28>>2]=(me[e+30>>0]|0)<<16|(me[e+29>>0]|0)<<24|(me[e+31>>0]|0)<<8|(me[e+32>>0]|0);r=1;return r|0}function ct(e){e=e|0;Ie(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=be;be=be+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)lt(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;be=o;return}if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;yr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;be=o;return}function lt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0;d=be;be=be+640|0;l=d+112|0;f=d+96|0;c=d+88|0;h=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){be=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;yr(a,n)|0}if(!(t&7)){Oi[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;yr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;yr(a,u)|0}if(!(t&7)){Oi[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[h>>2]=1154;pe[h+4>>2]=2499;pe[h+8>>2]=1516;_r(a,1100,h)|0;yr(a,c)|0;break}}}while(0);if(!(e&7)){Oi[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;be=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;yr(a,l)|0;be=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0;c=be;be=be+560|0;a=c+40|0;s=c+24|0;t=c;o=c+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;yr(o,c+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{h=t+164|0;pe[h>>2]=0;pe[h+4>>2]=0;pe[h+8>>2]=0;pe[h+12>>2]=0}pe[i>>2]=t;h=t;u=pe[e>>2]|0}else{h=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;yr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;h=st(h,u,n,e)|0;be=c;return h|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<<r>>>0<o>>>0&1)|0;e=e>>>0<11?e&255:11;h=st(h,u,n,e)|0;be=c;return h|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0;L=be;be=be+800|0;k=L+256|0;C=L+240|0;M=L+232|0;P=L+216|0;A=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;y=L+120|0;g=L+112|0;b=L+96|0;v=L+88|0;m=L+72|0;f=L+64|0;c=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;O=L+288|0;D=L+264|0;I=mt(e,14)|0;if(!I){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Oi[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(O,1100,n)|0;yr(O,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;be=L;return t|0}lt(i);pe[r>>2]=0;t=1;be=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(I|0)){if(r>>>0<=I>>>0){do{if((pe[t+12>>2]|0)>>>0<I>>>0){if(nt(d,I,(r+1|0)==(I|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;be=L;return t|0}}while(0);Wr((pe[d>>2]|0)+r|0,0,I-r|0)|0}pe[p>>2]=I}Wr(pe[d>>2]|0,0,I|0)|0;l=e+20|0;r=pe[l>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=me[i>>0]|0}r=r+8|0;pe[l>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(O,1100,u)|0;yr(O,s)|0;r=pe[l>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}h=i>>>27;pe[n>>2]=i<<5;pe[l>>2]=r+-5;if((h+-1|0)>>>0>20){t=0;be=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Wr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(h){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[l>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=me[i>>0]|0}r=r+8|0;pe[l>>2]=r;if((r|0)>=33){pe[c>>2]=1154;pe[c+4>>2]=3199;pe[c+8>>2]=1650;_r(O,1100,c)|0;yr(O,f)|0;r=pe[l>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[l>>2]=r+-3;de[u+(me[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(h|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;h=e+16|0;i=0;t:while(1){a=I-i|0;r=vt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[m>>2]=1154;pe[m+4>>2]=903;pe[m+8>>2]=1781;_r(O,1100,m)|0;yr(O,v)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[l>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=me[n>>0]|0}r=r+8|0;pe[l>>2]=r;if((r|0)>=33){pe[b>>2]=1154;pe[b+4>>2]=3199;pe[b+8>>2]=1650;_r(O,1100,b)|0;yr(O,g)|0;r=pe[l>>2]|0}n=n<<32-r|pe[h>>2];pe[h>>2]=n}while((r|0)<3);else n=pe[h>>2]|0;pe[h>>2]=n<<3;pe[l>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[l>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=me[n>>0]|0}r=r+8|0;pe[l>>2]=r;if((r|0)>=33){pe[y>>2]=1154;pe[y+4>>2]=3199;pe[y+8>>2]=1650;_r(O,1100,y)|0;yr(O,_)|0;r=pe[l>>2]|0}n=n<<32-r|pe[h>>2];pe[h>>2]=n}while((r|0)<7);else n=pe[h>>2]|0;pe[h>>2]=n<<7;pe[l>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){R=90;break t}o=pe[l>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=me[r>>0]|0}r=n+8|0;pe[l>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(O,1100,w)|0;yr(O,x)|0;r=pe[l>>2]|0}n=o<<32-r|pe[h>>2];pe[h>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[h>>2]|0;r=o}pe[h>>2]=n<<2;pe[l>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=me[r>>0]|0}r=n+8|0;pe[l>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(O,1100,T)|0;yr(O,S)|0;r=pe[l>>2]|0}n=o<<32-r|pe[h>>2];pe[h>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[h>>2]|0;r=o}pe[h>>2]=n<<6;pe[l>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(O,1100,E)|0;yr(O,A)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[P>>2]=1154;pe[P+4>>2]=903;pe[P+8>>2]=1781;_r(O,1100,P)|0;yr(O,M)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(I>>>0>r>>>0)i=r;else break}if((R|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(O,1100,C)|0;yr(O,k)|0;r=0;break}if((I|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;be=L;return t|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0;c=be;be=be+544|0;s=c+16|0;a=c;o=c+24|0;if(!t){h=0;be=c;return h|0}if(t>>>0<=16){h=bt(e,t)|0;be=c;return h|0}u=bt(e,t+-16|0)|0;h=e+20|0;t=pe[h>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=me[e>>0]|0}t=t+8|0;pe[h>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;yr(o,s)|0;t=pe[h>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[h>>2]=t+-16;h=e>>>16|u<<16;be=c;return h|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0;y=be;be=be+608|0;m=y+88|0;p=y+72|0;l=y+64|0;f=y+48|0;c=y+40|0;d=y+24|0;h=y+16|0;u=y;b=y+96|0;v=pe[t+20>>2]|0;g=e+20|0;s=pe[g>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0<n>>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=me[i>>0]|0}else r=0;pe[g>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(me[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0<n>>>0){i=me[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[g>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[v+16>>2]|0)>>>0){i=pe[(pe[v+168>>2]|0)+(o>>>(32-(pe[v+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(b,1100,u)|0;yr(b,h)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(b,1100,d)|0;yr(b,c)|0}if((me[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(b,1100,f)|0;yr(b,l)|0}}else{i=pe[v+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[v+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[v+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=ve[(pe[v+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(b,1100,p)|0;yr(b,m)|0;g=0;be=y;return g|0}}while(0);pe[a>>2]=pe[a>>2]<<i;pe[g>>2]=(pe[g>>2]|0)-i;g=r;be=y;return g|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0;c=be;be=be+560|0;s=c+40|0;u=c+24|0;r=c;a=c+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;yr(a,c+16|0)|0}h=e+20|0;r=pe[h>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<<t;pe[a>>2]=o;t=s-t|0;pe[h>>2]=t;be=c;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=me[e>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;yr(a,s)|0;r=pe[h>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<<t;pe[i>>2]=s;t=r-t|0;pe[h>>2]=t;be=c;return u|0}function gt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0;p=be;be=be+544|0;l=p+16|0;f=p;c=p+24|0;if((e|0)==0|t>>>0<62){d=0;be=p;return d|0}h=at(300,0)|0;if(!h){d=0;be=p;return d|0}pe[h>>2]=519686845;r=h+4|0;pe[r>>2]=0;i=h+8|0;pe[i>>2]=0;u=h+88|0;n=h+136|0;o=h+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;m=h+184|0;a=h+208|0;s=h+232|0;v=h+252|0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;de[v+12>>0]=0;v=h+268|0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;de[v+12>>0]=0;v=h+284|0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;de[v+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;pe[m+12>>2]=0;pe[m+16>>2]=0;de[m+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((me[e>>0]|0)<<8|(me[e+1>>0]|0)|0)==18552:0)?((me[e+2>>0]|0)<<8|(me[e+3>>0]|0))>>>0>=74:0)?((me[e+7>>0]|0)<<16|(me[e+6>>0]|0)<<24|(me[e+8>>0]|0)<<8|(me[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Pt(h)|0){r=pe[u>>2]|0;if((me[r+39>>0]|0)<<8|(me[r+40>>0]|0)){if(!(Mt(h)|0))break;if(!(Ct(h)|0))break;r=pe[u>>2]|0}if(!((me[r+55>>0]|0)<<8|(me[r+56>>0]|0))){v=h;be=p;return v|0}if(kt(h)|0?It(h)|0:0){v=h;be=p;return v|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;Ft(h);if(!(h&7)){Oi[pe[104>>2]&1](h,0,0,1,pe[27]|0)|0;v=0;be=p;return v|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(c,1100,f)|0;yr(c,l)|0;v=0;be=p;return v|0}return 0}function yt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,h=0,c=0;c=be;be=be+544|0;h=c;u=c+24|0;o=pe[e+88>>2]|0;s=(me[o+70+(n<<2)+1>>0]|0)<<16|(me[o+70+(n<<2)>>0]|0)<<24|(me[o+70+(n<<2)+2>>0]|0)<<8|(me[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(me[o+16>>0]|0)>>>0)o=(me[o+70+(a<<2)+1>>0]|0)<<16|(me[o+70+(a<<2)>>0]|0)<<24|(me[o+70+(a<<2)+2>>0]|0)<<8|(me[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;h=o-s|0;h=_t(e,u,h,t,r,i,n)|0;be=c;return h|0}pe[h>>2]=1154;pe[h+4>>2]=3704;pe[h+8>>2]=1792;_r(u,1100,h)|0;yr(u,c+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;h=o-s|0;h=_t(e,u,h,t,r,i,n)|0;be=c;return h|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,h=0,c=0;c=pe[e+88>>2]|0;u=((me[c+12>>0]|0)<<8|(me[c+13>>0]|0))>>>a;h=((me[c+14>>0]|0)<<8|(me[c+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;h=h>>>0>1?(h+3|0)>>>2:1;c=c+18|0;a=de[c>>0]|0;a=ge(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ge(a,h)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(h+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(me[c>>0]|0|0){case 0:{Rt(e,i,n,a,u,h,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Ot(e,i,n,a,u,h,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,h,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,h,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ht(e,t,r)|0;be=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ht(e,t,r)|0;be=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ht(e,t,r)|0;be=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ht(e,t,r)|0;be=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,h=0;u=be;be=be+576|0;a=u+56|0;o=u+40|0;n=u+64|0;h=u;pe[h>>2]=40;ht(e,t,h)|0;i=(((pe[h+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[h+8>>2]|0)>>>r)+3|0)>>>2;r=h+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;yr(n,a)|0;e=0}h=ge(ge(t,i)|0,e)|0;be=u;return h|0}function At(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0;p=be;be=be+608|0;l=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;c=p+88|0;m=p;f=p+84|0;pe[m>>2]=40;ht(e,t,m)|0;u=(((pe[m+4>>2]|0)>>>n)+3|0)>>>2;m=m+32|0;o=pe[m+4>>2]|0;do{switch(pe[m>>2]|0){case 0:{if(!o)o=8;else h=13;break}case 1:{if(!o)h=12;else h=13;break}case 2:{if(!o)h=12;else h=13;break}case 3:{if(!o)h=12;else h=13;break}case 4:{if(!o)h=12;else h=13;break}case 5:{if(!o)h=12;else h=13;break}case 6:{if(!o)h=12;else h=13;break}case 7:{if(!o)h=12;else h=13;break}case 8:{if(!o)h=12;else h=13;break}case 9:{if(!o)o=8;else h=13;break}default:h=13}}while(0);if((h|0)==12)o=16;else if((h|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(c,1100,a)|0;yr(c,s)|0;o=0}s=ge(o,u)|0;a=gt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)yt(a,f,i,s,n)|0;if(o){be=p;return}if((pe[a>>2]|0)!=519686845){be=p;return}Ft(a);if(!(a&7)){Oi[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;be=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(c,1100,d)|0;yr(c,l)|0;be=p;return}}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(me[n+68>>0]|0)<<8|(me[n+67>>0]|0)<<16|(me[n+69>>0]|0);r=i+t|0;n=(me[n+65>>0]|0)<<8|(me[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((me[t+39>>0]|0)<<8|(me[t+40>>0]|0))){if(!((me[t+55>>0]|0)<<8|(me[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((me[t+55>>0]|0)<<8|(me[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function Mt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0;p=be;be=be+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;l=(me[t+39>>0]|0)<<8|(me[t+40>>0]|0);c=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(l|0)){if(r>>>0<=l>>>0){do{if((pe[e+244>>2]|0)>>>0<l>>>0){if(nt(c,l,(r+1|0)==(l|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;be=p;return d|0}else t=r}while(0);Wr((pe[c>>2]|0)+(t<<2)|0,0,l-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=l}h=e+92|0;r=pe[e+4>>2]|0;i=(me[t+34>>0]|0)<<8|(me[t+33>>0]|0)<<16|(me[t+35>>0]|0);n=r+i|0;t=(me[t+37>>0]|0)<<8|(me[t+36>>0]|0)<<16|(me[t+38>>0]|0);if(!t){d=0;be=p;return d|0}pe[h>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(h,d)|0?(f=d+24|0,pt(h,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;yr(a,u)|0}if(!l)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[c>>2]|0;while(1){i=(vt(h,d)|0)+i&31;n=(vt(h,f)|0)+n&63;o=(vt(h,d)|0)+o&31;t=(vt(h,d)|0)+t|0;a=(vt(h,f)|0)+a&63;e=(vt(h,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(l|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;be=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0;E=be;be=be+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(me[n+47>>0]|0)<<8|(me[n+48>>0]|0);y=e+92|0;t=pe[e+4>>2]|0;r=(me[n+42>>0]|0)<<8|(me[n+41>>0]|0)<<16|(me[n+43>>0]|0);i=t+r|0;n=(me[n+45>>0]|0)<<8|(me[n+44>>0]|0)<<16|(me[n+46>>0]|0);if(!n){S=0;be=E;return S|0}pe[y>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(y,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));g=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(g,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Wr((pe[g>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;yr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;h=w+32|0;c=w+36|0;f=w+40|0;l=w+44|0;d=w+48|0;p=w+52|0;m=w+56|0;v=w+60|0;b=0;r=pe[g>>2]|0;while(1){t=0;do{A=vt(y,S)|0;g=t<<1;P=w+(g<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(A<<2)>>2]|0)&3;g=w+((g|1)<<2)|0;pe[g>>2]=(pe[g>>2]|0)+(pe[T+(A<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(me[1725+(pe[i>>2]|0)>>0]|0)<<2|(me[1725+(pe[w>>2]|0)>>0]|0)|(me[1725+(pe[n>>2]|0)>>0]|0)<<4|(me[1725+(pe[e>>2]|0)>>0]|0)<<6|(me[1725+(pe[o>>2]|0)>>0]|0)<<8|(me[1725+(pe[a>>2]|0)>>0]|0)<<10|(me[1725+(pe[s>>2]|0)>>0]|0)<<12|(me[1725+(pe[u>>2]|0)>>0]|0)<<14|(me[1725+(pe[h>>2]|0)>>0]|0)<<16|(me[1725+(pe[c>>2]|0)>>0]|0)<<18|(me[1725+(pe[f>>2]|0)>>0]|0)<<20|(me[1725+(pe[l>>2]|0)>>0]|0)<<22|(me[1725+(pe[d>>2]|0)>>0]|0)<<24|(me[1725+(pe[p>>2]|0)>>0]|0)<<26|(me[1725+(pe[m>>2]|0)>>0]|0)<<28|(me[1725+(pe[v>>2]|0)>>0]|0)<<30;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0;l=be;be=be+560|0;u=l+16|0;s=l;a=l+48|0;f=l+24|0;n=pe[e+88>>2]|0;c=(me[n+55>>0]|0)<<8|(me[n+56>>0]|0);h=e+92|0;t=pe[e+4>>2]|0;r=(me[n+50>>0]|0)<<8|(me[n+49>>0]|0)<<16|(me[n+51>>0]|0);i=t+r|0;n=(me[n+53>>0]|0)<<8|(me[n+52>>0]|0)<<16|(me[n+54>>0]|0);if(!n){f=0;be=l;return f|0}pe[h>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(h,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(c|0)){if(t>>>0<=c>>>0){do{if((pe[e+276>>2]|0)>>>0<c>>>0)if(nt(o,c,(t+1|0)==(c|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Wr((pe[o>>2]|0)+(t<<1)|0,0,c-t<<1|0)|0}pe[r>>2]=c}if(!c){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;yr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=vt(h,f)|0;r=u+r&255;i=(vt(h,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(c|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;be=l;return f|0}function It(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0;E=be;be=be+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(me[n+63>>0]|0)<<8|(me[n+64>>0]|0);y=e+92|0;t=pe[e+4>>2]|0;r=(me[n+58>>0]|0)<<8|(me[n+57>>0]|0)<<16|(me[n+59>>0]|0);i=t+r|0;n=(me[n+61>>0]|0)<<8|(me[n+60>>0]|0)<<16|(me[n+62>>0]|0);if(!n){S=0;be=E;return S|0}pe[y>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(y,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));g=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0<r>>>0)if(nt(g,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Wr((pe[g>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;yr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;h=w+32|0;c=w+36|0;f=w+40|0;l=w+44|0;d=w+48|0;p=w+52|0;m=w+56|0;v=w+60|0;b=0;r=pe[g>>2]|0;while(1){t=0;do{A=vt(y,S)|0;g=t<<1;P=w+(g<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(A<<2)>>2]|0)&7;g=w+((g|1)<<2)|0;pe[g>>2]=(pe[g>>2]|0)+(pe[T+(A<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);A=me[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(me[1729+(pe[i>>2]|0)>>0]|0)<<3|(me[1729+(pe[w>>2]|0)>>0]|0)|(me[1729+(pe[n>>2]|0)>>0]|0)<<6|(me[1729+(pe[e>>2]|0)>>0]|0)<<9|(me[1729+(pe[o>>2]|0)>>0]|0)<<12|A<<15;P=me[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(me[1729+(pe[s>>2]|0)>>0]|0)<<2|A>>>1|(me[1729+(pe[u>>2]|0)>>0]|0)<<5|(me[1729+(pe[h>>2]|0)>>0]|0)<<8|(me[1729+(pe[c>>2]|0)>>0]|0)<<11|P<<14;$[r+4>>1]=(me[1729+(pe[l>>2]|0)>>0]|0)<<1|P>>>2|(me[1729+(pe[d>>2]|0)>>0]|0)<<4|(me[1729+(pe[p>>2]|0)>>0]|0)<<7|(me[1729+(pe[m>>2]|0)>>0]|0)<<10|(me[1729+(pe[v>>2]|0)>>0]|0)<<13;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);P=t;be=E;return P|0}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0,N=0,U=0,z=0,X=0,q=0,H=0,G=0,V=0,Y=0,W=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,he=0,ce=0,fe=0,le=0;ce=be;be=be+720|0;he=ce+184|0;se=ce+168|0;ae=ce+160|0;oe=ce+144|0;ne=ce+136|0;ie=ce+120|0;re=ce+112|0;ee=ce+96|0;$=ce+88|0;Q=ce+72|0;Z=ce+64|0;K=ce+48|0;J=ce+40|0;ue=ce+24|0;te=ce+16|0;W=ce;V=ce+208|0;Y=ce+192|0;N=e+240|0;U=pe[N>>2]|0;q=e+256|0;H=pe[q>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;G=i>>>2;if(!(r<<24>>24)){be=ce;return 1}z=(s|0)==0;X=s+-1|0;R=(o&1|0)!=0;O=i<<1;D=e+92|0;L=e+116|0;F=e+140|0;j=e+236|0;B=a+-1|0;I=(n&1|0)!=0;k=e+188|0;E=e+252|0;A=G+1|0;P=G+2|0;M=G+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){g=x&1;u=(g|0)==0;b=(g<<5^32)+-16|0;g=(g<<1^2)+-1|0;_=u?a:-1;h=u?0:B;e=(x|0)==(X|0);y=R&e;if((h|0)!=(_|0)){v=R&e^1;m=u?w:w+C|0;while(1){if((n|0)==1)n=vt(D,L)|0|512;p=n&7;n=n>>>3;u=me[1823+p>>0]|0;e=0;do{l=(vt(D,F)|0)+o|0;d=l-U|0;o=d>>31;o=o&l|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[W>>2]=1154;pe[W+4>>2]=903;pe[W+8>>2]=1781;_r(V,1100,W)|0;yr(V,te)|0}pe[Y+(e<<2)>>2]=pe[(pe[j>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0<u>>>0);d=I&(h|0)==(B|0);if(y|d){l=0;do{c=ge(l,i)|0;e=m+c|0;u=(l|0)==0|v;f=l<<1;le=(vt(D,k)|0)+r|0;fe=le-H|0;r=fe>>31;r=r&le|fe&~r;do{if(d){if(!u){fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;break}pe[e>>2]=pe[Y+((me[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(V,1100,oe)|0;yr(V,ae)|0}pe[m+(c+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r}else{if(!u){fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;break}pe[e>>2]=pe[Y+((me[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(V,1100,ie)|0;yr(V,ne)|0}pe[m+(c+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;pe[m+(c+8)>>2]=pe[Y+((me[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(V,1100,se)|0;yr(V,he)|0}pe[m+(c+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);l=l+1|0}while((l|0)!=2)}else{pe[m>>2]=pe[Y+((me[1831+(p<<2)>>0]|0)<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(V,1100,ue)|0;yr(V,J)|0}pe[m+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[m+8>>2]=pe[Y+((me[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(V,1100,K)|0;yr(V,Z)|0}pe[m+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[m+(G<<2)>>2]=pe[Y+((me[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(V,1100,Q)|0;yr(V,$)|0}pe[m+(A<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[m+(P<<2)>>2]=pe[Y+((me[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(vt(D,k)|0)+r|0;le=fe-H|0;r=le>>31;r=r&fe|le&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(V,1100,ee)|0;yr(V,re)|0}pe[m+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}h=h+g|0;if((h|0)==(_|0))break;else m=m+b|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+O|0}}S=S+1|0}while((S|0)!=(T|0));be=ce;return 1}function Ot(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0,N=0,U=0,z=0,X=0,q=0,H=0,G=0,V=0,Y=0,W=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,he=0,ce=0,fe=0,le=0;fe=be;be=be+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;ce=fe+24|0;he=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;q=e+256|0;Z=pe[q>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(me[r+63>>0]|0)<<8|(me[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=fe;return 1}X=(s|0)==0;H=s+-1|0;G=i<<1;V=e+92|0;Y=e+116|0;W=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;j=(o&1|0)==0;I=e+288|0;R=e+284|0;O=e+252|0;D=e+140|0;L=e+236|0;F=e+164|0;C=e+268|0;k=W<<5;P=r&255;r=0;n=0;o=0;e=0;u=1;M=0;do{if(!X){E=pe[t+(M<<2)>>2]|0;A=0;while(1){T=A&1;h=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=h?a:-1;c=h?0:W;if((c|0)!=(S|0)){w=j|(A|0)!=(H|0);_=h?E:E+k|0;while(1){if((u|0)==1)u=vt(V,Y)|0|512;y=u&7;u=u>>>3;f=me[1823+y>>0]|0;h=0;do{b=(vt(V,F)|0)+n|0;g=b-$|0;n=g>>31;n=n&b|g&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;yr(te,he)|0}pe[ee+(h<<2)>>2]=ve[(pe[C>>2]|0)+(n<<1)>>1];h=h+1|0}while(h>>>0<f>>>0);h=0;do{b=(vt(V,D)|0)+e|0;g=b-U|0;e=g>>31;e=e&b|g&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[ce>>2]=1154;pe[ce+4>>2]=903;pe[ce+8>>2]=1781;_r(te,1100,ce)|0;yr(te,ne)|0}pe[re+(h<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];h=h+1|0}while(h>>>0<f>>>0);g=B|(c|0)!=(W|0);v=0;b=_;while(1){m=w|(v|0)==0;p=v<<1;l=0;d=b;while(1){f=(vt(V,J)|0)+r|0;h=f-z|0;r=h>>31;r=r&f|h&~r;h=(vt(V,K)|0)+o|0;f=h-Z|0;o=f>>31;o=o&h|f&~o;if((g|(l|0)==0)&m){h=me[l+p+(1831+(y<<2))>>0]|0;f=r*3|0;if((pe[I>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;yr(te,ae)|0}le=pe[R>>2]|0;pe[d>>2]=(ve[le+(f<<1)>>1]|0)<<16|pe[ee+(h<<2)>>2];pe[d+4>>2]=(ve[le+(f+2<<1)>>1]|0)<<16|(ve[le+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(h<<2)>>2];if((pe[q>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;yr(te,ue)|0}pe[d+12>>2]=pe[(pe[O>>2]|0)+(o<<2)>>2]}l=l+1|0;if((l|0)==2)break;else d=d+16|0}v=v+1|0;if((v|0)==2)break;else b=b+i|0}c=c+T|0;if((c|0)==(S|0))break;else _=_+x|0}}A=A+1|0;if((A|0)==(s|0))break;else E=E+G|0}}M=M+1|0}while((M|0)!=(P|0));be=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0,N=0,U=0,z=0,X=0,q=0,H=0,G=0,V=0,Y=0,W=0,J=0,K=0,Z=0;Z=be;be=be+608|0;W=Z+64|0;Y=Z+48|0;V=Z+40|0;K=Z+24|0;J=Z+16|0;G=Z;H=Z+88|0;q=Z+72|0;O=e+272|0;D=pe[O>>2]|0;r=pe[e+88>>2]|0;L=(me[r+63>>0]|0)<<8|(me[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=Z;return 1}F=(s|0)==0;j=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;R=(o&1|0)==0;C=e+288|0;k=e+284|0;I=e+164|0;P=e+268|0;M=z<<4;A=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!F){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;y=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){g=R|(T|0)!=(j|0);b=n?x:x+M|0;while(1){if((e|0)==1)e=vt(N,U)|0|512;v=e&7;e=e>>>3;h=me[1823+v>>0]|0;n=0;do{p=(vt(N,I)|0)+o|0;m=p-D|0;o=m>>31;o=o&p|m&~o;if((pe[O>>2]|0)>>>0<=o>>>0){pe[G>>2]=1154;pe[G+4>>2]=903;pe[G+8>>2]=1781;_r(H,1100,G)|0;yr(H,J)|0}pe[q+(n<<2)>>2]=ve[(pe[P>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0<h>>>0);m=(u|0)==(z|0)&E;d=0;p=b;while(1){l=g|(d|0)==0;f=d<<1;n=(vt(N,X)|0)+r|0;c=n-L|0;h=c>>31;h=h&n|c&~h;if(l){r=me[1831+(v<<2)+f>>0]|0;n=h*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(H,1100,K)|0;yr(H,V)|0}c=pe[k>>2]|0;pe[p>>2]=(ve[c+(n<<1)>>1]|0)<<16|pe[q+(r<<2)>>2];pe[p+4>>2]=(ve[c+(n+2<<1)>>1]|0)<<16|(ve[c+(n+1<<1)>>1]|0)}c=p+8|0;n=(vt(N,X)|0)+h|0;h=n-L|0;r=h>>31;r=r&n|h&~r;if(!(m|l^1)){n=me[(f|1)+(1831+(v<<2))>>0]|0;h=r*3|0;if((pe[C>>2]|0)>>>0<=h>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(H,1100,Y)|0;yr(H,W)|0}l=pe[k>>2]|0;pe[c>>2]=(ve[l+(h<<1)>>1]|0)<<16|pe[q+(n<<2)>>2];pe[p+12>>2]=(ve[l+(h+2<<1)>>1]|0)<<16|(ve[l+(h+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else b=b+y|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(A|0));be=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0,N=0,U=0,z=0,X=0,q=0,H=0,G=0,V=0,Y=0,W=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=be;be=be+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(me[r+63>>0]|0)<<8|(me[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=ae;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;W=e+212|0;B=(n&1|0)==0;j=(o&1|0)==0;D=e+288|0;L=e+284|0;F=e+164|0;R=e+268|0;O=Y<<5;k=r&255;r=0;n=0;o=0;e=0;u=1;I=0;do{if(!X){M=pe[t+(I<<2)>>2]|0;C=0;while(1){A=C&1;h=(A|0)==0;E=(A<<6^64)+-32|0;A=(A<<1^2)+-1|0;P=h?a:-1;c=h?0:Y;if((c|0)!=(P|0)){S=j|(C|0)!=(q|0);T=h?M:M+O|0;while(1){if((u|0)==1)u=vt(G,V)|0|512;x=u&7;u=u>>>3;f=me[1823+x>>0]|0;h=0;do{_=(vt(G,F)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;yr(Z,ne)|0}pe[J+(h<<2)>>2]=ve[(pe[R>>2]|0)+(e<<1)>>1];h=h+1|0}while(h>>>0<f>>>0);h=0;do{_=(vt(G,F)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;yr(Z,$)|0}pe[K+(h<<2)>>2]=ve[(pe[R>>2]|0)+(n<<1)>>1];h=h+1|0}while(h>>>0<f>>>0);w=B|(c|0)!=(Y|0);y=0;_=T;while(1){g=S|(y|0)==0;b=y<<1;m=0;v=_;while(1){p=(vt(G,W)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(vt(G,W)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(m|0)==0)&g){d=me[m+b+(1831+(x<<2))>>0]|0;p=o*3|0;h=pe[D>>2]|0;if(h>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;yr(Z,te)|0;h=pe[D>>2]|0}f=pe[L>>2]|0;l=r*3|0;if(h>>>0>l>>>0)h=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;yr(Z,ie)|0;h=pe[L>>2]|0}pe[v>>2]=(ve[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[v+4>>2]=(ve[f+(p+2<<1)>>1]|0)<<16|(ve[f+(p+1<<1)>>1]|0);pe[v+8>>2]=(ve[h+(l<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[v+12>>2]=(ve[h+(l+2<<1)>>1]|0)<<16|(ve[h+(l+1<<1)>>1]|0)}m=m+1|0;if((m|0)==2)break;else v=v+16|0}y=y+1|0;if((y|0)==2)break;else _=_+i|0}c=c+A|0;if((c|0)==(P|0))break;else T=T+E|0}}C=C+1|0;if((C|0)==(s|0))break;else M=M+H|0}}I=I+1|0}while((I|0)!=(k|0));be=ae;return 1}function Ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0;l=be;be=be+608|0;f=l+88|0;c=l+72|0;u=l+64|0;s=l+48|0;o=l+40|0;a=l+24|0;n=l+16|0;i=l;h=l+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(h,1100,i)|0;yr(h,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(h,1100,a)|0;yr(h,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(h,1100,s)|0;yr(h,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=l;return}if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(h,1100,c)|0;yr(h,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);be=l;return}function jt(e,t){e=e|0;t=t|0;var r=0;r=be;be=be+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;br(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=be;be=be+16|0;if(!(Fe(200,2)|0)){t=De(pe[49]|0)|0;be=e;return t|0}else jt(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=be;be=be+16|0;Ii[e&3]();jt(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;return}function Vt(e){e=e|0;Nt(e);return}function Yt(e){e=e|0;Nt(e);return}function Wt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=be;be=be+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;be=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0;d=be;be=be+64|0;l=d;f=pe[e>>2]|0;c=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[l>>2]=r;pe[l+4>>2]=e;pe[l+8>>2]=t;pe[l+12>>2]=i;i=l+16|0;e=l+20|0;t=l+24|0;n=l+28|0;o=l+32|0;a=l+40|0;s=(f|0)==(r|0);u=i;h=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(h|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[l+48>>2]=1;Ri[pe[(pe[r>>2]|0)+20>>2]&3](r,l,c,c,1,0);i=(pe[t>>2]|0)==1?c:0}else{Pi[pe[(pe[f>>2]|0)+24>>2]&3](f,l,c,1,0);switch(pe[l+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);be=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Pi[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ri[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ri[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+16|0;i=n;pe[i>>2]=pe[r>>2];e=Ai[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];be=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=be;be=be+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];jt(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Ai[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;jt(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;jt(2327,s)}}jt(2406,a)}function sr(){var e=0;e=be;be=be+16|0;if(!(je(196,6)|0)){be=e;return}else jt(2179,e)}function ur(e){e=e|0;var t=0;t=be;be=be+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){be=t;return}else jt(2229,t)}function hr(e){e=e|0;var t=0,r=0;t=0;while(1){if((me[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function cr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=cr()|0;pe[t>>2]=0-e;e=-1}return e|0}function lr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+lr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +lr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=cr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function mr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function vr(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Or(e)|0;break}r=(Sr(e)|0)==0;t=Or(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=vr(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Or(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function br(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Ar(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Ar(t,e)|0}}while(0);return r|0}function gr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Ir(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0<t>>>0){i=Ai[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Ai[pe[r+36>>2]&7](r,e,i)|0)>>>0<i>>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function yr(e,t){e=e|0;t=t|0;var r=0,i=0;r=be;be=be+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;be=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=be;be=be+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;be=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0;m=be;be=be+224|0;f=m+120|0;p=m+80|0;d=m;l=m+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)h=Sr(e)|0;else h=0;r=pe[e>>2]|0;c=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=l;a=e+28|0;pe[a>>2]=l;s=e+20|0;pe[s>>2]=l;pe[r>>2]=80;u=e+16|0;pe[u>>2]=l+80;i=Dr(e,t,f,d,p)|0;if(o){Ai[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|c;if(h)Er(e);r=(r&32|0)==0?i:-1}be=m;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0,c=0;c=be;be=be+128|0;n=c+112|0;h=c;o=h;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=cr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[h+48>>2]=u;e=h+20|0;pe[e>>2]=n;pe[h+44>>2]=n;t=n+u|0;n=h+16|0;pe[n>>2]=t;pe[h+28>>2]=t;t=wr(h,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}be=c;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Ar(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Ir(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0<n>>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Ai[pe[e+36>>2]&7](e,s,1)|0)==1)r=me[s>>0]|0;else r=-1}}while(0);be=u;return r|0}function Pr(e){e=e|0;var t=0,r=0;t=be;be=be+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Ae(6,r|0)|0)|0;be=t;return e|0}function Mr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=be;be=be+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(Ge(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;be=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0;p=be;be=be+48|0;f=p+16|0;c=p;i=p+32|0;l=e+28|0;n=pe[l>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;h=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ve(146,f|0)|0)|0}else{qe(7,e|0);pe[c>>2]=pe[u>>2];pe[c+4>>2]=i;pe[c+8>>2]=t;a=fr(Ve(146,c|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[l>>2]=(pe[l>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[h>>2]|0;pe[l>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[h>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[l>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[l>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}be=p;return r|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;be=n;return i|0}function Ir(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Rr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ge(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Or(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Ai[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0<n>>>0)Ai[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,h=0.0,c=0,f=0,l=0,d=0,p=0.0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0,B=0,N=0,U=0,z=0,X=0,q=0,H=0,G=0,V=0,Y=0,W=0,J=0,K=0,Z=0,Q=0;Q=be;be=be+624|0;Y=Q+24|0;J=Q+16|0;W=Q+588|0;X=Q+576|0;V=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;k=(e|0)!=0;I=N+40|0;B=I;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;q=W;H=z;G=H-q|0;R=-2-q|0;O=H+2|0;D=Y+288|0;L=W+9|0;F=L;j=W+8|0;o=0;m=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=cr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[m>>0]|0;if(!(a<<24>>24)){C=245;break}else s=m;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}M=s+1|0;a=de[M>>0]|0;s=M}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);b=s-m|0;if(k?(pe[e>>2]&32|0)==0:0)gr(m,b,e)|0;if((s|0)!=(m|0)){m=a;a=b;continue}c=a+1|0;s=de[c>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){M=(de[a+2>>0]|0)==36;c=M?a+3|0:c;s=de[c>>0]|0;d=M?u:-1;t=M?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<<a+-32&75913)){f=u;a=c;break t}u=1<<(s<<24>>24)+-32|u;c=c+1|0;s=de[c>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=c;break}}}else{f=0;a=c}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!k){v=f;a=u;t=0;M=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){v=f|8192;M=0-s|0}else{v=f;M=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{v=f;M=s}}else{v=f;M=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){c=(s<<24>>24)+-48|0;if(c>>>0<10){a=u;s=0}else{a=u;c=0;break}while(1){s=(s*10|0)+c|0;a=a+1|0;c=(de[a>>0]|0)+-48|0;if(c>>>0>=10){c=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;c=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(k){a=(pe[r>>2]|0)+(4-1)&~(4-1);c=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;c=0}}else c=-1}while(0);l=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(l*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;l=f}else{P=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;E=i+(d<<3)|0;A=pe[E+4>>2]|0;C=V;pe[C>>2]=pe[E>>2];pe[C+4>>2]=A;C=52;break}if(!k){o=0;break e}jr(V,f,r)}}while(0);if((C|0)==52?(C=0,!k):0){m=P;a=b;continue}d=de[a>>0]|0;d=(l|0)!=0&(d&15|0)==3?d&-33:d;u=v&-65537;A=(v&8192|0)==0?v:u;t:do{switch(d|0){case 110:switch(l|0){case 0:{pe[pe[V>>2]>>2]=o;m=P;a=b;continue e}case 1:{pe[pe[V>>2]>>2]=o;m=P;a=b;continue e}case 2:{m=pe[V>>2]|0;pe[m>>2]=o;pe[m+4>>2]=((o|0)<0)<<31>>31;m=P;a=b;continue e}case 3:{$[pe[V>>2]>>1]=o;m=P;a=b;continue e}case 4:{de[pe[V>>2]>>0]=o;m=P;a=b;continue e}case 6:{pe[pe[V>>2]>>2]=o;m=P;a=b;continue e}case 7:{m=pe[V>>2]|0;pe[m>>2]=o;pe[m+4>>2]=((o|0)<0)<<31>>31;m=P;a=b;continue e}default:{m=P;a=b;continue e}}case 112:{l=A|8;c=c>>>0>8?c:8;d=120;C=64;break}case 88:case 120:{l=A;C=64;break}case 111:{u=V;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=I;else{a=I;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(A&8)){s=A;l=0;f=5839;C=77}else{l=B-a+1|0;s=A;c=(c|0)<(l|0)?l:c;l=0;f=5839;C=77}break}case 105:case 100:{s=V;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Yr(0,0,a|0,s|0)|0;s=re;u=V;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(A&2048)){f=A&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=V;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[V>>2];m=N;s=1;l=0;d=5839;a=I;break}case 109:{a=cr()|0;a=hr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[V>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[V>>2];pe[U>>2]=0;pe[V>>2]=Z;c=-1;C=86;break}case 83:{if(!c){Nr(e,32,M,0,A);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{h=+ee[V>>3];pe[J>>2]=0;ee[te>>3]=h;if((pe[te+4>>2]|0)>=0)if(!(A&2048)){E=A&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{h=-h;S=1;E=5856}ee[te>>3]=h;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(h,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){m=d&32;b=(m|0)==0?E:E+9|0;v=S|2;a=12-c|0;do{if(!(c>>>0>11|(a|0)==0)){h=8.0;do{a=a+-1|0;h=h*16.0}while((a|0)!=0);if((de[b>>0]|0)==45){h=-(h+(-p-h));break}else{h=p+h-h;break}}else h=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;l=a+-2|0;de[l>>0]=d+15;f=(c|0)<1;u=(A&8|0)==0;s=W;while(1){E=~~h;a=s+1|0;de[s>>0]=me[5823+E>>0]|m;h=(h-+(E|0))*16.0;do{if((a-q|0)==1){if(u&(f&h==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(h!=0.0))break;else s=a}c=(c|0)!=0&(R+a|0)<(c|0)?O+c-l|0:G-l+a|0;u=c+v|0;Nr(e,32,M,u,A);if(!(pe[e>>2]&32))gr(b,v,e)|0;Nr(e,48,M,u,A^65536);a=a-q|0;if(!(pe[e>>2]&32))gr(W,a,e)|0;s=H-l|0;Nr(e,48,c-(a+s)|0,0,0);if(!(pe[e>>2]&32))gr(l,s,e)|0;Nr(e,32,M,u,A^8192);a=(u|0)<(M|0)?M:u;break}a=(c|0)<0?6:c;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;h=p*268435456.0}else{h=p;s=pe[J>>2]|0}T=(s|0)<0?Y:D;x=T;s=T;do{_=~~h>>>0;pe[s>>2]=_;s=s+4|0;h=(h-+(_>>>0))*1.0e9}while(h!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){l=(s|0)>29?29:s;c=u+-4|0;do{if(c>>>0<f>>>0)c=f;else{s=0;do{_=Kr(pe[c>>2]|0,0,l|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;y=ai(_|0,s|0,1e9,0)|0;pe[c>>2]=y;s=oi(_|0,s|0,1e9,0)|0;c=c+-4|0}while(c>>>0>=f>>>0);if(!s){c=f;break}c=f+-4|0;pe[c>>2]=s}}while(0);while(1){if(u>>>0<=c>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-l|0;pe[J>>2]=s;if((s|0)>0)f=c;else break}}else c=T;if((s|0)<0){b=((a+25|0)/9|0)+1|0;g=(w|0)==102;m=c;while(1){v=0-s|0;v=(v|0)>9?9:v;do{if(m>>>0<u>>>0){s=(1<<v)+-1|0;f=1e9>>>v;c=0;l=m;do{_=pe[l>>2]|0;pe[l>>2]=(_>>>v)+c;c=ge(_&s,f)|0;l=l+4|0}while(l>>>0<u>>>0);s=(pe[m>>2]|0)==0?m+4|0:m;if(!c){c=s;break}pe[u>>2]=c;c=s;u=u+4|0}else c=(pe[m>>2]|0)==0?m+4|0:m}while(0);s=g?T:c;u=(u-s>>2|0)>(b|0)?s+(b<<2)|0:u;s=(pe[J>>2]|0)+v|0;pe[J>>2]=s;if((s|0)>=0){m=c;break}else m=c}}else m=c;do{if(m>>>0<u>>>0){s=(x-m>>2)*9|0;f=pe[m>>2]|0;if(f>>>0<10)break;else c=10;do{c=c*10|0;s=s+1|0}while(f>>>0>=c>>>0)}else s=0}while(0);y=(w|0)==103;_=(a|0)!=0;c=a-((w|0)!=102?s:0)+((_&y)<<31>>31)|0;if((c|0)<(((u-x>>2)*9|0)+-9|0)){l=c+9216|0;g=(l|0)/9|0;c=T+(g+-1023<<2)|0;l=((l|0)%9|0)+1|0;if((l|0)<9){f=10;do{f=f*10|0;l=l+1|0}while((l|0)!=9)}else f=10;v=pe[c>>2]|0;b=(v>>>0)%(f>>>0)|0;if((b|0)==0?(T+(g+-1022<<2)|0)==(u|0):0)f=m;else C=163;do{if((C|0)==163){C=0;p=(((v>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;l=(f|0)/2|0;do{if(b>>>0<l>>>0)h=.5;else{if((b|0)==(l|0)?(T+(g+-1022<<2)|0)==(u|0):0){h=1.0;break}h=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;h=-h}}while(0);l=v-b|0;pe[c>>2]=l;if(!(p+h!=p)){f=m;break}w=l+f|0;pe[c>>2]=w;if(w>>>0>999999999){s=m;while(1){f=c+-4|0;pe[c>>2]=0;if(f>>>0<s>>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)c=f;else{m=s;c=f;break}}}s=(x-m>>2)*9|0;l=pe[m>>2]|0;if(l>>>0<10){f=m;break}else f=10;do{f=f*10|0;s=s+1|0}while(l>>>0>=f>>>0);f=m}}while(0);w=c+4|0;m=f;u=u>>>0>w>>>0?w:u}b=0-s|0;while(1){if(u>>>0<=m>>>0){g=0;w=u;break}c=u+-4|0;if(!(pe[c>>2]|0))u=c;else{g=1;w=u;break}}do{if(y){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=A&8;if(u)break;do{if(g){u=pe[w+-4>>2]|0;if(!u){c=9;break}if(!((u>>>0)%10|0)){f=10;c=0}else{c=0;break}do{f=f*10|0;c=c+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else c=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-c|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-c|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=A&8}while(0);v=a|u;f=(v|0)!=0&1;l=(d|32|0)==102;if(l){s=(s|0)>0?s:0;d=0}else{c=(s|0)<0?b:s;c=Br(c,((c|0)<0)<<31>>31,z)|0;if((H-c|0)<2)do{c=c+-1|0;de[c>>0]=48}while((H-c|0)<2);de[c+-1>>0]=(s>>31&2)+43;x=c+-2|0;de[x>>0]=d;s=H-x|0;d=x}b=S+1+a+f+s|0;Nr(e,32,M,b,A);if(!(pe[e>>2]&32))gr(E,S,e)|0;Nr(e,48,M,b,A^65536);do{if(l){c=m>>>0>T>>>0?T:m;s=c;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(c|0)){if((u|0)!=(L|0))break;de[j>>0]=48;u=j}else{if(u>>>0<=W>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>W>>>0)}}while(0);if(!(pe[e>>2]&32))gr(u,F-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(v){if(pe[e>>2]&32)break;gr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0<w>>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>W>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>W>>>0);if(!(pe[e>>2]&32))gr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0<w>>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{l=g?w:m+4|0;if((a|0)>-1){f=(u|0)==0;c=m;do{s=Br(pe[c>>2]|0,0,L)|0;if((s|0)==(L|0)){de[j>>0]=48;s=j}do{if((c|0)==(m|0)){u=s+1|0;if(!(pe[e>>2]&32))gr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}gr(5891,1,e)|0;s=u}else{if(s>>>0<=W>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>W>>>0)}}while(0);u=F-s|0;if(!(pe[e>>2]&32))gr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;c=c+4|0}while(c>>>0<l>>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;gr(d,H-d|0,e)|0}}while(0);Nr(e,32,M,b,A^8192);a=(b|0)<(M|0)?M:b}else{l=(d&32|0)!=0;f=h!=h|0.0!=0.0;s=f?0:S;c=s+3|0;Nr(e,32,M,c,u);a=pe[e>>2]|0;if(!(a&32)){gr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))gr(f?l?5883:5887:l?5875:5879,3,e)|0;Nr(e,32,M,c,A^8192);a=(c|0)<(M|0)?M:c}}while(0);m=P;continue e}default:{u=A;s=c;l=0;d=5839;a=I}}}while(0);t:do{if((C|0)==64){u=V;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=I;do{a=a+-1|0;de[a>>0]=me[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=V;if((l&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=l;l=0;f=5839;C=77}else{s=l;l=2;f=5839+(d>>4)|0;C=77}}else{a=I;s=l;l=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,I)|0;s=A;l=u;C=77}else if((C|0)==82){C=0;A=Rr(a,0,c)|0;E=(A|0)==0;m=a;s=E?c:A-a|0;l=0;d=5839;a=E?a+c|0:A}else if((C|0)==86){C=0;s=0;a=0;f=pe[V>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=mr(K,u)|0;if((a|0)<0|a>>>0>(c-s|0)>>>0)break;s=a+s|0;if(c>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,M,s,A);if(!s){a=0;C=98}else{u=0;c=pe[V>>2]|0;while(1){a=pe[c>>2]|0;if(!a){a=s;C=98;break t}a=mr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))gr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else c=c+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,M,a,A^8192);m=P;a=(M|0)>(a|0)?M:a;continue}if((C|0)==77){C=0;u=(c|0)>-1?s&-65537:s;s=V;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((c|0)!=0|s){s=(s&1^1)+(B-a)|0;m=a;s=(c|0)>(s|0)?c:s;d=f;a=I}else{m=I;s=0;d=f;a=I}}f=a-m|0;s=(s|0)<(f|0)?f:s;c=l+s|0;a=(M|0)<(c|0)?c:M;Nr(e,32,a,c,u);if(!(pe[e>>2]&32))gr(d,l,e)|0;Nr(e,48,a,c,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))gr(m,f,e)|0;Nr(e,32,a,c,u^8192);m=P}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;jr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);be=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=be;be=be+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Wr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){gr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;gr(a,n,e)|0}}while(0);be=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,A=0,P=0,M=0,C=0,k=0,I=0,R=0,O=0,D=0,L=0,F=0,j=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<<e)}while(0);j=e<<3;pe[n+4>>2]=j|3;j=n+(j|4)|0;pe[j>>2]=pe[j>>2]|1;j=o;return j|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<<e;i=r<<e&(i|0-i);i=(i&0-i)+-1|0;u=i>>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;h=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<<e);h=a}}while(0);j=e<<3;a=j-d|0;pe[o+4>>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+j>>2]=a;if(h){n=pe[156]|0;r=h>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<<r;if(e&r){e=644+(t+2<<2)|0;t=pe[e>>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{c=e;f=t}}else{pe[151]=e|r;c=644+(t+2<<2)|0;f=i}pe[c>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;j=u;return j|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;F=r>>>12&16;r=r>>>F;L=r>>>5&8;r=r>>>L;j=r>>>2&4;r=r>>>j;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|F|j|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;j=e>>>0<r>>>0;r=j?e:r;e=t;i=j?t:i}o=pe[155]|0;if(i>>>0<o>>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){l=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0<o>>>0)Xe();else{pe[e>>2]=0;l=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0<o>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;l=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=l;if(!l){pe[152]=pe[152]&~(1<<t);break}}else{if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=l;else pe[a+20>>2]=l;if(!l)break}e=pe[155]|0;if(l>>>0<e>>>0)Xe();pe[l+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0<e>>>0)Xe();else{pe[l+16>>2]=t;pe[t+24>>2]=l;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=t;pe[t+24>>2]=l;break}}}while(0);if(u>>>0<16){j=u+d|0;pe[i+4>>2]=j|3;j=i+(j+4)|0;pe[j>>2]=pe[j>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<<r;if(e&r){t=644+(t+2<<2)|0;e=pe[t>>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;m=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;m=n}pe[p>>2]=o;pe[m+12>>2]=o;pe[o+8>>2]=m;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}j=i+8|0;return j|0}else m=d}else m=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;c=pe[152]|0;if(c){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)h=31;else{m=(e+1048320|0)>>>16&8;_=e<<m;p=(_+520192|0)>>>16&4;_=_<<p;h=(_+245760|0)>>>16&2;h=14-(p|m|h)+(_<<h>>>15)|0;h=f>>>(h+7|0)&1|h<<1}else h=0;e=pe[908+(h<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((h|0)==31?0:25-(h>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0<a>>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<<h;e=c&(e|0-e);if(!e){m=f;break}e=(e&0-e)+-1|0;l=e>>>12&16;e=e>>>l;c=e>>>5&8;e=e>>>c;p=e>>>2&4;e=e>>>p;m=e>>>1&2;e=e>>>m;n=e>>>1&1;n=pe[908+((c|l|p|m|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;m=(pe[o+4>>2]&-8)-f|0;n=m>>>0<r>>>0;r=n?m:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0<n>>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0<n>>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0<n>>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<<t);break}}else{if(o>>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0<e>>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0<e>>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<<t;if(r&t){t=644+(e+2<<2)|0;e=pe[t>>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{b=t;g=e}}else{pe[151]=r|t;b=644+(e+2<<2)|0;g=i}pe[b>>2]=a;pe[g+12>>2]=a;pe[u+(f+8)>>2]=g;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{F=(t+1048320|0)>>>16&8;j=t<<F;L=(j+520192|0)>>>16&4;j=j<<L;i=(j+245760|0)>>>16&2;i=14-(L|F|i)+(j<<i>>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<<i;if(!(e&r)){pe[152]=e|r;pe[t>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&T>>>0>=j>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{j=s+f|0;pe[u+4>>2]=j|3;j=u+(j+4)|0;pe[j>>2]=pe[j>>2]|1}}while(0);j=u+8|0;return j|0}else m=f}else m=f}else m=-1}while(0);r=pe[153]|0;if(r>>>0>=m>>>0){t=r-m|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+m;pe[153]=t;pe[e+(m+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=m|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;j=e+(r+4)|0;pe[j>>2]=pe[j>>2]|1}j=e+8|0;return j|0}e=pe[154]|0;if(e>>>0>m>>>0){F=e-m|0;pe[154]=F;j=pe[157]|0;pe[157]=j+m;pe[j+(m+4)>>2]=F|1;pe[j+4>>2]=m|3;j=j+8|0;return j|0}do{if(!(pe[269]|0)){e=Oe(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(He(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=m+48|0;s=pe[271]|0;h=m+47|0;a=s+h|0;s=0-s|0;c=a&s;if(c>>>0<=m>>>0){j=0;return j|0}e=pe[261]|0;if((e|0)!=0?(g=pe[259]|0,T=g+c|0,T>>>0<=g>>>0|T>>>0>e>>>0):0){j=0;return j|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(v=n+4|0,(r+(pe[v>>2]|0)|0)>>>0>e>>>0):0){o=n;e=v;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=ke(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=ke(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=c;else r=c-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>m>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=ke(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(y=pe[271]|0,y=h-r+y&0-y,y>>>0<2147483647):0)if((ke(y|0)|0)==(-1|0)){ke(o|0)|0;break t}else{r=y+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?c>>>0<2147483647:0)?(w=ke(c|0)|0,x=ke(0)|0,w>>>0<x>>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(m+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){A=e;P=r;M=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0<w>>>0&a>>>0>=A>>>0:0){pe[P>>2]=M+p;j=(pe[154]|0)+p|0;F=a+8|0;F=(F&7|0)==0?0:0-F&7;L=j-F|0;pe[157]=a+F;pe[154]=L;pe[a+(F+4)>>2]=L|1;pe[a+(j+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0<e>>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;l=r+4|0;pe[l>>2]=(pe[l>>2]|0)+p;l=w+8|0;l=(l&7|0)==0?0:0-l&7;h=w+(p+8)|0;h=(h&7|0)==0?0:0-h&7;t=w+(h+p)|0;f=l+m|0;d=w+f|0;c=t-(w+l)-m|0;pe[w+(l+4)>>2]=m|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){j=(pe[153]|0)+c|0;pe[153]=j;pe[156]=d;pe[w+(f+4)>>2]=j|1;pe[w+(j+f)>>2]=j;break}s=p+4|0;r=pe[w+(s+h)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((h|24)+p)>>2]|0;i=pe[w+(p+12+h)>>2]|0;do{if((i|0)==(t|0)){n=h|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<e>>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((h|8)+p)>>2]|0;if(n>>>0<e>>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+h)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<<e);break r}}while(0);r=pe[155]|0;if(D>>>0<r>>>0)Xe();pe[D+24>>2]=a;t=h|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0<r>>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((h|8)+p)>>2]|0;n=pe[w+(p+12+h)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0<e>>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<<o);break}do{if((n|0)==(r|0))k=n+8|0;else{if(n>>>0<e>>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){k=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[k>>2]=i}}while(0);t=w+((u|h)+p)|0;n=u+c|0}else n=c;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<<t;do{if(!(r&t)){pe[151]=r|t;L=644+(e+2<<2)|0;F=i}else{t=644+(e+2<<2)|0;e=pe[t>>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;F=e;break}Xe()}}while(0);pe[L>>2]=d;pe[F+12>>2]=d;pe[w+(f+8)>>2]=F;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;F=t<<L;D=(F+520192|0)>>>16&4;F=F<<D;i=(F+245760|0)>>>16&2;i=14-(D|L|i)+(F<<i>>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<<i;if(!(e&r)){pe[152]=e|r;pe[t>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){j=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else j=t}while(0);t=j+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&j>>>0>=F>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=j;pe[w+(f+24)>>2]=0;break}else Xe()}else{j=(pe[154]|0)+c|0;pe[154]=j;pe[157]=d;pe[w+(f+4)>>2]=j|1}}while(0);j=w+(l|8)|0;return j|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0<n>>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;j=p+-40-r|0;pe[157]=w+r;pe[154]=j;pe[w+(r+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0<i>>>0)do{j=t;t=t+4|0;pe[t>>2]=7}while((j+8|0)>>>0<i>>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<<t;if(r&t){t=644+(e+2<<2)|0;e=pe[t>>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{I=t;R=e}}else{pe[151]=r|t;I=644+(e+2<<2)|0;R=i}pe[I>>2]=a;pe[R+12>>2]=a;pe[a+8>>2]=R;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{F=(t+1048320|0)>>>16&8;j=t<<F;L=(j+520192|0)>>>16&4;j=j<<L;i=(j+245760|0)>>>16&2;i=14-(L|F|i)+(j<<i>>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<<i;if(!(t&e)){pe[152]=t|e;pe[r>>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){O=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else O=t}while(0);t=O+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&O>>>0>=j>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=O;pe[a+24>>2]=0;break}else Xe()}}else{j=pe[155]|0;if((j|0)==0|w>>>0<j>>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{j=t<<1;F=644+(j<<2)|0;pe[644+(j+3<<2)>>2]=F;pe[644+(j+2<<2)>>2]=F;t=t+1|0}while((t|0)!=32);j=w+8|0;j=(j&7|0)==0?0:0-j&7;F=p+-40-j|0;pe[157]=w+j;pe[154]=F;pe[w+(j+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>m>>>0){F=t-m|0;pe[154]=F;j=pe[157]|0;pe[157]=j+m;pe[j+(m+4)>>2]=F|1;pe[j+4>>2]=m|3;j=j+8|0;return j|0}}j=cr()|0;pe[j>>2]=12;j=0;return j|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0,y=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0<s>>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;m=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;c=e+u|0;f=t+d|0;if(c>>>0<s>>>0)Xe();if((c|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){y=c;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[m>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<s>>>0)Xe();if((pe[i+12>>2]|0)!=(c|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<<n);y=c;o=f;break}if((r|0)!=(t|0)){if(r>>>0<s>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(c|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;y=c;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(c|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){h=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<s>>>0)Xe();else{pe[r>>2]=0;h=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0<s>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(c|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(c|0)){pe[t>>2]=i;pe[r>>2]=n;h=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((c|0)==(pe[r>>2]|0)){pe[r>>2]=h;if(!h){pe[152]=pe[152]&~(1<<t);y=c;o=f;break}}else{if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(c|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h){y=c;o=f;break}}r=pe[155]|0;if(h>>>0<r>>>0)Xe();pe[h+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0<r>>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;y=c;o=f;break}else{y=c;o=f}}else{y=c;o=f}}else{y=t;o=d}}while(0);if(y>>>0>=m>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((m|0)==(pe[157]|0)){g=(pe[154]|0)+o|0;pe[154]=g;pe[157]=y;pe[y+4>>2]=g|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((m|0)==(pe[156]|0)){g=(pe[153]|0)+o|0;pe[153]=g;pe[156]=y;pe[y+4>>2]=g|1;pe[y+g>>2]=g;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(m|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(m|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(m|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((m|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<<t);break}}else{if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(m|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0<r>>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0<r>>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(m|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<<n);break}if((r|0)!=(t|0)){if(r>>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(m|0))l=t;else Xe()}else l=r+8|0;pe[i+12>>2]=r;pe[l>>2]=i}}while(0);pe[y+4>>2]=o|1;pe[y+o>>2]=o;if((y|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[y+4>>2]=o|1;pe[y+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<<t;if(i&t){t=644+(r+2<<2)|0;r=pe[t>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{v=t;b=r}}else{pe[151]=i|t;v=644+(r+2<<2)|0;b=n}pe[v>>2]=y;pe[b+12>>2]=y;pe[y+8>>2]=b;pe[y+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{v=(t+1048320|0)>>>16&8;b=t<<v;m=(b+520192|0)>>>16&4;b=b<<m;n=(b+245760|0)>>>16&2;n=14-(m|v|n)+(b<<n>>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[y+28>>2]=n;pe[y+20>>2]=0;pe[y+16>>2]=0;r=pe[152]|0;i=1<<n;e:do{if(r&i){t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){g=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=y;pe[y+24>>2]=t;pe[y+12>>2]=y;pe[y+8>>2]=y;break e}}else g=t}while(0);t=g+8|0;r=pe[t>>2]|0;b=pe[155]|0;if(r>>>0>=b>>>0&g>>>0>=b>>>0){pe[r+12>>2]=y;pe[t>>2]=y;pe[y+8>>2]=r;pe[y+12>>2]=g;pe[y+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=y;pe[y+24>>2]=t;pe[y+12>>2]=y;pe[y+8>>2]=y}}while(0);y=(pe[159]|0)+-1|0;pe[159]=y;if(!y)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=cr()|0;pe[e>>2]=12;e=0;return e|0}r=Hr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0<t>>>0?i:t)|0)|0;zr(e);e=r;return e|0}function qr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;c=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0<c>>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Gr(e+t|0,r);return e|0}if((c|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}l=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=l|1;pe[157]=e+t;pe[154]=l;return e|0}if((c|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0<t>>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0<t>>>0){e=0;return e|0}l=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(c|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){h=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<s>>>0)Xe();else{pe[i>>2]=0;h=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0<s>>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(c|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(c|0)){pe[r>>2]=o;pe[i>>2]=n;h=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((c|0)==(pe[i>>2]|0)){pe[i>>2]=h;if(!h){pe[152]=pe[152]&~(1<<r);break}}else{if(a>>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(c|0))pe[r>>2]=h;else pe[a+20>>2]=h;if(!h)break}i=pe[155]|0;if(h>>>0<i>>>0)Xe();pe[h+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0<i>>>0)Xe();else{pe[h+16>>2]=r;pe[r+24>>2]=h;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=r;pe[r+24>>2]=h;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<s>>>0)Xe();if((pe[n+12>>2]|0)!=(c|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<<o);break}if((i|0)!=(r|0)){if(i>>>0<s>>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(c|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(l>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=l|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Gr(e+t|0,l);return e|0}return 0}function Gr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,v=0,b=0,g=0;m=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){h=pe[e>>2]|0;if(!(r&3))return;l=e+(0-h)|0;f=h+t|0;u=pe[155]|0;if(l>>>0<u>>>0)Xe();if((l|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){g=l;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-h)>>2]=f|1;pe[m>>2]=f;return}o=h>>>3;if(h>>>0<256){n=pe[e+(8-h)>>2]|0;i=pe[e+(12-h)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<u>>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<<o);g=l;a=f;break}if((i|0)!=(r|0)){if(i>>>0<u>>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;g=l;a=f;break}s=pe[e+(24-h)>>2]|0;n=pe[e+(12-h)>>2]|0;do{if((n|0)==(l|0)){n=16-h|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<u>>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{o=pe[e+(8-h)>>2]|0;if(o>>>0<u>>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=n;pe[i>>2]=o;c=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-h)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<<r);g=l;a=f;break}}else{if(s>>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[s+20>>2]=c;if(!c){g=l;a=f;break}}n=pe[155]|0;if(c>>>0<n>>>0)Xe();pe[c+24>>2]=s;r=16-h|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0<n>>>0)Xe();else{pe[c+16>>2]=i;pe[i+24>>2]=c;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;g=l;a=f;break}else{g=l;a=f}}else{g=l;a=f}}else{g=e;a=t}}while(0);u=pe[155]|0;if(m>>>0<u>>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((m|0)==(pe[157]|0)){b=(pe[154]|0)+a|0;pe[154]=b;pe[157]=g;pe[g+4>>2]=b|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((m|0)==(pe[156]|0)){b=(pe[153]|0)+a|0;pe[153]=b;pe[156]=g;pe[g+4>>2]=b|1;pe[g+b>>2]=b;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(m|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<u>>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0<u>>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(m|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(m|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((m|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<<r);break}}else{if(s>>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(m|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0<i>>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0<i>>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<u>>>0)Xe();if((pe[n+12>>2]|0)!=(m|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<<o);break}if((i|0)!=(r|0)){if(i>>>0<u>>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(m|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[g+4>>2]=a|1;pe[g+a>>2]=a;if((g|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[g+4>>2]=a|1;pe[g+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<<r;if(n&r){r=644+(i+2<<2)|0;i=pe[r>>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{v=r;b=i}}else{pe[151]=n|r;v=644+(i+2<<2)|0;b=o}pe[v>>2]=g;pe[b+12>>2]=g;pe[g+8>>2]=b;pe[g+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{v=(r+1048320|0)>>>16&8;b=r<<v;m=(b+520192|0)>>>16&4;b=b<<m;o=(b+245760|0)>>>16&2;o=14-(m|v|o)+(b<<o>>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[g+28>>2]=o;pe[g+20>>2]=0;pe[g+16>>2]=0;i=pe[152]|0;n=1<<o;if(!(i&n)){pe[152]=i|n;pe[r>>2]=g;pe[g+24>>2]=r;pe[g+12>>2]=g;pe[g+8>>2]=g;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=g;pe[g+24>>2]=r;pe[g+12>>2]=g;pe[g+8>>2]=g;return}}while(0);i=r+8|0;n=pe[i>>2]|0;b=pe[155]|0;if(!(n>>>0>=b>>>0&r>>>0>=b>>>0))Xe();pe[n+12>>2]=g;pe[i>>2]=g;pe[g+8>>2]=n;pe[g+12>>2]=r;pe[g+24>>2]=0;return}function Vr(){}function Yr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<<r)-1)<<32-r}re=0;return t>>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<<r|(e&(1<<r)-1<<32-r)>>>32-r;return e<<r}re=e<<r-32;return 0}function Zr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;r=e+r>>>0;return(re=t+i+(r>>>0<e>>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Re(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<<r)-1)<<32-r}re=(t|0)<0?-1:0;return t>>r-32|0}function ei(e){e=e|0;var t=0;t=de[v+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[v+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[v+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[v+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ge(n,o)|0;i=e>>>16;e=(r>>>16)+(ge(n,i)|0)|0;n=t>>>16;t=ge(n,o)|0;return(re=(e>>>16)+(ge(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0;h=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Yr(h^e,u^t,h,u)|0;a=re;e=o^h;t=n^u;return Yr((si(s,a,Yr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,h=0;n=be;be=be+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;h=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Yr(a^e,o^t,a,o)|0;t=re;si(e,t,Yr(h^r,u^i,h,u)|0,re,s)|0;i=Yr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;be=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ge(t,o)|0)+(ge(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=be;be=be+16|0;n=o|0;si(e,t,r,i,n)|0;be=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0;c=e;u=t;h=u;a=r;l=i;s=l;if(!h){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}l=0;n=(c>>>0)/(a>>>0)>>>0;return(re=l,n)|0}else{if(!o){l=0;n=0;return(re=l,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;l=0;n=0;return(re=l,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(h|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=c>>>(f>>>0)&t|h<<s;t=h>>>(f>>>0)&t;o=0;s=c<<s;break}if(!n){l=0;n=0;return(re=l,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=u|t&0;l=0;n=0;return(re=l,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(h|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&h>>>(d>>>0)|(h<<f|c>>>(s>>>0))&t;t=t&h>>>(s>>>0);o=c<<p&u;s=(h<<p|c>>>(d>>>0))&u|c<<f&s-33>>31;break}if(n){pe[n>>2]=o&c;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=h>>>(p>>>0)|0;p=h<<32-p|c>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(h>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(h>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!c){if(n){pe[n>>2]=0;pe[n+4>>2]=(h>>>0)%(s>>>0)}d=0;p=(h>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&h|t&0}d=0;p=h>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(h|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=h<<s|c>>>(t>>>0);t=h>>>(t>>>0);o=0;s=c<<s;break}if(!n){d=0;p=0;return(re=d,p)|0}pe[n>>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){h=s;u=0;s=0}else{f=r|0|0;c=l|i&0;h=Zr(f|0,c|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;l=e>>>31|t<<1|0;Yr(h,r,i,l)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Yr(i,l,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&c)|0;t=re;a=a-1|0}while((a|0)!=0);h=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(h|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Ai[e&7](t|0,r|0,i|0)|0}function hi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Pi[e&3](t|0,r|0,i|0,n|0,o|0)}function ci(e,t){e=e|0;t=t|0;Mi[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function li(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;ki[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Ii[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ri[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function mi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Oi[e&1](t|0,r|0,i|0,n|0,o|0)|0}function vi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function bi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function gi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function yi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Ai=[bi,Wt,Fr,Cr,Mr,kr,bi,bi];var Pi=[gi,tr,er,gi];var Mi=[yi,qt,Vt,Ht,Gt,Yt,ur,Lr];var Ci=[_i,Pr];var ki=[wi];var Ii=[xi,ar,sr,xi];var Ri=[Ti,ir,rr,Ti];var Oi=[Si,ut];var Di=[Ei,Kt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:At,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Yr,_memset:Wr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:vr,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:cr,_crn_get_dxt_format:St,runPostSets:Vr,_emscripten_replace_memory:We,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:hi,dynCall_vi:ci,dynCall_ii:fi,dynCall_viii:li,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:mi,dynCall_viiii:vi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0<I)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)fb(e.preRun.shift());ab(bb),0<I||e.calledRun||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),r()},1)):r())}}function ud(t,r){if(!r||!e.noExitRuntime)throw!e.noExitRuntime&&(na=!0,m=void 0,ab(H),e.onExit)&&e.onExit(t),da?(process.stdout.once("drain",function(){process.exit(t)}),console.log(" "),setTimeout(function(){process.exit(t)},500)):ea&&"function"==typeof quit&&quit(t),new ia(t)}e.callMain=e.zd=function(t){function r(){for(var e=0;e<3;e++)n.push(0)}assert(0==I,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(0==bb.length,"cannot call main when preRun functions remain to be called"),t=t||[],Ha||(Ha=!0,ab(cb));var i=t.length+1,n=[D(hb(e.thisProgram),"i8",0)];r();for(var o=0;o<i-1;o+=1)n.push(D(hb(t[o]),"i8",0)),r();n.push(0),n=D(n,"i32",0);try{ud(e._main(i,n,0),!0)}catch(t){if(!(t instanceof ia)){if("SimulateInfiniteLoop"!=t)throw t&&"object"==typeof t&&t.stack&&e.W("exception thrown: "+[t,t.stack]),t;e.noExitRuntime=!0}}},e.run=e.run=td,e.exit=e.exit=ud;var wd=[];function x(t){t=void 0!==t?(e.print(t),e.W(t),JSON.stringify(t)):"",na=!0;var r="abort("+t+") at "+Oa()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";throw wd&&wd.forEach(function(e){r=e(r,t)}),r}if(e.abort=e.abort=x,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();var vd=!0;e.noInitialRun&&(vd=!1),td(),window.Module=e}).call(this,require("_process"),require("buffer").Buffer,"/lib")},{_process:123,buffer:49,crypto:58,fs:47,path:116}],2:[function(e,t,r){var i=r;i.bignum=e("bn.js"),i.define=e("./asn1/api").define,i.base=e("./asn1/base"),i.constants=e("./asn1/constants"),i.decoders=e("./asn1/decoders"),i.encoders=e("./asn1/encoders")},{"./asn1/api":3,"./asn1/base":5,"./asn1/constants":9,"./asn1/decoders":11,"./asn1/encoders":14,"bn.js":17}],3:[function(e,t,r){var i=e("../asn1"),n=e("inherits");function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}r.define=function(e,t){return new o(e,t)},o.prototype._createNamed=function(t){var r;try{r=e("vm").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){r=function(e){this._initNamed(e)}}return n(r,t),r.prototype._initNamed=function(e){t.call(this,e)},new r(this)},o.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i.decoders[e])),this.decoders[e]},o.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},o.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(i.encoders[e])),this.encoders[e]},o.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},{"../asn1":2,inherits:103,vm:155}],4:[function(e,t,r){var i=e("inherits"),n=e("../base").Reporter,o=e("buffer").Buffer;function a(e,t){n.call(this,t),o.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function s(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof s||(e=new s(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}i(a,n),(r.DecoderBuffer=a).prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},a.prototype.restore=function(e){var t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,n.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new a(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},(r.EncoderBuffer=s).prototype.join=function(t,r){return t||(t=new o(this.length)),r||(r=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(e){e.join(t,r),r+=e.length}):("number"==typeof this.value?t[r]=this.value:"string"==typeof this.value?t.write(this.value,r):o.isBuffer(this.value)&&this.value.copy(t,r),r+=this.length)),t}},{"../base":5,buffer:49,inherits:103}],5:[function(e,t,r){var i=r;i.Reporter=e("./reporter").Reporter,i.DecoderBuffer=e("./buffer").DecoderBuffer,i.EncoderBuffer=e("./buffer").EncoderBuffer,i.Node=e("./node")},{"./buffer":4,"./node":6,"./reporter":7}],6:[function(e,t,r){var c=e("../base").Reporter,i=e("../base").EncoderBuffer,d=e("../base").DecoderBuffer,n=e("minimalistic-assert"),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],a=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);function s(e,t){var r={};(this._baseState=r).enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=s;var u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];s.prototype.clone=function(){var t=this._baseState,r={};u.forEach(function(e){r[e]=t[e]});var e=new this.constructor(r.parent);return e._baseState=r,e},s.prototype._wrap=function(){var r=this._baseState;a.forEach(function(t){this[t]=function(){var e=new this.constructor(this);return r.children.push(e),e[t].apply(e,arguments)}},this)},s.prototype._init=function(e){var t=this._baseState;n(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),n.equal(t.children.length,1,"Root node can have only one child")},s.prototype._useArgs=function(e){var t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(n(null===t.children),(t.children=r).forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(n(null===t.args),t.args=e,t.reverseArgs=e.map(function(r){if("object"!=typeof r||r.constructor!==Object)return r;var i={};return Object.keys(r).forEach(function(e){e==(0|e)&&(e|=0);var t=r[e];i[t]=e}),i}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(t){s.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}}),o.forEach(function(r){s.prototype[r]=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return n(null===e.tag),e.tag=r,this._useArgs(t),this}}),s.prototype.use=function(e){n(e);var t=this._baseState;return n(null===t.use),t.use=e,this},s.prototype.optional=function(){return this._baseState.optional=!0,this},s.prototype.def=function(e){var t=this._baseState;return n(null===t.default),t.default=e,t.optional=!0,this},s.prototype.explicit=function(e){var t=this._baseState;return n(null===t.explicit&&null===t.implicit),t.explicit=e,this},s.prototype.implicit=function(e){var t=this._baseState;return n(null===t.explicit&&null===t.implicit),t.implicit=e,this},s.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},s.prototype.key=function(e){var t=this._baseState;return n(null===t.key),t.key=e,this},s.prototype.any=function(){return this._baseState.any=!0,this},s.prototype.choice=function(t){var e=this._baseState;return n(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map(function(e){return t[e]})),this},s.prototype.contains=function(e){var t=this._baseState;return n(null===t.use),t.contains=e,this},s.prototype._decode=function(t,r){var e=this._baseState;if(null===e.parent)return t.wrapResult(e.children[0]._decode(t,r));var i,n=e.default,o=!0,a=null;if(null!==e.key&&(a=t.enterKey(e.key)),e.optional){var s=null;if(null!==e.explicit?s=e.explicit:null!==e.implicit?s=e.implicit:null!==e.tag&&(s=e.tag),null!==s||e.any){if(o=this._peekTag(t,s,e.any),t.isError(o))return o}else{var u=t.save();try{null===e.choice?this._decodeGeneric(e.tag,t,r):this._decodeChoice(t,r),o=!0}catch(e){o=!1}t.restore(u)}}if(e.obj&&o&&(i=t.enterObject()),o){if(null!==e.explicit){var h=this._decodeTag(t,e.explicit);if(t.isError(h))return h;t=h}var c=t.offset;if(null===e.use&&null===e.choice){if(e.any)u=t.save();var f=this._decodeTag(t,null!==e.implicit?e.implicit:e.tag,e.any);if(t.isError(f))return f;e.any?n=t.raw(u):t=f}if(r&&r.track&&null!==e.tag&&r.track(t.path(),c,t.length,"tagged"),r&&r.track&&null!==e.tag&&r.track(t.path(),t.offset,t.length,"content"),n=e.any?n:null===e.choice?this._decodeGeneric(e.tag,t,r):this._decodeChoice(t,r),t.isError(n))return n;if(e.any||null!==e.choice||null===e.children||e.children.forEach(function(e){e._decode(t,r)}),e.contains&&("octstr"===e.tag||"bitstr"===e.tag)){var l=new d(n);n=this._getUse(e.contains,t._reporterState.obj)._decode(l,r)}}return e.obj&&o&&(n=t.leaveObject(i)),null===e.key||null===n&&!0!==o?null!==a&&t.exitKey(a):t.leaveKey(a,e.key,n),n},s.prototype._decodeGeneric=function(e,t,r){var i=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,i.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&i.args?this._decodeObjid(t,i.args[0],i.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},s.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),n(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},s.prototype._decodeChoice=function(n,o){var a=this._baseState,s=null,u=!1;return Object.keys(a.choice).some(function(e){var t=n.save(),r=a.choice[e];try{var i=r._decode(n,o);if(n.isError(i))return!1;s={type:e,value:i},u=!0}catch(e){return n.restore(t),!1}return!0},this),u?s:n.error("Choice not matched")},s.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},s.prototype._encode=function(e,t,r){var i=this._baseState;if(null===i.default||i.default!==e){var n=this._encodeValue(e,t,r);if(void 0!==n&&!this._skipDefault(n,t,r))return n}},s.prototype._encodeValue=function(i,n,e){var t=this._baseState;if(null===t.parent)return t.children[0]._encode(i,n||new c);var r=null;if(this.reporter=n,t.optional&&void 0===i){if(null===t.default)return;i=t.default}var o=null,a=!1;if(t.any)r=this._createEncoderBuffer(i);else if(t.choice)r=this._encodeChoice(i,n);else if(t.contains)o=this._getUse(t.contains,e)._encode(i,n),a=!0;else if(t.children)o=t.children.map(function(e){if("null_"===e._baseState.tag)return e._encode(null,n,i);if(null===e._baseState.key)return n.error("Child should have a key");var t=n.enterKey(e._baseState.key);if("object"!=typeof i)return n.error("Child expected, but input is not object");var r=e._encode(i[e._baseState.key],n,i);return n.leaveKey(t),r},this).filter(function(e){return e}),o=this._createEncoderBuffer(o);else if("seqof"===t.tag||"setof"===t.tag){if(!t.args||1!==t.args.length)return n.error("Too many args for : "+t.tag);if(!Array.isArray(i))return n.error("seqof/setof, but data is not Array");var s=this.clone();s._baseState.implicit=null,o=this._createEncoderBuffer(i.map(function(e){var t=this._baseState;return this._getUse(t.args[0],i)._encode(e,n)},s))}else null!==t.use?r=this._getUse(t.use,e)._encode(i,n):(o=this._encodePrimitive(t.tag,i),a=!0);if(!t.any&&null===t.choice){var u=null!==t.implicit?t.implicit:t.tag,h=null===t.implicit?"universal":"context";null===u?null===t.use&&n.error("Tag could be omitted only for .use()"):null===t.use&&(r=this._encodeComposite(u,a,h,o))}return null!==t.explicit&&(r=this._encodeComposite(t.explicit,!1,"context",r)),r},s.prototype._encodeChoice=function(e,t){var r=this._baseState,i=r.choice[e.type];return i||n(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(e.value,t)},s.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},s.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},s.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},{"../base":5,"minimalistic-assert":109}],7:[function(e,t,r){var i=e("inherits");function n(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}(r.Reporter=n).prototype.isError=function(e){return e instanceof o},n.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},n.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},n.prototype.enterKey=function(e){return this._reporterState.path.push(e)},n.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},n.prototype.leaveKey=function(e,t,r){var i=this._reporterState;this.exitKey(e),null!==i.obj&&(i.obj[t]=r)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},n.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},n.prototype.error=function(e){var t,r=this._reporterState,i=e instanceof o;if(t=i?e:new o(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return i||r.errors.push(t),t},n.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},i(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:103}],8:[function(e,t,r){var i=e("../constants");r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=i._reverse(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=i._reverse(r.tag)},{"../constants":9}],9:[function(e,t,r){var i=r;i._reverse=function(r){var i={};return Object.keys(r).forEach(function(e){(0|e)==e&&(e|=0);var t=r[e];i[t]=e}),i},i.der=e("./der")},{"./der":8}],10:[function(e,t,r){var i=e("inherits"),n=e("../../asn1"),o=n.base,a=n.bignum,s=n.constants.der;function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new h,this.tree._init(e.body)}function h(e){o.Node.call(this,"der",e)}function c(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var i=s.tagClass[r>>6],n=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function f(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4<n)return e.error("length octect is too long");for(var o=i=0;o<n;o++){i<<=8;var a=e.readUInt8(r);if(e.isError(a))return a;i|=a}return i}(t.exports=u).prototype.decode=function(e,t){return e instanceof o.DecoderBuffer||(e=new o.DecoderBuffer(e,t)),this.tree._decode(e,t)},i(h,o.Node),h.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;var i=e.save(),n=c(e,'Failed to peek tag: "'+t+'"');return e.isError(n)?n:(e.restore(i),n.tag===t||n.tagStr===t||n.tagStr+"of"===t||r)},h.prototype._decodeTag=function(e,t,r){var i=c(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;var n=f(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(n))return n;if(!r&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(i.primitive||null!==n)return e.skip(n,'Failed to match body of: "'+t+'"');var o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(n=e.offset-o.offset,e.restore(o),e.skip(n,'Failed to match body of: "'+t+'"'))},h.prototype._skipUntilEnd=function(e,t){for(;;){var r=c(e,t);if(e.isError(r))return r;var i,n=f(e,r.primitive,t);if(e.isError(n))return n;if(i=r.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(i))return i;if("end"===r.tagStr)break}},h.prototype._decodeList=function(e,t,r,i){for(var n=[];!e.isEmpty();){var o=this._peekTag(e,"end");if(e.isError(o))return o;var a=r.decode(e,"der",i);if(e.isError(a)&&o)break;n.push(a)}return n},h.prototype._decodeStr=function(e,t){if("bitstr"===t){var r=e.readUInt8();return e.isError(r)?r:{unused:r,data:e.raw()}}if("bmpstr"===t){var i=e.raw();if(i.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var n="",o=0;o<i.length/2;o++)n+=String.fromCharCode(i.readUInt16BE(2*o));return n}if("numstr"===t){var a=e.raw().toString("ascii");return this._isNumstr(a)?a:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"!==t)return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported");var s=e.raw().toString("ascii");return this._isPrintstr(s)?s:e.error("Decoding of string type: printstr unsupported characters")},h.prototype._decodeObjid=function(e,t,r){for(var i,n=[],o=0;!e.isEmpty();){var a=e.readUInt8();o<<=7,o|=127&a,0==(128&a)&&(n.push(o),o=0)}128&a&&n.push(o);var s=n[0]/40|0,u=n[0]%40;if(i=r?n:[s,u].concat(n.slice(1)),t){var h=t[i.join(" ")];void 0===h&&(h=t[i.join(".")]),void 0!==h&&(i=h)}return i},h.prototype._decodeTime=function(e,t){var r=e.raw().toString();if("gentime"===t)var i=0|r.slice(0,4),n=0|r.slice(4,6),o=0|r.slice(6,8),a=0|r.slice(8,10),s=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");i=0|r.slice(0,2),n=0|r.slice(2,4),o=0|r.slice(4,6),a=0|r.slice(6,8),s=0|r.slice(8,10),u=0|r.slice(10,12);i=i<70?2e3+i:1900+i}return Date.UTC(i,n-1,o,a,s,u,0)},h.prototype._decodeNull=function(e){return null},h.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},h.prototype._decodeInt=function(e,t){var r=e.raw(),i=new a(r);return t&&(i=t[i.toString(10)]||i),i},h.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},{"../../asn1":2,inherits:103}],11:[function(e,t,r){var i=r;i.der=e("./der"),i.pem=e("./pem")},{"./der":10,"./pem":12}],12:[function(e,t,r){var i=e("inherits"),f=e("buffer").Buffer,l=e("./der");function n(e){l.call(this,e),this.enc="pem"}i(n,l),(t.exports=n).prototype.decode=function(e,t){for(var r=e.toString().split(/[\r\n]+/g),i=t.label.toUpperCase(),n=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1,s=0;s<r.length;s++){var u=r[s].match(n);if(null!==u&&u[2]===i){if(-1!==o){if("END"!==u[1])break;a=s;break}if("BEGIN"!==u[1])break;o=s}}if(-1===o||-1===a)throw new Error("PEM section not found for: "+i);var h=r.slice(o+1,a).join("");h.replace(/[^a-z0-9\+\/=]+/gi,"");var c=new f(h,"base64");return l.prototype.decode.call(this,c,t)}},{"./der":10,buffer:49,inherits:103}],13:[function(e,t,r){var i=e("inherits"),h=e("buffer").Buffer,n=e("../../asn1"),o=n.base,c=n.constants.der;function a(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new s,this.tree._init(e.body)}function s(e){o.Node.call(this,"der",e)}function u(e){return e<10?"0"+e:e}(t.exports=a).prototype.encode=function(e,t){return this.tree._encode(e,t).join()},i(s,o.Node),s.prototype._encodeComposite=function(e,t,r,i){var n,o=function(e,t,r,i){var n;"seqof"===e?e="seq":"setof"===e&&(e="set");if(c.tagByName.hasOwnProperty(e))n=c.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return i.error("Unknown tag: "+e);n=e}if(31<=n)return i.error("Multi-octet tag encoding unsupported");t||(n|=32);return n|=c.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(i.length<128)return(n=new h(2))[0]=o,n[1]=i.length,this._createEncoderBuffer([n,i]);for(var a=1,s=i.length;256<=s;s>>=8)a++;(n=new h(2+a))[0]=o,n[1]=128|a;s=1+a;for(var u=i.length;0<u;s--,u>>=8)n[s]=255&u;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new h(2*e.length),i=0;i<e.length;i++)r.writeUInt16BE(e.charCodeAt(i),2*i);return this._createEncoderBuffer(r)},s.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s\.]+/g);for(var i=0;i<e.length;i++)e[i]|=0}else if(Array.isArray(e)){e=e.slice();for(i=0;i<e.length;i++)e[i]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(40<=e[1])return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var n=0;for(i=0;i<e.length;i++){var o=e[i];for(n++;128<=o;o>>=7)n++}var a=new h(n),s=a.length-1;for(i=e.length-1;0<=i;i--){o=e[i];for(a[s--]=127&o;0<(o>>=7);)a[s--]=128|127&o}return this._createEncoderBuffer(a)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[u(i.getFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(i.getFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!h.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new h(r)}if(h.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new h(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var o=e;256<=o;o>>=8)i++;for(o=(n=new Array(i)).length-1;0<=o;o--)n[o]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new h(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==n.defaultBuffer[i])return!1;return!0}},{"../../asn1":2,buffer:49,inherits:103}],14:[function(e,t,r){var i=r;i.der=e("./der"),i.pem=e("./pem")},{"./der":13,"./pem":15}],15:[function(e,t,r){var i=e("inherits"),o=e("./der");function n(e){o.call(this,e),this.enc="pem"}i(n,o),(t.exports=n).prototype.encode=function(e,t){for(var r=o.prototype.encode.call(this,e).toString("base64"),i=["-----BEGIN "+t.label+"-----"],n=0;n<r.length;n+=64)i.push(r.slice(n,n+64));return i.push("-----END "+t.label+"-----"),i.join("\n")}},{"./der":13,inherits:103}],16:[function(e,t,r){"use strict";r.byteLength=function(e){return 3*e.length/4-f(e)},r.toByteArray=function(e){var t,r,i,n,o,a=e.length;n=f(e),o=new c(3*a/4-n),r=0<n?a-4:a;var s=0;for(t=0;t<r;t+=4)i=h[e.charCodeAt(t)]<<18|h[e.charCodeAt(t+1)]<<12|h[e.charCodeAt(t+2)]<<6|h[e.charCodeAt(t+3)],o[s++]=i>>16&255,o[s++]=i>>8&255,o[s++]=255&i;2===n?(i=h[e.charCodeAt(t)]<<2|h[e.charCodeAt(t+1)]>>4,o[s++]=255&i):1===n&&(i=h[e.charCodeAt(t)]<<10|h[e.charCodeAt(t+1)]<<4|h[e.charCodeAt(t+2)]>>2,o[s++]=i>>8&255,o[s++]=255&i);return o},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n="",o=[],a=0,s=r-i;a<s;a+=16383)o.push(l(e,a,s<a+16383?s:a+16383));1==i?(t=e[r-1],n+=u[t>>2],n+=u[t<<4&63],n+="=="):2==i&&(t=(e[r-2]<<8)+e[r-1],n+=u[t>>10],n+=u[t>>4&63],n+=u[t<<2&63],n+="=");return o.push(n),o.join("")};for(var u=[],h=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n<o;++n)u[n]=i[n],h[i.charCodeAt(n)]=n;function f(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function l(e,t,r){for(var i,n,o=[],a=t;a<r;a+=3)i=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(u[(n=i)>>18&63]+u[n>>12&63]+u[n>>6&63]+u[63&n]);return o.join("")}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},{}],17:[function(T,e,t){!function(e,t){"use strict";function v(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function b(e,t,r){if(b.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=b:t.BN=b,(b.BN=b).wordSize=26;try{i=T("buffer").Buffer}catch(e){}function a(e,t,r){for(var i=0,n=Math.min(e.length,r),o=t;o<n;o++){var a=e.charCodeAt(o)-48;i<<=4,i|=49<=a&&a<=54?a-49+10:17<=a&&a<=22?a-17+10:15&a}return i}function f(e,t,r,i){for(var n=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;n*=i,n+=49<=s?s-49+10:17<=s?s-17+10:s}return n}b.isBN=function(e){return e instanceof b||null!==e&&"object"==typeof e&&e.constructor.wordSize===b.wordSize&&Array.isArray(e.words)},b.max=function(e,t){return 0<e.cmp(t)?e:t},b.min=function(e,t){return e.cmp(t)<0?e:t},b.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),v(t===(0|t)&&2<=t&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},b.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(v(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},b.prototype._initArray=function(e,t,r){if(v("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o,a=0;if("be"===r)for(i=e.length-1,n=0;0<=i;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);else if("le"===r)for(n=i=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[n]|=o<<a&67108863,this.words[n+1]=o>>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);return this.strip()},b.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=e.length-6,i=0;t<=r;r-=6)n=a(e,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,26<=(o+=24)&&(o-=26,i++);r+6!==t&&(n=a(e,t,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},b.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,h=r;h<s;h+=i)u=f(e,h,h+i,t),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!=a){var c=1;for(u=f(e,h,e.length,t),h=0;h<a;h++)c*=t;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},b.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},b.prototype.clone=function(){var e=new b(null);return this.copy(e),e},b.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},b.prototype.strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},b.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},b.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var h=1;h<i;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=l;d++){var p=h-d|0;c+=(a=(n=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}b.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,n=0,o=0;o<this.length;o++){var a=this.words[o],s=(16777215&(a<<i|n)).toString(16);r=0!==(n=a>>>24-i&16777215)||o!==this.length-1?l[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,o--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var u=d[e],h=p[e];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var f=c.modn(h).toString(e);r=(c=c.idivn(h)).isZero()?f+r:l[u-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}v(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2<this.length&&v(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},b.prototype.toJSON=function(){return this.toString(16)},b.prototype.toBuffer=function(e,t){return v(void 0!==i),this.toArrayLike(i,e,t)},b.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},b.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),n=r||Math.max(1,i);v(i<=n,"byte array longer than desired length"),v(0<n,"Requested array length <= 0"),this.strip();var o,a,s="le"===t,u=new e(n),h=this.clone();if(s){for(a=0;!h.isZero();a++)o=h.andln(255),h.iushrn(8),u[a]=o;for(;a<n;a++)u[a]=0}else{for(a=0;a<n-i;a++)u[a]=0;for(a=0;!h.isZero();a++)o=h.andln(255),h.iushrn(8),u[n-a-1]=o}return u},b.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return 4096<=t&&(r+=13,t>>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},b.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},b.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},b.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},b.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},b.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},b.prototype.isNeg=function(){return 0!==this.negative},b.prototype.neg=function(){return this.clone().ineg()},b.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},b.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},b.prototype.ior=function(e){return v(0==(this.negative|e.negative)),this.iuor(e)},b.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},b.prototype.iand=function(e){return v(0==(this.negative|e.negative)),this.iuand(e)},b.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},b.prototype.ixor=function(e){return v(0==(this.negative|e.negative)),this.iuxor(e)},b.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){v("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0<r&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return 0<r&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,t){v("number"==typeof e&&0<=e);var r=e/26|0,i=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},b.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();i=this.length>e.length?(r=this,e):(r=e,this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},b.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;i=0<n?(r=this,e):(r=e,this);for(var o=0,a=0;a<i.length;a++)o=(t=(0|r.words[a])-(0|i.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},b.prototype.sub=function(e){return this.clone().isub(e)};var o=function(e,t,r){var i,n,o,a=e.words,s=t.words,u=r.words,h=0,c=0|a[0],f=8191&c,l=c>>>13,d=0|a[1],p=8191&d,m=d>>>13,v=0|a[2],b=8191&v,g=v>>>13,y=0|a[3],_=8191&y,w=y>>>13,x=0|a[4],T=8191&x,S=x>>>13,E=0|a[5],A=8191&E,P=E>>>13,M=0|a[6],C=8191&M,k=M>>>13,I=0|a[7],R=8191&I,O=I>>>13,D=0|a[8],L=8191&D,F=D>>>13,j=0|a[9],B=8191&j,N=j>>>13,U=0|s[0],z=8191&U,X=U>>>13,q=0|s[1],H=8191&q,G=q>>>13,V=0|s[2],Y=8191&V,W=V>>>13,J=0|s[3],K=8191&J,Z=J>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,he=se>>>13,ce=0|s[8],fe=8191&ce,le=ce>>>13,de=0|s[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ve=(h+(i=Math.imul(f,z))|0)+((8191&(n=(n=Math.imul(f,X))+Math.imul(l,z)|0))<<13)|0;h=((o=Math.imul(l,X))+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,X))+Math.imul(m,z)|0,o=Math.imul(m,X);var be=(h+(i=i+Math.imul(f,H)|0)|0)+((8191&(n=(n=n+Math.imul(f,G)|0)+Math.imul(l,H)|0))<<13)|0;h=((o=o+Math.imul(l,G)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,z),n=(n=Math.imul(b,X))+Math.imul(g,z)|0,o=Math.imul(g,X),i=i+Math.imul(p,H)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,G)|0;var ge=(h+(i=i+Math.imul(f,Y)|0)|0)+((8191&(n=(n=n+Math.imul(f,W)|0)+Math.imul(l,Y)|0))<<13)|0;h=((o=o+Math.imul(l,W)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(_,z),n=(n=Math.imul(_,X))+Math.imul(w,z)|0,o=Math.imul(w,X),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,G)|0,i=i+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,W)|0;var ye=(h+(i=i+Math.imul(f,K)|0)|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(l,K)|0))<<13)|0;h=((o=o+Math.imul(l,Z)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(T,z),n=(n=Math.imul(T,X))+Math.imul(S,z)|0,o=Math.imul(S,X),i=i+Math.imul(_,H)|0,n=(n=n+Math.imul(_,G)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,G)|0,i=i+Math.imul(b,Y)|0,n=(n=n+Math.imul(b,W)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,W)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,Z)|0;var _e=(h+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,ee)|0)+Math.imul(l,$)|0))<<13)|0;h=((o=o+Math.imul(l,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(A,z),n=(n=Math.imul(A,X))+Math.imul(P,z)|0,o=Math.imul(P,X),i=i+Math.imul(T,H)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,G)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,W)|0,i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var we=(h+(i=i+Math.imul(f,re)|0)|0)+((8191&(n=(n=n+Math.imul(f,ie)|0)+Math.imul(l,re)|0))<<13)|0;h=((o=o+Math.imul(l,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(C,z),n=(n=Math.imul(C,X))+Math.imul(k,z)|0,o=Math.imul(k,X),i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,G)|0,i=i+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,W)|0,i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,Z)|0,i=i+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var xe=(h+(i=i+Math.imul(f,oe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ae)|0)+Math.imul(l,oe)|0))<<13)|0;h=((o=o+Math.imul(l,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,z),n=(n=Math.imul(R,X))+Math.imul(O,z)|0,o=Math.imul(O,X),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,G)|0,i=i+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(b,re)|0,n=(n=n+Math.imul(b,ie)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Te=(h+(i=i+Math.imul(f,ue)|0)|0)+((8191&(n=(n=n+Math.imul(f,he)|0)+Math.imul(l,ue)|0))<<13)|0;h=((o=o+Math.imul(l,he)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(L,z),n=(n=Math.imul(L,X))+Math.imul(F,z)|0,o=Math.imul(F,X),i=i+Math.imul(R,H)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,G)|0,i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,W)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Se=(h+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,le)|0)+Math.imul(l,fe)|0))<<13)|0;h=((o=o+Math.imul(l,le)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(B,z),n=(n=Math.imul(B,X))+Math.imul(N,z)|0,o=Math.imul(N,X),i=i+Math.imul(L,H)|0,n=(n=n+Math.imul(L,G)|0)+Math.imul(F,H)|0,o=o+Math.imul(F,G)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,W)|0,i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(b,ue)|0,n=(n=n+Math.imul(b,he)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,he)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,le)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,le)|0;var Ee=(h+(i=i+Math.imul(f,pe)|0)|0)+((8191&(n=(n=n+Math.imul(f,me)|0)+Math.imul(l,pe)|0))<<13)|0;h=((o=o+Math.imul(l,me)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(B,H),n=(n=Math.imul(B,G))+Math.imul(N,H)|0,o=Math.imul(N,G),i=i+Math.imul(L,Y)|0,n=(n=n+Math.imul(L,W)|0)+Math.imul(F,Y)|0,o=o+Math.imul(F,W)|0,i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,Z)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ie)|0,i=i+Math.imul(T,oe)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,he)|0,i=i+Math.imul(b,fe)|0,n=(n=n+Math.imul(b,le)|0)+Math.imul(g,fe)|0,o=o+Math.imul(g,le)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(B,Y),n=(n=Math.imul(B,W))+Math.imul(N,Y)|0,o=Math.imul(N,W),i=i+Math.imul(L,K)|0,n=(n=n+Math.imul(L,Z)|0)+Math.imul(F,K)|0,o=o+Math.imul(F,Z)|0,i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,i=i+Math.imul(T,ue)|0,n=(n=n+Math.imul(T,he)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,he)|0,i=i+Math.imul(_,fe)|0,n=(n=n+Math.imul(_,le)|0)+Math.imul(w,fe)|0,o=o+Math.imul(w,le)|0;var Pe=(h+(i=i+Math.imul(b,pe)|0)|0)+((8191&(n=(n=n+Math.imul(b,me)|0)+Math.imul(g,pe)|0))<<13)|0;h=((o=o+Math.imul(g,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(B,K),n=(n=Math.imul(B,Z))+Math.imul(N,K)|0,o=Math.imul(N,Z),i=i+Math.imul(L,$)|0,n=(n=n+Math.imul(L,ee)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ie)|0,i=i+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,he)|0,i=i+Math.imul(T,fe)|0,n=(n=n+Math.imul(T,le)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,le)|0;var Me=(h+(i=i+Math.imul(_,pe)|0)|0)+((8191&(n=(n=n+Math.imul(_,me)|0)+Math.imul(w,pe)|0))<<13)|0;h=((o=o+Math.imul(w,me)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(B,$),n=(n=Math.imul(B,ee))+Math.imul(N,$)|0,o=Math.imul(N,ee),i=i+Math.imul(L,re)|0,n=(n=n+Math.imul(L,ie)|0)+Math.imul(F,re)|0,o=o+Math.imul(F,ie)|0,i=i+Math.imul(R,oe)|0,n=(n=n+Math.imul(R,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(A,fe)|0,n=(n=n+Math.imul(A,le)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,le)|0;var Ce=(h+(i=i+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,me)|0)+Math.imul(S,pe)|0))<<13)|0;h=((o=o+Math.imul(S,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(B,re),n=(n=Math.imul(B,ie))+Math.imul(N,re)|0,o=Math.imul(N,ie),i=i+Math.imul(L,oe)|0,n=(n=n+Math.imul(L,ae)|0)+Math.imul(F,oe)|0,o=o+Math.imul(F,ae)|0,i=i+Math.imul(R,ue)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,he)|0,i=i+Math.imul(C,fe)|0,n=(n=n+Math.imul(C,le)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,le)|0;var ke=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(P,pe)|0))<<13)|0;h=((o=o+Math.imul(P,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,oe),n=(n=Math.imul(B,ae))+Math.imul(N,oe)|0,o=Math.imul(N,ae),i=i+Math.imul(L,ue)|0,n=(n=n+Math.imul(L,he)|0)+Math.imul(F,ue)|0,o=o+Math.imul(F,he)|0,i=i+Math.imul(R,fe)|0,n=(n=n+Math.imul(R,le)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,le)|0;var Ie=(h+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(B,ue),n=(n=Math.imul(B,he))+Math.imul(N,ue)|0,o=Math.imul(N,he),i=i+Math.imul(L,fe)|0,n=(n=n+Math.imul(L,le)|0)+Math.imul(F,fe)|0,o=o+Math.imul(F,le)|0;var Re=(h+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,me)|0)+Math.imul(O,pe)|0))<<13)|0;h=((o=o+Math.imul(O,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(B,fe),n=(n=Math.imul(B,le))+Math.imul(N,fe)|0,o=Math.imul(N,le);var Oe=(h+(i=i+Math.imul(L,pe)|0)|0)+((8191&(n=(n=n+Math.imul(L,me)|0)+Math.imul(F,pe)|0))<<13)|0;h=((o=o+Math.imul(F,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var De=(h+(i=Math.imul(B,pe))|0)+((8191&(n=(n=Math.imul(B,me))+Math.imul(N,pe)|0))<<13)|0;return h=((o=Math.imul(N,me))+(n>>>13)|0)+(De>>>26)|0,De&=67108863,u[0]=ve,u[1]=be,u[2]=ge,u[3]=ye,u[4]=_e,u[5]=we,u[6]=xe,u[7]=Te,u[8]=Se,u[9]=Ee,u[10]=Ae,u[11]=Pe,u[12]=Me,u[13]=Ce,u[14]=ke,u[15]=Ie,u[16]=Re,u[17]=Oe,u[18]=De,0!==h&&(u[19]=h,r.length++),r};function s(e,t,r){return(new u).mulp(e,t,r)}function u(e,t){this.x=e,this.y=t}Math.imul||(o=n),b.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?o(this,e,t):r<63?n(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var a=n;n=0;for(var s=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var c=o-h,f=(0|e.words[c])*(0|t.words[h]),l=67108863&f;s=67108863&(l=l+s|0),n+=(a=(a=a+(f/67108864|0)|0)+(l>>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},u.prototype.makeRBT=function(e){for(var t=new Array(e),r=b.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},u.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},u.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a<o;a++)i[a]=t[e[a]],n[a]=r[e[a]]},u.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),h=Math.sin(2*Math.PI/s),c=0;c<n;c+=s)for(var f=u,l=h,d=0;d<a;d++){var p=r[c+d],m=i[c+d],v=r[c+d+a],b=i[c+d+a],g=f*v-l*b;b=f*b+l*v,v=g,r[c+d]=p+v,i[c+d]=m+b,r[c+d+a]=p-v,i[c+d+a]=m-b,d!==s&&(g=u*f-h*l,l=u*l+h*f,f=g)}},u.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},u.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},u.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},u.prototype.convert13b=function(e,t,r,i){for(var n=0,o=0;o<t;o++)n+=0|e[o],r[2*o]=8191&n,n>>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o<i;++o)r[o]=0;v(0===n),v(0==(-8192&n))},u.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},u.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),a=new Array(i),s=new Array(i),u=new Array(i),h=new Array(i),c=new Array(i),f=new Array(i),l=r.words;l.length=i,this.convert13b(e.words,e.length,a,i),this.convert13b(t.words,t.length,h,i),this.transform(a,o,s,u,i,n),this.transform(h,o,c,f,i,n);for(var d=0;d<i;d++){var p=s[d]*c[d]-u[d]*f[d];u[d]=s[d]*f[d]+u[d]*c[d],s[d]=p}return this.conjugate(s,u,i),this.transform(s,u,l,o,i,n),this.conjugate(l,o,i),this.normalize13b(l,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},b.prototype.mul=function(e){var t=new b(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},b.prototype.mulf=function(e){var t=new b(null);return t.words=new Array(this.length+e.length),s(this,e,t)},b.prototype.imul=function(e){return this.clone().mulTo(e,this)},b.prototype.imuln=function(e){v("number"==typeof e),v(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,n=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new b(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},b.prototype.iushln=function(e){v("number"==typeof e&&0<=e);var t,r=e%26,i=(e-r)/26,n=67108863>>>26-r<<26-r;if(0!=r){var o=0;for(t=0;t<this.length;t++){var a=this.words[t]&n,s=(0|this.words[t])-a<<r;this.words[t]=s|o,o=a>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!=i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},b.prototype.ishln=function(e){return v(0===this.negative),this.iushln(e)},b.prototype.iushrn=function(e,t,r){var i;v("number"==typeof e&&0<=e),i=t?(t-t%26)/26:0;var n=e%26,o=Math.min((e-n)/26,this.length),a=67108863^67108863>>>n<<n,s=r;if(i-=o,i=Math.max(0,i),s){for(var u=0;u<o;u++)s.words[u]=this.words[u];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var h=0;for(u=this.length-1;0<=u&&(0!==h||i<=u);u--){var c=0|this.words[u];this.words[u]=h<<26-n|c>>>n,h=c&a}return s&&0!==h&&(s.words[s.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,t,r){return v(0===this.negative),this.iushrn(e,t,r)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){v("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},b.prototype.imaskn=function(e){v("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26;if(v(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!=t&&r++,this.length=Math.min(r,this.length),0!=t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},b.prototype.maskn=function(e){return this.clone().imaskn(e)},b.prototype.iaddn=function(e){return v("number"==typeof e),v(e<67108864),e<0?this.isubn(-e):0!==this.negative?(1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(e),this.negative=1),this):this._iaddn(e)},b.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&67108864<=this.words[t];t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},b.prototype.isubn=function(e){if(v("number"==typeof e),v(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},b.prototype.addn=function(e){return this.clone().iaddn(e)},b.prototype.subn=function(e){return this.clone().isubn(e)},b.prototype.iabs=function(){return this.negative=0,this},b.prototype.abs=function(){return this.clone().iabs()},b.prototype._ishlnsubmul=function(e,t,r){var i,n,o=e.length+r;this._expand(o);var a=0;for(i=0;i<e.length;i++){n=(0|this.words[i+r])+a;var s=(0|e.words[i])*t;a=((n-=67108863&s)>>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i<this.length-r;i++)a=(n=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&n;if(0===a)return this.strip();for(v(-1===a),i=a=0;i<this.length;i++)a=(n=-(0|this.words[i])+a)>>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,s=i.length-n.length;if("mod"!==t){(a=new b(null)).length=1+s,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var h=i.clone()._ishlnsubmul(n,1,s);0===h.negative&&(i=h,a&&(a.words[s]=1));for(var c=s-1;0<=c;c--){var f=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(f=Math.min(f/o|0,67108863),i._ishlnsubmul(n,f,c);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);a&&(a.words[c]=f)}return a&&a.strip(),i.strip(),"div"!==t&&0!=r&&i.iushrn(r),{div:a||null,mod:i}},b.prototype.divmod=function(e,t,r){return v(!e.isZero()),this.isZero()?{div:new b(0),mod:new b(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(i=o.div.neg()),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.iadd(e)),{div:i,mod:n}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(n=o.mod.neg(),r&&0!==n.negative&&n.isub(e)),{div:o.div,mod:n}):e.length>this.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,o},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},b.prototype.modn=function(e){v(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},b.prototype.idivn=function(e){v(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){v(0===e.negative),v(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new b(1),n=new b(0),o=new b(0),a=new b(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var u=r.clone(),h=t.clone();!t.isZero();){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(0<c)for(t.iushrn(c);0<c--;)(i.isOdd()||n.isOdd())&&(i.iadd(u),n.isub(h)),i.iushrn(1),n.iushrn(1);for(var l=0,d=1;0==(r.words[0]&d)&&l<26;++l,d<<=1);if(0<l)for(r.iushrn(l);0<l--;)(o.isOdd()||a.isOdd())&&(o.iadd(u),a.isub(h)),o.iushrn(1),a.iushrn(1);0<=t.cmp(r)?(t.isub(r),i.isub(o),n.isub(a)):(r.isub(t),o.isub(i),a.isub(n))}return{a:o,b:a,gcd:r.iushln(s)}},b.prototype._invmp=function(e){v(0===e.negative),v(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,n=new b(1),o=new b(0),a=r.clone();0<t.cmpn(1)&&0<r.cmpn(1);){for(var s=0,u=1;0==(t.words[0]&u)&&s<26;++s,u<<=1);if(0<s)for(t.iushrn(s);0<s--;)n.isOdd()&&n.iadd(a),n.iushrn(1);for(var h=0,c=1;0==(r.words[0]&c)&&h<26;++h,c<<=1);if(0<h)for(r.iushrn(h);0<h--;)o.isOdd()&&o.iadd(a),o.iushrn(1);0<=t.cmp(r)?(t.isub(r),n.isub(o)):(r.isub(t),o.isub(n))}return(i=0===t.cmpn(1)?n:o).cmpn(0)<0&&i.iadd(e),i},b.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0;for(var i=r.negative=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},b.prototype.invm=function(e){return this.egcd(e).a.umod(e)},b.prototype.isEven=function(){return 0==(1&this.words[0])},b.prototype.isOdd=function(){return 1==(1&this.words[0])},b.prototype.andln=function(e){return this.words[0]&e},b.prototype.bincn=function(e){v("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(1+r),this.words[r]|=i,this;for(var n=i,o=r;0!==n&&o<this.length;o++){var a=0|this.words[o];n=(a+=n)>>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1<this.length)t=1;else{r&&(e=-e),v(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},b.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},b.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;0<=r;r--){var i=0|this.words[r],n=0|e.words[r];if(i!=n){i<n?t=-1:n<i&&(t=1);break}}return t},b.prototype.gtn=function(e){return 1===this.cmpn(e)},b.prototype.gt=function(e){return 1===this.cmp(e)},b.prototype.gten=function(e){return 0<=this.cmpn(e)},b.prototype.gte=function(e){return 0<=this.cmp(e)},b.prototype.ltn=function(e){return-1===this.cmpn(e)},b.prototype.lt=function(e){return-1===this.cmp(e)},b.prototype.lten=function(e){return this.cmpn(e)<=0},b.prototype.lte=function(e){return this.cmp(e)<=0},b.prototype.eqn=function(e){return 0===this.cmpn(e)},b.prototype.eq=function(e){return 0===this.cmp(e)},b.red=function(e){return new w(e)},b.prototype.toRed=function(e){return v(!this.red,"Already a number in reduction context"),v(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},b.prototype.fromRed=function(){return v(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},b.prototype._forceRed=function(e){return this.red=e,this},b.prototype.forceRed=function(e){return v(!this.red,"Already a number in reduction context"),this._forceRed(e)},b.prototype.redAdd=function(e){return v(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},b.prototype.redIAdd=function(e){return v(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},b.prototype.redSub=function(e){return v(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},b.prototype.redISub=function(e){return v(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},b.prototype.redShl=function(e){return v(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},b.prototype.redMul=function(e){return v(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},b.prototype.redIMul=function(e){return v(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},b.prototype.redSqr=function(){return v(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},b.prototype.redISqr=function(){return v(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},b.prototype.redSqrt=function(){return v(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},b.prototype.redInvm=function(){return v(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},b.prototype.redNeg=function(){return v(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},b.prototype.redPow=function(e){return v(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var h={k256:null,p224:null,p192:null,p25519:null};function c(e,t){this.name=e,this.p=new b(t,16),this.n=this.p.bitLength(),this.k=new b(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){c.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){c.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){c.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){c.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(e){if("string"==typeof e){var t=b._prime(e);this.m=t.p,this.prime=t}else v(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){w.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new b(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}c.prototype._tmp=function(){var e=new b(null);return e.words=new Array(Math.ceil(this.n/13)),e},c.prototype.ireduce=function(e){for(var t,r=e;this.split(r,this.tmp),(t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength())>this.n;);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):0<i?r.isub(this.p):r.strip(),r},c.prototype.split=function(e,t){e.iushrn(this.n,0,t)},c.prototype.imulK=function(e){return e.imul(this.k)},r(m,c),m.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var n=e.words[9];for(t.words[t.length++]=4194303&n,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,0===(e.words[i-10]=n)&&10<e.length?e.length-=10:e.length-=9},m.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(g,c),r(y,c),r(_,c),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},b._prime=function(e){if(h[e])return h[e];var t;if("k256"===e)t=new m;else if("p224"===e)t=new g;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return h[e]=t},w.prototype._verify1=function(e){v(0===e.negative,"red works only with positives"),v(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){v(0==(e.negative|t.negative),"red works only with positives"),v(e.red&&e.red===t.red,"red works only with red numbers")},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},w.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},w.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},w.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(v(t%2==1),3===t){var r=this.m.add(new b(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);v(!i.isZero());var o=new b(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new b(2*u*u).toRed(this);0!==this.pow(u,s).cmp(a);)u.redIAdd(a);for(var h=this.pow(u,i),c=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),l=n;0!==f.cmp(o);){for(var d=f,p=0;0!==d.cmp(o);p++)d=d.redSqr();v(p<l);var m=this.pow(h,new b(1).iushln(l-p-1));c=c.redMul(m),h=m.redSqr(),f=f.redMul(h),l=p}return c},w.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},w.prototype.pow=function(e,t){if(t.isZero())return new b(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new b(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,a=0,s=t.bitLength()%26;for(0===s&&(s=26),i=t.length-1;0<=i;i--){for(var u=t.words[i],h=s-1;0<=h;h--){var c=u>>h&1;n!==r[0]&&(n=this.sqr(n)),0!=c||0!==o?(o<<=1,o|=c,(4===++a||0===i&&0===h)&&(n=this.mul(n,r[o]),o=a=0)):a=0}s=26}return n},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},b.mont=function(e){return new x(e)},r(x,w),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new b(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:19}],18:[function(e,t,r){var i;function n(e){this.rand=e}if(t.exports=function(e){return i||(i=new n(null)),i.generate(e)},(t.exports.Rand=n).prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=e("crypto");if("function"!=typeof o.randomBytes)throw new Error("Not supported");n.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},{crypto:19}],19:[function(e,t,r){},{}],20:[function(e,t,r){var n=e("safe-buffer").Buffer;function o(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function i(e){for(;0<e.length;e++)e[0]=0}function a(e,t,r,i,n){for(var o,a,s,u,h=r[0],c=r[1],f=r[2],l=r[3],d=e[0]^t[0],p=e[1]^t[1],m=e[2]^t[2],v=e[3]^t[3],b=4,g=1;g<n;g++)o=h[d>>>24]^c[p>>>16&255]^f[m>>>8&255]^l[255&v]^t[b++],a=h[p>>>24]^c[m>>>16&255]^f[v>>>8&255]^l[255&d]^t[b++],s=h[m>>>24]^c[v>>>16&255]^f[d>>>8&255]^l[255&p]^t[b++],u=h[v>>>24]^c[d>>>16&255]^f[p>>>8&255]^l[255&m]^t[b++],d=o,p=a,m=s,v=u;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&v])^t[b++],a=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[v>>>8&255]<<8|i[255&d])^t[b++],s=(i[m>>>24]<<24|i[v>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^t[b++],u=(i[v>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^t[b++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var f=[0,1,2,4,8,16,32,64,128,27,54],l=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var h=s^s<<1^s<<2^s<<3^s<<4;h=h>>>8^255&h^99;var c=e[i[r[a]=h]=a],f=e[c],l=e[f],d=257*e[h]^16843008*h;n[0][a]=d<<24|d>>>8,n[1][a]=d<<16|d>>>16,n[2][a]=d<<8|d>>>24,n[3][a]=d,d=16843009*l^65537*f^257*c^16843008*a,o[0][h]=d<<24|d>>>8,o[1][h]=d<<16|d>>>16,o[2][h]=d<<8|d>>>24,o[3][h]=d,0===a?a=s=1:(a=c^e[e[e[l^c]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function s(e){this._key=o(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o<t;o++)n[o]=e[o];for(o=t;o<i;o++){var a=n[o-1];o%t==0?(a=a<<8|a>>>24,a=l.SBOX[a>>>24]<<24|l.SBOX[a>>>16&255]<<16|l.SBOX[a>>>8&255]<<8|l.SBOX[255&a],a^=f[o/t|0]<<24):6<t&&o%t==4&&(a=l.SBOX[a>>>24]<<24|l.SBOX[a>>>16&255]<<16|l.SBOX[a>>>8&255]<<8|l.SBOX[255&a]),n[o]=n[o-t]^a}for(var s=[],u=0;u<i;u++){var h=i-u,c=n[h-(u%4?0:4)];s[u]=u<4||h<=4?c:l.INV_SUB_MIX[0][l.SBOX[c>>>24]]^l.INV_SUB_MIX[1][l.SBOX[c>>>16&255]]^l.INV_SUB_MIX[2][l.SBOX[c>>>8&255]]^l.INV_SUB_MIX[3][l.SBOX[255&c]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,l.SUB_MIX,l.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,l.INV_SUB_MIX,l.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":143}],21:[function(e,t,r){var a=e("./aes"),h=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),c=e("./ghash"),n=e("buffer-xor"),f=e("./incr32");function o(e,t,r,i){s.call(this);var n=h.alloc(4,0);this._cipher=new a.AES(t);var o=this._cipher.encryptBlock(n);this._ghash=new c(o),r=function(e,t,r){if(12===t.length)return e._finID=h.concat([t,h.from([0,0,0,1])]),h.concat([t,h.from([0,0,0,2])]);var i=new c(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(h.alloc(o,0))),i.update(h.alloc(8,0));var a=8*n,s=h.alloc(8);s.writeUIntBE(a,0,8),i.update(s),e._finID=i.state;var u=h.from(e._finID);return f(u),u}(this,r,o),this._prev=h.from(r),this._cache=h.allocUnsafe(0),this._secCache=h.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(o,s),o.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=h.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n<i;++n)r+=e[n]^t[n];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},o.prototype.getAuthTag=function(){if(this._decrypt||!h.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},o.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},o.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},t.exports=o},{"./aes":20,"./ghash":25,"./incr32":26,"buffer-xor":48,"cipher-base":50,inherits:103,"safe-buffer":143}],22:[function(e,t,r){var i=e("./encrypter"),n=e("./decrypter"),o=e("./modes/list.json");r.createCipher=r.Cipher=i.createCipher,r.createCipheriv=r.Cipheriv=i.createCipheriv,r.createDecipher=r.Decipher=n.createDecipher,r.createDecipheriv=r.Decipheriv=n.createDecipheriv,r.listCiphers=r.getCiphers=function(){return Object.keys(o)}},{"./decrypter":23,"./encrypter":24,"./modes/list.json":34}],23:[function(e,t,r){var n=e("./authCipher"),o=e("safe-buffer").Buffer,a=e("./modes"),s=e("./streamCipher"),i=e("cipher-base"),u=e("./aes"),h=e("evp_bytestokey");function c(e,t,r){i.call(this),this._cache=new f,this._last=void 0,this._cipher=new u.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}function f(){this.cache=o.allocUnsafe(0)}function l(e,t,r){var i=a[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=o.from(r)),"GCM"!==i.mode&&r.length!==i.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=o.from(t)),t.length!==i.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===i.type?new s(i.module,t,r,!0):"auth"===i.type?new n(i.module,t,r,!0):new c(i.module,t,r)}e("inherits")(c,i),c.prototype._update=function(e){var t,r;this._cache.add(e);for(var i=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),i.push(r);return o.concat(i)},c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15],r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=o.concat([this.cache,e])},f.prototype.get=function(e){var t;if(e){if(16<this.cache.length)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(16<=this.cache.length)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(e,t){var r=a[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=h(t,!1,r.key,r.iv);return l(e,i.key,i.iv)},r.createDecipheriv=l},{"./aes":20,"./authCipher":21,"./modes":33,"./streamCipher":36,"cipher-base":50,evp_bytestokey:86,inherits:103,"safe-buffer":143}],24:[function(e,t,r){var n=e("./modes"),o=e("./authCipher"),a=e("safe-buffer").Buffer,s=e("./streamCipher"),i=e("cipher-base"),u=e("./aes"),h=e("evp_bytestokey");function c(e,t,r){i.call(this),this._cache=new l,this._cipher=new u.AES(t),this._prev=a.from(r),this._mode=e,this._autopadding=!0}e("inherits")(c,i),c.prototype._update=function(e){var t,r;this._cache.add(e);for(var i=[];t=this._cache.get();)r=this._mode.encrypt(this,t),i.push(r);return a.concat(i)};var f=a.alloc(16,16);function l(){this.cache=a.allocUnsafe(0)}function d(e,t,r){var i=n[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=a.from(t)),t.length!==i.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=a.from(r)),"GCM"!==i.mode&&r.length!==i.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===i.type?new s(i.module,t,r):"auth"===i.type?new o(i.module,t,r):new c(i.module,t,r)}c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=a.concat([this.cache,e])},l.prototype.get=function(){if(15<this.cache.length){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},l.prototype.flush=function(){for(var e=16-this.cache.length,t=a.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return a.concat([this.cache,t])},r.createCipheriv=d,r.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=h(t,!1,r.key,r.iv);return d(e,i.key,i.iv)}},{"./aes":20,"./authCipher":21,"./modes":33,"./streamCipher":36,"cipher-base":50,evp_bytestokey:86,inherits:103,"safe-buffer":143}],25:[function(e,t,r){var i=e("safe-buffer").Buffer,n=i.alloc(16,0);function o(e){var t=i.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},a.prototype._multiply=function(){for(var e,t,r=function(e){return[e.readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)]}(this.h),i=[0,0,0,0],n=-1;++n<128;){for(0!=(this.state[~~(n/8)]&1<<7-n%8)&&(i[0]^=r[0],i[1]^=r[1],i[2]^=r[2],i[3]^=r[3]),t=0!=(1&r[3]),e=3;0<e;e--)r[e]=r[e]>>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,t&&(r[0]=r[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":143}],26:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],27:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":48}],28:[function(e,t,r){var o=e("safe-buffer").Buffer,a=e("buffer-xor");function s(e,t,r){var i=t.length,n=a(t,e._cache);return e._cache=e._cache.slice(i),e._prev=o.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=o.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=o.allocUnsafe(0)),!(e._cache.length<=t.length)){n=o.concat([n,s(e,t,r)]);break}i=e._cache.length,n=o.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":48,"safe-buffer":143}],29:[function(e,t,r){var a=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,o=-1,a=0;++o<8;)i=t&1<<7-o?128:0,a+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>o%8,e._prev=u(e._prev,r?i:n);return a}function u(e,t){var r=e.length,i=-1,n=a.allocUnsafe(e.length);for(e=a.concat([e,a.from([t])]);++i<r;)n[i]=e[i]<<1|e[i+1]>>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=a.allocUnsafe(i),o=-1;++o<i;)n[o]=s(e,t[o],r);return n}},{"safe-buffer":143}],30:[function(e,t,r){var c=e("safe-buffer").Buffer;r.encrypt=function(e,t,r){for(var i,n,o,a,s=t.length,u=c.allocUnsafe(s),h=-1;++h<s;)u[h]=(i=e,n=t[h],o=r,void 0,a=i._cipher.encryptBlock(i._prev)[0]^n,i._prev=c.concat([i._prev.slice(1),c.from([o?n:a])]),a);return u}},{"safe-buffer":143}],31:[function(e,t,r){var c=e("buffer-xor"),f=e("safe-buffer").Buffer,l=e("../incr32");r.encrypt=function(e,t){var r,i,n=Math.ceil(t.length/16),o=e._cache.length;e._cache=f.concat([e._cache,f.allocUnsafe(16*n)]);for(var a=0;a<n;a++){var s=(void 0,i=(r=e)._cipher.encryptBlockRaw(r._prev),l(r._prev),i),u=o+16*a;e._cache.writeUInt32BE(s[0],u+0),e._cache.writeUInt32BE(s[1],u+4),e._cache.writeUInt32BE(s[2],u+8),e._cache.writeUInt32BE(s[3],u+12)}var h=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),c(t,h)}},{"../incr32":26,"buffer-xor":48,"safe-buffer":143}],32:[function(e,t,r){r.encrypt=function(e,t){return e._cipher.encryptBlock(t)},r.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},{}],33:[function(e,t,r){var i={ECB:e("./ecb"),CBC:e("./cbc"),CFB:e("./cfb"),CFB8:e("./cfb8"),CFB1:e("./cfb1"),OFB:e("./ofb"),CTR:e("./ctr"),GCM:e("./ctr")},n=e("./list.json");for(var o in n)n[o].module=i[n[o].mode];t.exports=n},{"./cbc":27,"./cfb":28,"./cfb1":29,"./cfb8":30,"./ctr":31,"./ecb":32,"./list.json":34,"./ofb":35}],34:[function(e,t,r){t.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},{}],35:[function(e,t,r){(function(n){var o=e("buffer-xor");r.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=n.concat([e._cache,(r=e,r._prev=r._cipher.encryptBlock(r._prev),r._prev)]);var r,i=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),o(t,i)}}).call(this,e("buffer").Buffer)},{buffer:49,"buffer-xor":48}],36:[function(e,t,r){var n=e("./aes"),o=e("safe-buffer").Buffer,a=e("cipher-base");function i(e,t,r,i){a.call(this),this._cipher=new n.AES(t),this._prev=o.from(r),this._cache=o.allocUnsafe(0),this._secCache=o.allocUnsafe(0),this._decrypt=i,this._mode=e}e("inherits")(i,a),i.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},i.prototype._final=function(){this._cipher.scrub()},t.exports=i},{"./aes":20,"cipher-base":50,inherits:103,"safe-buffer":143}],37:[function(e,t,r){var o=e("evp_bytestokey"),i=e("browserify-aes/browser"),n=e("browserify-des"),a=e("browserify-des/modes"),s=e("browserify-aes/modes");function u(e,t,r){if(e=e.toLowerCase(),s[e])return i.createCipheriv(e,t,r);if(a[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function h(e,t,r){if(e=e.toLowerCase(),s[e])return i.createDecipheriv(e,t,r);if(a[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}r.createCipher=r.Cipher=function(e,t){var r,i;if(e=e.toLowerCase(),s[e])r=s[e].key,i=s[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,i=a[e].iv}var n=o(t,!1,r,i);return u(e,n.key,n.iv)},r.createCipheriv=r.Cipheriv=u,r.createDecipher=r.Decipher=function(e,t){var r,i;if(e=e.toLowerCase(),s[e])r=s[e].key,i=s[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,i=a[e].iv}var n=o(t,!1,r,i);return h(e,n.key,n.iv)},r.createDecipheriv=r.Decipheriv=h,r.listCiphers=r.getCiphers=function(){return Object.keys(a).concat(i.getCiphers())}},{"browserify-aes/browser":22,"browserify-aes/modes":33,"browserify-des":38,"browserify-des/modes":39,evp_bytestokey:86}],38:[function(i,n,e){(function(a){var s=i("cipher-base"),e=i("des.js"),t=i("inherits"),u={"des-ede3-cbc":e.CBC.instantiate(e.EDE),"des-ede3":e.EDE,"des-ede-cbc":e.CBC.instantiate(e.EDE),"des-ede":e.EDE,"des-cbc":e.CBC.instantiate(e.DES),"des-ecb":e.DES};function r(e){s.call(this);var t,r=e.mode.toLowerCase(),i=u[r];t=e.decrypt?"decrypt":"encrypt";var n=e.key;"des-ede"!==r&&"des-ede-cbc"!==r||(n=a.concat([n,n.slice(0,8)]));var o=e.iv;this._des=i.create({key:n,iv:o,type:t})}u.des=u["des-cbc"],u.des3=u["des-ede3-cbc"],t(n.exports=r,s),r.prototype._update=function(e){return new a(this._des.update(e))},r.prototype._final=function(){return new a(this._des.final())}}).call(this,i("buffer").Buffer)},{buffer:49,"cipher-base":50,"des.js":59,inherits:103}],39:[function(e,t,r){r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}},{}],40:[function(t,r,e){(function(d){var p=t("bn.js"),i=t("randombytes");function e(e,t){var r=function(e){var t=m(e);return{blinder:t.toRed(p.mont(e.modulus)).redPow(new p(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),i=t.modulus.byteLength(),n=(p.mont(t.modulus),new p(e).mul(r.blinder).umod(t.modulus)),o=n.toRed(p.mont(t.prime1)),a=n.toRed(p.mont(t.prime2)),s=t.coefficient,u=t.prime1,h=t.prime2,c=o.redPow(t.exponent1),f=a.redPow(t.exponent2);c=c.fromRed(),f=f.fromRed();var l=c.isub(f).imul(s).umod(u);return l.imul(h),f.iadd(l),new d(f.imul(r.unblinder).umod(t.modulus).toArray(!1,i))}function m(e){for(var t=e.modulus.byteLength(),r=new p(i(t));0<=r.cmp(e.modulus)||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new p(i(t));return r}(r.exports=e).getr=m}).call(this,t("buffer").Buffer)},{"bn.js":17,buffer:49,randombytes:130}],41:[function(e,t,r){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":42}],42:[function(e,t,r){t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],43:[function(e,t,r){t.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],44:[function(f,l,e){(function(n){var r=f("create-hash"),i=f("stream"),e=f("inherits"),o=f("./sign"),a=f("./verify"),s=f("./algorithms.json");function t(e){i.Writable.call(this);var t=s[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function u(e){i.Writable.call(this);var t=s[e];if(!t)throw new Error("Unknown message digest");this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function h(e){return new t(e)}function c(e){return new u(e)}Object.keys(s).forEach(function(e){s[e].id=new n(s[e].id,"hex"),s[e.toLowerCase()]=s[e]}),e(t,i.Writable),t.prototype._write=function(e,t,r){this._hash.update(e),r()},t.prototype.update=function(e,t){return"string"==typeof e&&(e=new n(e,t)),this._hash.update(e),this},t.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),i=o(r,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i},e(u,i.Writable),u.prototype._write=function(e,t,r){this._hash.update(e),r()},u.prototype.update=function(e,t){return"string"==typeof e&&(e=new n(e,t)),this._hash.update(e),this},u.prototype.verify=function(e,t,r){"string"==typeof t&&(t=new n(t,r)),this.end();var i=this._hash.digest();return a(t,i,e,this._signType,this._tag)},l.exports={Sign:h,Verify:c,createSign:h,createVerify:c}}).call(this,f("buffer").Buffer)},{"./algorithms.json":42,"./sign":45,"./verify":46,buffer:49,"create-hash":53,inherits:103,stream:152}],45:[function(e,t,r){(function(m){var h=e("create-hmac"),c=e("browserify-rsa"),f=e("elliptic").ec,v=e("bn.js"),l=e("parse-asn1"),d=e("./curves.json");function b(e,t,r,i){if((e=new m(e.toArray())).length<t.byteLength()){var n=new m(t.byteLength()-e.length);n.fill(0),e=m.concat([n,e])}var o=r.length,a=function(e,t){e=(e=g(e,t)).mod(t);var r=new m(e.toArray());if(r.length<t.byteLength()){var i=new m(t.byteLength()-r.length);i.fill(0),r=m.concat([i,r])}return r}(r,t),s=new m(o);s.fill(1);var u=new m(o);return u.fill(0),u=h(i,u).update(s).update(new m([0])).update(e).update(a).digest(),s=h(i,u).update(s).digest(),{k:u=h(i,u).update(s).update(new m([1])).update(e).update(a).digest(),v:s=h(i,u).update(s).digest()}}function g(e,t){var r=new v(e),i=(e.length<<3)-t.bitLength();return 0<i&&r.ishrn(i),r}function y(e,t,r){var i,n;do{for(i=new m(0);8*i.length<e.bitLength();)t.v=h(r,t.k).update(t.v).digest(),i=m.concat([i,t.v]);n=g(i,e),t.k=h(r,t.k).update(t.v).update(new m([0])).digest(),t.v=h(r,t.k).update(t.v).digest()}while(-1!==n.cmp(e));return n}t.exports=function(e,t,r,i,n){var o=l(t);if(o.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(e,t){var r=d[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var i=new f(r).keyFromPrivate(t.privateKey).sign(e);return new m(i.toDER())}(e,o)}if("dsa"===o.type){if("dsa"!==i)throw new Error("wrong private key type");return function(e,t,r){for(var i,n,o,a,s=t.params.priv_key,u=t.params.p,h=t.params.q,c=t.params.g,f=new v(0),l=g(e,h).mod(h),d=!1,p=b(s,h,e,r);!1===d;)i=y(h,p,r),n=i,o=u,a=h,f=c.toRed(v.mont(o)).redPow(n).fromRed().mod(a),0===(d=i.invm(h).imul(l.add(s.mul(f))).mod(h)).cmpn(0)&&(d=!1,f=new v(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e)),128&t[0]&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),new m(r)}(f,d)}(e,o,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");e=m.concat([n,e]);for(var a=o.modulus.byteLength(),s=[0,1];e.length+s.length+1<a;)s.push(255);s.push(0);for(var u=-1;++u<e.length;)s.push(e[u]);return c(s,o)},t.exports.getKey=b,t.exports.makeKey=y}).call(this,e("buffer").Buffer)},{"./curves.json":43,"bn.js":17,"browserify-rsa":40,buffer:49,"create-hmac":56,elliptic:69,"parse-asn1":115}],46:[function(e,t,r){(function(l){var d=e("bn.js"),p=e("elliptic").ec,m=e("parse-asn1"),v=e("./curves.json");function b(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var o=m(r);if("ec"===o.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=v[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new p(i),o=r.data.subjectPrivateKey.data;return n.verify(t,e,o)}(e,t,o)}if("dsa"===o.type){if("dsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,n=r.data.q,o=r.data.g,a=r.data.pub_key,s=m.signature.decode(e,"der"),u=s.s,h=s.r;b(u,n),b(h,n);var c=d.mont(i),f=u.invm(n);return 0===o.toRed(c).redPow(new d(t).mul(f).mod(n)).fromRed().mul(a.toRed(c).redPow(h.mul(f).mod(n)).fromRed()).mod(i).mod(n).cmp(h)}(e,t,o)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=l.concat([n,t]);for(var a=o.modulus.byteLength(),s=[1],u=0;t.length+s.length+2<a;)s.push(255),u++;s.push(0);for(var h=-1;++h<t.length;)s.push(t[h]);s=new l(s);var c=d.mont(o.modulus);e=(e=new d(e).toRed(c)).redPow(new d(o.publicExponent)),e=new l(e.fromRed().toArray());var f=u<8?1:0;for(a=Math.min(e.length,s.length),e.length!==s.length&&(f=1),h=-1;++h<a;)f|=e[h]^s[h];return 0===f}}).call(this,e("buffer").Buffer)},{"./curves.json":43,"bn.js":17,buffer:49,elliptic:69,"parse-asn1":115}],47:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{dup:19}],48:[function(e,t,r){(function(o){t.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new o(r),n=0;n<r;++n)i[n]=e[n]^t[n];return i}}).call(this,e("buffer").Buffer)},{buffer:49}],49:[function(j,e,B){(function(e){"use strict";var i=j("base64-js"),o=j("ieee754"),a=j("isarray");function r(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(r()<t)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=f.prototype:(null===e&&(e=new f(t)),e.length=t),e}function f(e,t,r){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(e,t,r);if("number"!=typeof e)return n(this,e,t,r);if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}function n(e,t,r,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,i){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,r):new Uint8Array(t,r,i);f.TYPED_ARRAY_SUPPORT?(e=t).__proto__=f.prototype:e=c(e,t);return e}(e,t,r,i):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!f.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var i=0|d(t,r),n=(e=s(e,i)).write(t,r);n!==i&&(e=e.slice(0,n));return e}(e,t,r):function(e,t){if(f.isBuffer(t)){var r=0|l(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?s(e,0):c(e,t);if("Buffer"===t.type&&a(t.data))return c(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(u(t),e=s(e,t<0?0:0|l(t)),!f.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function c(e,t){var r=t.length<0?0:0|l(t.length);e=s(e,r);for(var i=0;i<r;i+=1)e[i]=255&t[i];return e}function l(e){if(e>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function d(e,t){if(f.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(i)return D(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=f.from(t,i)),f.isBuffer(t))return 0===t.length?-1:v(e,t,r,i,n);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,i,n){var o,a=1,s=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,u/=2,r/=2}function h(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var c=-1;for(o=r;o<s;o++)if(h(e,o)===h(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(s<r+u&&(r=s-u),o=r;0<=o;o--){for(var f=!0,l=0;l<u;l++)if(h(e,o+l)!==h(t,l)){f=!1;break}if(f)return o}return-1}function b(e,t,r,i){r=Number(r)||0;var n=e.length-r;i?n<(i=Number(i))&&(i=n):i=n;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");o/2<i&&(i=o/2);for(var a=0;a<i;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function g(e,t,r,i){return F(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function y(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n<r;){var o,a,s,u,h=e[n],c=null,f=239<h?4:223<h?3:191<h?2:1;if(n+f<=r)switch(f){case 1:h<128&&(c=h);break;case 2:128==(192&(o=e[n+1]))&&127<(u=(31&h)<<6|63&o)&&(c=u);break;case 3:o=e[n+1],a=e[n+2],128==(192&o)&&128==(192&a)&&2047<(u=(15&h)<<12|(63&o)<<6|63&a)&&(u<55296||57343<u)&&(c=u);break;case 4:o=e[n+1],a=e[n+2],s=e[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&65535<(u=(15&h)<<18|(63&o)<<12|(63&a)<<6|63&s)&&u<1114112&&(c=u)}null===c?(c=65533,f=1):65535<c&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),n+=f}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=w));return r}(i)}B.Buffer=f,B.SlowBuffer=function(e){+e!=e&&(e=0);return f.alloc(+e)},B.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),B.kMaxLength=r(),f.poolSize=8192,f._augment=function(e){return e.__proto__=f.prototype,e},f.from=function(e,t,r){return n(null,e,t,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(e,t,r){return function(e,t,r,i){return u(t),t<=0?s(e,t):void 0!==r?"string"==typeof i?s(e,t).fill(r,i):s(e,t).fill(r):s(e,t)}(null,e,t,r)},f.allocUnsafe=function(e){return h(null,e)},f.allocUnsafeSlow=function(e){return h(null,e)},f.isBuffer=function(e){return!(null==e||!e._isBuffer)},f.compare=function(e,t){if(!f.isBuffer(e)||!f.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,i=t.length,n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},f.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return f.alloc(0);var r;if(void 0===t)for(r=t=0;r<e.length;++r)t+=e[r].length;var i=f.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){var o=e[r];if(!f.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,n),n+=o.length}return i},f.byteLength=d,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)p(this,t,t+1);return this},f.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},f.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},f.prototype.toString=function(){var e=0|this.length;return 0==e?"":0===arguments.length?_(this,0,e):function(e,t,r){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},f.prototype.equals=function(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===f.compare(this,e)},f.prototype.inspect=function(){var e="",t=B.INSPECT_MAX_BYTES;return 0<this.length&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},f.prototype.compare=function(e,t,r,i,n){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(i,n),h=e.slice(t,r),c=0;c<s;++c)if(u[c]!==h[c]){o=u[c],a=h[c];break}return o<a?-1:a<o?1:0},f.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},f.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},f.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},f.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||n<r)&&(r=n),0<e.length&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o,a,s,u,h,c,f,l,d,p=!1;;)switch(i){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return l=t,d=r,F(D(e,(f=this).length-l),f,l,d);case"ascii":return g(this,e,t,r);case"latin1":case"binary":return g(this,e,t,r);case"base64":return u=this,h=t,c=r,F(L(e),u,h,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=t,s=r,F(function(e,t){for(var r,i,n,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(e,(o=this).length-a),o,a,s);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function x(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function T(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function S(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||i<r)&&(r=i);for(var n="",o=t;o<r;++o)n+=O(e[o]);return n}function E(e,t,r){for(var i=e.slice(t,r),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+256*i[o+1]);return n}function A(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,i,n,o){if(!f.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n<t||t<o)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function M(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(e.length-r,2);n<o;++n)e[r+n]=(t&255<<8*(i?n:1-n))>>>8*(i?n:1-n)}function C(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(e.length-r,4);n<o;++n)e[r+n]=t>>>8*(i?n:3-n)&255}function k(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(e,t,r,i,n){return n||k(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function R(e,t,r,i,n){return n||k(e,0,r,8),o.write(e,t,r,i,52,8),r+8}f.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i<e&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):i<t&&(t=i),t<e&&(t=e),f.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=f.prototype;else{var n=t-e;r=new f(n,void 0);for(var o=0;o<n;++o)r[o]=this[o+e]}return r},f.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||A(e,t,this.length);for(var i=this[e],n=1,o=0;++o<t&&(n*=256);)i+=this[e+o]*n;return i},f.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||A(e,t,this.length);for(var i=this[e+--t],n=1;0<t&&(n*=256);)i+=this[e+--t]*n;return i},f.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},f.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},f.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},f.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},f.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},f.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||A(e,t,this.length);for(var i=this[e],n=1,o=0;++o<t&&(n*=256);)i+=this[e+o]*n;return(n*=128)<=i&&(i-=Math.pow(2,8*t)),i},f.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||A(e,t,this.length);for(var i=t,n=1,o=this[e+--i];0<i&&(n*=256);)o+=this[e+--i]*n;return(n*=128)<=o&&(o-=Math.pow(2,8*t)),o},f.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},f.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},f.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},f.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),o.read(this,e,!0,23,4)},f.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),o.read(this,e,!1,23,4)},f.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),o.read(this,e,!0,52,8)},f.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),o.read(this,e,!1,52,8)},f.prototype.writeUIntLE=function(e,t,r,i){(e=+e,t|=0,r|=0,i)||P(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,o=0;for(this[t]=255&e;++o<r&&(n*=256);)this[t+o]=e/n&255;return t+r},f.prototype.writeUIntBE=function(e,t,r,i){(e=+e,t|=0,r|=0,i)||P(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,o=1;for(this[t+n]=255&e;0<=--n&&(o*=256);)this[t+n]=e/o&255;return t+r},f.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,255,0),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},f.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return I(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return I(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0<i&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);var n,o=i-r;if(this===e&&r<t&&t<i)for(n=o-1;0<=n;--n)e[n+t]=this[n+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(n=0;n<o;++n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},f.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!f.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=f.isBuffer(e)?e:D(new f(e,i).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var t=/[^+\/0-9A-Za-z-_]/g;function O(e){return e<16?"0"+e.toString(16):e.toString(16)}function D(e,t){var r;t=t||1/0;for(var i=e.length,n=null,o=[],a=0;a<i;++a){if(55295<(r=e.charCodeAt(a))&&r<57344){if(!n){if(56319<r){-1<(t-=3)&&o.push(239,191,189);continue}if(a+1===i){-1<(t-=3)&&o.push(239,191,189);continue}n=r;continue}if(r<56320){-1<(t-=3)&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&-1<(t-=3)&&o.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,r,i){for(var n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":16,ieee754:101,isarray:105}],50:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("stream").Transform,o=e("string_decoder").StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i},t.exports=a},{inherits:103,"safe-buffer":143,stream:152,string_decoder:153}],51:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":104}],52:[function(e,s,t){(function(o){var t=e("elliptic"),i=e("bn.js");s.exports=function(e){return new n(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function n(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new t.ec(this.curveType.name),this.keys=void 0}function a(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new o(e);if(r&&i.length<r){var n=new o(r-i.length);n.fill(0),i=o.concat([n,i])}return t?i.toString(t):i}r.p224=r.secp224r1,r.p256=r.secp256r1=r.prime256v1,r.p192=r.secp192r1=r.prime192v1,r.p384=r.secp384r1,r.p521=r.secp521r1,n.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},n.prototype.computeSecret=function(e,t,r){return t=t||"utf8",o.isBuffer(e)||(e=new o(e,t)),a(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},n.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),a(r,e)},n.prototype.getPrivateKey=function(e){return a(this.keys.getPrivate(),e)},n.prototype.setPublicKey=function(e,t){return t=t||"utf8",o.isBuffer(e)||(e=new o(e,t)),this.keys._importPublic(e),this},n.prototype.setPrivateKey=function(e,t){t=t||"utf8",o.isBuffer(e)||(e=new o(e,t));var r=new i(e);return r=r.toString(16),this.keys._importPrivate(r),this}}).call(this,e("buffer").Buffer)},{"bn.js":17,buffer:49,elliptic:69}],53:[function(u,h,e){(function(r){"use strict";var e=u("inherits"),t=u("./md5"),i=u("ripemd160"),n=u("sha.js"),o=u("cipher-base");function a(e){o.call(this,"digest"),this._hash=e,this.buffers=[]}function s(e){o.call(this,"digest"),this._hash=e}e(a,o),a.prototype._update=function(e){this.buffers.push(e)},a.prototype._final=function(){var e=r.concat(this.buffers),t=this._hash(e);return this.buffers=null,t},e(s,o),s.prototype._update=function(e){this._hash.update(e)},s.prototype._final=function(){return this._hash.digest()},h.exports=function(e){return"md5"===(e=e.toLowerCase())?new a(t):new s("rmd160"===e||"ripemd160"===e?new i:n(e))}}).call(this,u("buffer").Buffer)},{"./md5":55,buffer:49,"cipher-base":50,inherits:103,ripemd160:142,"sha.js":145}],54:[function(e,t,r){(function(o){"use strict";var a=new o(4);a.fill(0);t.exports=function(e,t){var r=t(function(e){if(e.length%4!=0){var t=e.length+(4-e.length%4);e=o.concat([e,a],t)}for(var r=new Array(e.length>>>2),i=0,n=0;i<e.length;i+=4,n++)r[n]=e.readInt32LE(i);return r}(e),8*e.length);e=new o(16);for(var i=0;i<r.length;i++)e.writeInt32LE(r[i],i<<2,!0);return e}}).call(this,e("buffer").Buffer)},{buffer:49}],55:[function(e,t,r){"use strict";var i=e("./make-hash");function n(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var r=1732584193,i=-271733879,n=-1732584194,o=271733878,a=0;a<e.length;a+=16){var s=r,u=i,h=n,c=o;i=p(i=p(i=p(i=p(i=d(i=d(i=d(i=d(i=l(i=l(i=l(i=l(i=f(i=f(i=f(i=f(i,n=f(n,o=f(o,r=f(r,i,n,o,e[a+0],7,-680876936),i,n,e[a+1],12,-389564586),r,i,e[a+2],17,606105819),o,r,e[a+3],22,-1044525330),n=f(n,o=f(o,r=f(r,i,n,o,e[a+4],7,-176418897),i,n,e[a+5],12,1200080426),r,i,e[a+6],17,-1473231341),o,r,e[a+7],22,-45705983),n=f(n,o=f(o,r=f(r,i,n,o,e[a+8],7,1770035416),i,n,e[a+9],12,-1958414417),r,i,e[a+10],17,-42063),o,r,e[a+11],22,-1990404162),n=f(n,o=f(o,r=f(r,i,n,o,e[a+12],7,1804603682),i,n,e[a+13],12,-40341101),r,i,e[a+14],17,-1502002290),o,r,e[a+15],22,1236535329),n=l(n,o=l(o,r=l(r,i,n,o,e[a+1],5,-165796510),i,n,e[a+6],9,-1069501632),r,i,e[a+11],14,643717713),o,r,e[a+0],20,-373897302),n=l(n,o=l(o,r=l(r,i,n,o,e[a+5],5,-701558691),i,n,e[a+10],9,38016083),r,i,e[a+15],14,-660478335),o,r,e[a+4],20,-405537848),n=l(n,o=l(o,r=l(r,i,n,o,e[a+9],5,568446438),i,n,e[a+14],9,-1019803690),r,i,e[a+3],14,-187363961),o,r,e[a+8],20,1163531501),n=l(n,o=l(o,r=l(r,i,n,o,e[a+13],5,-1444681467),i,n,e[a+2],9,-51403784),r,i,e[a+7],14,1735328473),o,r,e[a+12],20,-1926607734),n=d(n,o=d(o,r=d(r,i,n,o,e[a+5],4,-378558),i,n,e[a+8],11,-2022574463),r,i,e[a+11],16,1839030562),o,r,e[a+14],23,-35309556),n=d(n,o=d(o,r=d(r,i,n,o,e[a+1],4,-1530992060),i,n,e[a+4],11,1272893353),r,i,e[a+7],16,-155497632),o,r,e[a+10],23,-1094730640),n=d(n,o=d(o,r=d(r,i,n,o,e[a+13],4,681279174),i,n,e[a+0],11,-358537222),r,i,e[a+3],16,-722521979),o,r,e[a+6],23,76029189),n=d(n,o=d(o,r=d(r,i,n,o,e[a+9],4,-640364487),i,n,e[a+12],11,-421815835),r,i,e[a+15],16,530742520),o,r,e[a+2],23,-995338651),n=p(n,o=p(o,r=p(r,i,n,o,e[a+0],6,-198630844),i,n,e[a+7],10,1126891415),r,i,e[a+14],15,-1416354905),o,r,e[a+5],21,-57434055),n=p(n,o=p(o,r=p(r,i,n,o,e[a+12],6,1700485571),i,n,e[a+3],10,-1894986606),r,i,e[a+10],15,-1051523),o,r,e[a+1],21,-2054922799),n=p(n,o=p(o,r=p(r,i,n,o,e[a+8],6,1873313359),i,n,e[a+15],10,-30611744),r,i,e[a+6],15,-1560198380),o,r,e[a+13],21,1309151649),n=p(n,o=p(o,r=p(r,i,n,o,e[a+4],6,-145523070),i,n,e[a+11],10,-1120210379),r,i,e[a+2],15,718787259),o,r,e[a+9],21,-343485551),r=m(r,s),i=m(i,u),n=m(n,h),o=m(o,c)}return[r,i,n,o]}function s(e,t,r,i,n,o){return m(function(e,t){return e<<t|e>>>32-t}(m(m(t,e),m(i,o)),n),r)}function f(e,t,r,i,n,o,a){return s(t&r|~t&i,e,t,n,o,a)}function l(e,t,r,i,n,o,a){return s(t&i|r&~i,e,t,n,o,a)}function d(e,t,r,i,n,o,a){return s(t^r^i,e,t,n,o,a)}function p(e,t,r,i,n,o,a){return s(r^(t|~i),e,t,n,o,a)}function m(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return i(e,n)}},{"./make-hash":54}],56:[function(e,t,r){"use strict";var i=e("inherits"),n=e("./legacy"),a=e("cipher-base"),s=e("safe-buffer").Buffer,o=e("create-hash/md5"),u=e("ripemd160"),h=e("sha.js"),c=s.alloc(128);function f(e,t){a.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,(this._key=t).length>r)?t=("rmd160"===e?new u:h(e)).update(t).digest():t.length<r&&(t=s.concat([t,c],r));for(var i=this._ipad=s.allocUnsafe(r),n=this._opad=s.allocUnsafe(r),o=0;o<r;o++)i[o]=54^t[o],n[o]=92^t[o];this._hash="rmd160"===e?new u:h(e),this._hash.update(i)}i(f,a),f.prototype._update=function(e){this._hash.update(e)},f.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new u:h(this._alg)).update(this._opad).update(e).digest()},t.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new f("rmd160",t):"md5"===e?new n(o,t):new f(e,t)}},{"./legacy":57,"cipher-base":50,"create-hash/md5":55,inherits:103,ripemd160:142,"safe-buffer":143,"sha.js":145}],57:[function(e,t,r){"use strict";var i=e("inherits"),o=e("safe-buffer").Buffer,a=e("cipher-base"),s=o.alloc(128);function n(e,t){a.call(this,"digest"),"string"==typeof t&&(t=o.from(t)),this._alg=e,64<(this._key=t).length?t=e(t):t.length<64&&(t=o.concat([t,s],64));for(var r=this._ipad=o.allocUnsafe(64),i=this._opad=o.allocUnsafe(64),n=0;n<64;n++)r[n]=54^t[n],i[n]=92^t[n];this._hash=[r]}i(n,a),n.prototype._update=function(e){this._hash.push(e)},n.prototype._final=function(){var e=this._alg(o.concat(this._hash));return this._alg(o.concat([this._opad,e]))},t.exports=n},{"cipher-base":50,inherits:103,"safe-buffer":143}],58:[function(e,t,r){"use strict";r.randomBytes=r.rng=r.pseudoRandomBytes=r.prng=e("randombytes"),r.createHash=r.Hash=e("create-hash"),r.createHmac=r.Hmac=e("create-hmac");var i=e("browserify-sign/algos"),n=Object.keys(i),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);r.getHashes=function(){return o};var a=e("pbkdf2");r.pbkdf2=a.pbkdf2,r.pbkdf2Sync=a.pbkdf2Sync;var s=e("browserify-cipher");r.Cipher=s.Cipher,r.createCipher=s.createCipher,r.Cipheriv=s.Cipheriv,r.createCipheriv=s.createCipheriv,r.Decipher=s.Decipher,r.createDecipher=s.createDecipher,r.Decipheriv=s.Decipheriv,r.createDecipheriv=s.createDecipheriv,r.getCiphers=s.getCiphers,r.listCiphers=s.listCiphers;var u=e("diffie-hellman");r.DiffieHellmanGroup=u.DiffieHellmanGroup,r.createDiffieHellmanGroup=u.createDiffieHellmanGroup,r.getDiffieHellman=u.getDiffieHellman,r.createDiffieHellman=u.createDiffieHellman,r.DiffieHellman=u.DiffieHellman;var h=e("browserify-sign");r.createSign=h.createSign,r.Sign=h.Sign,r.createVerify=h.createVerify,r.Verify=h.Verify,r.createECDH=e("create-ecdh");var c=e("public-encrypt");r.publicEncrypt=c.publicEncrypt,r.privateEncrypt=c.privateEncrypt,r.publicDecrypt=c.publicDecrypt,r.privateDecrypt=c.privateDecrypt;var f=e("randomfill");r.randomFill=f.randomFill,r.randomFillSync=f.randomFillSync,r.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},r.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":37,"browserify-sign":44,"browserify-sign/algos":41,"create-ecdh":52,"create-hash":53,"create-hmac":56,"diffie-hellman":65,pbkdf2:117,"public-encrypt":124,randombytes:130,randomfill:131}],59:[function(e,t,r){"use strict";r.utils=e("./des/utils"),r.Cipher=e("./des/cipher"),r.DES=e("./des/des"),r.CBC=e("./des/cbc"),r.EDE=e("./des/ede")},{"./des/cbc":60,"./des/cipher":61,"./des/des":62,"./des/ede":63,"./des/utils":64}],60:[function(e,t,r){"use strict";var i=e("minimalistic-assert"),o=e("inherits"),a={};function n(e){i.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}r.instantiate=function(t){function r(e){t.call(this,e),this._cbcInit()}o(r,t);for(var e=Object.keys(a),i=0;i<e.length;i++){var n=e[i];r.prototype[n]=a[n]}return r.create=function(e){return new r(e)},r},a._cbcInit=function(){var e=new n(this.options.iv);this._cbcState=e},a._update=function(e,t,r,i){var n=this._cbcState,o=this.constructor.super_.prototype,a=n.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=e[t+s];o._update.call(this,a,0,r,i);for(s=0;s<this.blockSize;s++)a[s]=r[i+s]}else{o._update.call(this,e,t,r,i);for(s=0;s<this.blockSize;s++)r[i+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=e[t+s]}}},{inherits:103,"minimalistic-assert":109}],61:[function(e,t,r){"use strict";var i=e("minimalistic-assert");function n(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}(t.exports=n).prototype._init=function(){},n.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},n.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),i=0;i<r;i++)this.buffer[this.bufferOff+i]=e[t+i];return this.bufferOff+=r,r},n.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},n.prototype._updateEncrypt=function(e){var t=0,r=0,i=(this.bufferOff+e.length)/this.blockSize|0,n=new Array(i*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(n,r)));for(var o=e.length-(e.length-t)%this.blockSize;t<o;t+=this.blockSize)this._update(e,t,n,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return n},n.prototype._updateDecrypt=function(e){for(var t=0,r=0,i=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,n=new Array(i*this.blockSize);0<i;i--)t+=this._buffer(e,t),r+=this._flushBuffer(n,r);return t+=this._buffer(e,t),n},n.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},n.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},n.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},n.prototype._unpad=function(e){return e},n.prototype._finalDecrypt=function(){i.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},{"minimalistic-assert":109}],62:[function(e,t,r){"use strict";var a=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),l=n.utils,o=n.Cipher;function s(){this.tmp=new Array(2),this.keys=null}function u(e){o.call(this,e);var t=new s;this._desState=t,this.deriveKeys(t,e.key)}i(u,o),(t.exports=u).create=function(e){return new u(e)};var h=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(e,t){e.keys=new Array(32),a.equal(t.length,this.blockSize,"Invalid key length");var r=l.readUInt32BE(t,0),i=l.readUInt32BE(t,4);l.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var n=0;n<e.keys.length;n+=2){var o=h[n>>>1];r=l.r28shl(r,o),i=l.r28shl(i,o),l.pc2(r,i,e.keys,n)}},u.prototype._update=function(e,t,r,i){var n=this._desState,o=l.readUInt32BE(e,t),a=l.readUInt32BE(e,t+4);l.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],l.writeUInt32BE(r,o,i),l.writeUInt32BE(r,a,i+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i<e.length;i++)e[i]=r;return!0},u.prototype._unpad=function(e){for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)a.equal(e[r],t);return e.slice(0,e.length-t)},u.prototype._encrypt=function(e,t,r,i,n){for(var o=t,a=r,s=0;s<e.keys.length;s+=2){var u=e.keys[s],h=e.keys[s+1];l.expand(a,e.tmp,0),u^=e.tmp[0],h^=e.tmp[1];var c=l.substitute(u,h),f=a;a=(o^l.permute(c))>>>0,o=f}l.rip(a,o,i,n)},u.prototype._decrypt=function(e,t,r,i,n){for(var o=r,a=t,s=e.keys.length-2;0<=s;s-=2){var u=e.keys[s],h=e.keys[s+1];l.expand(o,e.tmp,0),u^=e.tmp[0],h^=e.tmp[1];var c=l.substitute(u,h),f=o;o=(a^l.permute(c))>>>0,a=f}l.rip(o,a,i,n)}},{"../des":59,inherits:103,"minimalistic-assert":109}],63:[function(e,t,r){"use strict";var o=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),a=n.Cipher,s=n.DES;function u(e,t){o.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function h(e){a.call(this,e);var t=new u(this.type,this.options.key);this._edeState=t}i(h,a),(t.exports=h).create=function(e){return new h(e)},h.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},h.prototype._pad=s.prototype._pad,h.prototype._unpad=s.prototype._unpad},{"../des":59,inherits:103,"minimalistic-assert":109}],64:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var n=0,o=0,a=6;0<=a;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1}for(a=6;0<=a;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[i+0]=n>>>0,r[i+1]=o>>>0},r.rip=function(e,t,r,i){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+a&1,n<<=1,n|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;0<=s;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.pc1=function(e,t,r,i){for(var n=0,o=0,a=7;5<=a;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var u=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,i){for(var n=0,o=0,a=u.length>>>1,s=0;s<a;s++)n<<=1,n|=e>>>u[s]&1;for(s=a;s<u.length;s++)o<<=1,o|=t>>>u[s]&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var o=23;15<=o;o-=4)i<<=6,i|=e>>>o&63;for(o=11;3<=o;o-=4)n|=e>>>o&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r<i.length;r++)t<<=1,t|=e>>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.length<t;)i="0"+i;for(var n=[],o=0;o<t;o+=r)n.push(i.slice(o,o+r));return n.join(" ")}},{}],65:[function(e,t,r){(function(o){var a=e("./lib/generatePrime"),i=e("./lib/primes.json"),s=e("./lib/dh");var u={binary:!0,hex:!0,base64:!0};r.DiffieHellmanGroup=r.createDiffieHellmanGroup=r.getDiffieHellman=function(e){var t=new o(i[e].prime,"hex"),r=new o(i[e].gen,"hex");return new s(t,r)},r.createDiffieHellman=r.DiffieHellman=function e(t,r,i,n){return o.isBuffer(r)||void 0===u[r]?e(t,"binary",r,i):(r=r||"binary",n=n||"binary",i=i||new o([2]),o.isBuffer(i)||(i=new o(i,n)),"number"==typeof t?new s(a(t,i),i,!0):(o.isBuffer(t)||(t=new o(t,r)),new s(t,i,!0)))}}).call(this,e("buffer").Buffer)},{"./lib/dh":66,"./lib/generatePrime":67,"./lib/primes.json":68,buffer:49}],66:[function(m,v,e){(function(o){var a=m("bn.js"),s=new(m("miller-rabin")),u=new a(24),h=new a(11),c=new a(10),f=new a(3),l=new a(7),d=m("./generatePrime"),e=m("randombytes");function i(e,t){return t=t||"utf8",o.isBuffer(e)||(e=new o(e,t)),this._pub=new a(e),this}function n(e,t){return t=t||"utf8",o.isBuffer(e)||(e=new o(e,t)),this._priv=new a(e),this}v.exports=t;var p={};function t(e,t,r){this.setGenerator(t),this.__prime=new a(e),this._prime=a.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=i,this.setPrivateKey=n):this._primeCode=8}function r(e,t){var r=new o(e.toArray());return t?r.toString(t):r}Object.defineProperty(t.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),i=[r,e.toString(16)].join("_");if(i in p)return p[i];var n,o=0;if(e.isEven()||!d.simpleSieve||!d.fermatTest(e)||!s.test(e))return o+=1,o+="02"===r||"05"===r?8:4,p[i]=o;switch(s.test(e.shrn(1))||(o+=2),r){case"02":e.mod(u).cmp(h)&&(o+=8);break;case"05":(n=e.mod(c)).cmp(f)&&n.cmp(l)&&(o+=8);break;default:o+=4}return p[i]=o}(this.__prime,this.__gen)),this._primeCode}}),t.prototype.generateKeys=function(){return this._priv||(this._priv=new a(e(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},t.prototype.computeSecret=function(e){var t=(e=(e=new a(e)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new o(t.toArray()),i=this.getPrime();if(r.length<i.length){var n=new o(i.length-r.length);n.fill(0),r=o.concat([n,r])}return r},t.prototype.getPublicKey=function(e){return r(this._pub,e)},t.prototype.getPrivateKey=function(e){return r(this._priv,e)},t.prototype.getPrime=function(e){return r(this.__prime,e)},t.prototype.getGenerator=function(e){return r(this._gen,e)},t.prototype.setGenerator=function(e,t){return t=t||"utf8",o.isBuffer(e)||(e=new o(e,t)),this.__gen=e,this._gen=new a(e),this}}).call(this,m("buffer").Buffer)},{"./generatePrime":67,"bn.js":17,buffer:49,"miller-rabin":108,randombytes:130}],67:[function(e,t,r){var n=e("randombytes");(t.exports=i).simpleSieve=v,i.fermatTest=b;var o=e("bn.js"),a=new o(24),s=new(e("miller-rabin")),u=new o(1),h=new o(2),c=new o(5),f=(new o(16),new o(8),new o(10)),l=new o(3),d=(new o(7),new o(11)),p=new o(4),m=(new o(12),null);function v(e){for(var t=function(){if(null!==m)return m;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var i=Math.ceil(Math.sqrt(r)),n=0;n<t&&e[n]<=i&&r%e[n]!=0;n++);t!==n&&e[n]<=i||(e[t++]=r)}return m=e}(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function b(e){var t=o.mont(e);return 0===h.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function i(e,t){if(e<16)return new o(2===t||5===t?[140,123]:[140,39]);var r,i;for(t=new o(t);;){for(r=new o(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(u),r.testn(1)||r.iadd(h),t.cmp(h)){if(!t.cmp(c))for(;r.mod(f).cmp(l);)r.iadd(p)}else for(;r.mod(a).cmp(d);)r.iadd(p);if(v(i=r.shrn(1))&&v(r)&&b(i)&&b(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":17,"miller-rabin":108,randombytes:130}],68:[function(e,t,r){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],69:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":84,"./elliptic/curve":72,"./elliptic/curves":75,"./elliptic/ec":76,"./elliptic/eddsa":79,"./elliptic/utils":83,brorand:18}],70:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,E=n.getNAF,A=n.getJSF,f=n.assert;function o(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0<r.cmpn(100)?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function a(e,t){this.curve=e,this.type=t,this.precomputed=null}(t.exports=o).prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){f(e.precomputed);var r=e._getDoubles(),i=E(t,1),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;for(var o=[],a=0;a<i.length;a+=r.step){var s=0;for(t=a+r.step-1;a<=t;t--)s=(s<<1)+i[t];o.push(s)}for(var u=this.jpoint(null,null,null),h=this.jpoint(null,null,null),c=n;0<c;c--){for(a=0;a<o.length;a++){(s=o[a])===c?h=h.mixedAdd(r.points[a]):s===-c&&(h=h.mixedAdd(r.points[a].neg()))}u=u.add(h)}return u.toP()},o.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=E(t,r),a=this.jpoint(null,null,null),s=o.length-1;0<=s;s--){for(t=0;0<=s&&0===o[s];s--)t++;if(0<=s&&t++,a=a.dblp(t),s<0)break;var u=o[s];f(0!==u),a="affine"===e.type?0<u?a.mixedAdd(n[u-1>>1]):a.mixedAdd(n[-u-1>>1].neg()):0<u?a.add(n[u-1>>1]):a.add(n[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},o.prototype._wnafMulAdd=function(e,t,r,i,n){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,u=0,h=0;h<i;h++){var c=(T=t[h])._getNAFPoints(e);o[h]=c.wnd,a[h]=c.points}for(h=i-1;1<=h;h-=2){var f=h-1,l=h;if(1===o[f]&&1===o[l]){var d=[t[f],null,null,t[l]];0===t[f].y.cmp(t[l].y)?(d[1]=t[f].add(t[l]),d[2]=t[f].toJ().mixedAdd(t[l].neg())):0===t[f].y.cmp(t[l].y.redNeg())?(d[1]=t[f].toJ().mixedAdd(t[l]),d[2]=t[f].add(t[l].neg())):(d[1]=t[f].toJ().mixedAdd(t[l]),d[2]=t[f].toJ().mixedAdd(t[l].neg()));var p=[-3,-1,-5,-7,0,7,5,1,3],m=A(r[f],r[l]);u=Math.max(m[0].length,u),s[f]=new Array(u),s[l]=new Array(u);for(var v=0;v<u;v++){var b=0|m[0][v],g=0|m[1][v];s[f][v]=p[3*(1+b)+(1+g)],s[l][v]=0,a[f]=d}}else s[f]=E(r[f],o[f]),s[l]=E(r[l],o[l]),u=Math.max(s[f].length,u),u=Math.max(s[l].length,u)}var y=this.jpoint(null,null,null),_=this._wnafT4;for(h=u;0<=h;h--){for(var w=0;0<=h;){var x=!0;for(v=0;v<i;v++)_[v]=0|s[v][h],0!==_[v]&&(x=!1);if(!x)break;w++,h--}if(0<=h&&w++,y=y.dblp(w),h<0)break;for(v=0;v<i;v++){var T,S=_[v];0!==S&&(0<S?T=a[v][S-1>>1]:S<0&&(T=a[v][-S-1>>1].neg()),y="affine"===T.type?y.mixedAdd(T):y.add(T))}}for(h=0;h<i;h++)a[h]=null;return n?y:y.toP()},(o.BasePoint=a).prototype.eq=function(){throw new Error("Not implemented")},a.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(e,t){e=n.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?f(e[e.length-1]%2==0):7===e[0]&&f(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},a.prototype.encodeCompressed=function(e){return this.encode(e,!0)},a.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},a.prototype.encode=function(e,t){return n.encode(this._encode(t),e)},a.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},a.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var o=0;o<e;o++)i=i.dbl();r.push(i)}return{step:e,points:r}},a.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1==r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},a.prototype._getBeta=function(){return null},a.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},{"../../elliptic":69,"bn.js":17}],71:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),u=e("bn.js"),o=e("inherits"),a=i.base,s=n.utils.assert;function h(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new u(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new u(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new u(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,i,n){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new u(t,16),this.y=new u(r,16),this.z=i?new u(i,16):this.curve.one,this.t=n&&new u(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(h,a),(t.exports=h).prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},h.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},h.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},h.prototype.pointFromX=function(e,t){(e=new u(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),n=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(n.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},h.prototype.pointFromY=function(e,t){(e=new u(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.one),n=r.redMul(this.d).redAdd(this.one),o=i.redMul(n.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},h.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},o(c,a.BasePoint),h.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},h.prototype.point=function(e,t,r,i){return new c(this,e,t,r,i)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),a=o.redSub(r),s=i.redSub(t),u=n.redMul(a),h=o.redMul(s),c=n.redMul(s),f=a.redMul(o);return this.curve.point(u,h,f,c)},c.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(h=this.curve._mulA(n)).redAdd(o);if(this.zOne)e=i.redSub(n).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(h.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=i.redSub(n).redISub(o).redMul(u),t=a.redMul(h.redSub(o)),r=a.redMul(u)}}else{var h=n.redAdd(o);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=h.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(h)).redMul(u),t=this.curve._mulC(h).redMul(n.redISub(o)),r=h.redMul(u)}return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=n.redSub(i),s=n.redAdd(i),u=r.redAdd(t),h=o.redMul(a),c=s.redMul(u),f=o.redMul(u),l=a.redMul(s);return this.curve.point(h,c,l,f)},c.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=n.redSub(s),h=n.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=i.redMul(u).redMul(c);return r=this.curve.twisted?(t=i.redMul(h).redMul(a.redSub(this.curve._mulA(o))),u.redMul(h)):(t=i.redMul(h).redMul(a.redSub(o)),this.curve._mulC(u).redMul(h)),this.curve.point(f,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}return!1},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],72:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":70,"./edwards":71,"./mont":73,"./short":74}],73:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),o=e("inherits"),a=i.base,s=e("../../elliptic").utils;function u(e){a.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function h(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),(t.exports=u).prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},o(h,a.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},u.prototype.point=function(e,t){return new h(this,e,t)},u.prototype.pointFromJSON=function(e){return h.fromJSON(this,e)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(e,t){return new h(e,t[0],t[1]||e.one)},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},h.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=n.redMul(i),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},h.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;0<=o;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},h.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],74:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),o=e("inherits"),a=i.base,s=n.utils.assert;function u(e){a.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function h(e,t,r,i){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(e,t,r,i){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new w(0)):(this.x=new w(t,16),this.y=new w(r,16),this.z=new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),(t.exports=u).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,a,s,u,h,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,l=this.n.clone(),d=new w(1),p=new w(0),m=new w(0),v=new w(1),b=0;0!==f.cmpn(0);){var g=l.div(f);u=l.sub(g.mul(f)),h=m.sub(g.mul(d));var y=v.sub(g.mul(p));if(!i&&u.cmp(c)<0)t=s.neg(),r=d,i=u.neg(),n=h;else if(i&&2==++b)break;l=f,f=s=u,m=d,d=h,v=p,p=y}o=u.neg(),a=h;var _=i.sqr().add(n.sqr());return 0<=o.sqr().add(a.sqr()).cmp(_)&&(o=t,a=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:n},{a:o,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=n.mul(r.a),s=o.mul(i.a),u=n.mul(r.b),h=o.mul(i.b);return{k1:e.sub(a).sub(s),k2:u.add(h).neg()}},u.prototype.pointFromX=function(e,t){(e=new w(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),i[2*o]=s,i[2*o+1]=u,n[2*o]=a.k1,n[2*o+1]=a.k2}for(var h=this._wnafMulAdd(1,i,n,2*o,r),c=0;c<2*o;c++)i[c]=null,n[c]=null;return h},o(h,a.BasePoint),u.prototype.point=function(e,t,r){return new h(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return h.fromJSON(this,e,t)},h.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};(e.beta=t).precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},h.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},h.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(e){return t.point(e[0],e[1],r)}var o=e[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},h.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},h.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},h.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},h.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},h.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},h.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),c=h.redMul(s),f=i.redMul(h),l=u.redSqr().redIAdd(c).redISub(f).redISub(f),d=u.redMul(f.redISub(l)).redISub(o.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,d,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(i),s=n.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),h=u.redMul(a),c=r.redMul(u),f=s.redSqr().redIAdd(h).redISub(c).redISub(c),l=s.redMul(c.redISub(f)).redISub(n.redMul(h)),d=this.z.redMul(a);return this.curve.jpoint(f,l,d)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}var i=this.curve.a,n=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),h=a.redAdd(a);for(r=0;r<e;r++){var c=o.redSqr(),f=h.redSqr(),l=f.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(i.redMul(u)),p=o.redMul(f),m=d.redSqr().redISub(p.redAdd(p)),v=p.redISub(m),b=d.redMul(v);b=b.redIAdd(b).redISub(l);var g=h.redMul(s);r+1<e&&(u=u.redMul(l)),o=m,s=g,h=b}return this.curve.jpoint(o,h.redMul(n),s)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var s=i.redAdd(i).redIAdd(i),u=s.redSqr().redISub(a).redISub(a),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=u,t=s.redMul(a.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),f=this.y.redSqr(),l=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(c).redISub(l);d=d.redIAdd(d);var p=c.redAdd(c).redIAdd(c),m=p.redSqr(),v=l.redIAdd(l);v=(v=v.redIAdd(v)).redIAdd(v),e=m.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(v),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},c.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var s=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=s.redMul(a.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),f=this.y.redSqr(),l=this.x.redMul(f),d=this.x.redSub(c).redMul(this.x.redAdd(c));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),m=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(c);var v=f.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),t=d.redMul(p.redISub(e)).redISub(v)}return this.curve.jpoint(e,t,r)},c.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(n)),u=t.redAdd(t),h=(u=u.redIAdd(u)).redMul(a),c=s.redSqr().redISub(h.redAdd(h)),f=h.redISub(c),l=a.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=s.redMul(f).redISub(l),p=r.redAdd(r).redMul(i);return this.curve.jpoint(c,d,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),o=n.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(i),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=i.redIAdd(i);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var h=n.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),c=t.redMul(h);c=(c=c.redIAdd(c)).redIAdd(c);var f=this.x.redMul(s).redISub(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.y.redMul(h.redMul(u.redISub(h)).redISub(a.redMul(s)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(f,l,d)},c.prototype.mul=function(e,t){return e=new w(e,t),this.curve._wnafMul(this,e)},c.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},c.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),0<=i.cmp(this.curve.p))return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}return!1},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],75:[function(e,t,r){"use strict";var i,n=r,o=e("hash.js"),a=e("../elliptic"),s=a.utils.assert;function u(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new u(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=u,h("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),h("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),h("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}h("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":69,"./precomputed/secp256k1":82,"hash.js":88}],76:[function(e,t,r){"use strict";var v=e("bn.js"),b=e("hmac-drbg"),o=e("../../elliptic"),d=o.utils.assert,i=e("./key"),g=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(d(o.curves.hasOwnProperty(e),"Unknown curve "+e),e=o.curves[e]),e instanceof o.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new b({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new v(2));;){var n=new v(t.generate(r));if(!(0<n.cmp(i)))return n.iaddn(1),this.keyFromPrivate(n)}},n.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return 0<r&&(e=e.ushrn(r)),!t&&0<=e.cmp(this.n)?e.sub(this.n):e},n.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new v(e,16));for(var n=this.n.byteLength(),o=t.getPrivate().toArray("be",n),a=e.toArray("be",n),s=new b({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new v(1)),h=0;;h++){var c=i.k?i.k(h):new v(s.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||0<=c.cmp(u))){var f=this.g.mul(c);if(!f.isInfinity()){var l=f.getX(),d=l.umod(this.n);if(0!==d.cmpn(0)){var p=c.invm(this.n).mul(d.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(f.getY().isOdd()?1:0)|(0!==l.cmp(d)?2:0);return i.canonical&&0<p.cmp(this.nh)&&(p=this.n.sub(p),m^=1),new g({r:d,s:p,recoveryParam:m})}}}}}},n.prototype.verify=function(e,t,r,i){e=this._truncateToN(new v(e,16)),r=this.keyFromPublic(r,i);var n=(t=new g(t,"hex")).r,o=t.s;if(n.cmpn(1)<0||0<=n.cmp(this.n))return!1;if(o.cmpn(1)<0||0<=o.cmp(this.n))return!1;var a,s=o.invm(this.n),u=s.mul(e).umod(this.n),h=s.mul(n).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),h)).isInfinity()&&a.eqXToP(n):!(a=this.g.mulAdd(u,r.getPublic(),h)).isInfinity()&&0===a.getX().umod(this.n).cmp(n)},n.prototype.recoverPubKey=function(e,t,r,i){d((3&r)===r,"The recovery param is more than two bits"),t=new g(t,i);var n=this.n,o=new v(e),a=t.r,s=t.s,u=1&r,h=r>>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&h)throw new Error("Unable to find sencond key candinate");a=h?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var c=t.r.invm(n),f=n.sub(o).mul(c).umod(n),l=s.mul(c).umod(n);return this.g.mulAdd(f,a,l)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new g(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":69,"./key":77,"./signature":78,"bn.js":17,"hmac-drbg":100}],77:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=o).fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":69,"bn.js":17}],78:[function(e,t,r){"use strict";var s=e("bn.js"),u=e("../../elliptic").utils,i=u.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function h(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,a=t.place;o<i;o++,a++)n<<=8,n|=e[a];return t.place=a,n}function a(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=u.toArray(e,t);var r=new h;if(48!==e[r.place++])return!1;if(c(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=c(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=c(e,r);if(e.length!==o+r.place)return!1;var a=e.slice(r.place,o+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===a[0]&&128&a[1]&&(a=a.slice(1)),this.r=new s(n),this.s=new s(a),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=a(t),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,t.length),(i=i.concat(t)).push(2),f(i,r.length);var n=i.concat(r),o=[48];return f(o,n.length),o=o.concat(n),u.encode(o,e)}},{"../../elliptic":69,"bn.js":17}],79:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),o=n.utils,a=o.assert,u=o.parseBytes,s=e("./key"),h=e("./signature");function c(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=c).prototype.sign=function(e,t){e=u(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),o=this.encodePoint(n),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=i.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:o})},c.prototype.verify=function(e,t,r){e=u(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(o)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(e){return s.fromPublic(this,e)},c.prototype.keyFromSecret=function(e){return s.fromSecret(this,e)},c.prototype.makeSignature=function(e){return e instanceof h?e:new h(this,e)},c.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},c.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),i=0!=(128&e[t]),n=o.intFromLE(r);return this.curve.pointFromY(n,i)},c.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(e){return o.intFromLE(e)},c.prototype.isPoint=function(e){return e instanceof this.pointClass}},{"../../elliptic":69,"./key":80,"./signature":81,"hash.js":88}],80:[function(e,t,r){"use strict";var i=e("../../elliptic").utils,n=i.assert,o=i.parseBytes,a=i.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),a(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),a(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),a(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),a(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),a(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),e)},s.prototype.getPublic=function(e){return i.encode(this.pubBytes(),e)},t.exports=s},{"../../elliptic":69}],81:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,o=n.assert,a=n.cachedProperty,s=n.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(u,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),a(u,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),a(u,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),a(u,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=u},{"../../elliptic":69,"bn.js":17}],82:[function(e,t,r){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],83:[function(e,t,r){"use strict";var i=r,n=e("bn.js"),o=e("minimalistic-assert"),a=e("minimalistic-crypto-utils");i.assert=o,i.toArray=a.toArray,i.zero2=a.zero2,i.toHex=a.toHex,i.encode=a.encode,i.getNAF=function(e,t){for(var r=[],i=1<<t+1,n=e.clone();0<=n.cmpn(1);){var o;if(n.isOdd()){var a=n.andln(i-1);o=(i>>1)-1<a?(i>>1)-a:a,n.isubn(o)}else o=0;r.push(o);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,u=1;u<s;u++)r.push(0);n.iushrn(s)}return r},i.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i=0,n=0;0<e.cmpn(-i)||0<t.cmpn(-n);){var o,a,s,u=e.andln(3)+i&3,h=t.andln(3)+n&3;3===u&&(u=-1),3===h&&(h=-1),o=0==(1&u)?0:3!=(s=e.andln(7)+i&7)&&5!==s||2!==h?u:-u,r[0].push(o),a=0==(1&h)?0:3!=(s=t.andln(7)+n&7)&&5!==s||2!==u?h:-h,r[1].push(a),2*i===o+1&&(i=1-i),2*n===a+1&&(n=1-n),e.iushrn(1),t.iushrn(1)}return r},i.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(e){return"string"==typeof e?i.toArray(e,"hex"):e},i.intFromLE=function(e){return new n(e,"hex","le")}},{"bn.js":17,"minimalistic-assert":109,"minimalistic-crypto-utils":110}],84:[function(e,t,r){t.exports={_from:"elliptic@^6.0.0",_id:"elliptic@6.4.0",_inBundle:!1,_integrity:"sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=",_location:"/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^6.0.0",name:"elliptic",escapedName:"elliptic",rawSpec:"^6.0.0",saveSpec:null,fetchSpec:"^6.0.0"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_shasum:"cac9af8762c85836187003c8dfe193e5e2eae5df",_spec:"elliptic@^6.0.0",_where:"d:\\pixi-games\\pixi-compressed-textures\\node_modules\\browserify-sign",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},bundleDependencies:!1,dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},deprecated:!1,description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},{}],85:[function(e,t,r){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function u(e){return"function"==typeof e}function h(e){return"object"==typeof e&&null!==e}function c(e){return void 0===e}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(e){if(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},i.prototype.emit=function(e){var t,r,i,n,o,a;if(this._events||(this._events={}),"error"===e&&(!this._events.error||h(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(c(r=this._events[e]))return!1;if(u(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=Array.prototype.slice.call(arguments,1),r.apply(this,n)}else if(h(r))for(n=Array.prototype.slice.call(arguments,1),i=(a=r.slice()).length,o=0;o<i;o++)a[o].apply(this,n);return!0},i.prototype.on=i.prototype.addListener=function(e,t){var r;if(!u(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,u(t.listener)?t.listener:t),this._events[e]?h(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,h(this._events[e])&&!this._events[e].warned&&(r=c(this._maxListeners)?i.defaultMaxListeners:this._maxListeners)&&0<r&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!u(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,o;if(!u(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||u(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(h(r)){for(o=n;0<o--;)if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(u(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){return this._events&&this._events[e]?u(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(u(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}},{}],86:[function(e,t,r){var d=e("safe-buffer").Buffer,p=e("md5.js");t.exports=function(e,t,r,i){if(d.isBuffer(e)||(e=d.from(e,"binary")),t&&(d.isBuffer(t)||(t=d.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var n=r/8,o=d.alloc(n),a=d.alloc(i||0),s=d.alloc(0);0<n||0<i;){var u=new p;u.update(s),u.update(e),t&&u.update(t),s=u.digest();var h=0;if(0<n){var c=o.length-n;h=Math.min(n,s.length),s.copy(o,c,0,h),n-=h}if(h<s.length&&0<i){var f=a.length-i,l=Math.min(i,s.length-h);s.copy(a,f,h,h+l),i-=l}}return s.fill(0),{key:o,iv:a}}},{"md5.js":106,"safe-buffer":143}],87:[function(r,i,e){(function(s){"use strict";var t=r("stream").Transform;function e(e){t.call(this),this._block=new s(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r("inherits")(e,t),e.prototype._transform=function(e,t,r){var i=null;try{"buffer"!==t&&(e=new s(e,t)),this.update(e)}catch(e){i=e}r(i)},e.prototype._flush=function(e){var t=null;try{this.push(this._digest())}catch(e){t=e}e(t)},e.prototype.update=function(e,t){if(!s.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");s.isBuffer(e)||(e=new s(e,t||"binary"));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)r[n++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var o=0,a=8*e.length;0<a;++o)this._length[o]+=a,0<(a=this._length[o]/4294967296|0)&&(this._length[o]-=4294967296*a);return this},e.prototype._update=function(e){throw new Error("_update is not implemented")},e.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();return void 0!==e&&(t=t.toString(e)),t},e.prototype._digest=function(){throw new Error("_digest is not implemented")},i.exports=e}).call(this,r("buffer").Buffer)},{buffer:49,inherits:103,stream:152}],88:[function(e,t,r){var i=r;i.utils=e("./hash/utils"),i.common=e("./hash/common"),i.sha=e("./hash/sha"),i.ripemd=e("./hash/ripemd"),i.hmac=e("./hash/hmac"),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},{"./hash/common":89,"./hash/hmac":90,"./hash/ripemd":91,"./hash/sha":92,"./hash/utils":99}],89:[function(e,t,r){"use strict";var n=e("./utils"),i=e("minimalistic-assert");function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}(r.BlockHash=o).prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i}},{"./utils":99,"minimalistic-assert":109}],90:[function(e,t,r){"use strict";var i=e("./utils"),n=e("minimalistic-assert");function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(t,r))}(t.exports=o).prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},{"./utils":99,"minimalistic-assert":109}],91:[function(e,t,r){"use strict";var i=e("./utils"),n=e("./common"),p=i.rotl32,m=i.sum32,v=i.sum32_3,b=i.sum32_4,o=n.BlockHash;function a(){if(!(this instanceof a))return new a;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function g(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function y(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function _(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}i.inherits(a,o),(r.ripemd160=a).blockSize=512,a.outSize=160,a.hmacStrength=192,a.padLength=64,a.prototype._update=function(e,t){for(var r=this.h[0],i=this.h[1],n=this.h[2],o=this.h[3],a=this.h[4],s=r,u=i,h=n,c=o,f=a,l=0;l<80;l++){var d=m(p(b(r,g(l,i,n,o),e[w[l]+t],y(l)),T[l]),a);r=a,a=o,o=p(n,10),n=i,i=d,d=m(p(b(s,g(79-l,u,h,c),e[x[l]+t],_(l)),S[l]),f),s=f,f=c,c=p(h,10),h=u,u=d}d=v(this.h[1],n,c),this.h[1]=v(this.h[2],o,f),this.h[2]=v(this.h[3],a,s),this.h[3]=v(this.h[4],r,u),this.h[4]=v(this.h[0],i,h),this.h[0]=d},a.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var w=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],x=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],T=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],S=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"./common":89,"./utils":99}],92:[function(e,t,r){"use strict";r.sha1=e("./sha/1"),r.sha224=e("./sha/224"),r.sha256=e("./sha/256"),r.sha384=e("./sha/384"),r.sha512=e("./sha/512")},{"./sha/1":93,"./sha/224":94,"./sha/256":95,"./sha/384":96,"./sha/512":97}],93:[function(e,t,r){"use strict";var i=e("../utils"),n=e("../common"),o=e("./common"),f=i.rotl32,l=i.sum32,d=i.sum32_5,p=o.ft_1,a=n.BlockHash,m=[1518500249,1859775393,2400959708,3395469782];function s(){if(!(this instanceof s))return new s;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(s,a),(t.exports=s).blockSize=512,s.outSize=160,s.hmacStrength=80,s.padLength=64,s.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=f(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4];for(i=0;i<r.length;i++){var h=~~(i/20),c=d(f(n,5),p(h,o,a,s),u,r[i],m[h]);u=s,s=a,a=f(o,30),o=n,n=c}this.h[0]=l(this.h[0],n),this.h[1]=l(this.h[1],o),this.h[2]=l(this.h[2],a),this.h[3]=l(this.h[3],s),this.h[4]=l(this.h[4],u)},s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},{"../common":89,"../utils":99,"./common":98}],94:[function(e,t,r){"use strict";var i=e("../utils"),n=e("./256");function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(o,n),(t.exports=o).blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},{"../utils":99,"./256":95}],95:[function(e,t,r){"use strict";var i=e("../utils"),n=e("../common"),o=e("./common"),p=e("minimalistic-assert"),m=i.sum32,v=i.sum32_4,b=i.sum32_5,g=o.ch32,y=o.maj32,_=o.s0_256,w=o.s1_256,x=o.g0_256,T=o.g1_256,a=n.BlockHash,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function u(){if(!(this instanceof u))return new u;a.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=s,this.W=new Array(64)}i.inherits(u,a),(t.exports=u).blockSize=512,u.outSize=256,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=v(T(r[i-2]),r[i-7],x(r[i-15]),r[i-16]);var n=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],h=this.h[5],c=this.h[6],f=this.h[7];for(p(this.k.length===r.length),i=0;i<r.length;i++){var l=b(f,w(u),g(u,h,c),this.k[i],r[i]),d=m(_(n),y(n,o,a));f=c,c=h,h=u,u=m(s,l),s=a,a=o,o=n,n=m(l,d)}this.h[0]=m(this.h[0],n),this.h[1]=m(this.h[1],o),this.h[2]=m(this.h[2],a),this.h[3]=m(this.h[3],s),this.h[4]=m(this.h[4],u),this.h[5]=m(this.h[5],h),this.h[6]=m(this.h[6],c),this.h[7]=m(this.h[7],f)},u.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},{"../common":89,"../utils":99,"./common":98,"minimalistic-assert":109}],96:[function(e,t,r){"use strict";var i=e("../utils"),n=e("./512");function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(o,n),(t.exports=o).blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},{"../utils":99,"./512":97}],97:[function(e,t,r){"use strict";var i=e("../utils"),n=e("../common"),D=e("minimalistic-assert"),o=i.rotr64_hi,a=i.rotr64_lo,s=i.shr64_hi,u=i.shr64_lo,L=i.sum64,F=i.sum64_hi,j=i.sum64_lo,l=i.sum64_4_hi,d=i.sum64_4_lo,B=i.sum64_5_hi,N=i.sum64_5_lo,h=n.BlockHash,c=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function f(){if(!(this instanceof f))return new f;h.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=c,this.W=new Array(160)}function U(e,t,r,i,n){var o=e&r^~e&n;return o<0&&(o+=4294967296),o}function z(e,t,r,i,n,o){var a=t&i^~t&o;return a<0&&(a+=4294967296),a}function X(e,t,r,i,n){var o=e&r^e&n^r&n;return o<0&&(o+=4294967296),o}function q(e,t,r,i,n,o){var a=t&i^t&o^i&o;return a<0&&(a+=4294967296),a}function H(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function G(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function V(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=4294967296),r}function Y(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function p(e,t){var r=o(e,t,1)^o(e,t,8)^s(e,t,7);return r<0&&(r+=4294967296),r}function m(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function v(e,t){var r=o(e,t,19)^o(t,e,29)^s(e,t,6);return r<0&&(r+=4294967296),r}function b(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}i.inherits(f,h),(t.exports=f).blockSize=1024,f.outSize=512,f.hmacStrength=192,f.padLength=128,f.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=v(r[i-4],r[i-3]),o=b(r[i-4],r[i-3]),a=r[i-14],s=r[i-13],u=p(r[i-30],r[i-29]),h=m(r[i-30],r[i-29]),c=r[i-32],f=r[i-31];r[i]=l(n,o,a,s,u,h,c,f),r[i+1]=d(n,o,a,s,u,h,c,f)}},f.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],n=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],u=this.h[5],h=this.h[6],c=this.h[7],f=this.h[8],l=this.h[9],d=this.h[10],p=this.h[11],m=this.h[12],v=this.h[13],b=this.h[14],g=this.h[15];D(this.k.length===r.length);for(var y=0;y<r.length;y+=2){var _=b,w=g,x=V(f,l),T=Y(f,l),S=U(f,l,d,p,m),E=z(f,l,d,p,m,v),A=this.k[y],P=this.k[y+1],M=r[y],C=r[y+1],k=B(_,w,x,T,S,E,A,P,M,C),I=N(_,w,x,T,S,E,A,P,M,C);_=H(i,n),w=G(i,n),x=X(i,n,o,a,s),T=q(i,n,o,a,s,u);var R=F(_,w,x,T),O=j(_,w,x,T);b=m,g=v,m=d,v=p,d=f,p=l,f=F(h,c,k,I),l=j(c,c,k,I),h=s,c=u,s=o,u=a,o=i,a=n,i=F(k,I,R,O),n=j(k,I,R,O)}L(this.h,0,i,n),L(this.h,2,o,a),L(this.h,4,s,u),L(this.h,6,h,c),L(this.h,8,f,l),L(this.h,10,d,p),L(this.h,12,m,v),L(this.h,14,b,g)},f.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},{"../common":89,"../utils":99,"minimalistic-assert":109}],98:[function(e,t,r){"use strict";var i=e("../utils").rotr32;function n(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}r.ft_1=function(e,t,r,i){return 0===e?n(t,r,i):1===e||3===e?a(t,r,i):2===e?o(t,r,i):void 0},r.ch32=n,r.maj32=o,r.p32=a,r.s0_256=function(e){return i(e,2)^i(e,13)^i(e,22)},r.s1_256=function(e){return i(e,6)^i(e,11)^i(e,25)},r.g0_256=function(e){return i(e,7)^i(e,18)^e>>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":99}],99:[function(e,t,r){"use strict";var h=e("minimalistic-assert"),i=e("inherits");function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function a(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=i,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,a=255&n;o?r.push(o,a):r.push(a)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},r.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t},r.htonl=o,r.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];"little"===t&&(n=o(n)),r+=a(n.toString(16))}return r},r.zero2=n,r.zero8=a,r.join32=function(e,t,r,i){var n=r-t;h(n%4==0);for(var o=new Array(n/4),a=0,s=t;a<o.length;a++,s+=4){var u;u="big"===i?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],o[a]=u>>>0}return o},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];"big"===t?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<<t|e>>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,a=(o<i?1:0)+r+n;e[t]=a>>>0,e[t+1]=o},r.sum64_hi=function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,o,a,s){var u=0,h=t;return u+=(h=h+i>>>0)<t?1:0,u+=(h=h+o>>>0)<o?1:0,e+r+n+a+(u+=(h=h+s>>>0)<s?1:0)>>>0},r.sum64_4_lo=function(e,t,r,i,n,o,a,s){return t+i+o+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,o,a,s,u,h){var c=0,f=t;return c+=(f=f+i>>>0)<t?1:0,c+=(f=f+o>>>0)<o?1:0,c+=(f=f+s>>>0)<s?1:0,e+r+n+a+u+(c+=(f=f+h>>>0)<h?1:0)>>>0},r.sum64_5_lo=function(e,t,r,i,n,o,a,s,u,h){return t+i+o+s+h>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:103,"minimalistic-assert":109}],100:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=o).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},o.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=a.toArray(e,t),r=a.toArray(r,i),n(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=a.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<e;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var o=n.slice(0,e);return this._update(r),this._reseed++,a.encode(o,t)}},{"hash.js":88,"minimalistic-assert":109,"minimalistic-crypto-utils":110}],101:[function(e,t,r){r.read=function(e,t,r,i,n){var o,a,s=8*n-i-1,u=(1<<s)-1,h=u>>1,c=-7,f=r?n-1:0,l=r?-1:1,d=e[t+f];for(f+=l,o=d&(1<<-c)-1,d>>=-c,c+=s;0<c;o=256*o+e[t+f],f+=l,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=i;0<c;a=256*a+e[t+f],f+=l,c-=8);if(0===o)o=1-h;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,i),o-=h}return(d?-1:1)*a*Math.pow(2,o-i)},r.write=function(e,t,r,i,n,o){var a,s,u,h=8*o-n-1,c=(1<<h)-1,f=c>>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),2<=(t+=1<=a+f?l/u:l*Math.pow(2,1-f))*u&&(a++,u/=2),c<=a+f?(s=0,a=c):1<=a+f?(s=(t*u-1)*Math.pow(2,n),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<<n|s,h+=n;0<h;e[r+d]=255&a,d+=p,a/=256,h-=8);e[r+d-p]|=128*m}},{}],102:[function(e,t,r){var i=[].indexOf;t.exports=function(e,t){if(i)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}},{}],103:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],104:[function(e,t,r){function i(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(i(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&i(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],105:[function(e,t,r){var i={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},{}],106:[function(n,o,e){(function(t){"use strict";var e=n("inherits"),r=n("hash-base"),a=new Array(16);function i(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function s(e,t){return e<<t|e>>>32-t}function u(e,t,r,i,n,o,a){return s(e+(t&r|~t&i)+n+o|0,a)+t|0}function h(e,t,r,i,n,o,a){return s(e+(t&i|r&~i)+n+o|0,a)+t|0}function c(e,t,r,i,n,o,a){return s(e+(t^r^i)+n+o|0,a)+t|0}function f(e,t,r,i,n,o,a){return s(e+(r^(t|~i))+n+o|0,a)+t|0}e(i,r),i.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d;i=f(i=f(i=f(i=f(i=c(i=c(i=c(i=c(i=h(i=h(i=h(i=h(i=u(i=u(i=u(i=u(i,n=u(n,o=u(o,r=u(r,i,n,o,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),o,r,e[3],3250441966,22),n=u(n,o=u(o,r=u(r,i,n,o,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),o,r,e[7],4249261313,22),n=u(n,o=u(o,r=u(r,i,n,o,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),o,r,e[11],2304563134,22),n=u(n,o=u(o,r=u(r,i,n,o,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),o,r,e[15],1236535329,22),n=h(n,o=h(o,r=h(r,i,n,o,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),o,r,e[0],3921069994,20),n=h(n,o=h(o,r=h(r,i,n,o,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),o,r,e[4],3889429448,20),n=h(n,o=h(o,r=h(r,i,n,o,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),o,r,e[8],1163531501,20),n=h(n,o=h(o,r=h(r,i,n,o,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),o,r,e[12],2368359562,20),n=c(n,o=c(o,r=c(r,i,n,o,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),o,r,e[14],4259657740,23),n=c(n,o=c(o,r=c(r,i,n,o,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),o,r,e[10],3200236656,23),n=c(n,o=c(o,r=c(r,i,n,o,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),o,r,e[6],76029189,23),n=c(n,o=c(o,r=c(r,i,n,o,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),o,r,e[2],3299628645,23),n=f(n,o=f(o,r=f(r,i,n,o,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),o,r,e[5],4237533241,21),n=f(n,o=f(o,r=f(r,i,n,o,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),o,r,e[1],2240044497,21),n=f(n,o=f(o,r=f(r,i,n,o,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),o,r,e[13],1309151649,21),n=f(n,o=f(o,r=f(r,i,n,o,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56<this._blockOffset&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new t(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},o.exports=i}).call(this,n("buffer").Buffer)},{buffer:49,"hash-base":107,inherits:103}],107:[function(e,t,r){"use strict";var s=e("safe-buffer").Buffer,i=e("stream").Transform;function n(e){i.call(this),this._block=s.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(n,i),n.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},n.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},n.prototype.update=function(e,t){if(function(e,t){if(!s.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");s.isBuffer(e)||(e=s.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)r[n++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var o=0,a=8*e.length;0<a;++o)this._length[o]+=a,0<(a=this._length[o]/4294967296|0)&&(this._length[o]-=4294967296*a);return this},n.prototype._update=function(){throw new Error("_update is not implemented")},n.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0);for(var r=this._blockOffset=0;r<4;++r)this._length[r]=0;return t},n.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=n},{inherits:103,"safe-buffer":143,stream:152}],108:[function(e,t,r){var d=e("bn.js"),i=e("brorand");function n(e){this.rand=e||new i.Rand}(t.exports=n).create=function(e){return new n(e)},n.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new d(this.rand.generate(r))}while(0<=i.cmp(e));return i},n.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},n.prototype.test=function(e,t,r){var i=e.bitLength(),n=d.mont(e),o=new d(1).toRed(n);t||(t=Math.max(1,i/48|0));for(var a=e.subn(1),s=0;!a.testn(s);s++);for(var u=e.shrn(s),h=a.toRed(n);0<t;t--){var c=this._randrange(new d(2),a);r&&r(c);var f=c.toRed(n).redPow(u);if(0!==f.cmp(o)&&0!==f.cmp(h)){for(var l=1;l<s;l++){if(0===(f=f.redSqr()).cmp(o))return!1;if(0===f.cmp(h))break}if(l===s)return!1}}return!0},n.prototype.getDivisor=function(e,t){var r=e.bitLength(),i=d.mont(e),n=new d(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var o=e.subn(1),a=0;!o.testn(a);a++);for(var s=e.shrn(a),u=o.toRed(i);0<t;t--){var h=this._randrange(new d(2),o),c=e.gcd(h);if(0!==c.cmpn(1))return c;var f=h.toRed(i).redPow(s);if(0!==f.cmp(n)&&0!==f.cmp(u)){for(var l=1;l<a;l++){if(0===(f=f.redSqr()).cmp(n))return f.fromRed().subn(1).gcd(e);if(0===f.cmp(u))break}if(l===a)return(f=f.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},{"bn.js":17,brorand:18}],109:[function(e,t,r){function i(e,t){if(!e)throw new Error(t||"Assertion failed")}(t.exports=i).equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},{}],110:[function(e,t,r){"use strict";var i=r;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}i.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16));else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,a=255&n;o?r.push(o,a):r.push(a)}return r},i.zero2=n,i.toHex=o,i.encode=function(e,t){return"hex"===t?o(e):e}},{}],111:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],112:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var o=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=o;var a=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=a;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=u;var h=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=h;var c=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=c,r.DSAparam=i.define("DSAparam",function(){this.int()});var f=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(l),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=f;var l=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":113,"asn1.js":2}],113:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=i.define("RelativeDistinguishedName",function(){this.setof(o)}),h=i.define("RDNSequence",function(){this.seqof(u)}),c=i.define("Name",function(){this.choice({rdnSequence:this.use(h)})}),f=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),l=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(c),this.key("validity").use(f),this.key("subject").use(c),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())}),p=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});t.exports=p},{"asn1.js":2}],114:[function(e,t,r){(function(l){var d=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,p=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,m=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,v=e("evp_bytestokey"),b=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(d);if(n){var o="aes"+n[1],a=new l(n[2],"hex"),s=new l(n[3].replace(/\r?\n/g,""),"base64"),u=v(t,a.slice(0,8),parseInt(n[1],10)).key,h=[],c=b.createDecipheriv(o,u,a);h.push(c.update(s)),h.push(c.final()),r=l.concat(h)}else{var f=i.match(m);r=new l(f[2].replace(/\r?\n/g,""),"base64")}return{tag:i.match(p)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":22,buffer:49,evp_bytestokey:86}],115:[function(t,r,e){(function(f){var s=t("./asn1"),l=t("./aesid.json"),u=t("./fixProc"),d=t("browserify-aes"),p=t("pbkdf2");function e(e){var t;"object"!=typeof e||f.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new f(e));var r,i,n=u(e,t),o=n.tag,a=n.data;switch(o){case"CERTIFICATE":i=s.certificate.decode(a,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=s.PublicKey.decode(a,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=s.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"ENCRYPTED PRIVATE KEY":a=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=l[e.algorithm.decrypt.cipher.algo.join(".")],o=e.algorithm.decrypt.cipher.iv,a=e.subjectPrivateKey,s=parseInt(n.split("-")[1],10)/8,u=p.pbkdf2Sync(t,r,i,s),h=d.createDecipheriv(n,u,o),c=[];return c.push(h.update(a)),c.push(h.final()),f.concat(c)}(a=s.EncryptedPrivateKey.decode(a,"der"),t);case"PRIVATE KEY":switch(r=(i=s.PrivateKey.decode(a,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:s.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=s.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"RSA PUBLIC KEY":return s.RSAPublicKey.decode(a,"der");case"RSA PRIVATE KEY":return s.RSAPrivateKey.decode(a,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:s.DSAPrivateKey.decode(a,"der")};case"EC PRIVATE KEY":return{curve:(a=s.ECPrivateKey.decode(a,"der")).parameters.value,privateKey:a.privateKey};default:throw new Error("unknown key type "+o)}}(r.exports=e).signature=s.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":111,"./asn1":112,"./fixProc":114,"browserify-aes":22,buffer:49,pbkdf2:117}],116:[function(e,t,h){(function(n){function o(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return t.exec(e).slice(1)};function s(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;i<e.length;i++)t(e[i],i,e)&&r.push(e[i]);return r}h.resolve=function(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){var i=0<=r?arguments[r]:n.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,t="/"===i.charAt(0))}return(t?"/":"")+(e=o(s(e.split("/"),function(e){return!!e}),!t).join("/"))||"."},h.normalize=function(e){var t=h.isAbsolute(e),r="/"===i(e,-1);return(e=o(s(e.split("/"),function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},h.isAbsolute=function(e){return"/"===e.charAt(0)},h.join=function(){var e=Array.prototype.slice.call(arguments,0);return h.normalize(s(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},h.relative=function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;0<=r&&""===e[r];r--);return r<t?[]:e.slice(t,r-t+1)}e=h.resolve(e).substr(1),t=h.resolve(t).substr(1);for(var i=r(e.split("/")),n=r(t.split("/")),o=Math.min(i.length,n.length),a=o,s=0;s<o;s++)if(i[s]!==n[s]){a=s;break}var u=[];for(s=a;s<i.length;s++)u.push("..");return(u=u.concat(n.slice(a))).join("/")},h.sep="/",h.delimiter=":",h.dirname=function(e){var t=a(e),r=t[0],i=t[1];return r||i?(i&&(i=i.substr(0,i.length-1)),r+i):"."},h.basename=function(e,t){var r=a(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},h.extname=function(e){return a(e)[3]};var i="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,e("_process"))},{_process:123}],117:[function(e,t,r){r.pbkdf2=e("./lib/async"),r.pbkdf2Sync=e("./lib/sync")},{"./lib/async":118,"./lib/sync":121}],118:[function(t,r,e){(function(u,h){var c,e=t("./precondition"),f=t("./default-encoding"),l=t("./sync"),d=t("safe-buffer").Buffer,p=h.crypto&&h.crypto.subtle,m={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},v=[];function b(e,t,r,i,n){return p.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return p.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:n}},e,i<<3)}).then(function(e){return d.from(e)})}r.exports=function(t,r,i,n,o,a){if(d.isBuffer(t)||(t=d.from(t,f)),d.isBuffer(r)||(r=d.from(r,f)),e(i,n),"function"==typeof o&&(a=o,o=void 0),"function"!=typeof a)throw new Error("No callback provided to pbkdf2");var s=m[(o=o||"sha1").toLowerCase()];if(!s||"function"!=typeof h.Promise)return u.nextTick(function(){var e;try{e=l(t,r,i,n,o)}catch(e){return a(e)}a(null,e)});!function(e,t){e.then(function(e){u.nextTick(function(){t(null,e)})},function(e){u.nextTick(function(){t(e)})})}(function(e){if(h.process&&!h.process.browser)return Promise.resolve(!1);if(!p||!p.importKey||!p.deriveBits)return Promise.resolve(!1);if(void 0!==v[e])return v[e];var t=b(c=c||d.alloc(8),c,10,128,e).then(function(){return!0}).catch(function(){return!1});return v[e]=t}(s).then(function(e){return e?b(t,r,i,n,s):l(t,r,i,n,o)}),a)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":119,"./precondition":120,"./sync":121,_process:123,"safe-buffer":143}],119:[function(e,r,t){(function(e){var t;e.browser?t="utf-8":t=6<=parseInt(e.version.split(".")[0].slice(1),10)?"utf-8":"binary";r.exports=t}).call(this,e("_process"))},{_process:123}],120:[function(e,t,r){var i=Math.pow(2,30)-1;t.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||i<t||t!=t)throw new TypeError("Bad key length")}},{}],121:[function(e,t,r){var h=e("create-hash/md5"),c=e("ripemd160"),f=e("sha.js"),v=e("./precondition"),b=e("./default-encoding"),g=e("safe-buffer").Buffer,l=g.alloc(128),y={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function _(e,t,r){var i=function(t){return"rmd160"===t||"ripemd160"===t?c:"md5"===t?h:function(e){return f(t).update(e).digest()}}(e),n="sha512"===e||"sha384"===e?128:64;t.length>n?t=i(t):t.length<n&&(t=g.concat([t,l],n));for(var o=g.allocUnsafe(n+y[e]),a=g.allocUnsafe(n+y[e]),s=0;s<n;s++)o[s]=54^t[s],a[s]=92^t[s];var u=g.allocUnsafe(n+r+4);o.copy(u,0,0,n),this.ipad1=u,this.ipad2=o,this.opad=a,this.alg=e,this.blocksize=n,this.hash=i,this.size=y[e]}_.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(e,t,r,i,n){g.isBuffer(e)||(e=g.from(e,b)),g.isBuffer(t)||(t=g.from(t,b)),v(r,i);var o=new _(n=n||"sha1",e,t.length),a=g.allocUnsafe(i),s=g.allocUnsafe(t.length+4);t.copy(s,0,0,t.length);for(var u=0,h=y[n],c=Math.ceil(i/h),f=1;f<=c;f++){s.writeUInt32BE(f,t.length);for(var l=o.run(s,o.ipad1),d=l,p=1;p<r;p++){d=o.run(d,o.ipad2);for(var m=0;m<h;m++)l[m]^=d[m]}l.copy(a,u),u+=h}return a}},{"./default-encoding":119,"./precondition":120,"create-hash/md5":55,ripemd160:142,"safe-buffer":143,"sha.js":145}],122:[function(e,t,r){(function(s){"use strict";!s.version||0===s.version.indexOf("v0.")||0===s.version.indexOf("v1.")&&0!==s.version.indexOf("v1.8.")?t.exports=function(e,t,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var n,o,a=arguments.length;switch(a){case 0:case 1:return s.nextTick(e);case 2:return s.nextTick(function(){e.call(null,t)});case 3:return s.nextTick(function(){e.call(null,t,r)});case 4:return s.nextTick(function(){e.call(null,t,r,i)});default:for(n=new Array(a-1),o=0;o<n.length;)n[o++]=arguments[o];return s.nextTick(function(){e.apply(null,n)})}}:t.exports=s.nextTick}).call(this,e("_process"))},{_process:123}],123:[function(e,t,r){var i,n,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(t){if(i===setTimeout)return setTimeout(t,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:a}catch(e){i=a}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var h,c=[],f=!1,l=-1;function d(){f&&h&&(f=!1,h.length?c=h.concat(c):l=-1,c.length&&p())}function p(){if(!f){var e=u(d);f=!0;for(var t=c.length;t;){for(h=c,c=[];++l<t;)h&&h[l].run();l=-1,t=c.length}h=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new m(e,t)),1!==c.length||f||u(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],124:[function(e,t,r){r.publicEncrypt=e("./publicEncrypt"),r.privateDecrypt=e("./privateDecrypt"),r.privateEncrypt=function(e,t){return r.publicEncrypt(e,t,!0)},r.publicDecrypt=function(e,t){return r.privateDecrypt(e,t,!0)}},{"./privateDecrypt":126,"./publicEncrypt":127}],125:[function(e,t,r){(function(o){var a=e("create-hash");function s(e){var t=new o(4);return t.writeUInt32BE(e,0),t}t.exports=function(e,t){for(var r,i=new o(""),n=0;i.length<t;)r=s(n++),i=o.concat([i,a("sha1").update(e).update(r).digest()]);return i.slice(0,t)}}).call(this,e("buffer").Buffer)},{buffer:49,"create-hash":53}],126:[function(e,t,r){(function(c){var u=e("parse-asn1"),f=e("./mgf"),l=e("./xor"),h=e("bn.js"),d=e("browserify-rsa"),p=e("create-hash"),m=e("./withPublic");t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,o=u(e),a=o.modulus.byteLength();if(t.length>a||0<=new h(t).cmp(o.modulus))throw new Error("decryption error");n=r?m(new h(t),o):d(t,o);var s=new c(a-n.length);if(s.fill(0),n=c.concat([s,n],a),4===i)return function(e,t){e.modulus;var r=e.modulus.byteLength(),i=(t.length,p("sha1").update(new c("")).digest()),n=i.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,n+1),a=t.slice(n+1),s=l(o,f(a,n)),u=l(a,f(s,r-n-1));if(function(e,t){e=new c(e),t=new c(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n<i;)r+=e[n]^t[n];return r}(i,u.slice(0,n)))throw new Error("decryption error");var h=n;for(;0===u[h];)h++;if(1===u[h++])return u.slice(h);throw new Error("decryption error")}(o,n);if(1===i)return function(e,t,r){var i=t.slice(0,2),n=2,o=0;for(;0!==t[n++];)if(n>=t.length){o++;break}var a=t.slice(2,n-1);t.slice(n-1,n);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}}).call(this,e("buffer").Buffer)},{"./mgf":125,"./withPublic":128,"./xor":129,"bn.js":17,"browserify-rsa":40,buffer:49,"create-hash":53,"parse-asn1":115}],127:[function(e,t,r){(function(l){var a=e("parse-asn1"),d=e("randombytes"),p=e("create-hash"),m=e("./mgf"),v=e("./xor"),b=e("bn.js"),s=e("./withPublic"),u=e("browserify-rsa");t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,o=a(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=p("sha1").update(new l("")).digest(),o=n.length,a=2*o;if(r-a-2<i)throw new Error("message too long");var s=new l(r-i-a-2);s.fill(0);var u=r-o-1,h=d(o),c=v(l.concat([n,s,new l([1]),t],u),m(h,u)),f=v(h,m(c,o));return new b(l.concat([new l([0]),f,c],r))}(o,t);else if(1===i)n=function(e,t,r){var i,n=t.length,o=e.modulus.byteLength();if(o-11<n)throw new Error("message too long");r?(i=new l(o-n-3)).fill(255):i=function(e,t){var r,i=new l(e),n=0,o=d(2*e),a=0;for(;n<e;)a===o.length&&(o=d(2*e),a=0),(r=o[a++])&&(i[n++]=r);return i}(o-n-3);return new b(l.concat([new l([0,r?1:2]),i,new l([0]),t],o))}(o,t,r);else{if(3!==i)throw new Error("unknown padding");if(0<=(n=new b(t)).cmp(o.modulus))throw new Error("data too long for modulus")}return r?u(n,o):s(n,o)}}).call(this,e("buffer").Buffer)},{"./mgf":125,"./withPublic":128,"./xor":129,"bn.js":17,"browserify-rsa":40,buffer:49,"create-hash":53,"parse-asn1":115,randombytes:130}],128:[function(e,t,r){(function(r){var i=e("bn.js");t.exports=function(e,t){return new r(e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed().toArray())}}).call(this,e("buffer").Buffer)},{"bn.js":17,buffer:49}],129:[function(e,t,r){t.exports=function(e,t){for(var r=e.length,i=-1;++i<r;)e[i]^=t[i];return e}},{}],130:[function(e,t,r){(function(n,o){"use strict";var a=e("safe-buffer").Buffer,s=o.crypto||o.msCrypto;s&&s.getRandomValues?t.exports=function(e,t){if(65536<e)throw new Error("requested too many random bytes");var r=new o.Uint8Array(e);0<e&&s.getRandomValues(r);var i=a.from(r.buffer);return"function"!=typeof t?i:n.nextTick(function(){t(null,i)})}:t.exports=function(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:123,"safe-buffer":143}],131:[function(r,e,d){(function(a,n){"use strict";function e(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var t=r("safe-buffer"),s=r("randombytes"),o=t.Buffer,i=t.kMaxLength,u=n.crypto||n.msCrypto,h=Math.pow(2,32)-1;function c(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(h<e||e<0)throw new TypeError("offset must be a uint32");if(i<e||t<e)throw new RangeError("offset out of range")}function f(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(h<e||e<0)throw new TypeError("size must be a uint32");if(r<e+t||i<e)throw new RangeError("buffer too small")}function l(r,i,e,n){if(a.browser){var t=r.buffer,o=new Uint8Array(t,i,e);return u.getRandomValues(o),n?void a.nextTick(function(){n(null,r)}):r}if(!n)return s(e).copy(r,i),r;s(e,function(e,t){if(e)return n(e);t.copy(r,i),n(null,r)})}u&&u.getRandomValues||!a.browser?(d.randomFill=function(e,t,r,i){if(!(o.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)i=t,t=0,r=e.length;else if("function"==typeof r)i=r,r=e.length-t;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return c(t,e.length),f(r,t,e.length),l(e,t,r,i)},d.randomFillSync=function(e,t,r){void 0===t&&(t=0);if(!(o.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');c(t,e.length),void 0===r&&(r=e.length-t);return f(r,t,e.length),l(e,t,r)}):(d.randomFill=e,d.randomFillSync=e)}).call(this,r("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:123,randombytes:130,"safe-buffer":143}],132:[function(e,t,r){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":133}],133:[function(e,t,r){"use strict";var i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var n=e("process-nextick-args"),o=e("core-util-is");o.inherits=e("inherits");var a=e("./_stream_readable"),s=e("./_stream_writable");o.inherits(f,a);for(var u=i(s.prototype),h=0;h<u.length;h++){var c=u[h];f.prototype[c]||(f.prototype[c]=s.prototype[c])}function f(e){if(!(this instanceof f))return new f(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",l)}function l(){this.allowHalfOpen||this._writableState.ended||n(d,this)}function d(e){e.end()}},{"./_stream_readable":135,"./_stream_writable":137,"core-util-is":51,inherits:103,"process-nextick-args":122}],134:[function(e,t,r){"use strict";t.exports=o;var i=e("./_stream_transform"),n=e("core-util-is");function o(e){if(!(this instanceof o))return new o(e);i.call(this,e)}n.inherits=e("inherits"),n.inherits(o,i),o.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":136,"core-util-is":51,inherits:103}],135:[function(E,A,e){(function(m){"use strict";A.exports=i;var v=E("process-nextick-args"),b=E("isarray"),l=E("buffer").Buffer;i.ReadableState=r;E("events");var n,g=function(e,t){return e.listeners(t).length};!function(){try{n=E("stream")}catch(e){}finally{n||(n=E("events").EventEmitter)}}();l=E("buffer").Buffer;var e=E("core-util-is");e.inherits=E("inherits");var o,a,t=E("util"),y=void 0;function r(e,t){a=a||E("./_stream_duplex"),e=e||{},this.objectMode=!!e.objectMode,t instanceof a&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=E("string_decoder/").StringDecoder),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function i(e){if(a=a||E("./_stream_duplex"),!(this instanceof i))return new i(e);this._readableState=new r(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),n.call(this)}function s(e,t,r,i,n){var o=function(e,t){var r=null;l.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,c(e)}(e,t);else if(t.objectMode||r&&0<r.length)if(t.ended&&!n){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&n){a=new Error("stream.unshift() after end event");e.emit("error",a)}else{var s;!t.decoder||n||i||(r=t.decoder.write(r),s=!t.objectMode&&0===r.length),n||(t.reading=!1),s||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&c(e))),function(e,t){t.readingMore||(t.readingMore=!0,v(d,e,t))}(e,t)}else n||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}y=t&&t.debuglog?t.debuglog("stream"):function(){},e.inherits(i,n),i.prototype.push=function(e,t){var r=this._readableState;return r.objectMode||"string"!=typeof e||(t=t||r.defaultEncoding)!==r.encoding&&(e=new l(e,t),t=""),s(this,r,e,t,!1)},i.prototype.unshift=function(e){return s(this,this._readableState,e,"",!0)},i.prototype.isPaused=function(){return!1===this._readableState.flowing},i.prototype.setEncoding=function(e){return o||(o=E("string_decoder/").StringDecoder),this._readableState.decoder=new o(e),this._readableState.encoding=e,this};var u=8388608;function h(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=function(e){return u<=e?e=u:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function c(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(y("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v(f,e):f(e))}function f(e){y("emit readable"),e.emit("readable"),w(e)}function d(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(y("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function p(e){y("readable nexttick read 0"),e.read(0)}function _(e,t){t.reading||(y("resume read 0"),e.read(0)),t.resumeScheduled=!1,e.emit("resume"),w(e),t.flowing&&!t.reading&&e.read(0)}function w(e){var t=e._readableState;if(y("flow",t.flowing),t.flowing)do{var r=e.read()}while(null!==r&&t.flowing)}function x(e,t){var r,i=t.buffer,n=t.length,o=!!t.decoder,a=!!t.objectMode;if(0===i.length)return null;if(0===n)r=null;else if(a)r=i.shift();else if(!e||n<=e)r=o?i.join(""):1===i.length?i[0]:l.concat(i,n),i.length=0;else{if(e<i[0].length)r=(c=i[0]).slice(0,e),i[0]=c.slice(e);else if(e===i[0].length)r=i.shift();else{r=o?"":new l(e);for(var s=0,u=0,h=i.length;u<h&&s<e;u++){var c=i[0],f=Math.min(e-s,c.length);o?r+=c.slice(0,f):c.copy(r,s,0,f),f<c.length?i[0]=c.slice(f):i.shift(),s+=f}}}return r}function T(e){var t=e._readableState;if(0<t.length)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,v(S,t,e))}function S(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}i.prototype.read=function(e){y("read",e);var t=this._readableState,r=e;if(("number"!=typeof e||0<e)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return y("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):c(this),null;if(0===(e=h(e,t))&&t.ended)return 0===t.length&&T(this),null;var i,n=t.needReadable;return y("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&y("length less than watermark",n=!0),(t.ended||t.reading)&&y("reading or ended",n=!1),n&&(y("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),n&&!t.reading&&(e=h(r,t)),null===(i=0<e?x(e,t):null)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),r!==e&&t.ended&&0===t.length&&T(this),null!==i&&this.emit("data",i),i},i.prototype._read=function(e){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,y("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||!1!==e.end)&&t!==m.stdout&&t!==m.stderr?a:h;function o(e){y("onunpipe"),e===r&&h()}function a(){y("onend"),t.end()}i.endEmitted?v(n):r.once("end",n),t.on("unpipe",o);var s=function(t){return function(){var e=t._readableState;y("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&g(t,"data")&&(e.flowing=!0,w(t))}}(r);t.on("drain",s);var u=!1;function h(){y("cleanup"),t.removeListener("close",l),t.removeListener("finish",d),t.removeListener("drain",s),t.removeListener("error",f),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",h),r.removeListener("data",c),u=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||s()}function c(e){y("ondata"),!1===t.write(e)&&(1!==i.pipesCount||i.pipes[0]!==t||1!==r.listenerCount("data")||u||(y("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++),r.pause())}function f(e){y("onerror",e),p(),t.removeListener("error",f),0===g(t,"error")&&t.emit("error",e)}function l(){t.removeListener("finish",d),p()}function d(){y("onfinish"),t.removeListener("close",l),p()}function p(){y("unpipe"),r.unpipe(t)}return r.on("data",c),t._events&&t._events.error?b(t._events.error)?t._events.error.unshift(f):t._events.error=[f,t._events.error]:t.on("error",f),t.once("close",l),t.once("finish",d),t.emit("pipe",r),i.flowing||(y("pipe resume"),r.resume()),t},i.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var n=0;n<i;n++)r[n].emit("unpipe",this);return this}var o=function(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},i.prototype.addListener=i.prototype.on=function(e,t){var r=n.prototype.on.call(this,e,t);if("data"===e&&!1!==this._readableState.flowing&&this.resume(),"readable"===e&&!this._readableState.endEmitted){var i=this._readableState;i.readableListening||(i.readableListening=!0,i.emittedReadable=!1,i.needReadable=!0,i.reading?i.length&&c(this):v(p,this))}return r},i.prototype.resume=function(){var e=this._readableState;return e.flowing||(y("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,v(_,e,t))}(this,e)),this},i.prototype.pause=function(){return y("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(y("pause"),this._readableState.flowing=!1,this.emit("pause")),this},i.prototype.wrap=function(t){var r=this._readableState,i=!1,n=this;for(var e in t.on("end",function(){if(y("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),t.on("data",function(e){(y("wrapped data"),r.decoder&&(e=r.decoder.write(e)),r.objectMode&&null==e)||(r.objectMode||e&&e.length)&&(n.push(e)||(i=!0,t.pause()))}),t)void 0===this[e]&&"function"==typeof t[e]&&(this[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e));return function(e,t){for(var r=0,i=e.length;r<i;r++)t(e[r],r)}(["error","close","destroy","pause","resume"],function(e){t.on(e,n.emit.bind(n,e))}),n._read=function(e){y("wrapped _read",e),i&&(i=!1,t.resume())},n},i._fromList=x}).call(this,E("_process"))},{"./_stream_duplex":133,_process:123,buffer:49,"core-util-is":51,events:85,inherits:103,isarray:105,"process-nextick-args":122,"string_decoder/":153,util:19}],136:[function(e,t,r){"use strict";t.exports=a;var i=e("./_stream_duplex"),n=e("core-util-is");function o(r){this.afterTransform=function(e,t){return function(e,t,r){var i=e._transformState;i.transforming=!1;var n=i.writecb;if(!n)return e.emit("error",new Error("no writecb in Transform class"));i.writechunk=null,(i.writecb=null)!=r&&e.push(r);n(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}(r,e,t)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function a(e){if(!(this instanceof a))return new a(e);i.call(this,e),this._transformState=new o(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e){s(t,e)}):s(t)})}function s(e,t){if(t)return e.emit("error",t);var r=e._writableState,i=e._transformState;if(r.length)throw new Error("calling transform done when ws.length != 0");if(i.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}n.inherits=e("inherits"),n.inherits(a,i),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,i.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("not implemented")},a.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{"./_stream_duplex":133,"core-util-is":51,inherits:103}],137:[function(y,_,e){(function(e){"use strict";_.exports=f;var a=y("process-nextick-args"),s=!e.browser&&-1<["v0.10","v0.9."].indexOf(e.version.slice(0,5))?setImmediate:a,u=y("buffer").Buffer;f.WritableState=n;var t=y("core-util-is");t.inherits=y("inherits");var r,i={deprecate:y("util-deprecate")};!function(){try{r=y("stream")}catch(e){}finally{r||(r=y("events").EventEmitter)}}();var o;u=y("buffer").Buffer;function h(){}function c(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function n(e,t){o=o||y("./_stream_duplex"),e=e||{},this.objectMode=!!e.objectMode,t instanceof o&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1;var n=(this.finished=!1)===e.decodeStrings;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,n){--t.pendingcb,r?a(n,i):n(i);e._writableState.errorEmitted=!0,e.emit("error",i)}(e,r,i,t,n);else{var o=m(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||p(e,r),i?s(d,e,r,o,n):d(e,r,o,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new g(this),this.corkedRequestsFree.next=new g(this)}function f(e){if(o=o||y("./_stream_duplex"),!(this instanceof f||this instanceof o))return new f(e);this._writableState=new n(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),r.call(this)}function l(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function d(e,t,r,i){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),b(e,t)}function p(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0;r;)r=(n[a]=r).next,a+=1;l(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,t.corkedRequestsFree=o.next,o.next=null}else{for(;r;){var s=r.chunk,u=r.encoding,h=r.callback;if(l(e,t,!1,t.objectMode?1:s.length,s,u,h),r=r.next,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function m(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function v(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function b(e,t){var r=m(t);return r&&(0===t.pendingcb?(v(e,t),t.finished=!0,e.emit("finish")):v(e,t)),r}function g(i){var n=this;this.next=null,this.entry=null,this.finish=function(e){var t=n.entry;for(n.entry=null;t;){var r=t.callback;i.pendingcb--,r(e),t=t.next}i.corkedRequestsFree?i.corkedRequestsFree.next=n:i.corkedRequestsFree=n}}t.inherits(f,r),n.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(n.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}(),f.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},f.prototype.write=function(e,t,r){var i=this._writableState,n=!1;return"function"==typeof t&&(r=t,t=null),u.isBuffer(e)?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=h),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),a(t,r)}(this,r):function(e,t,r,i){var n=!0;if(!u.isBuffer(r)&&"string"!=typeof r&&null!=r&&!t.objectMode){var o=new TypeError("Invalid non-string/buffer chunk");e.emit("error",o),a(i,o),n=!1}return n}(this,i,e,r)&&(i.pendingcb++,n=function(e,t,r,i,n){r=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=new u(t,r)),t}(t,r,i),u.isBuffer(r)&&(i="buffer");var o=t.objectMode?1:r.length;t.length+=o;var a=t.length<t.highWaterMark;a||(t.needDrain=!0);if(t.writing||t.corked){var s=t.lastBufferedRequest;t.lastBufferedRequest=new c(r,i,n),s?s.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else l(e,t,!1,o,r,i,n);return a}(this,i,e,t,r)),n},f.prototype.cork=function(){this._writableState.corked++},f.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||p(this,e))},f.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e},f.prototype._write=function(e,t,r){r(new Error("not implemented"))},f.prototype._writev=null,f.prototype.end=function(e,t,r){var i=this._writableState;"function"==typeof e?(r=e,t=e=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(e,t,r){t.ending=!0,b(e,t),r&&(t.finished?a(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r)}}).call(this,y("_process"))},{"./_stream_duplex":133,_process:123,buffer:49,"core-util-is":51,events:85,inherits:103,"process-nextick-args":122,"util-deprecate":154}],138:[function(e,t,r){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":134}],139:[function(e,t,r){var i=function(){try{return e("stream")}catch(e){}}();(r=t.exports=e("./lib/_stream_readable.js")).Stream=i||r,(r.Readable=r).Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":133,"./lib/_stream_passthrough.js":134,"./lib/_stream_readable.js":135,"./lib/_stream_transform.js":136,"./lib/_stream_writable.js":137}],140:[function(e,t,r){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":136}],141:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":137}],142:[function(n,o,e){(function(t){"use strict";var e=n("inherits"),r=n("hash-base");function i(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function d(e,t){return e<<t|e>>>32-t}function p(e,t,r,i,n,o,a,s){return d(e+(t^r^i)+o+a|0,s)+n|0}function m(e,t,r,i,n,o,a,s){return d(e+(t&r|~t&i)+o+a|0,s)+n|0}function v(e,t,r,i,n,o,a,s){return d(e+((t|~r)^i)+o+a|0,s)+n|0}function b(e,t,r,i,n,o,a,s){return d(e+(t&i|r&~i)+o+a|0,s)+n|0}function g(e,t,r,i,n,o,a,s){return d(e+(t^(r|~i))+o+a|0,s)+n|0}e(i,r),i.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d,a=this._e;a=p(a,r=p(r,i,n,o,a,e[0],0,11),i,n=d(n,10),o,e[1],0,14),i=p(i=d(i,10),n=p(n,o=p(o,a,r,i,n,e[2],0,15),a,r=d(r,10),i,e[3],0,12),o,a=d(a,10),r,e[4],0,5),o=p(o=d(o,10),a=p(a,r=p(r,i,n,o,a,e[5],0,8),i,n=d(n,10),o,e[6],0,7),r,i=d(i,10),n,e[7],0,9),r=p(r=d(r,10),i=p(i,n=p(n,o,a,r,i,e[8],0,11),o,a=d(a,10),r,e[9],0,13),n,o=d(o,10),a,e[10],0,14),n=p(n=d(n,10),o=p(o,a=p(a,r,i,n,o,e[11],0,15),r,i=d(i,10),n,e[12],0,6),a,r=d(r,10),i,e[13],0,7),a=m(a=d(a,10),r=p(r,i=p(i,n,o,a,r,e[14],0,9),n,o=d(o,10),a,e[15],0,8),i,n=d(n,10),o,e[7],1518500249,7),i=m(i=d(i,10),n=m(n,o=m(o,a,r,i,n,e[4],1518500249,6),a,r=d(r,10),i,e[13],1518500249,8),o,a=d(a,10),r,e[1],1518500249,13),o=m(o=d(o,10),a=m(a,r=m(r,i,n,o,a,e[10],1518500249,11),i,n=d(n,10),o,e[6],1518500249,9),r,i=d(i,10),n,e[15],1518500249,7),r=m(r=d(r,10),i=m(i,n=m(n,o,a,r,i,e[3],1518500249,15),o,a=d(a,10),r,e[12],1518500249,7),n,o=d(o,10),a,e[0],1518500249,12),n=m(n=d(n,10),o=m(o,a=m(a,r,i,n,o,e[9],1518500249,15),r,i=d(i,10),n,e[5],1518500249,9),a,r=d(r,10),i,e[2],1518500249,11),a=m(a=d(a,10),r=m(r,i=m(i,n,o,a,r,e[14],1518500249,7),n,o=d(o,10),a,e[11],1518500249,13),i,n=d(n,10),o,e[8],1518500249,12),i=v(i=d(i,10),n=v(n,o=v(o,a,r,i,n,e[3],1859775393,11),a,r=d(r,10),i,e[10],1859775393,13),o,a=d(a,10),r,e[14],1859775393,6),o=v(o=d(o,10),a=v(a,r=v(r,i,n,o,a,e[4],1859775393,7),i,n=d(n,10),o,e[9],1859775393,14),r,i=d(i,10),n,e[15],1859775393,9),r=v(r=d(r,10),i=v(i,n=v(n,o,a,r,i,e[8],1859775393,13),o,a=d(a,10),r,e[1],1859775393,15),n,o=d(o,10),a,e[2],1859775393,14),n=v(n=d(n,10),o=v(o,a=v(a,r,i,n,o,e[7],1859775393,8),r,i=d(i,10),n,e[0],1859775393,13),a,r=d(r,10),i,e[6],1859775393,6),a=v(a=d(a,10),r=v(r,i=v(i,n,o,a,r,e[13],1859775393,5),n,o=d(o,10),a,e[11],1859775393,12),i,n=d(n,10),o,e[5],1859775393,7),i=b(i=d(i,10),n=b(n,o=v(o,a,r,i,n,e[12],1859775393,5),a,r=d(r,10),i,e[1],2400959708,11),o,a=d(a,10),r,e[9],2400959708,12),o=b(o=d(o,10),a=b(a,r=b(r,i,n,o,a,e[11],2400959708,14),i,n=d(n,10),o,e[10],2400959708,15),r,i=d(i,10),n,e[0],2400959708,14),r=b(r=d(r,10),i=b(i,n=b(n,o,a,r,i,e[8],2400959708,15),o,a=d(a,10),r,e[12],2400959708,9),n,o=d(o,10),a,e[4],2400959708,8),n=b(n=d(n,10),o=b(o,a=b(a,r,i,n,o,e[13],2400959708,9),r,i=d(i,10),n,e[3],2400959708,14),a,r=d(r,10),i,e[7],2400959708,5),a=b(a=d(a,10),r=b(r,i=b(i,n,o,a,r,e[15],2400959708,6),n,o=d(o,10),a,e[14],2400959708,8),i,n=d(n,10),o,e[5],2400959708,6),i=g(i=d(i,10),n=b(n,o=b(o,a,r,i,n,e[6],2400959708,5),a,r=d(r,10),i,e[2],2400959708,12),o,a=d(a,10),r,e[4],2840853838,9),o=g(o=d(o,10),a=g(a,r=g(r,i,n,o,a,e[0],2840853838,15),i,n=d(n,10),o,e[5],2840853838,5),r,i=d(i,10),n,e[9],2840853838,11),r=g(r=d(r,10),i=g(i,n=g(n,o,a,r,i,e[7],2840853838,6),o,a=d(a,10),r,e[12],2840853838,8),n,o=d(o,10),a,e[2],2840853838,13),n=g(n=d(n,10),o=g(o,a=g(a,r,i,n,o,e[10],2840853838,12),r,i=d(i,10),n,e[14],2840853838,5),a,r=d(r,10),i,e[1],2840853838,12),a=g(a=d(a,10),r=g(r,i=g(i,n,o,a,r,e[3],2840853838,13),n,o=d(o,10),a,e[8],2840853838,14),i,n=d(n,10),o,e[11],2840853838,11),i=g(i=d(i,10),n=g(n,o=g(o,a,r,i,n,e[6],2840853838,8),a,r=d(r,10),i,e[15],2840853838,5),o,a=d(a,10),r,e[13],2840853838,6),o=d(o,10);var s=this._a,u=this._b,h=this._c,c=this._d,f=this._e;f=g(f,s=g(s,u,h,c,f,e[5],1352829926,8),u,h=d(h,10),c,e[14],1352829926,9),u=g(u=d(u,10),h=g(h,c=g(c,f,s,u,h,e[7],1352829926,9),f,s=d(s,10),u,e[0],1352829926,11),c,f=d(f,10),s,e[9],1352829926,13),c=g(c=d(c,10),f=g(f,s=g(s,u,h,c,f,e[2],1352829926,15),u,h=d(h,10),c,e[11],1352829926,15),s,u=d(u,10),h,e[4],1352829926,5),s=g(s=d(s,10),u=g(u,h=g(h,c,f,s,u,e[13],1352829926,7),c,f=d(f,10),s,e[6],1352829926,7),h,c=d(c,10),f,e[15],1352829926,8),h=g(h=d(h,10),c=g(c,f=g(f,s,u,h,c,e[8],1352829926,11),s,u=d(u,10),h,e[1],1352829926,14),f,s=d(s,10),u,e[10],1352829926,14),f=b(f=d(f,10),s=g(s,u=g(u,h,c,f,s,e[3],1352829926,12),h,c=d(c,10),f,e[12],1352829926,6),u,h=d(h,10),c,e[6],1548603684,9),u=b(u=d(u,10),h=b(h,c=b(c,f,s,u,h,e[11],1548603684,13),f,s=d(s,10),u,e[3],1548603684,15),c,f=d(f,10),s,e[7],1548603684,7),c=b(c=d(c,10),f=b(f,s=b(s,u,h,c,f,e[0],1548603684,12),u,h=d(h,10),c,e[13],1548603684,8),s,u=d(u,10),h,e[5],1548603684,9),s=b(s=d(s,10),u=b(u,h=b(h,c,f,s,u,e[10],1548603684,11),c,f=d(f,10),s,e[14],1548603684,7),h,c=d(c,10),f,e[15],1548603684,7),h=b(h=d(h,10),c=b(c,f=b(f,s,u,h,c,e[8],1548603684,12),s,u=d(u,10),h,e[12],1548603684,7),f,s=d(s,10),u,e[4],1548603684,6),f=b(f=d(f,10),s=b(s,u=b(u,h,c,f,s,e[9],1548603684,15),h,c=d(c,10),f,e[1],1548603684,13),u,h=d(h,10),c,e[2],1548603684,11),u=v(u=d(u,10),h=v(h,c=v(c,f,s,u,h,e[15],1836072691,9),f,s=d(s,10),u,e[5],1836072691,7),c,f=d(f,10),s,e[1],1836072691,15),c=v(c=d(c,10),f=v(f,s=v(s,u,h,c,f,e[3],1836072691,11),u,h=d(h,10),c,e[7],1836072691,8),s,u=d(u,10),h,e[14],1836072691,6),s=v(s=d(s,10),u=v(u,h=v(h,c,f,s,u,e[6],1836072691,6),c,f=d(f,10),s,e[9],1836072691,14),h,c=d(c,10),f,e[11],1836072691,12),h=v(h=d(h,10),c=v(c,f=v(f,s,u,h,c,e[8],1836072691,13),s,u=d(u,10),h,e[12],1836072691,5),f,s=d(s,10),u,e[2],1836072691,14),f=v(f=d(f,10),s=v(s,u=v(u,h,c,f,s,e[10],1836072691,13),h,c=d(c,10),f,e[0],1836072691,13),u,h=d(h,10),c,e[4],1836072691,7),u=m(u=d(u,10),h=m(h,c=v(c,f,s,u,h,e[13],1836072691,5),f,s=d(s,10),u,e[8],2053994217,15),c,f=d(f,10),s,e[6],2053994217,5),c=m(c=d(c,10),f=m(f,s=m(s,u,h,c,f,e[4],2053994217,8),u,h=d(h,10),c,e[1],2053994217,11),s,u=d(u,10),h,e[3],2053994217,14),s=m(s=d(s,10),u=m(u,h=m(h,c,f,s,u,e[11],2053994217,14),c,f=d(f,10),s,e[15],2053994217,6),h,c=d(c,10),f,e[0],2053994217,14),h=m(h=d(h,10),c=m(c,f=m(f,s,u,h,c,e[5],2053994217,6),s,u=d(u,10),h,e[12],2053994217,9),f,s=d(s,10),u,e[2],2053994217,12),f=m(f=d(f,10),s=m(s,u=m(u,h,c,f,s,e[13],2053994217,9),h,c=d(c,10),f,e[9],2053994217,12),u,h=d(h,10),c,e[7],2053994217,5),u=p(u=d(u,10),h=m(h,c=m(c,f,s,u,h,e[10],2053994217,15),f,s=d(s,10),u,e[14],2053994217,8),c,f=d(f,10),s,e[12],0,8),c=p(c=d(c,10),f=p(f,s=p(s,u,h,c,f,e[15],0,5),u,h=d(h,10),c,e[10],0,12),s,u=d(u,10),h,e[4],0,9),s=p(s=d(s,10),u=p(u,h=p(h,c,f,s,u,e[1],0,12),c,f=d(f,10),s,e[5],0,5),h,c=d(c,10),f,e[8],0,14),h=p(h=d(h,10),c=p(c,f=p(f,s,u,h,c,e[7],0,6),s,u=d(u,10),h,e[6],0,8),f,s=d(s,10),u,e[2],0,13),f=p(f=d(f,10),s=p(s,u=p(u,h,c,f,s,e[13],0,6),h,c=d(c,10),f,e[14],0,5),u,h=d(h,10),c,e[0],0,15),u=p(u=d(u,10),h=p(h,c=p(c,f,s,u,h,e[3],0,13),f,s=d(s,10),u,e[9],0,11),c,f=d(f,10),s,e[11],0,11),c=d(c,10);var l=this._b+n+c|0;this._b=this._c+o+f|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+i+h|0,this._a=l},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56<this._blockOffset&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new t(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},o.exports=i}).call(this,n("buffer").Buffer)},{buffer:49,"hash-base":87,inherits:103}],143:[function(e,t,r){var i=e("buffer"),n=i.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,r),r.Buffer=a),o(n,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:49}],144:[function(e,t,r){var c=e("safe-buffer").Buffer;function i(e,t){this._block=c.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=c.from(e,t));for(var r=this._block,i=this._blockSize,n=e.length,o=this._len,a=0;a<n;){for(var s=o%i,u=Math.min(n-a,i-s),h=0;h<u;h++)r[s+h]=e[a+h];a+=u,(o+=u)%i==0&&this._update(r)}return this._len+=n,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,1+t),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=4294967295&r,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":143}],145:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":146,"./sha1":147,"./sha224":148,"./sha256":149,"./sha384":150,"./sha512":151}],146:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s=this._w,u=0|this._a,h=0|this._b,c=0|this._c,f=0|this._d,l=0|this._e,d=0;d<16;++d)s[d]=e.readInt32BE(4*d);for(;d<80;++d)s[d]=s[d-3]^s[d-8]^s[d-14]^s[d-16];for(var p=0;p<80;++p){var m=~~(p/20),v=0|((a=u)<<5|a>>>27)+(i=h,n=c,o=f,0===(r=m)?i&n|~i&o:2===r?i&n|i&o|n&o:i^n^o)+l+s[p]+b[m];l=f,f=c,c=(t=h)<<30|t>>>2,h=u,u=v}this._a=u+this._a|0,this._b=h+this._b|0,this._c=c+this._c|0,this._d=f+this._d|0,this._e=l+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],147:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,g=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,h=0|this._a,c=0|this._b,f=0|this._c,l=0|this._d,d=0|this._e,p=0;p<16;++p)u[p]=e.readInt32BE(4*p);for(;p<80;++p)u[p]=(t=u[p-3]^u[p-8]^u[p-14]^u[p-16])<<1|t>>>31;for(var m=0;m<80;++m){var v=~~(m/20),b=0|((s=h)<<5|s>>>27)+(n=c,o=f,a=l,0===(i=v)?n&o|~n&a:2===i?n&o|n&a|o&a:n^o^a)+d+u[m]+g[v];d=l,l=f,f=(r=c)<<30|r>>>2,c=h,h=b}this._a=h+this._a|0,this._b=c+this._b|0,this._c=f+this._c|0,this._d=l+this._d|0,this._e=d+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],148:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}i(u,n),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=u},{"./hash":144,"./sha256":149,inherits:103,"safe-buffer":143}],149:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,h=0|this._a,c=0|this._b,f=0|this._c,l=0|this._d,d=0|this._e,p=0|this._f,m=0|this._g,v=0|this._h,b=0;b<16;++b)u[b]=e.readInt32BE(4*b);for(;b<64;++b)u[b]=0|(((r=u[b-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+u[b-7]+(((t=u[b-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+u[b-16];for(var g=0;g<64;++g){var y=v+(((s=d)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((a=m)^d&(p^a))+w[g]+u[g]|0,_=0|(((o=h)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((i=h)&(n=c)|f&(i|n));v=m,m=p,p=d,d=l+y|0,l=f,f=c,c=h,h=y+_|0}this._a=h+this._a|0,this._b=c+this._b|0,this._c=f+this._c|0,this._d=l+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},s.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],150:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}i(u,n),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var i=a.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=u},{"./hash":144,"./sha512":151,inherits:103,"safe-buffer":143}],151:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,ee=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function s(){this.init(),this._w=a,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function oe(e,t){return e>>>0<t>>>0?1:0}i(s,n),s.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u,h=this._w,c=0|this._ah,f=0|this._bh,l=0|this._ch,d=0|this._dh,p=0|this._eh,m=0|this._fh,v=0|this._gh,b=0|this._hh,g=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,x=0|this._el,T=0|this._fl,S=0|this._gl,E=0|this._hl,A=0;A<32;A+=2)h[A]=e.readInt32BE(4*A),h[A+1]=e.readInt32BE(4*A+4);for(;A<160;A+=2){var P=h[A-30],M=h[A-30+1],C=((s=P)>>>1|(u=M)<<31)^(s>>>8|u<<24)^s>>>7,k=((o=M)>>>1|(a=P)<<31)^(o>>>8|a<<24)^(o>>>7|a<<25);P=h[A-4],M=h[A-4+1];var I=((i=P)>>>19|(n=M)<<13)^(n>>>29|i<<3)^i>>>6,R=((t=M)>>>19|(r=P)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),O=h[A-14],D=h[A-14+1],L=h[A-32],F=h[A-32+1],j=k+D|0,B=C+O+oe(j,k)|0;B=(B=B+I+oe(j=j+R|0,R)|0)+L+oe(j=j+F|0,F)|0,h[A]=B,h[A+1]=j}for(var N=0;N<160;N+=2){B=h[N],j=h[N+1];var U=re(c,f,l),z=re(g,y,_),X=ie(c,g),q=ie(g,c),H=ne(p,x),G=ne(x,p),V=ee[N],Y=ee[N+1],W=te(p,m,v),J=te(x,T,S),K=E+G|0,Z=b+H+oe(K,E)|0;Z=(Z=(Z=Z+W+oe(K=K+J|0,J)|0)+V+oe(K=K+Y|0,Y)|0)+B+oe(K=K+j|0,j)|0;var Q=q+z|0,$=X+U+oe(Q,q)|0;b=v,E=S,v=m,S=T,m=p,T=x,p=d+Z+oe(x=w+K|0,w)|0,d=l,w=_,l=f,_=y,f=c,y=g,c=Z+$+oe(g=K+Q|0,K)|0}this._al=this._al+g|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+x|0,this._fl=this._fl+T|0,this._gl=this._gl+S|0,this._hl=this._hl+E|0,this._ah=this._ah+c+oe(this._al,g)|0,this._bh=this._bh+f+oe(this._bl,y)|0,this._ch=this._ch+l+oe(this._cl,_)|0,this._dh=this._dh+d+oe(this._dl,w)|0,this._eh=this._eh+p+oe(this._el,x)|0,this._fh=this._fh+m+oe(this._fl,T)|0,this._gh=this._gh+v+oe(this._gl,S)|0,this._hh=this._hh+b+oe(this._hl,E)|0},s.prototype._hash=function(){var i=o.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],152:[function(e,t,r){t.exports=i;var c=e("events").EventEmitter;function i(){c.call(this)}e("inherits")(i,c),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),(i.Stream=i).prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",n),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(e){if(h(),0===c.listenerCount(this,"error"))throw e}function h(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("error",u),t.on("error",u),r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t}},{events:85,inherits:103,"readable-stream/duplex.js":132,"readable-stream/passthrough.js":138,"readable-stream/readable.js":139,"readable-stream/transform.js":140,"readable-stream/writable.js":141}],153:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.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}};var o=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=a)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}o.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(e=e.slice(r,e.length),!(55296<=(n=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))&&n<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived);var n;i=(t+=e.toString(this.encoding,0,i)).length-1;if(55296<=(n=t.charCodeAt(i))&&n<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,i)}return t},o.prototype.detectIncompleteChar=function(e){for(var t=3<=e.length?3:e.length;0<t;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},o.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:49}],154:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],155:[function(require,module,exports){var indexOf=require("indexof"),Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(e){return function(e,t,r){e[t]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(t){if(!(t instanceof Context))throw new TypeError("needs a 'context' argument.");var e=document.createElement("iframe");e.style||(e.style={}),e.style.display="none",document.body.appendChild(e);var r=e.contentWindow,i=r.eval,n=r.execScript;!i&&n&&(n.call(r,"null"),i=r.eval),forEach(Object_keys(t),function(e){r[e]=t[e]}),forEach(globals,function(e){t[e]&&(r[e]=t[e])});var o=Object_keys(r),a=i.call(r,this.code);return forEach(Object_keys(r),function(e){(e in t||-1===indexOf(o,e))&&(t[e]=r[e])}),forEach(globals,function(e){e in t||defineProp(t,e,r[e])}),document.body.removeChild(e),a},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(t){var r=Script.createContext(t),e=this.runInContext(r);return forEach(Object_keys(r),function(e){t[e]=r[e]}),e},forEach(Object_keys(Script.prototype),function(r){exports[r]=Script[r]=function(e){var t=Script(e);return t[r].apply(t,[].slice.call(arguments,1))}}),exports.createScript=function(e){return exports.Script(e)},exports.createContext=Script.createContext=function(t){var r=new Context;return"object"==typeof t&&forEach(Object_keys(t),function(e){r[e]=t[e]}),r}},{indexof:102}],156:[function(e,t,r){function f(e,t,r,i,n,o,a){f.prototype.init.apply(this,arguments)}function i(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function l(e,t,r){switch(e){case d:case h:case ue:return(t+3>>2)*(r+3>>2)*8;case p:case m:case c:case v:return(t+3>>2)*(r+3>>2)*16;case ne:case ae:return Math.floor((Math.max(t,8)*Math.max(r,8)*4+7)/8);case oe:case se:return Math.floor((Math.max(t,16)*Math.max(r,8)*2+7)/8);case b:case n:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*16;case g:case o:return Math.floor((t+4)/5)*Math.floor((r+3)/4)*16;case y:case a:return Math.floor((t+4)/5)*Math.floor((r+4)/5)*16;case _:case s:return Math.floor((t+5)/6)*Math.floor((r+4)/5)*16;case w:case u:return Math.floor((t+5)/6)*Math.floor((r+5)/6)*16;case x:case I:return Math.floor((t+7)/8)*Math.floor((r+4)/5)*16;case T:case R:return Math.floor((t+7)/8)*Math.floor((r+5)/6)*16;case S:case O:return Math.floor((t+7)/8)*Math.floor((r+7)/8)*16;case E:case D:return Math.floor((t+9)/10)*Math.floor((r+4)/5)*16;case A:case L:return Math.floor((t+9)/10)*Math.floor((r+5)/6)*16;case P:case F:return Math.floor((t+9)/10)*Math.floor((r+7)/8)*16;case M:case j:return Math.floor((t+9)/10)*Math.floor((r+9)/10)*16;case C:case B:return Math.floor((t+11)/12)*Math.floor((r+9)/10)*16;case k:case N:return Math.floor((t+11)/12)*Math.floor((r+11)/12)*16;default:return 0}}(t.exports=f).prototype.init=function(e,t,r,i,n,o,a,s){this.src=e,this.width=i,this.height=n,this.data=t,this.type=r,this.levels=o,this.internalFormat=a,this.isCompressedImage=!0,this.crunch=s,this.preserveSource=!0;var u=this.complete;return this.complete=!!t,!u&&this.complete&&this.onload&&this.onload({target:this}),this},f.prototype.dispose=function(){this.data=null},f.prototype.generateWebGLTexture=function(e){if(null===this.data)throw"Trying to create a second (or more) webgl texture from the same CompressedImage : "+this.src;for(var t=this.width,r=this.height,i=this.levels,n=0,o=0;o<this.levels;++o){var a=l(this.internalFormat,t,r),s=new Uint8Array(this.data.buffer,this.data.byteOffset+n,a);e.compressedTexImage2D(e.TEXTURE_2D,o,this.internalFormat,t,r,0,s),(t>>=1)<1&&(t=1),(r>>=1)<1&&(r=1),n+=a}1<i?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_NEAREST)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)),this.crunch&&(Module._free(this.crunch[0]),Module._free(this.crunch[1])),this.preserveSource||(this.data=null)},f.loadFromArrayBuffer=function(e,t){return new f(t).loadFromArrayBuffer(e)},f.prototype.loadFromArrayBuffer=function(e,t){var r=new Uint8Array(e,0,3);if(r[0]=="DDS".charCodeAt(0)&&r[1]=="DDS".charCodeAt(1)&&r[2]=="DDS".charCodeAt(2))return this._loadDDS(e);if(r[0]=="PVR".charCodeAt(0)&&r[1]=="PVR".charCodeAt(1)&&r[2]=="PVR".charCodeAt(2))return this._loadPVR(e);if(19==r[0]&&171==r[1]&&161==r[2])return this._loadASTC(e);if(t)return this._loadCRN(e);throw"Compressed texture format is not recognized: "+this.src},f.prototype.arrayBufferCopy=function(e,t,r,i){dst32Offset=r/4;for(var n=i%4,o=new Uint32Array(e.buffer,0,(i-n)/4),a=new Uint32Array(t.buffer),s=0;s<o.length;s++)a[dst32Offset+s]=o[s];for(var u=i-n;u<i;u++)t[r+u]=e[u]},f.prototype._loadCRN=function(e){DXT_FORMAT_MAP=[d,p,m];var t=e.byteLength,r=new Uint8Array(e),i=Module._malloc(t);f.prototype.arrayBufferCopy(r,Module.HEAPU8,i,t);var n=Module._crn_get_width(i,t),o=Module._crn_get_height(i,t),a=Module._crn_get_levels(i,t),s=Module._crn_get_dxt_format(i,t),u=Module._crn_get_uncompressed_size(i,t,0),h=Module._malloc(u);Module._crn_decompress(i,t,h,u,0);var c=new Uint8Array(Module.HEAPU8.buffer,h,u);return this.init(this.src,c,"CRN",n,o,a,DXT_FORMAT_MAP[s],[i,h])},f.prototype._loadDDS=function(e){var t=new Int32Array(e,0,q);if(t[H]!=U)throw"Invalid magic number in DDS header";if(!t[K]&X)throw"Unsupported format, must contain a FourCC code";var r,i=t[Z];switch(i){case Q:r=d;break;case $:r=p;break;case ee:r=m;break;case te:r=h;break;case re:r=c;break;case ie:r=v;break;default:throw"Unsupported FourCC code: "+function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)}var n=1;t[V]&z&&(n=Math.max(1,t[J]));var o=t[W],a=t[Y],s=t[G]+4,u=new Uint8Array(e,s);return this.init(this.src,u,"DDS",o,a,n,r)},f.prototype._loadASTC=function(e){var t=new Int8Array(e,0,Ee);if(new Uint32Array(e.slice(0,4))!=Ae)throw"Invalid magic number in ASTC header";for(var r=[b,g,y,_,w,x,T,S,E,A,P,M,C,k],i=e.byteLength-Ee,n=new Uint8Array([t[7],t[8],t[9],0]),o=new Uint8Array([t[10],t[11],t[12],0]),a=new Uint32Array(n.buffer)[0],s=new Uint32Array(o.buffer)[0],u=0,h=0;h<r.length;h++)if(i===l(r[h],a,s)){u=r[h];break}if(0===u)throw"Unable to autodetect ASTC format; file size not right";var c=new Uint8Array(e,Ee,i);return this.init(this.src,c,"ASTC",a,s,1,u)},f.prototype._loadPVR=function(e){var t=new Int32Array(e,0,be);if(t[ye]!=ge)throw"Invalid magic number in PVR header";var r,i=t[_e];switch(i){case he:r=oe;break;case ce:r=se;break;case fe:r=ne;break;case le:r=ae;break;case de:r=ue;break;case pe:r=d;break;case me:r=p;break;case ve:r=m;break;default:throw"Unsupported PVR format: "+i}var n=t[xe],o=t[we],a=t[Te],s=t[Se]+52,u=new Uint8Array(e,s);return this.init(this.src,u,"PVR",n,o,a,r)};var d=33776,p=33778,m=33779,h=35986,c=35987,v=34798,b=37808,g=37809,y=37810,_=37811,w=37812,x=37813,T=37814,S=37815,E=37816,A=37817,P=37818,M=37819,C=37820,k=37821,n=37840,o=37841,a=37842,s=37843,u=37844,I=37845,R=37846,O=37847,D=37848,L=37849,F=37850,j=37851,B=37852,N=37853,U=542327876,z=131072,X=4,q=31,H=0,G=1,V=2,Y=3,W=4,J=7,K=20,Z=21,Q=i("DXT1"),$=i("DXT3"),ee=i("DXT5"),te=i("ATC "),re=i("ATCA"),ie=i("ATCI"),ne=35840,oe=35841,ae=35842,se=35843,ue=36196,he=0,ce=1,fe=2,le=3,de=6,pe=7,me=9,ve=5,be=13,ge=55727696,ye=0,_e=2,we=6,xe=7,Te=11,Se=12,Ee=16,Ae=1554098963},{}],157:[function(e,t,r){var i=PIXI,n=(e("./CompressedImage"),i.WebGLManager);function o(e){n.call(this,e),this.extensions={}}((o.prototype=Object.create(n.prototype)).constructor=o).prototype.onContextChange=function(){var e=this.renderer.gl;function t(e,t){var r=["","WEBKIT_","MOZ_"],i=null;for(var n in r)if(i=e.getExtension(r[n]+t))break;return i}this.extensions={dxt:t(e,"WEBGL_compressed_texture_s3tc"),pvrtc:t(e,"WEBGL_compressed_texture_pvrtc"),astc:t(e,"WEBGL_compressed_texture_astc"),atc:t(e,"WEBGL_compressed_texture_atc"),etc1:t(e,"WEBGL_compressed_texture_etc1")},this.extensions.crn=this.extensions.dxt},t.exports=o,i.WebGLRenderer.registerPlugin("compressedTextureManager",o),o.prototype.getSupportedExtensions=function(){return this.extensions}},{"./CompressedImage":156}],158:[function(e,t,r){var i=e("./CompressedImage"),n={uploadNotCompressed:PIXI.glCore.GLTexture.prototype.upload,isCompressed:!1,upload:function(e){if(!(e instanceof i))return this.uploadNotCompressed(e);this.bind();var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),this.isCompressed=!0,e.generateWebGLTexture(t)},enableMipmap:function(){if(!this.isCompressed){var e=this.gl;this.bind(),this.mipmap=!0,e.generateMipmap(e.TEXTURE_2D)}}};t.exports=n},{"./CompressedImage":156}],159:[function(e,t,r){t.exports=function(u){u=u||[];var h=e("./imageParser")();return function(e,t){var r=e.metadata.choice;if(!r)return t();var i=e.url,n=0;if(!e._defaultUrlChoice){if(!(0<=(n=(e._defaultUrlChoice=i).lastIndexOf("."))))return t();e._baseUrl=i.substring(0,n)}for(var o=r.length-1;0<=o;o--){i=e._baseUrl+r[o];for(var a=0;a<u.length;a++)if(r[o]===u[a]){e.url=i;var s=r[o];return-1<s.indexOf("@")&&(s=s.replace(/@[0-9.]*x/,"")),0<=(n=s.indexOf("."))&&(s=s.substring(n+1)),e.extension=s,e.loadType=e._determineLoadType(),h(e,t)}}return h(e,t)}}},{"./imageParser":161}],160:[function(e,t,r){var n=PIXI,o=n.utils;e("./CompressedImage");t.exports=function(e){return function(e,t){if(e.texture&&e._defaultUrlChoice&&e._defaultUrl!=e.url){var r=e.texture,i=r.baseTexture;delete o.BaseTextureCache[i.imageUrl],delete o.TextureCache[i.imageUrl],i.imageUrl=e._defaultUrlChoice,n.utils.BaseTextureCache[i.imageUrl]=i,n.utils.TextureCache[i.imageUrl]=r}t()}}},{"./CompressedImage":156}],161:[function(e,t,r){var i=PIXI,n=(i.utils,e("./CompressedImage")),o=i.loaders.Resource;o.setExtensionXhrType("dds",o.XHR_RESPONSE_TYPE.BUFFER),o.setExtensionXhrType("crn",o.XHR_RESPONSE_TYPE.BUFFER),o.setExtensionXhrType("pvr",o.XHR_RESPONSE_TYPE.BUFFER),o.setExtensionXhrType("etc1",o.XHR_RESPONSE_TYPE.BUFFER),o.setExtensionXhrType("astc",o.XHR_RESPONSE_TYPE.BUFFER),t.exports=function(){return function(e,t){if(-1!=e.url.indexOf(".crn")||-1!=e.url.indexOf(".dds")||-1!=e.url.indexOf(".pvr")||-1!=e.url.indexOf(".etc1")||-1!=e.url.indexOf(".astc")){var r=e.compressedImage||new n(e.url);if(e.data)throw"compressedImageParser middleware must be specified in loader.before() and must have zero resource.data";e.isCompressedImage=!0,e.data=r,e.onComplete.add(function(){e.type=o.TYPE.IMAGE,r.loadFromArrayBuffer(e.data,e.url.includes(".crn")),e.data=r})}t()}}},{"./CompressedImage":156}],162:[function(r,i,e){(function(e){var t={CompressedImage:r("./CompressedImage"),CompressedTextureManager:r("./CompressedTextureManager"),imageParser:r("./imageParser"),extensionChooser:r("./extensionChooser"),extensionFixer:r("./extensionFixer"),GLTextureMixin:r("./GLTextureMixin"),detectExtensions:function(e,t){var r=[];if(e instanceof PIXI.WebGLRenderer){var i=e.plugins.compressedTextureManager.getSupportedExtensions();i.dxt&&r.push(".dds"),i.pvrtc&&r.push(".pvr"),i.atc&&r.push(".atc"),i.astc&&r.push(".astc"),i.etc1&&r.push(".etc1")}else PIXI.CanvasRenderer;for(var n="@"+(t=t||e.resolution)+"x",o=r.slice(0);0<o.length;)r.push(n+o.pop());return r.push(n+".png"),r.push(n+".jpg"),r.push(n+".json"),r.push(n+".atlas"),r}};try{t.crn=r("./../lib/crn_decomp")}catch(e){console.warn("Unable to load crn decompression in pixi-compressed-textures")}Object.assign(PIXI.glCore.GLTexture.prototype,t.GLTextureMixin),PIXI.loaders.Loader.addPixiMiddleware(t.extensionFixer),PIXI.loader.use(t.extensionFixer()),i.exports=e.PIXI.compressedTextures=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./../lib/crn_decomp":1,"./CompressedImage":156,"./CompressedTextureManager":157,"./GLTextureMixin":158,"./extensionChooser":159,"./extensionFixer":160,"./imageParser":161}]},{},[162])(162)});var __filters=function(e,l){"use strict";var r="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",t=function(t){function e(e){t.call(this,r,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (c.a > 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n"),Object.assign(this,{gamma:1,saturation:1,contrast:1,brightness:1,red:1,green:1,blue:1,alpha:1},e)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,t,r,i)},e}(l.Filter),d=function(i){function e(e,t,r){void 0===e&&(e=4),void 0===t&&(t=3),void 0===r&&(r=!1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",r?"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}\n":"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample top right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}"),this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new l.Point,this.pixelSize=1,this._clamp=r,this._kernels=null,Array.isArray(e)?this.kernels=e:(this._blur=e,this.quality=t)}i&&(e.__proto__=i);var t={kernels:{configurable:!0},clamp:{configurable:!0},pixelSize:{configurable:!0},quality:{configurable:!0},blur:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n,o=this.pixelSize.x/t.size.width,a=this.pixelSize.y/t.size.height;if(1===this._quality||0===this._blur)n=this._kernels[0]+.5,this.uniforms.uOffset[0]=n*o,this.uniforms.uOffset[1]=n*a,e.applyFilter(this,t,r,i);else{for(var s,u=e.getRenderTarget(!0),h=t,c=u,f=this._quality-1,l=0;l<f;l++)n=this._kernels[l]+.5,this.uniforms.uOffset[0]=n*o,this.uniforms.uOffset[1]=n*a,e.applyFilter(this,h,c,!0),s=h,h=c,c=s;n=this._kernels[f]+.5,this.uniforms.uOffset[0]=n*o,this.uniforms.uOffset[1]=n*a,e.applyFilter(this,h,r,i),e.returnRenderTarget(u)}},e.prototype._generateKernels=function(){var e=this._blur,t=this._quality,r=[e];if(0<e)for(var i=e,n=e/t,o=1;o<t;o++)i-=n,r.push(i);this._kernels=r},t.kernels.get=function(){return this._kernels},t.kernels.set=function(e){Array.isArray(e)&&0<e.length?(this._kernels=e,this._quality=e.length,this._blur=Math.max.apply(Math,e)):(this._kernels=[0],this._quality=1)},t.clamp.get=function(){return this._clamp},t.pixelSize.set=function(e){"number"==typeof e?(this._pixelSize.x=e,this._pixelSize.y=e):Array.isArray(e)?(this._pixelSize.x=e[0],this._pixelSize.y=e[1]):e instanceof l.Point?(this._pixelSize.x=e.x,this._pixelSize.y=e.y):(this._pixelSize.x=1,this._pixelSize.y=1)},t.pixelSize.get=function(){return this._pixelSize},t.quality.get=function(){return this._quality},t.quality.set=function(e){this._quality=Math.max(1,Math.round(e)),this._generateKernels()},t.blur.get=function(){return this._blur},t.blur.set=function(e){this._blur=e,this._generateKernels()},Object.defineProperties(e.prototype,t),e}(l.Filter),s=r,u=function(t){function e(e){void 0===e&&(e=.5),t.call(this,s,"\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform float threshold;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n // A simple & fast algorithm for getting brightness.\n // It's inaccuracy , but good enought for this feature.\n float _max = max(max(color.r, color.g), color.b);\n float _min = min(min(color.r, color.g), color.b);\n float brightness = (_max + _min) * 0.5;\n\n if(brightness > threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n"),this.threshold=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={threshold:{configurable:!0}};return r.threshold.get=function(){return this.uniforms.threshold},r.threshold.set=function(e){this.uniforms.threshold=e},Object.defineProperties(e.prototype,r),e}(l.Filter),i=function(a){function e(e){a.call(this,s,"uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor = color + bloomColor;\n}\n"),"number"==typeof e&&(e={threshold:e}),e=Object.assign({threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:l.settings.RESOLUTION},e),this.bloomScale=e.bloomScale,this.brightness=e.brightness;var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._extractFilter=new u(e.threshold),this._extractFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o}a&&(e.__proto__=a);var t={resolution:{configurable:!0},threshold:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r,i,n){var o=e.getRenderTarget(!0);this._extractFilter.apply(e,t,o,!0,n);var a=e.getRenderTarget(!0);this._blurFilter.apply(e,o,a,!0,n),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=a,e.applyFilter(this,t,r,i),e.returnRenderTarget(a),e.returnRenderTarget(o)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.threshold.get=function(){return this._extractFilter.threshold},t.threshold.set=function(e){this._extractFilter.threshold=e},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(l.Filter),n=function(t){function e(e){void 0===e&&(e=8),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform float pixelSize;\nuniform sampler2D uSampler;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n return floor( coord / size ) * size;\n}\n\nvec2 getMod(vec2 coord, vec2 size)\n{\n return mod( coord , size) / size;\n}\n\nfloat character(float n, vec2 p)\n{\n p = floor(p*vec2(4.0, -4.0) + 2.5);\n\n if (clamp(p.x, 0.0, 4.0) == p.x)\n {\n if (clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\n }\n }\n return 0.0;\n}\n\nvoid main()\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n // get the rounded color..\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\n pixCoord = unmapCoord(pixCoord);\n\n vec4 color = texture2D(uSampler, pixCoord);\n\n // determine the character to use\n float gray = (color.r + color.g + color.b) / 3.0;\n\n float n = 65536.0; // .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n // get the mod..\n vec2 modd = getMod(coord, vec2(pixelSize));\n\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\n\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.pixelSize},r.size.set=function(e){this.uniforms.pixelSize=e},Object.defineProperties(e.prototype,r),e}(l.Filter),o=function(t){function e(e){void 0===e&&(e={}),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color = texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler, vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"),this.uniforms.lightColor=new Float32Array(3),this.uniforms.shadowColor=new Float32Array(3),e=Object.assign({rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},e),this.rotation=e.rotation,this.thickness=e.thickness,this.lightColor=e.lightColor,this.lightAlpha=e.lightAlpha,this.shadowColor=e.shadowColor,this.shadowAlpha=e.shadowAlpha}t&&(e.__proto__=t);var r={rotation:{configurable:!0},thickness:{configurable:!0},lightColor:{configurable:!0},lightAlpha:{configurable:!0},shadowColor:{configurable:!0},shadowAlpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},r.rotation.get=function(){return this._angle/l.DEG_TO_RAD},r.rotation.set=function(e){this._angle=e*l.DEG_TO_RAD,this._updateTransform()},r.thickness.get=function(){return this._thickness},r.thickness.set=function(e){this._thickness=e,this._updateTransform()},r.lightColor.get=function(){return l.utils.rgb2hex(this.uniforms.lightColor)},r.lightColor.set=function(e){l.utils.hex2rgb(e,this.uniforms.lightColor)},r.lightAlpha.get=function(){return this.uniforms.lightAlpha},r.lightAlpha.set=function(e){this.uniforms.lightAlpha=e},r.shadowColor.get=function(){return l.utils.rgb2hex(this.uniforms.shadowColor)},r.shadowColor.set=function(e){l.utils.hex2rgb(e,this.uniforms.shadowColor)},r.shadowAlpha.get=function(){return this.uniforms.shadowAlpha},r.shadowAlpha.set=function(e){this.uniforms.shadowAlpha=e},Object.defineProperties(e.prototype,r),e}(l.Filter),a=l.filters,h=a.BlurXFilter,c=a.BlurYFilter,f=a.AlphaFilter,p=function(a){function e(e,t,r,i){var n,o;void 0===e&&(e=2),void 0===t&&(t=4),void 0===r&&(r=l.settings.RESOLUTION),void 0===i&&(i=5),a.call(this),"number"==typeof e?o=n=e:e instanceof l.Point?(n=e.x,o=e.y):Array.isArray(e)&&(n=e[0],o=e[1]),this.blurXFilter=new h(n,t,r,i),this.blurYFilter=new c(o,t,r,i),this.blurYFilter.blendMode=l.BLEND_MODES.SCREEN,this.defaultFilter=new f}a&&(e.__proto__=a);var t={blur:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.defaultFilter.apply(e,t,r),this.blurXFilter.apply(e,t,i),this.blurYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.blurXFilter.blur},t.blur.set=function(e){this.blurXFilter.blur=this.blurYFilter.blur=e},t.blurX.get=function(){return this.blurXFilter.blur},t.blurX.set=function(e){this.blurXFilter.blur=e},t.blurY.get=function(){return this.blurYFilter.blur},t.blurY.set=function(e){this.blurYFilter.blur=e},Object.defineProperties(e.prototype,t),e}(l.Filter),m=function(i){function e(e,t,r){i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","uniform float radius;\nuniform float strength;\nuniform vec2 center;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nvoid main()\n{\n vec2 coord = vTextureCoord * filterArea.xy;\n coord -= center * dimensions.xy;\n float distance = length(coord);\n if (distance < radius) {\n float percent = distance / radius;\n if (strength > 0.0) {\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\n } else {\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\n }\n }\n coord += center * dimensions.xy;\n coord /= filterArea.xy;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n gl_FragColor = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.center=e||[.5,.5],this.radius="number"==typeof t?t:100,this.strength="number"==typeof r?r:1}i&&(e.__proto__=i);var t={radius:{configurable:!0},strength:{configurable:!0},center:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.strength.get=function(){return this.uniforms.strength},t.strength.set=function(e){this.uniforms.strength=e},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},Object.defineProperties(e.prototype,t),e}(l.Filter),v=function(i){function e(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D colorMap;\nuniform float _mix;\nuniform float _size;\nuniform float _sliceSize;\nuniform float _slicePixelSize;\nuniform float _sliceInnerSize;\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n\n vec4 adjusted;\n if (color.a > 0.0) {\n color.rgb /= color.a;\n float innerWidth = _size - 1.0;\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\n float s0 = xOffset + (zSlice0 * _sliceSize);\n float s1 = xOffset + (zSlice1 * _sliceSize);\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\n float zOffset = fract(color.b * innerWidth);\n adjusted = mix(slice0Color, slice1Color, zOffset);\n\n color.rgb *= color.a;\n }\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\n\n}"),this._size=0,this._sliceSize=0,this._slicePixelSize=0,this._sliceInnerSize=0,this._scaleMode=null,this._nearest=!1,this.nearest=t,this.mix=r,this.colorMap=e}i&&(e.__proto__=i);var t={colorSize:{configurable:!0},colorMap:{configurable:!0},nearest:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms._mix=this.mix,e.applyFilter(this,t,r,i)},t.colorSize.get=function(){return this._size},t.colorMap.get=function(){return this._colorMap},t.colorMap.set=function(e){e instanceof l.Texture||(e=l.Texture.from(e)),e&&e.baseTexture&&(e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=!1,this._size=e.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=e),this._colorMap=e},t.nearest.get=function(){return this._nearest},t.nearest.set=function(e){this._nearest=e,this._scaleMode=e?l.SCALE_MODES.NEAREST:l.SCALE_MODES.LINEAR;var t=this._colorMap;t&&t.baseTexture&&(t.baseTexture._glTextures={},t.baseTexture.scaleMode=this._scaleMode,t.baseTexture.mipmap=!1,t._updateID++,t.baseTexture.emit("update",t.baseTexture))},e.prototype.updateColorMap=function(){var e=this._colorMap;e&&e.baseTexture&&(e._updateID++,e.baseTexture.emit("update",e.baseTexture),this.colorMap=e)},e.prototype.destroy=function(e){this._colorMap&&this._colorMap.destroy(e),i.prototype.destroy.call(this)},Object.defineProperties(e.prototype,t),e}(l.Filter),b=function(i){function e(e,t,r){void 0===e&&(e=16711680),void 0===t&&(t=0),void 0===r&&(r=.4),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec3 originalColor;\nuniform vec3 newColor;\nuniform float epsilon;\nvoid main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n float doReplace = step(colorDistance, epsilon);\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\n}\n"),this.uniforms.originalColor=new Float32Array(3),this.uniforms.newColor=new Float32Array(3),this.originalColor=e,this.newColor=t,this.epsilon=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={originalColor:{configurable:!0},newColor:{configurable:!0},epsilon:{configurable:!0}};return t.originalColor.set=function(e){var t=this.uniforms.originalColor;"number"==typeof e?(l.utils.hex2rgb(e,t),this._originalColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._originalColor=l.utils.rgb2hex(t))},t.originalColor.get=function(){return this._originalColor},t.newColor.set=function(e){var t=this.uniforms.newColor;"number"==typeof e?(l.utils.hex2rgb(e,t),this._newColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._newColor=l.utils.rgb2hex(t))},t.newColor.get=function(){return this._newColor},t.epsilon.set=function(e){this.uniforms.epsilon=e},t.epsilon.get=function(){return this.uniforms.epsilon},Object.defineProperties(e.prototype,t),e}(l.Filter),g=function(i){function e(e,t,r){void 0===t&&(t=200),void 0===r&&(r=200),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n"),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),void 0!==e&&(this.matrix=e),this.width=t,this.height=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={matrix:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return t.matrix.get=function(){return this.uniforms.matrix},t.matrix.set=function(e){var r=this;e.forEach(function(e,t){return r.uniforms.matrix[t]=e})},t.width.get=function(){return 1/this.uniforms.texelSize[0]},t.width.set=function(e){this.uniforms.texelSize[0]=1/e},t.height.get=function(){return 1/this.uniforms.texelSize[1]},t.height.set=function(e){this.uniforms.texelSize[1]=1/e},Object.defineProperties(e.prototype,t),e}(l.Filter),y=function(e){function t(){e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(l.Filter),_=function(t){function e(e){t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nconst float SQRT_2 = 1.414213;\n\nconst float light = 1.0;\n\nuniform float curvature;\nuniform float lineWidth;\nuniform float lineContrast;\nuniform bool verticalLine;\nuniform float noise;\nuniform float noiseSize;\n\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\n\nuniform float seed;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n vec2 dir = vec2(coord - vec2(0.5, 0.5));\n\n float _c = curvature > 0. ? curvature : 1.;\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\n vec2 uv = dir * k;\n\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 rgb = gl_FragColor.rgb;\n\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n rgb += _noise * noise;\n }\n\n if (lineWidth > 0.0) {\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\n rgb *= j;\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\n rgb *= 0.99 + ceil(segment) * 0.015;\n }\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n gl_FragColor.rgb = rgb;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.time=0,this.seed=0,Object.assign(this,{curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},e)}t&&(e.__proto__=t);var r={curvature:{configurable:!0},lineWidth:{configurable:!0},lineContrast:{configurable:!0},verticalLine:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.curvature.set=function(e){this.uniforms.curvature=e},r.curvature.get=function(){return this.uniforms.curvature},r.lineWidth.set=function(e){this.uniforms.lineWidth=e},r.lineWidth.get=function(){return this.uniforms.lineWidth},r.lineContrast.set=function(e){this.uniforms.lineContrast=e},r.lineContrast.get=function(){return this.uniforms.lineContrast},r.verticalLine.set=function(e){this.uniforms.verticalLine=e},r.verticalLine.get=function(){return this.uniforms.verticalLine},r.noise.set=function(e){this.uniforms.noise=e},r.noise.get=function(){return this.uniforms.noise},r.noiseSize.set=function(e){this.uniforms.noiseSize=e},r.noiseSize.get=function(){return this.uniforms.noiseSize},r.vignetting.set=function(e){this.uniforms.vignetting=e},r.vignetting.get=function(){return this.uniforms.vignetting},r.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},r.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},r.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},r.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,r),e}(l.Filter),w=function(r){function e(e,t){void 0===e&&(e=1),void 0===t&&(t=5),r.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 filterArea;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * filterArea.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n"),this.scale=e,this.angle=t}r&&(e.__proto__=r),(e.prototype=Object.create(r&&r.prototype)).constructor=e;var t={scale:{configurable:!0},angle:{configurable:!0}};return t.scale.get=function(){return this.uniforms.scale},t.scale.set=function(e){this.uniforms.scale=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(l.Filter),x=function(f){function e(e){e&&e.constructor!==Object&&(console.warn("DropShadowFilter now uses options instead of (rotation, distance, blur, color, alpha)"),e={rotation:e},void 0!==arguments[1]&&(e.distance=arguments[1]),void 0!==arguments[2]&&(e.blur=arguments[2]),void 0!==arguments[3]&&(e.color=arguments[3]),void 0!==arguments[4]&&(e.alpha=arguments[4])),e=Object.assign({rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:l.settings.RESOLUTION},e),f.call(this);var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._tintFilter=new l.Filter("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord);\n\n // Un-premultiply alpha before applying the color\n if (sample.a > 0.0) {\n sample.rgb /= sample.a;\n }\n\n // Premultiply alpha again\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}"),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o,this.targetTransform=new l.Matrix;var a=e.shadowOnly,s=e.rotation,u=e.distance,h=e.alpha,c=e.color;this.shadowOnly=a,this.rotation=s,this.distance=u,this.alpha=h,this.color=c,this._updatePadding()}f&&(e.__proto__=f);var t={resolution:{configurable:!0},distance:{configurable:!0},rotation:{configurable:!0},alpha:{configurable:!0},color:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(f&&f.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=e.getRenderTarget();n.transform=this.targetTransform,this._tintFilter.apply(e,t,n,!0),n.transform=null,this._blurFilter.apply(e,n,r,i),!0!==this.shadowOnly&&e.applyFilter(this,t,r,!1),e.returnRenderTarget(n)},e.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},e.prototype._updateTargetTransform=function(){this.targetTransform.tx=this.distance*Math.cos(this.angle),this.targetTransform.ty=this.distance*Math.sin(this.angle)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._tintFilter&&(this._tintFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.distance.get=function(){return this._distance},t.distance.set=function(e){this._distance=e,this._updatePadding(),this._updateTargetTransform()},t.rotation.get=function(){return this.angle/l.DEG_TO_RAD},t.rotation.set=function(e){this.angle=e*l.DEG_TO_RAD,this._updateTargetTransform()},t.alpha.get=function(){return this._tintFilter.uniforms.alpha},t.alpha.set=function(e){this._tintFilter.uniforms.alpha=e},t.color.get=function(){return l.utils.rgb2hex(this._tintFilter.uniforms.color)},t.color.set=function(e){l.utils.hex2rgb(e,this._tintFilter.uniforms.color)},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e,this._updatePadding()},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(l.Filter),T=function(t){function e(e){void 0===e&&(e=5),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float strength;\nuniform vec4 filterArea;\n\n\nvoid main(void)\n{\n\tvec2 onePixel = vec2(1.0 / filterArea);\n\n\tvec4 color;\n\n\tcolor.rgb = vec3(0.5);\n\n\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\n\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\n\n\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\n\n\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\n\n\tgl_FragColor = vec4(color.rgb * alpha, alpha);\n}\n"),this.strength=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={strength:{configurable:!0}};return r.strength.get=function(){return this.uniforms.strength},r.strength.set=function(e){this.uniforms.strength=e},Object.defineProperties(e.prototype,r),e}(l.Filter),S=function(t){function e(e){void 0===e&&(e={}),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","// precision highp float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void)\n{\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if( coord.x > filterClamp.z ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.x < filterClamp.x ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n\n if( coord.y > filterClamp.w ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.y < filterClamp.y ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n }\n\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, coord).a;\n}\n"),this.uniforms.dimensions=new Float32Array(2),e=Object.assign({slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},e),this.direction=e.direction,this.red=e.red,this.green=e.green,this.blue=e.blue,this.offset=e.offset,this.fillMode=e.fillMode,this.average=e.average,this.seed=e.seed,this.minSize=e.minSize,this.sampleSize=e.sampleSize,this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=l.Texture.fromCanvas(this._canvas,l.SCALE_MODES.NEAREST),this._slices=0,this.slices=e.slices}t&&(e.__proto__=t);var r={sizes:{configurable:!0},offsets:{configurable:!0},slices:{configurable:!0},direction:{configurable:!0},red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=t.sourceFrame.width,o=t.sourceFrame.height;this.uniforms.dimensions[0]=n,this.uniforms.dimensions[1]=o,this.uniforms.aspect=o/n,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,t,r,i)},e.prototype._randomizeSizes=function(){var e=this._sizes,t=this._slices-1,r=this.sampleSize,i=Math.min(this.minSize/r,.9/this._slices);if(this.average){for(var n=this._slices,o=1,a=0;a<t;a++){var s=o/(n-a),u=Math.max(s*(1-.6*Math.random()),i);o-=e[a]=u}e[t]=o}else{for(var h=1,c=Math.sqrt(1/this._slices),f=0;f<t;f++){var l=Math.max(c*h*Math.random(),i);h-=e[f]=l}e[t]=h}this.shuffle()},e.prototype.shuffle=function(){for(var e=this._sizes,t=this._slices-1;0<t;t--){var r=Math.random()*t>>0,i=e[t];e[t]=e[r],e[r]=i}},e.prototype._randomizeOffsets=function(){for(var e=0;e<this._slices;e++)this._offsets[e]=Math.random()*(Math.random()<.5?-1:1)},e.prototype.refresh=function(){this._randomizeSizes(),this._randomizeOffsets(),this.redraw()},e.prototype.redraw=function(){var e,t=this.sampleSize,r=this.texture,i=this._canvas.getContext("2d");i.clearRect(0,0,8,t);for(var n=0,o=0;o<this._slices;o++){e=Math.floor(256*this._offsets[o]);var a=this._sizes[o]*t,s=0<e?e:0,u=e<0?-e:0;i.fillStyle="rgba("+s+", "+u+", 0, 1)",i.fillRect(0,n>>0,t,1+a>>0),n+=a}r.baseTexture.update(),this.uniforms.displacementMap=r},r.sizes.set=function(e){for(var t=Math.min(this._slices,e.length),r=0;r<t;r++)this._sizes[r]=e[r]},r.sizes.get=function(){return this._sizes},r.offsets.set=function(e){for(var t=Math.min(this._slices,e.length),r=0;r<t;r++)this._offsets[r]=e[r]},r.offsets.get=function(){return this._offsets},r.slices.get=function(){return this._slices},r.slices.set=function(e){this._slices!==e&&(this._slices=e,this.uniforms.slices=e,this._sizes=this.uniforms.slicesWidth=new Float32Array(e),this._offsets=this.uniforms.slicesOffset=new Float32Array(e),this.refresh())},r.direction.get=function(){return this._direction},r.direction.set=function(e){if(this._direction!==e){var t=(this._direction=e)*l.DEG_TO_RAD;this.uniforms.sinDir=Math.sin(t),this.uniforms.cosDir=Math.cos(t)}},r.red.get=function(){return this.uniforms.red},r.red.set=function(e){this.uniforms.red=e},r.green.get=function(){return this.uniforms.green},r.green.set=function(e){this.uniforms.green=e},r.blue.get=function(){return this.uniforms.blue},r.blue.set=function(e){this.uniforms.blue=e},e.prototype.destroy=function(){this.texture.destroy(!0),this.texture=null,this._canvas=null,this.red=null,this.green=null,this.blue=null,this._sizes=null,this._offsets=null},Object.defineProperties(e.prototype,r),e}(l.Filter);S.TRANSPARENT=0,S.ORIGINAL=1,S.LOOP=2,S.CLAMP=3,S.MIRROR=4;var E=function(o){function e(e,t,r,i,n){void 0===e&&(e=10),void 0===t&&(t=4),void 0===r&&(r=0),void 0===i&&(i=16777215),void 0===n&&(n=.1),o.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nuniform float distance;\nuniform float outerStrength;\nuniform float innerStrength;\nuniform vec4 glowColor;\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nconst float PI = 3.14159265358979323846264;\n\nvoid main(void) {\n vec2 px = vec2(1.0 / filterArea.x, 1.0 / filterArea.y);\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\n vec4 curColor;\n float totalAlpha = 0.0;\n float maxTotalAlpha = 0.0;\n float cosAngle;\n float sinAngle;\n vec2 displaced;\n for (float angle = 0.0; angle <= PI * 2.0; angle += %QUALITY_DIST%) {\n cosAngle = cos(angle);\n sinAngle = sin(angle);\n for (float curDistance = 1.0; curDistance <= %DIST%; curDistance++) {\n displaced.x = vTextureCoord.x + cosAngle * curDistance * px.x;\n displaced.y = vTextureCoord.y + sinAngle * curDistance * px.y;\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\n totalAlpha += (distance - curDistance) * curColor.a;\n maxTotalAlpha += (distance - curDistance);\n }\n }\n maxTotalAlpha = max(maxTotalAlpha, 0.0001);\n\n ownColor.a = max(ownColor.a, 0.0001);\n ownColor.rgb = ownColor.rgb / ownColor.a;\n float outerGlowAlpha = (totalAlpha / maxTotalAlpha) * outerStrength * (1. - ownColor.a);\n float innerGlowAlpha = ((maxTotalAlpha - totalAlpha) / maxTotalAlpha) * innerStrength * ownColor.a;\n float resultAlpha = (ownColor.a + outerGlowAlpha);\n gl_FragColor = vec4(mix(mix(ownColor.rgb, glowColor.rgb, innerGlowAlpha / ownColor.a), glowColor.rgb, outerGlowAlpha / resultAlpha) * resultAlpha, resultAlpha);\n}\n".replace(/%QUALITY_DIST%/gi,""+(1/n/e).toFixed(7)).replace(/%DIST%/gi,""+e.toFixed(7))),this.uniforms.glowColor=new Float32Array([0,0,0,1]),this.distance=e,this.color=i,this.outerStrength=t,this.innerStrength=r}o&&(e.__proto__=o),(e.prototype=Object.create(o&&o.prototype)).constructor=e;var t={color:{configurable:!0},distance:{configurable:!0},outerStrength:{configurable:!0},innerStrength:{configurable:!0}};return t.color.get=function(){return l.utils.rgb2hex(this.uniforms.glowColor)},t.color.set=function(e){l.utils.hex2rgb(e,this.uniforms.glowColor)},t.distance.get=function(){return this.uniforms.distance},t.distance.set=function(e){this.uniforms.distance=e},t.outerStrength.get=function(){return this.uniforms.outerStrength},t.outerStrength.set=function(e){this.uniforms.outerStrength=e},t.innerStrength.get=function(){return this.uniforms.innerStrength},t.innerStrength.set=function(e){this.uniforms.innerStrength=e},Object.defineProperties(e.prototype,t),e}(l.Filter),A=function(t){function e(e){t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nuniform vec2 light;\nuniform bool parallel;\nuniform float aspect;\n\nuniform float gain;\nuniform float lacunarity;\nuniform float time;\n\n${perlin}\n\nvoid main(void) {\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n float d;\n\n if (parallel) {\n float _cos = light.x;\n float _sin = light.y;\n d = (_cos * coord.x) + (_sin * coord.y * aspect);\n } else {\n float dx = coord.x - light.x / dimensions.x;\n float dy = (coord.y - light.y / dimensions.y) * aspect;\n float dis = sqrt(dx * dx + dy * dy) + 0.00001;\n d = dy / dis;\n }\n\n vec3 dir = vec3(d, d, 0.0);\n\n float noise = turb(dir + vec3(time, 0.0, 62.1 + time) * 0.05, vec3(480.0, 320.0, 480.0), lacunarity, gain);\n noise = mix(noise, 0.0, 0.3);\n //fade vertically.\n vec4 mist = vec4(noise, noise, noise, 1.0) * (1.0 - coord.y);\n mist.a = 1.0;\n\n gl_FragColor = texture2D(uSampler, vTextureCoord) + mist;\n}\n".replace("${perlin}","vec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x)\n{\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t)\n{\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep)\n{\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain)\n{\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++)\n {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}\n")),this.uniforms.dimensions=new Float32Array(2),"number"==typeof e&&(console.warn("GodrayFilter now uses options instead of (angle, gain, lacunarity, time)"),e={angle:e},void 0!==arguments[1]&&(e.gain=arguments[1]),void 0!==arguments[2]&&(e.lacunarity=arguments[2]),void 0!==arguments[3]&&(e.time=arguments[3])),e=Object.assign({angle:30,gain:.5,lacunarity:2.5,time:0,parallel:!0,center:[0,0]},e),this._angleLight=new l.Point,this.angle=e.angle,this.gain=e.gain,this.lacunarity=e.lacunarity,this.parallel=e.parallel,this.center=e.center,this.time=e.time}t&&(e.__proto__=t);var r={angle:{configurable:!0},gain:{configurable:!0},lacunarity:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=t.sourceFrame,o=n.width,a=n.height;this.uniforms.light=this.parallel?this._angleLight:this.center,this.uniforms.parallel=this.parallel,this.uniforms.dimensions[0]=o,this.uniforms.dimensions[1]=a,this.uniforms.aspect=a/o,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.angle.get=function(){return this._angle},r.angle.set=function(e){var t=(this._angle=e)*l.DEG_TO_RAD;this._angleLight.x=Math.cos(t),this._angleLight.y=Math.sin(t)},r.gain.get=function(){return this.uniforms.gain},r.gain.set=function(e){this.uniforms.gain=e},r.lacunarity.get=function(){return this.uniforms.lacunarity},r.lacunarity.set=function(e){this.uniforms.lacunarity=e},Object.defineProperties(e.prototype,r),e}(l.Filter),P=function(i){function e(e,t,r){void 0===e&&(e=[0,0]),void 0===t&&(t=5),void 0===r&&(r=0),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uVelocity;\nuniform int uKernelSize;\nuniform float uOffset;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\n// Notice:\n// the perfect way:\n// int kernelSize = min(uKernelSize, MAX_KERNELSIZE);\n// BUT in real use-case , uKernelSize < MAX_KERNELSIZE almost always.\n// So use uKernelSize directly.\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n vec2 velocity = uVelocity / filterArea.xy;\n float offset = -uOffset / length(uVelocity) - 0.5;\n int k = uKernelSize - 1;\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n vec2 bias = velocity * (float(i) / float(k) + offset);\n color += texture2D(uSampler, vTextureCoord + bias);\n }\n gl_FragColor = color / float(uKernelSize);\n}\n"),this.uniforms.uVelocity=new Float32Array(2),this._velocity=new l.ObservablePoint(this.velocityChanged,this),this.velocity=e,this.kernelSize=t,this.offset=r}i&&(e.__proto__=i);var t={velocity:{configurable:!0},offset:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=this.velocity,o=n.x,a=n.y;this.uniforms.uKernelSize=0!==o||0!==a?this.kernelSize:0,e.applyFilter(this,t,r,i)},t.velocity.set=function(e){Array.isArray(e)?this._velocity.set(e[0],e[1]):(e instanceof l.Point||e instanceof l.ObservablePoint)&&this._velocity.copy(e)},t.velocity.get=function(){return this._velocity},e.prototype.velocityChanged=function(){this.uniforms.uVelocity[0]=this._velocity.x,this.uniforms.uVelocity[1]=this._velocity.y},t.offset.set=function(e){this.uniforms.uOffset=e},t.offset.get=function(){return this.uniforms.uOffset},Object.defineProperties(e.prototype,t),e}(l.Filter),M=function(i){function e(e,t,r){void 0===t&&(t=.05),void 0===r&&(r=null),r=r||e.length,i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform float epsilon;\n\nconst int MAX_COLORS = %maxColors%;\n\nuniform vec3 originalColors[MAX_COLORS];\nuniform vec3 targetColors[MAX_COLORS];\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n\n float alpha = gl_FragColor.a;\n if (alpha < 0.0001)\n {\n return;\n }\n\n vec3 color = gl_FragColor.rgb / alpha;\n\n for(int i = 0; i < MAX_COLORS; i++)\n {\n vec3 origColor = originalColors[i];\n if (origColor.r < 0.0)\n {\n break;\n }\n vec3 colorDiff = origColor - color;\n if (length(colorDiff) < epsilon)\n {\n vec3 targetColor = targetColors[i];\n gl_FragColor = vec4((targetColor + colorDiff) * alpha, alpha);\n return;\n }\n }\n}\n".replace(/%maxColors%/g,r)),this.epsilon=t,this._maxColors=r,this._replacements=null,this.uniforms.originalColors=new Float32Array(3*r),this.uniforms.targetColors=new Float32Array(3*r),this.replacements=e}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={replacements:{configurable:!0},maxColors:{configurable:!0},epsilon:{configurable:!0}};return t.replacements.set=function(e){var t=this.uniforms.originalColors,r=this.uniforms.targetColors,i=e.length;if(i>this._maxColors)throw"Length of replacements ("+i+") exceeds the maximum colors length ("+this._maxColors+")";t[3*i]=-1;for(var n=0;n<i;n++){var o=e[n],a=o[0];"number"==typeof a?a=l.utils.hex2rgb(a):o[0]=l.utils.rgb2hex(a),t[3*n]=a[0],t[3*n+1]=a[1],t[3*n+2]=a[2];var s=o[1];"number"==typeof s?s=l.utils.hex2rgb(s):o[1]=l.utils.rgb2hex(s),r[3*n]=s[0],r[3*n+1]=s[1],r[3*n+2]=s[2]}this._replacements=e},t.replacements.get=function(){return this._replacements},e.prototype.refresh=function(){this.replacements=this._replacements},t.maxColors.get=function(){return this._maxColors},t.epsilon.set=function(e){this.uniforms.epsilon=e},t.epsilon.get=function(){return this.uniforms.epsilon},Object.defineProperties(e.prototype,t),e}(l.Filter),C=function(r){function e(e,t){void 0===t&&(t=0),r.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nuniform float sepia;\nuniform float noise;\nuniform float noiseSize;\nuniform float scratch;\nuniform float scratchDensity;\nuniform float scratchWidth;\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\nuniform float seed;\n\nconst float SQRT_2 = 1.414213;\nconst vec3 SEPIA_RGB = vec3(112.0 / 255.0, 66.0 / 255.0, 20.0 / 255.0);\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvec3 Overlay(vec3 src, vec3 dst)\n{\n // if (dst <= 0.5) then: 2 * src * dst\n // if (dst > 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\n}\n\n\nvoid main()\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 color = gl_FragColor.rgb;\n\n if (sepia > 0.0)\n {\n float gray = (color.x + color.y + color.z) / 3.0;\n vec3 grayscale = vec3(gray);\n\n color = Overlay(SEPIA_RGB, grayscale);\n\n color = grayscale + sepia * (color - grayscale);\n }\n\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\n dir.y *= dimensions.y / dimensions.x;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n if (scratchDensity > seed && scratch != 0.0)\n {\n float phase = seed * 256.0;\n float s = mod(floor(phase), 2.0);\n float dist = 1.0 / scratchDensity;\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\n if (d < seed * 0.6 + 0.4)\n {\n highp float period = scratchDensity * 10.0;\n\n float xx = coord.x * period + phase;\n float aa = abs(mod(xx, 0.5) * 4.0);\n float bb = mod(floor(xx / 0.5), 2.0);\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\n\n float kk = 2.0 * period;\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\n float dh = dw * kk;\n\n float tine = (yy - (2.0 - dh));\n\n if (tine > 0.0) {\n float _sign = sign(scratch);\n\n tine = s * tine / period + scratch + 0.1;\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\n\n color.rgb *= tine;\n }\n }\n }\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\n // float _noise = snoise(d) * 0.5;\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n color += _noise * noise;\n }\n\n gl_FragColor.rgb = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),"number"==typeof e?(this.seed=e,e=null):this.seed=t,Object.assign(this,{sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},e)}r&&(e.__proto__=r);var t={sepia:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},scratch:{configurable:!0},scratchDensity:{configurable:!0},scratchWidth:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,e.applyFilter(this,t,r,i)},t.sepia.set=function(e){this.uniforms.sepia=e},t.sepia.get=function(){return this.uniforms.sepia},t.noise.set=function(e){this.uniforms.noise=e},t.noise.get=function(){return this.uniforms.noise},t.noiseSize.set=function(e){this.uniforms.noiseSize=e},t.noiseSize.get=function(){return this.uniforms.noiseSize},t.scratch.set=function(e){this.uniforms.scratch=e},t.scratch.get=function(){return this.uniforms.scratch},t.scratchDensity.set=function(e){this.uniforms.scratchDensity=e},t.scratchDensity.get=function(){return this.uniforms.scratchDensity},t.scratchWidth.set=function(e){this.uniforms.scratchWidth=e},t.scratchWidth.get=function(){return this.uniforms.scratchWidth},t.vignetting.set=function(e){this.uniforms.vignetting=e},t.vignetting.get=function(){return this.uniforms.vignetting},t.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},t.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},t.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},t.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,t),e}(l.Filter),k=function(o){function a(e,t,r){void 0===e&&(e=1),void 0===t&&(t=0),void 0===r&&(r=.1);var i=Math.max(r*a.MAX_SAMPLES,a.MIN_SAMPLES),n=(2*Math.PI/i).toFixed(7);o.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 thickness;\nuniform vec4 outlineColor;\nuniform vec4 filterClamp;\n\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\n\nvoid main(void) {\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\n vec4 curColor;\n float maxAlpha = 0.;\n vec2 displaced;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n float resultAlpha = max(maxAlpha, ownColor.a);\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\n}\n".replace(/\$\{angleStep\}/,n)),this.uniforms.thickness=new Float32Array([0,0]),this.thickness=e,this.uniforms.outlineColor=new Float32Array([0,0,0,1]),this.color=t,this.quality=r}o&&(a.__proto__=o);var e={color:{configurable:!0}};return((a.prototype=Object.create(o&&o.prototype)).constructor=a).prototype.apply=function(e,t,r,i){this.uniforms.thickness[0]=this.thickness/t.size.width,this.uniforms.thickness[1]=this.thickness/t.size.height,e.applyFilter(this,t,r,i)},e.color.get=function(){return l.utils.rgb2hex(this.uniforms.outlineColor)},e.color.set=function(e){l.utils.hex2rgb(e,this.uniforms.outlineColor)},Object.defineProperties(a.prototype,e),a}(l.Filter);k.MIN_SAMPLES=1,k.MAX_SAMPLES=100;var I=function(t){function e(e){void 0===e&&(e=10),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform vec2 size;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n\treturn floor( coord / size ) * size;\n}\n\nvoid main(void)\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = pixelate(coord, size);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord);\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.size},r.size.set=function(e){"number"==typeof e&&(e=[e,e]),this.uniforms.size=e},Object.defineProperties(e.prototype,r),e}(l.Filter),R=function(n){function e(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=[0,0]),void 0===r&&(r=5),void 0===i&&(i=-1),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float uRadian;\nuniform vec2 uCenter;\nuniform float uRadius;\nuniform int uKernelSize;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n float aspect = filterArea.y / filterArea.x;\n vec2 center = uCenter.xy / filterArea.xy;\n float gradient = uRadius / filterArea.x * 0.3;\n float radius = uRadius / filterArea.x - gradient * 0.5;\n int k = uKernelSize - 1;\n\n vec2 coord = vTextureCoord;\n vec2 dir = vec2(center - coord);\n float dist = length(vec2(dir.x, dir.y * aspect));\n\n float radianStep = uRadian;\n if (radius >= 0.0 && dist > radius) {\n float delta = dist - radius;\n float gap = gradient;\n float scale = 1.0 - abs(delta / gap);\n if (scale <= 0.0) {\n gl_FragColor = color;\n return;\n }\n radianStep *= scale;\n }\n radianStep /= float(k);\n\n float s = sin(radianStep);\n float c = cos(radianStep);\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n\n coord -= center;\n coord.y *= aspect;\n coord = rotationMatrix * coord;\n coord.y /= aspect;\n coord += center;\n\n vec4 sample = texture2D(uSampler, coord);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample;\n }\n\n gl_FragColor = color / float(uKernelSize);\n}\n"),this._angle=0,this.angle=e,this.center=t,this.kernelSize=r,this.radius=i}n&&(e.__proto__=n);var t={angle:{configurable:!0},center:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.uKernelSize=0!==this._angle?this.kernelSize:0,e.applyFilter(this,t,r,i)},t.angle.set=function(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180},t.angle.get=function(){return this._angle},t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(l.Filter),O=function(t){function e(e){t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nuniform bool mirror;\nuniform float boundary;\nuniform vec2 amplitude;\nuniform vec2 waveLength;\nuniform vec2 alpha;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n if (coord.y < boundary) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\n float areaY = boundary * dimensions.y / filterArea.y;\n float v = areaY + areaY - vTextureCoord.y;\n float y = mirror ? v : vTextureCoord.y;\n\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\n\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\n x = clamp(x, filterClamp.x, filterClamp.z);\n\n vec4 color = texture2D(uSampler, vec2(x, y));\n\n gl_FragColor = color * _alpha;\n}\n"),this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,{mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},e)}t&&(e.__proto__=t);var r={mirror:{configurable:!0},boundary:{configurable:!0},amplitude:{configurable:!0},waveLength:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.mirror.set=function(e){this.uniforms.mirror=e},r.mirror.get=function(){return this.uniforms.mirror},r.boundary.set=function(e){this.uniforms.boundary=e},r.boundary.get=function(){return this.uniforms.boundary},r.amplitude.set=function(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]},r.amplitude.get=function(){return this.uniforms.amplitude},r.waveLength.set=function(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]},r.waveLength.get=function(){return this.uniforms.waveLength},r.alpha.set=function(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]},r.alpha.get=function(){return this.uniforms.alpha},Object.defineProperties(e.prototype,r),e}(l.Filter),D=function(i){function e(e,t,r){void 0===e&&(e=[-10,0]),void 0===t&&(t=[0,10]),void 0===r&&(r=[0,0]),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\n}\n"),this.red=e,this.green=t,this.blue=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return t.red.get=function(){return this.uniforms.red},t.red.set=function(e){this.uniforms.red=e},t.green.get=function(){return this.uniforms.green},t.green.set=function(e){this.uniforms.green=e},t.blue.get=function(){return this.uniforms.blue},t.blue.set=function(e){this.uniforms.blue=e},Object.defineProperties(e.prototype,t),e}(l.Filter),L=function(i){function e(e,t,r){void 0===e&&(e=[0,0]),void 0===t&&(t={}),void 0===r&&(r=0),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nuniform vec2 center;\n\nuniform float amplitude;\nuniform float wavelength;\n// uniform float power;\nuniform float brightness;\nuniform float speed;\nuniform float radius;\n\nuniform float time;\n\nconst float PI = 3.14159;\n\nvoid main()\n{\n float halfWavelength = wavelength * 0.5 / filterArea.x;\n float maxRadius = radius / filterArea.x;\n float currentRadius = time * speed / filterArea.x;\n\n float fade = 1.0;\n\n if (maxRadius > 0.0) {\n if (currentRadius > maxRadius) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\n }\n\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\n dir.y *= filterArea.y / filterArea.x;\n float dist = length(dir);\n\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n vec2 diffUV = normalize(dir);\n\n float diff = (dist - currentRadius) / halfWavelength;\n\n float p = 1.0 - pow(abs(diff), 2.0);\n\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\n\n vec2 offset = diffUV * powDiff / filterArea.xy;\n\n // Do clamp :\n vec2 coord = vTextureCoord + offset;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n // No clamp :\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\n\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\n\n gl_FragColor = color;\n}\n"),this.center=e,Array.isArray(t)&&(console.warn("Deprecated Warning: ShockwaveFilter params Array has been changed to options Object."),t={}),t=Object.assign({amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},t),this.amplitude=t.amplitude,this.wavelength=t.wavelength,this.brightness=t.brightness,this.speed=t.speed,this.radius=t.radius,this.time=r}i&&(e.__proto__=i);var t={center:{configurable:!0},amplitude:{configurable:!0},wavelength:{configurable:!0},brightness:{configurable:!0},speed:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},t.amplitude.get=function(){return this.uniforms.amplitude},t.amplitude.set=function(e){this.uniforms.amplitude=e},t.wavelength.get=function(){return this.uniforms.wavelength},t.wavelength.set=function(e){this.uniforms.wavelength=e},t.brightness.get=function(){return this.uniforms.brightness},t.brightness.set=function(e){this.uniforms.brightness=e},t.speed.get=function(){return this.uniforms.speed},t.speed.set=function(e){this.uniforms.speed=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},Object.defineProperties(e.prototype,t),e}(l.Filter),F=function(i){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D uLightmap;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\nuniform vec4 ambientColor;\nvoid main() {\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\n vec4 light = texture2D(uLightmap, lightCoord);\n vec3 ambient = ambientColor.rgb * ambientColor.a;\n vec3 intensity = ambient + light.rgb;\n vec3 finalColor = diffuseColor.rgb * intensity;\n gl_FragColor = vec4(finalColor, diffuseColor.a);\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.uniforms.ambientColor=new Float32Array([0,0,0,r]),this.texture=e,this.color=t}i&&(e.__proto__=i);var t={texture:{configurable:!0},color:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.texture.get=function(){return this.uniforms.uLightmap},t.texture.set=function(e){this.uniforms.uLightmap=e},t.color.set=function(e){var t=this.uniforms.ambientColor;"number"==typeof e?(l.utils.hex2rgb(e,t),this._color=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._color=l.utils.rgb2hex(t))},t.color.get=function(){return this._color},t.alpha.get=function(){return this.uniforms.ambientColor[3]},t.alpha.set=function(e){this.uniforms.ambientColor[3]=e},Object.defineProperties(e.prototype,t),e}(l.Filter),j=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.uniforms.blur=e,this.uniforms.gradientBlur=t,this.uniforms.start=r||new l.Point(0,window.innerHeight/2),this.uniforms.end=i||new l.Point(600,window.innerHeight/2),this.uniforms.delta=new l.Point(30,30),this.uniforms.texSize=new l.Point(window.innerWidth,window.innerHeight),this.updateDelta()}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},t.blur.get=function(){return this.uniforms.blur},t.blur.set=function(e){this.uniforms.blur=e},t.gradientBlur.get=function(){return this.uniforms.gradientBlur},t.gradientBlur.set=function(e){this.uniforms.gradientBlur=e},t.start.get=function(){return this.uniforms.start},t.start.set=function(e){this.uniforms.start=e,this.updateDelta()},t.end.get=function(){return this.uniforms.end},t.end.set=function(e){this.uniforms.end=e,this.updateDelta()},Object.defineProperties(e.prototype,t),e}(l.Filter),B=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=e/r,this.uniforms.delta.y=t/r},t}(j),N=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=-t/r,this.uniforms.delta.y=e/r},t}(j),U=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this),this.tiltShiftXFilter=new B(e,t,r,i),this.tiltShiftYFilter=new N(e,t,r,i)}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.tiltShiftXFilter.apply(e,t,i),this.tiltShiftYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.tiltShiftXFilter.blur},t.blur.set=function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e},t.gradientBlur.get=function(){return this.tiltShiftXFilter.gradientBlur},t.gradientBlur.set=function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e},t.start.get=function(){return this.tiltShiftXFilter.start},t.start.set=function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e},t.end.get=function(){return this.tiltShiftXFilter.end},t.end.set=function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e},Object.defineProperties(e.prototype,t),e}(l.Filter),z=function(i){function e(e,t,r){void 0===e&&(e=200),void 0===t&&(t=4),void 0===r&&(r=20),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.radius=e,this.angle=t,this.padding=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={offset:{configurable:!0},radius:{configurable:!0},angle:{configurable:!0}};return t.offset.get=function(){return this.uniforms.offset},t.offset.set=function(e){this.uniforms.offset=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(l.Filter),X=function(n){function e(e,t,r,i){void 0===e&&(e=.1),void 0===t&&(t=[0,0]),void 0===r&&(r=0),void 0===i&&(i=-1),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\n// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n\n float minGradient = uInnerRadius * 0.3;\n float innerRadius = (uInnerRadius + minGradient * 0.5) / filterArea.x;\n\n float gradient = uRadius * 0.3;\n float radius = (uRadius - gradient * 0.5) / filterArea.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\n float dist = length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\n\n float strength = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius) {\n delta = innerRadius - dist;\n gap = minGradient;\n } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\n delta = dist - radius;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / filterArea.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength *= delta;\n if (countLimit < 1.0)\n {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n }\n\n // randomize the lookup values to hide the fixed number of samples\n float offset = rand(vTextureCoord, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vTextureCoord + dir * percent;\n vec4 sample = texture2D(uSampler, p);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n // switch back from pre-multiplied alpha\n // color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.center=t,this.strength=e,this.innerRadius=r,this.radius=i}n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e;var t={center:{configurable:!0},strength:{configurable:!0},innerRadius:{configurable:!0},radius:{configurable:!0}};return t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.strength.get=function(){return this.uniforms.uStrength},t.strength.set=function(e){this.uniforms.uStrength=e},t.innerRadius.get=function(){return this.uniforms.uInnerRadius},t.innerRadius.set=function(e){this.uniforms.uInnerRadius=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(l.Filter);return e.AdjustmentFilter=t,e.AdvancedBloomFilter=i,e.AsciiFilter=n,e.BevelFilter=o,e.BloomFilter=p,e.BulgePinchFilter=m,e.ColorMapFilter=v,e.ColorReplaceFilter=b,e.ConvolutionFilter=g,e.CrossHatchFilter=y,e.CRTFilter=_,e.DotFilter=w,e.DropShadowFilter=x,e.EmbossFilter=T,e.GlitchFilter=S,e.GlowFilter=E,e.GodrayFilter=A,e.KawaseBlurFilter=d,e.MotionBlurFilter=P,e.MultiColorReplaceFilter=M,e.OldFilmFilter=C,e.OutlineFilter=k,e.PixelateFilter=I,e.RadialBlurFilter=R,e.ReflectionFilter=O,e.RGBSplitFilter=D,e.ShockwaveFilter=L,e.SimpleLightmapFilter=F,e.TiltShiftFilter=U,e.TiltShiftAxisFilter=j,e.TiltShiftXFilter=B,e.TiltShiftYFilter=N,e.TwistFilter=z,e.ZoomBlurFilter=X,e}({},PIXI),pixi_projection,pixi_projection;Object.assign(PIXI.filters,this?this.__filters:__filters),this.PIXI=this.PIXI||{},function(d,v){"use strict";var l,p=function(){function l(e,t,r){this.value=e,this.time=t,this.next=null,this.isStepped=!1,this.ease=r?"function"==typeof r?r:d.ParticleUtils.generateEase(r):null}return l.createList=function(e){if("list"in e){var t=e.list,r=void 0,i=void 0,n=t[0],o=n.value,a=n.time;if(i=r=new l("string"==typeof o?d.ParticleUtils.hexToRGB(o):o,a,e.ease),2<t.length||2===t.length&&t[1].value!==o)for(var s=1;s<t.length;++s){var u=t[s],h=u.value,c=u.time;r.next=new l("string"==typeof h?d.ParticleUtils.hexToRGB(h):h,c),r=r.next}return i.isStepped=!!e.isStepped,i}var f=new l("string"==typeof e.start?d.ParticleUtils.hexToRGB(e.start):e.start,0);return e.end!==e.start&&(f.next=new l("string"==typeof e.end?d.ParticleUtils.hexToRGB(e.end):e.end,1)),f},l}();(l=d.ParticleUtils||(d.ParticleUtils={})).verbose=!1,l.DEG_TO_RADS=Math.PI/180,l.rotatePoint=function(e,t){if(e){e*=l.DEG_TO_RADS;var r=Math.sin(e),i=Math.cos(e),n=t.x*i-t.y*r,o=t.x*r+t.y*i;t.x=n,t.y=o}},l.combineRGBComponents=function(e,t,r){return e<<16|t<<8|r},l.normalize=function(e){var t=1/l.length(e);e.x*=t,e.y*=t},l.scaleBy=function(e,t){e.x*=t,e.y*=t},l.length=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},l.hexToRGB=function(e,t){var r;return t||(t={}),"#"==e.charAt(0)?e=e.substr(1):0===e.indexOf("0x")&&(e=e.substr(2)),8==e.length&&(r=e.substr(0,2),e=e.substr(2)),t.r=parseInt(e.substr(0,2),16),t.g=parseInt(e.substr(2,2),16),t.b=parseInt(e.substr(4,2),16),r&&(t.a=parseInt(r,16)),t},l.generateEase=function(n){var o=n.length,a=1/o;return function(e){var t,r,i=o*e|0;return t=(e-i*a)*o,(r=n[i]||n[o-1]).s+t*(2*(1-t)*(r.cp-r.s)+t*(r.e-r.s))}},l.getBlendMode=function(e){if(!e)return v.BLEND_MODES.NORMAL;for(e=e.toUpperCase();0<=e.indexOf(" ");)e=e.replace(" ","_");return v.BLEND_MODES[e]||v.BLEND_MODES.NORMAL},l.createSteppedGradient=function(e,t){void 0===t&&(t=10),("number"!=typeof t||t<=0)&&(t=10);var r=new p(l.hexToRGB(e[0].value),e[0].time);r.isStepped=!0;for(var i=r,n=e[0],o=1,a=e[o],s=1;s<t;++s){for(var u=s/t;u>a.time;)n=a,a=e[++o];u=(u-n.time)/(a.time-n.time);var h=l.hexToRGB(n.value),c=l.hexToRGB(a.value),f={r:(c.r-h.r)*u+h.r,g:(c.g-h.g)*u+h.g,b:(c.b-h.b)*u+h.b};i.next=new p(f,s/t),i=i.next}return r};var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var n=function(){function e(e){void 0===e&&(e=!1),this.current=null,this.next=null,this.isColor=!!e,this.interpolate=null,this.ease=null}return e.prototype.reset=function(e){this.current=e,this.next=e.next,this.next&&1<=this.next.time?this.interpolate=this.isColor?o:r:e.isStepped?this.interpolate=this.isColor?h:u:this.interpolate=this.isColor?s:a,this.ease=this.current.ease},e}();function r(e){return this.ease&&(e=this.ease(e)),(this.next.value-this.current.value)*e+this.current.value}function o(e){this.ease&&(e=this.ease(e));var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function a(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;return e=(e-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*e+this.current.value}function s(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;e=(e-this.current.time)/(this.next.time-this.current.time);var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function u(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function h(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;var t=this.current.value;return d.ParticleUtils.combineRGBComponents(t.r,t.g,t.b)}var c,f=function(r){function i(e){var t=r.call(this)||this;return t.emitter=e,t.anchor.x=t.anchor.y=.5,t.velocity=new v.Point,t.rotationSpeed=0,t.rotationAcceleration=0,t.maxLife=0,t.age=0,t.ease=null,t.extraData=null,t.alphaList=new n,t.speedList=new n,t.speedMultiplier=1,t.acceleration=new v.Point,t.maxSpeed=NaN,t.scaleList=new n,t.scaleMultiplier=1,t.colorList=new n(!0),t._doAlpha=!1,t._doScale=!1,t._doSpeed=!1,t._doAcceleration=!1,t._doColor=!1,t._doNormalMovement=!1,t._oneOverLife=0,t.next=null,t.prev=null,t.init=t.init,t.Particle_init=i.prototype.init,t.update=t.update,t.Particle_update=i.prototype.update,t.Sprite_destroy=r.prototype.destroy,t.Particle_destroy=i.prototype.destroy,t.applyArt=t.applyArt,t.kill=t.kill,t}return t(i,r),i.prototype.init=function(){this.age=0,this.velocity.x=this.speedList.current.value*this.speedMultiplier,this.velocity.y=0,d.ParticleUtils.rotatePoint(this.rotation,this.velocity),this.noRotation?this.rotation=0:this.rotation*=d.ParticleUtils.DEG_TO_RADS,this.rotationSpeed*=d.ParticleUtils.DEG_TO_RADS,this.rotationAcceleration*=d.ParticleUtils.DEG_TO_RADS,this.alpha=this.alphaList.current.value,this.scale.x=this.scale.y=this.scaleList.current.value,this._doAlpha=!!this.alphaList.current.next,this._doSpeed=!!this.speedList.current.next,this._doScale=!!this.scaleList.current.next,this._doColor=!!this.colorList.current.next,this._doAcceleration=0!==this.acceleration.x||0!==this.acceleration.y,this._doNormalMovement=this._doSpeed||0!==this.speedList.current.value||this._doAcceleration,this._oneOverLife=1/this.maxLife;var e=this.colorList.current.value;this.tint=d.ParticleUtils.combineRGBComponents(e.r,e.g,e.b),this.visible=!0},i.prototype.applyArt=function(e){this.texture=e||v.Texture.EMPTY},i.prototype.update=function(e){if(this.age+=e,this.age>=this.maxLife||this.age<0)return this.kill(),-1;var t=this.age*this._oneOverLife;if(this.ease&&(t=4==this.ease.length?this.ease(t,0,1,1):this.ease(t)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(t)),this._doScale){var r=this.scaleList.interpolate(t)*this.scaleMultiplier;this.scale.x=this.scale.y=r}if(this._doNormalMovement){var i=void 0,n=void 0;if(this._doSpeed){var o=this.speedList.interpolate(t)*this.speedMultiplier;d.ParticleUtils.normalize(this.velocity),d.ParticleUtils.scaleBy(this.velocity,o),i=this.velocity.x*e,n=this.velocity.y*e}else if(this._doAcceleration){var a=this.velocity.x,s=this.velocity.y;if(this.velocity.x+=this.acceleration.x*e,this.velocity.y+=this.acceleration.y*e,this.maxSpeed){var u=d.ParticleUtils.length(this.velocity);u>this.maxSpeed&&d.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/u)}i=(a+this.velocity.x)/2*e,n=(s+this.velocity.y)/2*e}else i=this.velocity.x*e,n=this.velocity.y*e;this.position.x+=i,this.position.y+=n}if(this._doColor&&(this.tint=this.colorList.interpolate(t)),0!==this.rotationAcceleration){var h=this.rotationSpeed+this.rotationAcceleration*e;this.rotation+=(this.rotationSpeed+h)/2*e,this.rotationSpeed=h}else 0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*e:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x));return t},i.prototype.kill=function(){this.emitter.recycle(this)},i.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.Sprite_destroy(),this.emitter=this.velocity=this.colorList=this.scaleList=this.alphaList=this.speedList=this.ease=this.next=this.prev=null},i.parseArt=function(e){var t;for(t=e.length;0<=t;--t)"string"==typeof e[t]&&(e[t]=v.Texture.fromImage(e[t]));if(d.ParticleUtils.verbose)for(t=e.length-1;0<t;--t)if(e[t].baseTexture!=e[t-1].baseTexture){window.console&&console.warn("PixiParticles: using particle textures from different images may hinder performance in WebGL");break}return e},i.parseData=function(e){return e},i}(v.Sprite),m=function(){function e(e){this.segments=[],this.countingLengths=[],this.totalLength=0,this.init(e)}return e.prototype.init=function(e){if(e&&e.length)if(Array.isArray(e[0]))for(var t=0;t<e.length;++t)for(var r=e[t],i=r[0],n=1;n<r.length;++n){var o=r[n];this.segments.push({p1:i,p2:o,l:0}),i=o}else for(i=e[0],t=1;t<e.length;++t){o=e[t];this.segments.push({p1:i,p2:o,l:0}),i=o}else this.segments.push({p1:{x:0,y:0},p2:{x:0,y:0},l:0});for(t=0;t<this.segments.length;++t){var a=this.segments[t],s=a.p1,u=a.p2,h=Math.sqrt((u.x-s.x)*(u.x-s.x)+(u.y-s.y)*(u.y-s.y));this.segments[t].l=h,this.totalLength+=h,this.countingLengths.push(this.totalLength)}},e.prototype.getRandomPoint=function(e){var t,r,i=Math.random()*this.totalLength;if(1===this.segments.length)t=this.segments[0],r=i;else for(var n=0;n<this.countingLengths.length;++n)if(i<this.countingLengths[n]){t=this.segments[n],r=0===n?i:i-this.countingLengths[n-1];break}r/=t.l||1;var o=t.p1,a=t.p2;e.x=o.x+r*(a.x-o.x),e.y=o.y+r*(a.y-o.y)},e}(),e=v;c=parseInt(/^(\d+)\./.exec(v.VERSION)[1])<5?e.ticker.shared:e.Ticker.shared;var b=new v.Point,g=function(){function e(e,t,r){this._particleConstructor=f,this.particleImages=null,this.startAlpha=null,this.startSpeed=null,this.minimumSpeedMultiplier=1,this.acceleration=null,this.maxSpeed=NaN,this.startScale=null,this.minimumScaleMultiplier=1,this.startColor=null,this.minLifetime=0,this.maxLifetime=0,this.minStartRotation=0,this.maxStartRotation=0,this.noRotation=!1,this.minRotationSpeed=0,this.maxRotationSpeed=0,this.particleBlendMode=0,this.customEase=null,this.extraData=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=null,this.spawnType=null,this._spawnFunc=null,this.spawnRect=null,this.spawnCircle=null,this.spawnPolygonalChain=null,this.particlesPerWave=1,this.particleSpacing=0,this.angleStart=0,this.rotation=0,this.ownerPos=null,this._prevEmitterPos=null,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._origArt=null,this._autoUpdate=!1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=e,t&&r&&this.init(t,r),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}return Object.defineProperty(e.prototype,"frequency",{get:function(){return this._frequency},set:function(e){this._frequency="number"==typeof e&&0<e?e:1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"particleConstructor",{get:function(){return this._particleConstructor},set:function(e){if(e!=this._particleConstructor){this._particleConstructor=e,this.cleanup();for(var t=this._poolFirst;t;t=t.next)t.destroy();this._poolFirst=null,this._origConfig&&this._origArt&&this.init(this._origArt,this._origConfig)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},set:function(e){this.cleanup(),this._parent=e},enumerable:!0,configurable:!0}),e.prototype.init=function(e,t){if(e&&t){this.cleanup(),this._origConfig=t,this._origArt=e,e=Array.isArray(e)?e.slice():[e];var r=this._particleConstructor;this.particleImages=r.parseArt?r.parseArt(e):e,t.alpha?this.startAlpha=p.createList(t.alpha):this.startAlpha=new p(1,0),t.speed?(this.startSpeed=p.createList(t.speed),this.minimumSpeedMultiplier=("minimumSpeedMultiplier"in t?t.minimumSpeedMultiplier:t.speed.minimumSpeedMultiplier)||1):(this.minimumSpeedMultiplier=1,this.startSpeed=new p(0,0));var i,n=t.acceleration;switch(n&&(n.x||n.y)?(this.startSpeed.next=null,this.acceleration=new v.Point(n.x,n.y),this.maxSpeed=t.maxSpeed||NaN):this.acceleration=new v.Point,t.scale?(this.startScale=p.createList(t.scale),this.minimumScaleMultiplier=("minimumScaleMultiplier"in t?t.minimumScaleMultiplier:t.scale.minimumScaleMultiplier)||1):(this.startScale=new p(1,0),this.minimumScaleMultiplier=1),t.color?this.startColor=p.createList(t.color):this.startColor=new p({r:255,g:255,b:255},0),t.startRotation?(this.minStartRotation=t.startRotation.min,this.maxStartRotation=t.startRotation.max):this.minStartRotation=this.maxStartRotation=0,t.noRotation&&(this.minStartRotation||this.maxStartRotation)?this.noRotation=!!t.noRotation:this.noRotation=!1,t.rotationSpeed?(this.minRotationSpeed=t.rotationSpeed.min,this.maxRotationSpeed=t.rotationSpeed.max):this.minRotationSpeed=this.maxRotationSpeed=0,this.rotationAcceleration=t.rotationAcceleration||0,this.minLifetime=t.lifetime.min,this.maxLifetime=t.lifetime.max,this.particleBlendMode=d.ParticleUtils.getBlendMode(t.blendMode),t.ease?this.customEase="function"==typeof t.ease?t.ease:d.ParticleUtils.generateEase(t.ease):this.customEase=null,r.parseData?this.extraData=r.parseData(t.extraData):this.extraData=t.extraData||null,this.spawnRect=this.spawnCircle=null,this.particlesPerWave=1,t.particlesPerWave&&1<t.particlesPerWave&&(this.particlesPerWave=t.particlesPerWave),this.particleSpacing=0,this.angleStart=0,t.spawnType){case"rect":this.spawnType="rect",this._spawnFunc=this._spawnRect;var o=t.spawnRect;this.spawnRect=new v.Rectangle(o.x,o.y,o.w,o.h);break;case"circle":this.spawnType="circle",this._spawnFunc=this._spawnCircle,i=t.spawnCircle,this.spawnCircle=new v.Circle(i.x,i.y,i.r);break;case"ring":this.spawnType="ring",this._spawnFunc=this._spawnRing,i=t.spawnCircle,this.spawnCircle=new v.Circle(i.x,i.y,i.r),this.spawnCircle.minRadius=i.minR;break;case"burst":this.spawnType="burst",this._spawnFunc=this._spawnBurst,this.particleSpacing=t.particleSpacing,this.angleStart=t.angleStart?t.angleStart:0;break;case"point":this.spawnType="point",this._spawnFunc=this._spawnPoint;break;case"polygonalChain":this.spawnType="polygonalChain",this._spawnFunc=this._spawnPolygonalChain,this.spawnPolygonalChain=new m(t.spawnPolygon);break;default:this.spawnType="point",this._spawnFunc=this._spawnPoint}this.frequency=t.frequency,this.spawnChance="number"==typeof t.spawnChance&&0<t.spawnChance?t.spawnChance:1,this.emitterLifetime=t.emitterLifetime||-1,this.maxParticles=0<t.maxParticles?t.maxParticles:1e3,this.addAtBack=!!t.addAtBack,this.rotation=0,this.ownerPos=new v.Point,this.spawnPos=new v.Point(t.pos.x,t.pos.y),this._prevEmitterPos=this.spawnPos.clone(),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=void 0===t.emit||!!t.emit,this.autoUpdate=!!t.autoUpdate}},e.prototype.recycle=function(e){e.next&&(e.next.prev=e.prev),e.prev&&(e.prev.next=e.next),e==this._activeParticlesLast&&(this._activeParticlesLast=e.prev),e==this._activeParticlesFirst&&(this._activeParticlesFirst=e.next),e.prev=null,e.next=this._poolFirst,(this._poolFirst=e).parent&&e.parent.removeChild(e),--this.particleCount},e.prototype.rotate=function(e){if(this.rotation!=e){var t=e-this.rotation;this.rotation=e,d.ParticleUtils.rotatePoint(t,this.spawnPos),this._posChanged=!0}},e.prototype.updateSpawnPos=function(e,t){this._posChanged=!0,this.spawnPos.x=e,this.spawnPos.y=t},e.prototype.updateOwnerPos=function(e,t){this._posChanged=!0,this.ownerPos.x=e,this.ownerPos.y=t},e.prototype.resetPositionTracking=function(){this._prevPosIsValid=!1},Object.defineProperty(e.prototype,"emit",{get:function(){return this._emit},set:function(e){this._emit=!!e,this._emitterLife=this.emitterLifetime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){this._autoUpdate&&!e?c.remove(this.update,this):!this._autoUpdate&&e&&c.add(this.update,this),this._autoUpdate=!!e},enumerable:!0,configurable:!0}),e.prototype.playOnceAndDestroy=function(e){this.autoUpdate=!0,this.emit=!0,this._destroyWhenComplete=!0,this._completeCallback=e},e.prototype.playOnce=function(e){this.emit=!0,this._completeCallback=e},e.prototype.update=function(e){if(this._autoUpdate&&(e=e/v.settings.TARGET_FPMS/1e3),this._parent){var t,r,i,n,o;for(r=this._activeParticlesFirst;r;r=i)i=r.next,r.update(e);this._prevPosIsValid&&(n=this._prevEmitterPos.x,o=this._prevEmitterPos.y);var a=this.ownerPos.x+this.spawnPos.x,s=this.ownerPos.y+this.spawnPos.y;if(this._emit)for(this._spawnTimer-=e<0?0:e;this._spawnTimer<=0;){if(0<this._emitterLife&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles)this._spawnTimer+=this._frequency;else{var u=void 0;if(u=this.minLifetime==this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer<u){var h=void 0,c=void 0;if(this._prevPosIsValid&&this._posChanged){var f=1+this._spawnTimer/e;h=(a-n)*f+n,c=(s-o)*f+o}else h=a,c=s;t=0;for(var l=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount);t<l;++t)if(!(this.spawnChance<1&&Math.random()>=this.spawnChance)){var d=void 0;if(this._poolFirst?(d=this._poolFirst,this._poolFirst=this._poolFirst.next,d.next=null):d=new this.particleConstructor(this),1<this.particleImages.length?d.applyArt(this.particleImages[Math.floor(Math.random()*this.particleImages.length)]):d.applyArt(this.particleImages[0]),d.alphaList.reset(this.startAlpha),1!=this.minimumSpeedMultiplier&&(d.speedMultiplier=Math.random()*(1-this.minimumSpeedMultiplier)+this.minimumSpeedMultiplier),d.speedList.reset(this.startSpeed),d.acceleration.x=this.acceleration.x,d.acceleration.y=this.acceleration.y,d.maxSpeed=this.maxSpeed,1!=this.minimumScaleMultiplier&&(d.scaleMultiplier=Math.random()*(1-this.minimumScaleMultiplier)+this.minimumScaleMultiplier),d.scaleList.reset(this.startScale),d.colorList.reset(this.startColor),this.minRotationSpeed==this.maxRotationSpeed?d.rotationSpeed=this.minRotationSpeed:d.rotationSpeed=Math.random()*(this.maxRotationSpeed-this.minRotationSpeed)+this.minRotationSpeed,d.rotationAcceleration=this.rotationAcceleration,d.noRotation=this.noRotation,d.maxLife=u,d.blendMode=this.particleBlendMode,d.ease=this.customEase,d.extraData=this.extraData,this._spawnFunc(d,h,c,t),d.init(),d.update(-this._spawnTimer),d.parent){var p=this._parent.children;if(p[0]==d)p.shift();else if(p[p.length-1]==d)p.pop();else{var m=p.indexOf(d);p.splice(m,1)}this.addAtBack?p.unshift(d):p.push(d)}else this.addAtBack?this._parent.addChildAt(d,0):this._parent.addChild(d);this._activeParticlesLast?((this._activeParticlesLast.next=d).prev=this._activeParticlesLast,this._activeParticlesLast=d):this._activeParticlesLast=this._activeParticlesFirst=d,++this.particleCount}}this._spawnTimer+=this._frequency}}this._posChanged&&(this._prevEmitterPos.x=a,this._prevEmitterPos.y=s,this._prevPosIsValid=!0,this._posChanged=!1),this._emit||this._activeParticlesFirst||(this._completeCallback&&this._completeCallback(),this._destroyWhenComplete&&this.destroy())}},e.prototype._spawnPoint=function(e,t,r){this.minStartRotation==this.maxStartRotation?e.rotation=this.minStartRotation+this.rotation:e.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,e.position.x=t,e.position.y=r},e.prototype._spawnRect=function(e,t,r){this.minStartRotation==this.maxStartRotation?e.rotation=this.minStartRotation+this.rotation:e.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,b.x=Math.random()*this.spawnRect.width+this.spawnRect.x,b.y=Math.random()*this.spawnRect.height+this.spawnRect.y,0!==this.rotation&&d.ParticleUtils.rotatePoint(this.rotation,b),e.position.x=t+b.x,e.position.y=r+b.y},e.prototype._spawnCircle=function(e,t,r){this.minStartRotation==this.maxStartRotation?e.rotation=this.minStartRotation+this.rotation:e.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,b.x=Math.random()*this.spawnCircle.radius,b.y=0,d.ParticleUtils.rotatePoint(360*Math.random(),b),b.x+=this.spawnCircle.x,b.y+=this.spawnCircle.y,0!==this.rotation&&d.ParticleUtils.rotatePoint(this.rotation,b),e.position.x=t+b.x,e.position.y=r+b.y},e.prototype._spawnRing=function(e,t,r){var i=this.spawnCircle;this.minStartRotation==this.maxStartRotation?e.rotation=this.minStartRotation+this.rotation:e.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,i.minRadius!==i.radius?b.x=Math.random()*(i.radius-i.minRadius)+i.minRadius:b.x=i.radius,b.y=0;var n=360*Math.random();e.rotation+=n,d.ParticleUtils.rotatePoint(n,b),b.x+=this.spawnCircle.x,b.y+=this.spawnCircle.y,0!==this.rotation&&d.ParticleUtils.rotatePoint(this.rotation,b),e.position.x=t+b.x,e.position.y=r+b.y},e.prototype._spawnPolygonalChain=function(e,t,r){this.minStartRotation==this.maxStartRotation?e.rotation=this.minStartRotation+this.rotation:e.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,this.spawnPolygonalChain.getRandomPoint(b),0!==this.rotation&&d.ParticleUtils.rotatePoint(this.rotation,b),e.position.x=t+b.x,e.position.y=r+b.y},e.prototype._spawnBurst=function(e,t,r,i){0===this.particleSpacing?e.rotation=360*Math.random():e.rotation=this.angleStart+this.particleSpacing*i+this.rotation,e.position.x=t,e.position.y=r},e.prototype.cleanup=function(){var e,t;for(e=this._activeParticlesFirst;e;e=t)t=e.next,this.recycle(e),e.parent&&e.parent.removeChild(e);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0},e.prototype.destroy=function(){var e;this.autoUpdate=!1,this.cleanup();for(var t=this._poolFirst;t;t=e)e=t.next,t.destroy();this._poolFirst=this._parent=this.particleImages=this.spawnPos=this.ownerPos=this.startColor=this.startScale=this.startAlpha=this.startSpeed=this.customEase=this._completeCallback=null},e}(),y=new v.Point,_=["pow","sqrt","abs","floor","round","ceil","E","PI","sin","cos","tan","asin","acos","atan","atan2","log"],w=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(_).join("|"),"g"),x=function(r){function e(e){var t=r.call(this,e)||this;return t.path=null,t.initialRotation=0,t.initialPosition=new v.Point,t.movement=0,t}return t(e,r),e.prototype.init=function(){this.initialRotation=this.rotation,this.Particle_init(),this.path=this.extraData.path,this._doNormalMovement=!this.path,this.movement=0,this.initialPosition.x=this.position.x,this.initialPosition.y=this.position.y},e.prototype.update=function(e){var t=this.Particle_update(e);if(0<=t&&this.path){var r=this.speedList.interpolate(t)*this.speedMultiplier;this.movement+=r*e,y.x=this.movement,y.y=this.path(this.movement),d.ParticleUtils.rotatePoint(this.initialRotation,y),this.position.x=this.initialPosition.x+y.x,this.position.y=this.initialPosition.y+y.y}return t},e.prototype.destroy=function(){this.Particle_destroy(),this.path=this.initialPosition=null},e.parseArt=function(e){return f.parseArt(e)},e.parseData=function(e){var t={};if(e&&e.path)try{t.path=function(e){for(var t=e.match(w),r=t.length-1;0<=r;--r)0<=_.indexOf(t[r])&&(t[r]="Math."+t[r]);return e=t.join(""),new Function("x","return "+e+";")}(e.path)}catch(e){d.ParticleUtils.verbose&&console.error("PathParticle: error in parsing path expression"),t.path=null}else d.ParticleUtils.verbose&&console.error("PathParticle requires a path string in extraData!"),t.path=null;return t},e}(f),T=function(r){function e(e){var t=r.call(this,e)||this;return t.textures=null,t.duration=0,t.framerate=0,t.elapsed=0,t.loop=!1,t}return t(e,r),e.prototype.init=function(){this.Particle_init(),this.elapsed=0,this.framerate<0&&(this.duration=this.maxLife,this.framerate=this.textures.length/this.duration)},e.prototype.applyArt=function(e){this.textures=e.textures,this.framerate=e.framerate,this.duration=e.duration,this.loop=e.loop},e.prototype.update=function(e){var t=this.Particle_update(e);if(0<=t){this.elapsed+=e,this.elapsed>this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6);var r=this.elapsed*this.framerate+1e-7|0;this.texture=this.textures[r]||v.Texture.EMPTY}return t},e.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},e.parseArt=function(e){for(var t,r,i,n,o,a=[],s=0;s<e.length;++s){t=e[s],a[s]=r={},r.textures=o=[],i=t.textures;for(var u=0;u<i.length;++u)if("string"==typeof(n=i[u]))o.push(v.Texture.fromImage(n));else if(n instanceof v.Texture)o.push(n);else{var h=n.count||1;for(n="string"==typeof n.texture?v.Texture.fromImage(n.texture):n.texture;0<h;--h)o.push(n)}"matchLife"==t.framerate?(r.framerate=-1,r.duration=0,r.loop=!1):(r.loop=!!t.loop,r.framerate=0<t.framerate?t.framerate:60,r.duration=o.length/r.framerate)}return a},e}(f);d.Particle=f,d.Emitter=g,d.PathParticle=x,d.AnimatedParticle=T,d.PolygonalChain=m,d.PropertyList=n,d.PropertyNode=p}(this.PIXI.particles=this.PIXI.particles||{},PIXI),function(e){var t;(t=e.utils||(e.utils={})).createIndicesForQuads=function(e){for(var t=6*e,r=new Uint16Array(t),i=0,n=0;i<t;i+=6,n+=4)r[i+0]=n+0,r[i+1]=n+1,r[i+2]=n+2,r[i+3]=n+0,r[i+4]=n+2,r[i+5]=n+3;return r},t.isPow2=function(e){return!(e&e-1||!e)},t.nextPow2=function(e){return e+=+(0===e),--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.log2=function(e){var t,r;return t=+(65535<e)<<4,t|=r=+(255<(e>>>=t))<<3,t|=r=+(15<(e>>>=r))<<2,(t|=r=+(3<(e>>>=r))<<1)|(e>>>=r)>>1},t.getIntersectionFactor=function(e,t,r,i,n){var o=t.x-e.x,a=r.x-i.x,s=r.x-e.x,u=t.y-e.y,h=r.y-i.y,c=r.y-e.y,f=o*h-u*a;if(Math.abs(f)<1e-7)return n.x=o,n.y=u,0;var l=(s*h-c*a)/f,d=(o*c-u*s)/f;return d<1e-6||-1e-6<d-1?-1:(n.x=e.x+l*(t.x-e.x),n.y=e.y+l*(t.y-e.y),1)},t.getPositionFromQuad=function(e,t,r){r=r||new PIXI.Point;var i=1-t.x,n=1-i,o=1-t.y,a=1-o;return r.x=(e[0].x*i+e[1].x*n)*o+(e[3].x*i+e[2].x*n)*a,r.y=(e[0].y*i+e[1].y*n)*o+(e[3].y*i+e[2].y*n)*a,r}}(pixi_projection||(pixi_projection={})),PIXI.projection=pixi_projection,function(e){var t,r=function(){function e(e,t){void 0===t&&(t=!0),this._enabled=!1,this.legacy=e,t&&(this.enabled=!0),this.legacy.proj=this}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(e){this._enabled=e},enumerable:!0,configurable:!0}),e.prototype.clear=function(){},e}();e.AbstractProjection=r,(t=e.TRANSFORM_STEP||(e.TRANSFORM_STEP={}))[t.NONE=0]="NONE",t[t.BEFORE_PROJ=4]="BEFORE_PROJ",t[t.PROJ=5]="PROJ",t[t.ALL=9]="ALL"}(pixi_projection||(pixi_projection={}));var __extends=this&&this.__extends||function(){var i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}}(),pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection,pixi_projection;!function(r){function i(e){var t=this.proj,r=this,i=e._worldID,n=r.localTransform,o=t.scaleAfterAffine&&2<=t.affine;r._localID!==r._currentLocalID&&(o?(n.a=r._cx,n.b=r._sx,n.c=r._cy,n.d=r._sy,n.tx=r.position._x,n.ty=r.position._y):(n.a=r._cx*r.scale._x,n.b=r._sx*r.scale._x,n.c=r._cy*r.scale._y,n.d=r._sy*r.scale._y,n.tx=r.position._x-(r.pivot._x*n.a+r.pivot._y*n.c),n.ty=r.position._y-(r.pivot._x*n.b+r.pivot._y*n.d)),r._currentLocalID=r._localID,t._currentProjID=-1);var a=t._projID;if(t._currentProjID!==a&&(t._currentProjID=a,t.updateLocalTransform(n),r._parentID=-1),r._parentID!==i){var s=e.proj;s&&!s._affine?t.world.setToMult(s.world,t.local):t.world.setToMultLegacy(e.worldTransform,t.local);var u=r.worldTransform;t.world.copy(u,t._affine,t.affinePreserveOrientation),o&&(u.a*=r.scale._x,u.b*=r.scale._x,u.c*=r.scale._y,u.d*=r.scale._y,u.tx-=r.pivot._x*u.a+r.pivot._y*u.c,u.ty-=r.pivot._x*u.b+r.pivot._y*u.d),r._parentID=i,r._worldID++}}var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._projID=0,e._currentProjID=-1,e._affine=r.AFFINE.NONE,e.affinePreserveOrientation=!1,e.scaleAfterAffine=!0,e}return __extends(e,t),e.prototype.updateLocalTransform=function(e){},Object.defineProperty(e.prototype,"affine",{get:function(){return this._affine},set:function(e){this._affine!=e&&(this._affine=e,this._currentProjID=-1,this.legacy._currentLocalID=-1)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{set:function(e){e!==this._enabled&&(this._enabled=e,this.legacy.updateTransform=e?i:PIXI.TransformStatic.prototype.updateTransform,this.legacy._parentID=-1)},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this._currentProjID=-1,this._projID=0},e}(r.AbstractProjection);r.LinearProjection=e}(pixi_projection||(pixi_projection={})),function(e){var t,r;t=e.webgl||(e.webgl={}),r=function(){function e(e){this.vertices=new ArrayBuffer(e),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)}return e.prototype.destroy=function(){this.vertices=null},e}(),t.BatchBuffer=r}(pixi_projection||(pixi_projection={})),function(e){(e.webgl||(e.webgl={})).generateMultiTextureShader=function(e,t,r,i){t=(t=t.replace(/%count%/gi,i+"")).replace(/%forloop%/gi,function(e){var t="";t+="\n",t+="\n";for(var r=0;r<e;r++)0<r&&(t+="\nelse "),r<e-1&&(t+="if(textureId == "+r+".0)"),t+="\n{",t+="\n\tcolor = texture2D(uSamplers["+r+"], textureCoord);",t+="\n}";return t+="\n",t+="\n"}(i));for(var n=new PIXI.Shader(r,e,t),o=new Int32Array(i),a=0;a<i;a++)o[a]=a;return n.bind(),n.uniforms.uSamplers=o,n}}(pixi_projection||(pixi_projection={})),function(O){!function(n){var e=PIXI.ObjectRenderer,M=PIXI.settings,C=PIXI.glCore.GLBuffer,k=PIXI.utils.premultiplyTint,I=PIXI.utils.premultiplyBlendMode,R=1<<21,o=function(){this.textures=[],this.textureCount=0,this.ids=[],this.size=0,this.start=0,this.blend=PIXI.BLEND_MODES.NORMAL,this.uniforms=null};n.BatchGroup=o;var t=function(i){function e(e){var t=i.call(this,e)||this;t.shaderVert="",t.shaderFrag="",t.MAX_TEXTURES_LOCAL=32,t.vertSize=5,t.vertByteSize=4*t.vertSize,t.size=M.SPRITE_BATCH_SIZE,t.currentIndex=0,t.sprites=[],t.vertexBuffers=[],t.vaos=[],t.vaoMax=2,t.vertexCount=0,t.MAX_TEXTURES=1,t.indices=O.utils.createIndicesForQuads(t.size),t.groups=[];for(var r=0;r<t.size;r++)t.groups[r]=new o;return t.vaoMax=2,t.vertexCount=0,t.renderer.on("prerender",t.onPrerender,t),t}return __extends(e,i),e.prototype.getUniforms=function(e){return null},e.prototype.syncUniforms=function(e){if(e){var t=this.shader;for(var r in e)t.uniforms[r]=e[r]}},e.prototype.onContextChange=function(){var e=this.renderer.gl;this.MAX_TEXTURES=Math.min(this.MAX_TEXTURES_LOCAL,this.renderer.plugins.sprite.MAX_TEXTURES),this.shader=n.generateMultiTextureShader(this.shaderVert,this.shaderFrag,e,this.MAX_TEXTURES),this.indexBuffer=C.createIndexBuffer(e,this.indices,e.STATIC_DRAW),this.renderer.bindVao(null);this.shader.attributes;for(var t=0;t<this.vaoMax;t++){var r=this.vertexBuffers[t]=C.createVertexBuffer(e,null,e.STREAM_DRAW);this.vaos[t]=this.createVao(r)}if(!this.buffers){this.buffers=[];for(t=1;t<=O.utils.nextPow2(this.size);t*=2)this.buffers.push(new n.BatchBuffer(4*t*this.vertByteSize))}this.vao=this.vaos[0]},e.prototype.onPrerender=function(){this.vertexCount=0},e.prototype.render=function(e){this.currentIndex>=this.size&&this.flush(),e._texture._uvs&&e._texture.baseTexture&&(this.sprites[this.currentIndex++]=e)},e.prototype.flush=function(){if(0!==this.currentIndex){var e,t,r,i=this.renderer.gl,n=this.MAX_TEXTURES,o=O.utils.nextPow2(this.currentIndex),a=O.utils.log2(o),s=this.buffers[a],u=this.sprites,h=this.groups,c=s.float32View,f=s.uint32View,l=0,d=null,p=1,m=0,v=h[0],b=I[u[0]._texture.baseTexture.premultipliedAlpha?1:0][u[0].blendMode];for(v.textureCount=0,v.start=0,v.blend=b,R++,r=0;r<this.currentIndex;++r){var g=u[r];u[r]=null,e=g._texture.baseTexture;var y=I[Number(e.premultipliedAlpha)][g.blendMode];b!==y&&(b=y,t=null,m=n,R++);var _=this.getUniforms(g);d!==_&&(d=_,t=null,m=n,R++),t!==e&&(t=e)._enabled!==R&&(m===n&&(R++,m=0,v.size=r-v.start,(v=h[p++]).textureCount=0,v.blend=b,v.start=r,v.uniforms=d),e._enabled=R,e._virtalBoundId=m,v.textures[v.textureCount++]=e,m++);var w=Math.min(g.worldAlpha,1),x=w<1&&e.premultipliedAlpha?k(g._tintRGB,w):g._tintRGB+(255*w<<24);this.fillVertices(c,f,l,g,x,e._virtalBoundId),l+=4*this.vertSize}if(v.size=r-v.start,M.CAN_UPLOAD_SAME_BUFFER)this.vertexBuffers[this.vertexCount].upload(s.vertices,0,!0);else{if(this.vaoMax<=this.vertexCount){this.vaoMax++;this.shader.attributes;var T=this.vertexBuffers[this.vertexCount]=C.createVertexBuffer(i,null,i.STREAM_DRAW);this.vaos[this.vertexCount]=this.createVao(T)}this.renderer.bindVao(this.vaos[this.vertexCount]),this.vertexBuffers[this.vertexCount].upload(s.vertices,0,!1),this.vertexCount++}for(d=null,r=0;r<p;r++){var S=h[r],E=S.textureCount;S.uniforms!==d&&this.syncUniforms(S.uniforms);for(var A=0;A<E;A++){this.renderer.bindTexture(S.textures[A],A,!0),S.textures[A]._virtalBoundId=-1;var P=this.shader.uniforms.samplerSize;P&&(P[0]=S.textures[A].realWidth,P[1]=S.textures[A].realHeight,this.shader.uniforms.samplerSize=P)}this.renderer.state.setBlendMode(S.blend),i.drawElements(i.TRIANGLES,6*S.size,i.UNSIGNED_SHORT,6*S.start*2)}this.currentIndex=0}},e.prototype.start=function(){this.renderer.bindShader(this.shader),M.CAN_UPLOAD_SAME_BUFFER&&(this.renderer.bindVao(this.vaos[this.vertexCount]),this.vertexBuffers[this.vertexCount].bind())},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this.vaoMax;e++)this.vertexBuffers[e]&&this.vertexBuffers[e].destroy(),this.vaos[e]&&this.vaos[e].destroy();this.indexBuffer&&this.indexBuffer.destroy(),this.renderer.off("prerender",this.onPrerender,this),i.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.vertexBuffers=null,this.vaos=null,this.indexBuffer=null,this.indices=null,this.sprites=null;for(e=0;e<this.buffers.length;++e)this.buffers[e].destroy()},e}(e);n.MultiTextureSpriteRenderer=t}(O.webgl||(O.webgl={}))}(pixi_projection||(pixi_projection={})),function(e){var f=[new PIXI.Point,new PIXI.Point,new PIXI.Point,new PIXI.Point],l=[0,0,0,0],t=function(){function e(){this.surfaceID="default",this._updateID=0,this.vertexSrc="",this.fragmentSrc=""}return e.prototype.fillUniforms=function(e){},e.prototype.clear=function(){},e.prototype.boundsQuad=function(e,t,r){for(var i=t[0],n=t[1],o=t[0],a=t[1],s=2;s<8;s+=2)i>t[s]&&(i=t[s]),o<t[s]&&(o=t[s]),n>t[s+1]&&(n=t[s+1]),a<t[s+1]&&(a=t[s+1]);if(f[0].set(i,n),this.apply(f[0],f[0]),f[1].set(o,n),this.apply(f[1],f[1]),f[2].set(o,a),this.apply(f[2],f[2]),f[3].set(i,a),this.apply(f[3],f[3]),r)r.apply(f[0],f[0]),r.apply(f[1],f[1]),r.apply(f[2],f[2]),r.apply(f[3],f[3]),t[0]=f[0].x,t[1]=f[0].y,t[2]=f[1].x,t[3]=f[1].y,t[4]=f[2].x,t[5]=f[2].y,t[6]=f[3].x,t[7]=f[3].y;else{for(s=1;s<=3;s++)if(f[s].y<f[0].y||f[s].y==f[0].y&&f[s].x<f[0].x){var u=f[0];f[0]=f[s],f[s]=u}for(s=1;s<=3;s++)l[s]=Math.atan2(f[s].y-f[0].y,f[s].x-f[0].x);for(s=1;s<=3;s++)for(var h=s+1;h<=3;h++)if(l[s]>l[h]){u=f[s];f[s]=f[h],f[h]=u;var c=l[s];l[s]=l[h],l[h]=c}if(t[0]=f[0].x,t[1]=f[0].y,t[2]=f[1].x,t[3]=f[1].y,t[4]=f[2].x,t[5]=f[2].y,t[6]=f[3].x,t[7]=f[3].y,(f[3].x-f[2].x)*(f[1].y-f[2].y)-(f[1].x-f[2].x)*(f[3].y-f[2].y)<0)return t[4]=f[3].x,void(t[5]=f[3].y)}},e}();e.Surface=t}(pixi_projection||(pixi_projection={})),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.distortion=new PIXI.Point,e}return __extends(e,t),e.prototype.clear=function(){this.distortion.set(0,0)},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.distortion,i=e.x*e.y;return t.x=e.x+r.x*i,t.y=e.y+r.y*i,t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=e.x,i=e.y,n=this.distortion.x,o=this.distortion.y;if(0==n)t.x=r,t.y=i/(1+o*r);else if(0==o)t.y=i,t.x=r/(1+n*i);else{var a=.5*(i*n-r*o+1)/o,s=a*a+r/o;if(s<=1e-5)return void t.set(NaN,NaN);t.x=0<o?-a+Math.sqrt(s):-a-Math.sqrt(s),t.y=(r/t.x-1)/n}return t},e.prototype.mapSprite=function(e,t,r){var i=e.texture;return n.x=-e.anchor.x*i.orig.width,n.y=-e.anchor.y*i.orig.height,n.width=i.orig.width,n.height=i.orig.height,this.mapQuad(n,t,r||e.transform)},e.prototype.mapQuad=function(e,t,r){var i=-e.x/e.width,n=-e.y/e.height,o=(1-e.x)/e.width,a=(1-e.y)/e.height,s=t[0].x*(1-i)+t[1].x*i,u=t[0].y*(1-i)+t[1].y*i,h=t[0].x*(1-o)+t[1].x*o,c=t[0].y*(1-o)+t[1].y*o,f=t[3].x*(1-i)+t[2].x*i,l=t[3].y*(1-i)+t[2].y*i,d=t[3].x*(1-o)+t[2].x*o,p=t[3].y*(1-o)+t[2].y*o,m=s*(1-n)+f*n,v=u*(1-n)+l*n,b=h*(1-n)+d*n,g=c*(1-n)+p*n,y=s*(1-a)+f*a,_=u*(1-a)+l*a,w=h*(1-a)+d*a,x=c*(1-a)+p*a,T=S;return T.tx=m,T.ty=v,T.a=b-m,T.b=g-v,T.c=y-m,T.d=_-v,E.set(w,x),T.applyInverse(E,E),this.distortion.set(E.x-1,E.y-1),r.setFromMatrix(T),this},e.prototype.fillUniforms=function(e){e.distortion=e.distortion||new Float32Array([0,0,0,0]);var t=Math.abs(this.distortion.x),r=Math.abs(this.distortion.y);e.distortion[0]=1e4*t<=r?0:this.distortion.x,e.distortion[1]=1e4*r<=t?0:this.distortion.y,e.distortion[2]=1/e.distortion[0],e.distortion[3]=1/e.distortion[1]},e}(e.Surface);e.BilinearSurface=t}(pixi_projection||(pixi_projection={})),function(r){var e=function(t){function e(){var e=t.call(this)||this;return e.proj=new r.ProjectionSurface(e.transform),e}return __extends(e,t),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj},enumerable:!0,configurable:!0}),e}(PIXI.Container);r.Container2s=e}(pixi_projection||(pixi_projection={})),function(r){var i=PIXI.TransformStatic.prototype.updateTransform;function t(e){var t=this.proj,r=e.proj;return r?r._surface?(t._activeProjection=r,this.updateLocalTransform(),this.localTransform.copy(this.worldTransform),void(this._parentID<0&&++this._worldID)):(i.call(this,e),void(t._activeProjection=r._activeProjection)):(i.call(this,e),void(t._activeProjection=null))}var e=function(i){function e(e,t){var r=i.call(this,e,t)||this;return r._surface=null,r._activeProjection=null,r._currentSurfaceID=-1,r._currentLegacyID=-1,r._lastUniforms=null,r}return __extends(e,i),Object.defineProperty(e.prototype,"enabled",{set:function(e){e!==this._enabled&&(this._enabled=e,this.legacy.updateTransform=e?t:PIXI.TransformStatic.prototype.updateTransform,this.legacy._parentID=-1)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"surface",{get:function(){return this._surface},set:function(e){this._surface!=e&&(this._surface=e||null,this.legacy._parentID=-1)},enumerable:!0,configurable:!0}),e.prototype.applyPartial=function(e,t){return null!==this._activeProjection?(t=this.legacy.worldTransform.apply(e,t),this._activeProjection.surface.apply(t,t)):null!==this._surface?this.surface.apply(e,t):this.legacy.worldTransform.apply(e,t)},e.prototype.apply=function(e,t){return null!==this._activeProjection?(t=this.legacy.worldTransform.apply(e,t),this._activeProjection.surface.apply(t,t),this._activeProjection.legacy.worldTransform.apply(t,t)):null!==this._surface?(t=this.surface.apply(e,t),this.legacy.worldTransform.apply(t,t)):this.legacy.worldTransform.apply(e,t)},e.prototype.applyInverse=function(e,t){return null!==this._activeProjection?(t=this._activeProjection.legacy.worldTransform.applyInverse(e,t),this._activeProjection._surface.applyInverse(t,t),this.legacy.worldTransform.applyInverse(t,t)):null!==this._surface?(t=this.legacy.worldTransform.applyInverse(e,t),this._surface.applyInverse(t,t)):this.legacy.worldTransform.applyInverse(e,t)},e.prototype.mapBilinearSprite=function(e,t){this._surface instanceof r.BilinearSurface||(this.surface=new r.BilinearSurface),this.surface.mapSprite(e,t,this.legacy)},e.prototype.clear=function(){this.surface&&this.surface.clear()},Object.defineProperty(e.prototype,"uniforms",{get:function(){return this._currentLegacyID===this.legacy._worldID&&this._currentSurfaceID===this.surface._updateID||(this._lastUniforms=this._lastUniforms||{},this._lastUniforms.worldTransform=this.legacy.worldTransform.toArray(!0),this._surface.fillUniforms(this._lastUniforms)),this._lastUniforms},enumerable:!0,configurable:!0}),e}(r.AbstractProjection);r.ProjectionSurface=e}(pixi_projection||(pixi_projection={})),function(e){var t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=100,e.MAX_TEXTURES_LOCAL=1,e.shaderVert="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec3 aTrans1;\nattribute vec3 aTrans2;\nattribute vec4 aFrame;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 worldTransform;\n\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position.xyw = projectionMatrix * worldTransform * vec3(aVertexPosition, 1.0);\n gl_Position.z = 0.0;\n \n vTextureCoord = aVertexPosition;\n vTrans1 = aTrans1;\n vTrans2 = aTrans2;\n vTextureId = aTextureId;\n vColor = aColor;\n vFrame = aFrame;\n}\n",e.shaderFrag="precision highp float;\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nuniform sampler2D uSamplers[%count%];\nuniform vec2 samplerSize[%count%]; \nuniform vec4 distortion;\n\nvoid main(void){\nvec2 surface;\nvec2 surface2;\n\nfloat vx = vTextureCoord.x;\nfloat vy = vTextureCoord.y;\nfloat dx = distortion.x;\nfloat dy = distortion.y;\nfloat revx = distortion.z;\nfloat revy = distortion.w;\n\nif (distortion.x == 0.0) {\n surface.x = vx;\n surface.y = vy / (1.0 + dy * vx);\n surface2 = surface;\n} else\nif (distortion.y == 0.0) {\n surface.y = vy;\n surface.x = vx/ (1.0 + dx * vy);\n surface2 = surface;\n} else {\n float c = vy * dx - vx * dy;\n float b = (c + 1.0) * 0.5;\n float b2 = (-c + 1.0) * 0.5;\n float d = b * b + vx * dy;\n if (d < -0.00001) {\n discard;\n }\n d = sqrt(max(d, 0.0));\n surface.x = (- b + d) * revy;\n surface2.x = (- b - d) * revy;\n surface.y = (- b2 + d) * revx;\n surface2.y = (- b2 - d) * revx;\n}\n\nvec2 uv;\nuv.x = vTrans1.x * surface.x + vTrans1.y * surface.y + vTrans1.z;\nuv.y = vTrans2.x * surface.x + vTrans2.y * surface.y + vTrans2.z;\n\nvec2 pixels = uv * samplerSize[0];\n\nif (pixels.x < vFrame.x || pixels.x > vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n uv.x = vTrans1.x * surface2.x + vTrans1.y * surface2.y + vTrans1.z;\n uv.y = vTrans2.x * surface2.x + vTrans2.y * surface2.y + vTrans2.z;\n pixels = uv * samplerSize[0];\n \n if (pixels.x < vFrame.x || pixels.x > vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n discard;\n }\n}\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = 1.0; //edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),h=i.aTrans,c=0;c<4;c++)e[r]=a[2*c],e[r+1]=a[2*c+1],e[r+2]=h.a,e[r+3]=h.c,e[r+4]=h.tx,e[r+5]=h.b,e[r+6]=h.d,e[r+7]=h.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_bilinear",t)}(),function(e){var t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=100,e.MAX_TEXTURES_LOCAL=1,e.shaderVert="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec3 aTrans1;\nattribute vec3 aTrans2;\nattribute vec4 aFrame;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 worldTransform;\n\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position.xyw = projectionMatrix * worldTransform * vec3(aVertexPosition, 1.0);\n gl_Position.z = 0.0;\n \n vTextureCoord = aVertexPosition;\n vTrans1 = aTrans1;\n vTrans2 = aTrans2;\n vTextureId = aTextureId;\n vColor = aColor;\n vFrame = aFrame;\n}\n",e.shaderFrag="precision highp float;\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nuniform sampler2D uSamplers[%count%];\nuniform vec2 samplerSize[%count%]; \nuniform vec4 params;\n\nvoid main(void){\nvec2 surface;\n\nfloat vx = vTextureCoord.x;\nfloat vy = vTextureCoord.y;\nfloat aleph = params.x;\nfloat bet = params.y;\nfloat A = params.z;\nfloat B = params.w;\n\nif (aleph == 0.0) {\n\tsurface.y = vy / (1.0 + vx * bet);\n\tsurface.x = vx;\n}\nelse if (bet == 0.0) {\n\tsurface.x = vx / (1.0 + vy * aleph);\n\tsurface.y = vy;\n} else {\n\tsurface.x = vx * (bet + 1.0) / (bet + 1.0 + vy * aleph);\n\tsurface.y = vy * (aleph + 1.0) / (aleph + 1.0 + vx * bet);\n}\n\nvec2 uv;\nuv.x = vTrans1.x * surface.x + vTrans1.y * surface.y + vTrans1.z;\nuv.y = vTrans2.x * surface.x + vTrans2.y * surface.y + vTrans2.z;\n\nvec2 pixels = uv * samplerSize[0];\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),h=i.aTrans,c=0;c<4;c++)e[r]=a[2*c],e[r+1]=a[2*c+1],e[r+2]=h.a,e[r+3]=h.c,e[r+4]=h.tx,e[r+5]=h.b,e[r+6]=h.d,e[r+7]=h.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_strange",t)}(),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.params=[0,0,NaN,NaN],e}return __extends(e,t),e.prototype.clear=function(){var e=this.params;e[0]=0,e[1]=0,e[2]=NaN,e[3]=NaN},e.prototype.setAxisX=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.y=Math.atan2(n,i);var s=this.params;s[2]=0!==t?-o*t:NaN,this._calc01()},e.prototype.setAxisY=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.x=-Math.atan2(n,i)+Math.PI/2;var s=this.params;s[3]=0!==t?-o*t:NaN,this._calc01()},e.prototype._calc01=function(){var e=this.params;if(isNaN(e[2]))e[1]=0,isNaN(e[3])?e[0]=0:e[0]=1/e[3];else if(isNaN(e[3]))e[0]=0,e[1]=1/e[2];else{var t=1-e[2]*e[3];e[0]=(1-e[2])/t,e[1]=(1-e[3])/t}},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=this.params[2],o=this.params[3],a=e.x,s=e.y;if(0===r)t.y=s*(1+a*i),t.x=a;else if(0===i)t.x=a*(1+s*r),t.y=s;else{var u=n*o-s*a;t.x=n*a*(o+s)/u,t.y=o*s*(n+a)/u}return t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=(this.params[2],this.params[3],e.x),o=e.y;return 0===r?(t.y=o/(1+n*i),t.x=n):0===i?(t.x=n*(1+o*r),t.y=o):(t.x=n*(i+1)/(i+1+o*r),t.y=o*(r+1)/(r+1+n*i)),t},e.prototype.mapSprite=function(e,t,r){var i=e.texture;return n.x=-e.anchor.x*i.orig.width,n.y=-e.anchor.y*i.orig.height,n.width=i.orig.width,n.height=i.orig.height,this.mapQuad(n,t,r||e.transform)},e.prototype.mapQuad=function(e,t,r){var i=-e.x/e.width,n=-e.y/e.height,o=(1-e.x)/e.width,a=(1-e.y)/e.height,s=t[0].x*(1-i)+t[1].x*i,u=t[0].y*(1-i)+t[1].y*i,h=t[0].x*(1-o)+t[1].x*o,c=t[0].y*(1-o)+t[1].y*o,f=t[3].x*(1-i)+t[2].x*i,l=t[3].y*(1-i)+t[2].y*i,d=t[3].x*(1-o)+t[2].x*o,p=t[3].y*(1-o)+t[2].y*o,m=s*(1-n)+f*n,v=u*(1-n)+l*n,b=h*(1-n)+d*n,g=c*(1-n)+p*n,y=s*(1-a)+f*a,_=u*(1-a)+l*a,w=h*(1-a)+d*a,x=c*(1-a)+p*a,T=S;return T.tx=m,T.ty=v,T.a=b-m,T.b=g-v,T.c=y-m,T.d=_-v,E.set(w,x),T.applyInverse(E,E),r.setFromMatrix(T),this},e.prototype.fillUniforms=function(e){var t=this.params,r=e.params||new Float32Array([0,0,0,0]);(e.params=r)[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3]},e}(e.Surface);e.StrangeSurface=t}(pixi_projection||(pixi_projection={})),function(e){PIXI.Sprite.prototype.convertTo2s=function(){this.proj||(this.pluginName="sprite_bilinear",this.aTrans=new PIXI.Matrix,this.calculateVertices=e.Sprite2s.prototype.calculateVertices,this.calculateTrimmedVertices=e.Sprite2s.prototype.calculateTrimmedVertices,this._calculateBounds=e.Sprite2s.prototype._calculateBounds,PIXI.Container.prototype.convertTo2s.call(this))},PIXI.Container.prototype.convertTo2s=function(){this.proj||(this.proj=new e.Projection2d(this.transform),Object.defineProperty(this,"worldTransform",{get:function(){return this.proj},enumerable:!0,configurable:!0}))},PIXI.Container.prototype.convertSubtreeTo2s=function(){this.convertTo2s();for(var e=0;e<this.children.length;e++)this.children[e].convertSubtreeTo2s()}}(pixi_projection||(pixi_projection={})),function(i){var e=function(r){function e(e){var t=r.call(this,e)||this;return t.aTrans=new PIXI.Matrix,t.proj=new i.ProjectionSurface(t.transform),t.pluginName="sprite_bilinear",t}return __extends(e,r),e.prototype._calculateBounds=function(){this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData)},e.prototype.calculateVertices=function(){var e=this.transform._worldID,t=this._texture._updateID;if(this._transformID!==e||this._textureID!==t){this._transformID=e,this._textureID=t;var r=this._texture,i=this.vertexData,n=r.trim,o=r.orig,a=this._anchor,s=0,u=0,h=0,c=0;if(h=n?(s=(u=n.x-a._x*o.width)+n.width,(c=n.y-a._y*o.height)+n.height):(s=(u=-a._x*o.width)+o.width,(c=-a._y*o.height)+o.height),this.proj._surface)i[0]=u,i[1]=c,i[2]=s,i[3]=c,i[4]=s,i[5]=h,i[6]=u,i[7]=h,this.proj._surface.boundsQuad(i,i);else{var f=this.transform.worldTransform,l=f.a,d=f.b,p=f.c,m=f.d,v=f.tx,b=f.ty;i[0]=l*u+p*c+v,i[1]=m*c+d*u+b,i[2]=l*s+p*c+v,i[3]=m*c+d*s+b,i[4]=l*s+p*h+v,i[5]=m*h+d*s+b,i[6]=l*u+p*h+v,i[7]=m*h+d*u+b,this.proj._activeProjection&&this.proj._activeProjection.surface.boundsQuad(i,i)}r.transform||(r.transform=new PIXI.TextureMatrix(r)),r.transform.update();var g=this.aTrans;g.set(o.width,0,0,o.height,u,c),null===this.proj._surface&&g.prepend(this.transform.worldTransform),g.invert(),g.prepend(r.transform.mapCoord)}},e.prototype.calculateTrimmedVertices=function(){var e=this.transform._worldID,t=this._texture._updateID;if(this.vertexTrimmedData){if(this._transformTrimmedID===e&&this._textureTrimmedID===t)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=e,this._textureTrimmedID=t;var r=this._texture,i=this.vertexTrimmedData,n=r.orig,o=this._anchor,a=-o._x*n.width,s=a+n.width,u=-o._y*n.height,h=u+n.height;if(this.proj._surface)i[0]=a,i[1]=u,i[2]=s,i[3]=u,i[4]=s,i[5]=h,i[6]=a,i[7]=h,this.proj._surface.boundsQuad(i,i,this.transform.worldTransform);else{var c=this.transform.worldTransform,f=c.a,l=c.b,d=c.c,p=c.d,m=c.tx,v=c.ty;i[0]=f*a+d*u+m,i[1]=p*u+l*a+v,i[2]=f*s+d*u+m,i[3]=p*u+l*s+v,i[4]=f*s+d*h+m,i[5]=p*h+l*s+v,i[6]=f*a+d*h+m,i[7]=p*h+l*a+v,this.proj._activeProjection&&this.proj._activeProjection.surface.boundsQuad(i,i,this.proj._activeProjection.legacy.worldTransform)}},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj},enumerable:!0,configurable:!0}),e}(PIXI.Sprite);i.Sprite2s=e}(pixi_projection||(pixi_projection={})),function(o){var e=function(n){function e(e,t,r){var i=n.call(this,e,t,r)||this;return i.aTrans=new PIXI.Matrix,i.proj=new o.ProjectionSurface(i.transform),i.pluginName="sprite_bilinear",i}return __extends(e,n),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj},enumerable:!0,configurable:!0}),e}(PIXI.Text);(o.Text2s=e).prototype.calculateVertices=o.Sprite2s.prototype.calculateVertices,e.prototype.calculateTrimmedVertices=o.Sprite2s.prototype.calculateTrimmedVertices,e.prototype._calculateBounds=o.Sprite2s.prototype._calculateBounds}(pixi_projection||(pixi_projection={})),function(o){o.container2dWorldTransform=function(){return this.proj.affine?this.transform.worldTransform:this.proj.world};var e=function(t){function e(){var e=t.call(this)||this;return e.proj=new o.Projection2d(e.transform),e}return __extends(e,t),e.prototype.toLocal=function(e,t,r,i,n){return void 0===n&&(n=o.TRANSFORM_STEP.ALL),t&&(e=t.toGlobal(e,r,i)),i||this._recursivePostUpdateTransform(),n>=o.TRANSFORM_STEP.PROJ?(i||this.displayObjectUpdateTransform(),this.proj.affine?this.transform.worldTransform.applyInverse(e,r):this.proj.world.applyInverse(e,r)):(this.parent?r=this.parent.worldTransform.applyInverse(e,r):r.copy(e),n===o.TRANSFORM_STEP.NONE?r:this.transform.localTransform.applyInverse(r,r))},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e}(PIXI.Container);o.Container2d=e,o.container2dToLocal=e.prototype.toLocal}(pixi_projection||(pixi_projection={})),function(e){var u,t,b=PIXI.Point,r=[1,0,0,0,1,0,0,0,1];(t=u=e.AFFINE||(e.AFFINE={}))[t.NONE=0]="NONE",t[t.FREE=1]="FREE",t[t.AXIS_X=2]="AXIS_X",t[t.AXIS_Y=3]="AXIS_Y",t[t.POINT=4]="POINT",t[t.AXIS_XR=5]="AXIS_XR";var i=function(){function e(e){this.floatArray=null,this.mat3=new Float64Array(e||r)}return Object.defineProperty(e.prototype,"a",{get:function(){return this.mat3[0]/this.mat3[8]},set:function(e){this.mat3[0]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.mat3[1]/this.mat3[8]},set:function(e){this.mat3[1]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c",{get:function(){return this.mat3[3]/this.mat3[8]},set:function(e){this.mat3[3]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"d",{get:function(){return this.mat3[4]/this.mat3[8]},set:function(e){this.mat3[4]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tx",{get:function(){return this.mat3[6]/this.mat3[8]},set:function(e){this.mat3[6]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ty",{get:function(){return this.mat3[7]/this.mat3[8]},set:function(e){this.mat3[7]=e*this.mat3[8]},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t,r,i,n,o){var a=this.mat3;return a[0]=e,a[1]=t,a[2]=0,a[3]=r,a[4]=i,a[5]=0,a[6]=n,a[7]=o,a[8]=1,this},e.prototype.toArray=function(e,t){this.floatArray||(this.floatArray=new Float32Array(9));var r=t||this.floatArray,i=this.mat3;return e?(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7]):(r[0]=i[0],r[1]=i[3],r[2]=i[6],r[3]=i[1],r[4]=i[4],r[5]=i[7],r[6]=i[2],r[7]=i[5]),r[8]=i[8],r},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.mat3,i=e.x,n=e.y,o=1/(r[2]*i+r[5]*n+r[8]);return t.x=o*(r[0]*i+r[3]*n+r[6]),t.y=o*(r[1]*i+r[4]*n+r[7]),t},e.prototype.translate=function(e,t){var r=this.mat3;return r[0]+=e*r[2],r[1]+=t*r[2],r[3]+=e*r[5],r[4]+=t*r[5],r[6]+=e*r[8],r[7]+=t*r[8],this},e.prototype.scale=function(e,t){var r=this.mat3;return r[0]*=e,r[1]*=t,r[3]*=e,r[4]*=t,r[6]*=e,r[7]*=t,this},e.prototype.scaleAndTranslate=function(e,t,r,i){var n=this.mat3;n[0]=e*n[0]+r*n[2],n[1]=t*n[1]+i*n[2],n[3]=e*n[3]+r*n[5],n[4]=t*n[4]+i*n[5],n[6]=e*n[6]+r*n[8],n[7]=t*n[7]+i*n[8]},e.prototype.applyInverse=function(e,t){t=t||new b;var r=this.mat3,i=e.x,n=e.y,o=r[0],a=r[3],s=r[6],u=r[1],h=r[4],c=r[7],f=r[2],l=r[5],d=r[8],p=(d*h-c*l)*i+(-d*a+s*l)*n+(c*a-s*h),m=(-d*u+c*f)*i+(d*o-s*f)*n+(-c*o+s*u),v=(l*u-h*f)*i+(-l*o+a*f)*n+(h*o-a*u);return t.x=p/v,t.y=m/v,t},e.prototype.invert=function(){var e=this.mat3,t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],s=e[6],u=e[7],h=e[8],c=h*o-a*u,f=-h*n+a*s,l=u*n-o*s,d=t*c+r*f+i*l;return d&&(d=1/d,e[0]=c*d,e[1]=(-h*r+i*u)*d,e[2]=(a*r-i*o)*d,e[3]=f*d,e[4]=(h*t-i*s)*d,e[5]=(-a*t+i*n)*d,e[6]=l*d,e[7]=(-u*t+r*s)*d,e[8]=(o*t-r*n)*d),this},e.prototype.identity=function(){var e=this.mat3;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,this},e.prototype.clone=function(){return new e(this.mat3)},e.prototype.copyTo=function(e){var t=this.mat3,r=e.mat3;return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],e},e.prototype.copyTo2dOr3d=function(e){return this.copyTo(e)},e.prototype.copy=function(e,t,r){var i=this.mat3,n=1/i[8],o=i[6]*n,a=i[7]*n;if(e.a=(i[0]-i[2]*o)*n,e.b=(i[1]-i[2]*a)*n,e.c=(i[3]-i[5]*o)*n,e.d=(i[4]-i[5]*a)*n,e.tx=o,e.ty=a,2<=t){var s=e.a*e.d-e.b*e.c;r||(s=Math.abs(s)),t===u.POINT?(s=0<s?1:-1,e.a=s,e.b=0,e.c=0,e.d=s):t===u.AXIS_X?(s/=Math.sqrt(e.b*e.b+e.d*e.d),e.c=0,e.d=s):t===u.AXIS_Y?(s/=Math.sqrt(e.a*e.a+e.c*e.c),e.a=s,e.c=0):t===u.AXIS_XR&&(e.a=e.d*s,e.c=-e.b*s)}},e.prototype.copyFrom=function(e){var t=this.mat3;return t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=e.c,t[4]=e.d,t[5]=0,t[6]=e.tx,t[7]=e.ty,t[8]=1,this},e.prototype.setToMultLegacy=function(e,t){var r=this.mat3,i=t.mat3,n=e.a,o=e.b,a=e.c,s=e.d,u=e.tx,h=e.ty,c=i[0],f=i[1],l=i[2],d=i[3],p=i[4],m=i[5],v=i[6],b=i[7],g=i[8];return r[0]=c*n+f*a+l*u,r[1]=c*o+f*s+l*h,r[2]=l,r[3]=d*n+p*a+m*u,r[4]=d*o+p*s+m*h,r[5]=m,r[6]=v*n+b*a+g*u,r[7]=v*o+b*s+g*h,r[8]=g,this},e.prototype.setToMultLegacy2=function(e,t){var r=this.mat3,i=e.mat3,n=i[0],o=i[1],a=i[2],s=i[3],u=i[4],h=i[5],c=i[6],f=i[7],l=i[8],d=t.a,p=t.b,m=t.c,v=t.d,b=t.tx,g=t.ty;return r[0]=d*n+p*s,r[1]=d*o+p*u,r[2]=d*a+p*h,r[3]=m*n+v*s,r[4]=m*o+v*u,r[5]=m*a+v*h,r[6]=b*n+g*s+c,r[7]=b*o+g*u+f,r[8]=b*a+g*h+l,this},e.prototype.setToMult=function(e,t){var r=this.mat3,i=e.mat3,n=t.mat3,o=i[0],a=i[1],s=i[2],u=i[3],h=i[4],c=i[5],f=i[6],l=i[7],d=i[8],p=n[0],m=n[1],v=n[2],b=n[3],g=n[4],y=n[5],_=n[6],w=n[7],x=n[8];return r[0]=p*o+m*u+v*f,r[1]=p*a+m*h+v*l,r[2]=p*s+m*c+v*d,r[3]=b*o+g*u+y*f,r[4]=b*a+g*h+y*l,r[5]=b*s+g*c+y*d,r[6]=_*o+w*u+x*f,r[7]=_*a+w*h+x*l,r[8]=_*s+w*c+x*d,this},e.prototype.prepend=function(e){return e.mat3?this.setToMult(e,this):this.setToMultLegacy(e,this)},e.IDENTITY=new e,e.TEMP_MATRIX=new e,e}();e.Matrix2d=i}(pixi_projection||(pixi_projection={})),function(d){var p=new PIXI.Point,m=[new PIXI.Point,new PIXI.Point,new PIXI.Point,new PIXI.Point],n=new PIXI.Rectangle,v=new d.Matrix2d,e=function(i){function e(e,t){var r=i.call(this,e,t)||this;return r.matrix=new d.Matrix2d,r.pivot=new PIXI.ObservablePoint(r.onChange,r,0,0),r.reverseLocalOrder=!1,r.local=new d.Matrix2d,r.world=new d.Matrix2d,r}return __extends(e,i),e.prototype.onChange=function(){var e=this.pivot,t=this.matrix.mat3;t[6]=-(e._x*t[0]+e._y*t[3]),t[7]=-(e._x*t[1]+e._y*t[4]),this._projID++},e.prototype.setAxisX=function(e,t){void 0===t&&(t=1);var r=e.x,i=e.y,n=Math.sqrt(r*r+i*i),o=this.matrix.mat3;o[0]=r/n,o[1]=i/n,o[2]=t/n,this.onChange()},e.prototype.setAxisY=function(e,t){void 0===t&&(t=1);var r=e.x,i=e.y,n=Math.sqrt(r*r+i*i),o=this.matrix.mat3;o[3]=r/n,o[4]=i/n,o[5]=t/n,this.onChange()},e.prototype.mapSprite=function(e,t){var r=e.texture;return n.x=-e.anchor.x*r.orig.width,n.y=-e.anchor.y*r.orig.height,n.width=r.orig.width,n.height=r.orig.height,this.mapQuad(n,t)},e.prototype.mapQuad=function(e,t){m[0].set(e.x,e.y),m[1].set(e.x+e.width,e.y),m[2].set(e.x+e.width,e.y+e.height),m[3].set(e.x,e.y+e.height);var r=1,i=2,n=3;if(0!==d.utils.getIntersectionFactor(t[0],t[2],t[1],t[3],p)){r=1,i=3,n=2;var o=Math.sqrt((t[0].x-p.x)*(t[0].x-p.x)+(t[0].y-p.y)*(t[0].y-p.y)),a=Math.sqrt((t[r].x-p.x)*(t[r].x-p.x)+(t[r].y-p.y)*(t[r].y-p.y)),s=Math.sqrt((t[i].x-p.x)*(t[i].x-p.x)+(t[i].y-p.y)*(t[i].y-p.y)),u=Math.sqrt((t[n].x-p.x)*(t[n].x-p.x)+(t[n].y-p.y)*(t[n].y-p.y)),h=(o+u)/u,c=(a+s)/s,f=(a+s)/a,l=this.matrix.mat3;l[0]=m[0].x*h,l[1]=m[0].y*h,l[2]=h,l[3]=m[r].x*c,l[4]=m[r].y*c,l[5]=c,l[6]=m[i].x*f,l[7]=m[i].y*f,l[8]=f,this.matrix.invert(),(l=v.mat3)[0]=t[0].x,l[1]=t[0].y,l[2]=1,l[3]=t[r].x,l[4]=t[r].y,l[5]=1,l[6]=t[i].x,l[7]=t[i].y,l[8]=1,this.matrix.setToMult(v,this.matrix),this._projID++}},e.prototype.updateLocalTransform=function(e){0!==this._projID?this.reverseLocalOrder?this.local.setToMultLegacy2(this.matrix,e):this.local.setToMultLegacy(e,this.matrix):this.local.copyFrom(e)},e.prototype.clear=function(){i.prototype.clear.call(this),this.matrix.identity(),this.pivot.set(0,0)},e}(d.LinearProjection);d.Projection2d=e}(pixi_projection||(pixi_projection={})),function(s){var e=function(a){function e(e,t,r,i,n){var o=a.call(this,e,t,r,i,n)||this;return o.proj=new s.Projection2d(o.transform),o.pluginName="mesh2d",o}return __extends(e,a),e.prototype.toLocal=function(e,t,r,i,n){return void 0===n&&(n=s.TRANSFORM_STEP.ALL),s.container2dToLocal.call(this,e,t,r,i,n)},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e}(PIXI.mesh.Mesh);s.Mesh2d=e}(pixi_projection||(pixi_projection={})),function(e){var t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onContextChange=function(){var e=this.renderer.gl;this.shader=new PIXI.Shader(e,"precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position.xyw = projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0);\n gl_Position.z = 0.0;\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","\nvarying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}")},t}(PIXI.mesh.MeshRenderer);e.Mesh2dRenderer=t,PIXI.WebGLRenderer.registerPlugin("mesh2d",t)}(pixi_projection||(pixi_projection={})),function(e){function t(){this.proj||(this.proj=new e.Projection2d(this.transform),this.toLocal=e.Container2d.prototype.toLocal,Object.defineProperty(this,"worldTransform",{get:e.container2dWorldTransform,enumerable:!0,configurable:!0}))}PIXI.Container.prototype.convertTo2d=t,PIXI.Sprite.prototype.convertTo2d=function(){this.proj||(this.calculateVertices=e.Sprite2d.prototype.calculateVertices,this.calculateTrimmedVertices=e.Sprite2d.prototype.calculateTrimmedVertices,this._calculateBounds=e.Sprite2d.prototype._calculateBounds,this.pluginName="sprite2d",this.vertexData=new Float32Array(12),t.call(this))},PIXI.mesh.Mesh.prototype.convertTo2d=function(){this.proj||(this.pluginName="mesh2d",t.call(this))},PIXI.Container.prototype.convertSubtreeTo2d=function(){this.convertTo2d();for(var e=0;e<this.children.length;e++)this.children[e].convertSubtreeTo2d()}}(pixi_projection||(pixi_projection={})),function(o){var e=function(l){function e(e){var t=l.call(this,e)||this;return t.proj=new o.Projection2d(t.transform),t.pluginName="sprite2d",t.vertexData=new Float32Array(12),t}return __extends(e,l),e.prototype._calculateBounds=function(){this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData)},e.prototype.calculateVertices=function(){if(this.proj._affine)return 8!=this.vertexData.length&&(this.vertexData=new Float32Array(8)),void l.prototype.calculateVertices.call(this);12!=this.vertexData.length&&(this.vertexData=new Float32Array(12));var e=this.transform._worldID,t=this._texture._updateID;if(this._transformID!==e||this._textureID!==t){this._transformID=e,this._textureID=t;var r=this._texture,i=this.proj.world.mat3,n=this.vertexData,o=r.trim,a=r.orig,s=this._anchor,u=0,h=0,c=0,f=0;c=o?(u=(h=o.x-s._x*a.width)+o.width,(f=o.y-s._y*a.height)+o.height):(u=(h=-s._x*a.width)+a.width,(f=-s._y*a.height)+a.height),n[0]=i[0]*h+i[3]*f+i[6],n[1]=i[1]*h+i[4]*f+i[7],n[2]=i[2]*h+i[5]*f+i[8],n[3]=i[0]*u+i[3]*f+i[6],n[4]=i[1]*u+i[4]*f+i[7],n[5]=i[2]*u+i[5]*f+i[8],n[6]=i[0]*u+i[3]*c+i[6],n[7]=i[1]*u+i[4]*c+i[7],n[8]=i[2]*u+i[5]*c+i[8],n[9]=i[0]*h+i[3]*c+i[6],n[10]=i[1]*h+i[4]*c+i[7],n[11]=i[2]*h+i[5]*c+i[8]}},e.prototype.calculateTrimmedVertices=function(){if(this.proj._affine)l.prototype.calculateTrimmedVertices.call(this);else{var e=this.transform._worldID,t=this._texture._updateID;if(this.vertexTrimmedData){if(this._transformTrimmedID===e&&this._textureTrimmedID===t)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=e,this._textureTrimmedID=t;var r=this._texture,i=this.vertexTrimmedData,n=r.orig,o=this._anchor,a=this.proj.world.mat3,s=-o._x*n.width,u=s+n.width,h=-o._y*n.height,c=h+n.height,f=1/(a[2]*s+a[5]*h+a[8]);i[0]=f*(a[0]*s+a[3]*h+a[6]),i[1]=f*(a[1]*s+a[4]*h+a[7]),f=1/(a[2]*u+a[5]*h+a[8]),i[2]=f*(a[0]*u+a[3]*h+a[6]),i[3]=f*(a[1]*u+a[4]*h+a[7]),f=1/(a[2]*u+a[5]*c+a[8]),i[4]=f*(a[0]*u+a[3]*c+a[6]),i[5]=f*(a[1]*u+a[4]*c+a[7]),f=1/(a[2]*s+a[5]*c+a[8]),i[6]=f*(a[0]*s+a[3]*c+a[6]),i[7]=f*(a[1]*s+a[4]*c+a[7])}},e.prototype.toLocal=function(e,t,r,i,n){return void 0===n&&(n=o.TRANSFORM_STEP.ALL),o.container2dToLocal.call(this,e,t,r,i,n)},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e}(PIXI.Sprite);o.Sprite2d=e}(pixi_projection||(pixi_projection={})),function(e){var t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shaderVert="precision highp float;\nattribute vec3 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position.xyw = projectionMatrix * aVertexPosition;\n gl_Position.z = 0.0;\n \n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor;\n}\n",e.shaderFrag="\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\nvec4 color;\nvec2 textureCoord = vTextureCoord;\nfloat textureId = floor(vTextureId+0.5);\n%forloop%\ngl_FragColor = color * vColor;\n}",e}return __extends(e,t),e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=6,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTextureCoord,r.UNSIGNED_SHORT,!0,this.vertByteSize,12).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,16);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,20),i},e.prototype.fillVertices=function(e,t,r,i,n,o){var a=i.vertexData,s=i._texture._uvs.uvsUint32;if(8===a.length)if(this.renderer.roundPixels){var u=this.renderer.resolution;e[r]=(a[0]*u|0)/u,e[r+1]=(a[1]*u|0)/u,e[r+2]=1,e[r+6]=(a[2]*u|0)/u,e[r+7]=(a[3]*u|0)/u,e[r+8]=1,e[r+12]=(a[4]*u|0)/u,e[r+13]=(a[5]*u|0)/u,e[r+14]=1,e[r+18]=(a[6]*u|0)/u,e[r+19]=(a[7]*u|0)/u,e[r+20]=1}else e[r]=a[0],e[r+1]=a[1],e[r+2]=1,e[r+6]=a[2],e[r+7]=a[3],e[r+8]=1,e[r+12]=a[4],e[r+13]=a[5],e[r+14]=1,e[r+18]=a[6],e[r+19]=a[7],e[r+20]=1;else e[r]=a[0],e[r+1]=a[1],e[r+2]=a[2],e[r+6]=a[3],e[r+7]=a[4],e[r+8]=a[5],e[r+12]=a[6],e[r+13]=a[7],e[r+14]=a[8],e[r+18]=a[9],e[r+19]=a[10],e[r+20]=a[11];t[r+3]=s[0],t[r+9]=s[1],t[r+15]=s[2],t[r+21]=s[3],t[r+4]=t[r+10]=t[r+16]=t[r+22]=n,e[r+5]=e[r+11]=e[r+17]=e[r+23]=o},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite2d",t)}(),function(o){var e=function(n){function e(e,t,r){var i=n.call(this,e,t,r)||this;return i.proj=new o.Projection2d(i.transform),i.pluginName="sprite2d",i.vertexData=new Float32Array(12),i}return __extends(e,n),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e}(PIXI.Text);(o.Text2d=e).prototype.calculateVertices=o.Sprite2d.prototype.calculateVertices,e.prototype.calculateTrimmedVertices=o.Sprite2d.prototype.calculateTrimmedVertices,e.prototype._calculateBounds=o.Sprite2d.prototype._calculateBounds}(pixi_projection||(pixi_projection={})),function(o){var r=new PIXI.TransformStatic,e=function(n){function e(e,t,r){var i=n.call(this,e,t,r)||this;return i.tileProj=new o.Projection2d(i.tileTransform),i.tileProj.reverseLocalOrder=!0,i.proj=new o.Projection2d(i.transform),i.pluginName="tilingSprite2d",i.uvRespectAnchor=!0,i}return __extends(e,n),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e.prototype.toLocal=function(e,t,r,i,n){return void 0===n&&(n=o.TRANSFORM_STEP.ALL),o.container2dToLocal.call(this,e,t,r,i,n)},e.prototype._renderWebGL=function(e){var t=this._texture;t&&t.valid&&(this.tileTransform.updateTransform(r),this.uvTransform.update(),e.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this))},e}(PIXI.extras.TilingSprite);o.TilingSprite2d=e}(pixi_projection||(pixi_projection={})),function(e){var r="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec3 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position.xyw = projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0);\n\n vTextureCoord = uTransform * vec3(aTextureCoord, 1.0);\n}\n",c=new e.Matrix2d,f=PIXI.WRAP_MODES,l=PIXI.utils,t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onContextChange=function(){var e=this.renderer.gl;this.shader=new PIXI.Shader(e,r,"\nvarying vec3 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = mod(vTextureCoord.xy / vTextureCoord.z - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 sample = texture2D(uSampler, coord);\n gl_FragColor = sample * uColor;\n}\n"),this.simpleShader=new PIXI.Shader(e,r,"\n\tvarying vec3 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord.xy / vTextureCoord.z);\n gl_FragColor = sample * uColor;\n}\n"),this.renderer.bindVao(null),this.quad=new PIXI.Quad(e,this.renderer.state.attribState),this.quad.initVao(this.shader)},t.prototype.render=function(e){var t=this.renderer,r=this.quad;t.bindVao(r.vao);var i=r.vertices;i[0]=i[6]=e._width*-e.anchor.x,i[1]=i[3]=e._height*-e.anchor.y,i[2]=i[4]=e._width*(1-e.anchor.x),i[5]=i[7]=e._height*(1-e.anchor.y),e.uvRespectAnchor&&((i=r.uvs)[0]=i[6]=-e.anchor.x,i[1]=i[3]=-e.anchor.y,i[2]=i[4]=1-e.anchor.x,i[5]=i[7]=1-e.anchor.y),r.upload();var n=e._texture,o=n.baseTexture,a=e.tileProj.world,s=e.uvTransform,u=o.isPowerOfTwo&&n.frame.width===o.width&&n.frame.height===o.height;u&&(o._glTextures[t.CONTEXT_UID]?u=o.wrapMode!==f.CLAMP:o.wrapMode===f.CLAMP&&(o.wrapMode=f.REPEAT));var h=u?this.simpleShader:this.shader;t.bindShader(h),c.identity(),c.scale(n.width,n.height),c.prepend(a),c.scale(1/e._width,1/e._height),c.invert(),u?c.prepend(s.mapCoord):(h.uniforms.uMapCoord=s.mapCoord.toArray(!0),h.uniforms.uClampFrame=s.uClampFrame,h.uniforms.uClampOffset=s.uClampOffset),h.uniforms.uTransform=c.toArray(!0),h.uniforms.uColor=l.premultiplyTintToRgba(e.tint,e.worldAlpha,h.uniforms.uColor,o.premultipliedAlpha),h.uniforms.translationMatrix=e.proj.world.toArray(!0),h.uniforms.uSampler=t.bindTexture(n),t.setBlendMode(l.correctBlendMode(e.blendMode,o.premultipliedAlpha)),r.vao.draw(this.renderer.gl.TRIANGLES,6,0)},t}(PIXI.extras.TilingSpriteRenderer);e.TilingSprite2dRenderer=t,PIXI.WebGLRenderer.registerPlugin("tilingSprite2d",t)}(pixi_projection||(pixi_projection={})),function(i){var e=function(){function e(e){var t=this;this.onContextChange=function(e){t.gl=e,t.renderer.maskManager.pushSpriteMask=r},(this.renderer=e).on("context",this.onContextChange)}return e.prototype.destroy=function(){this.renderer.off("context",this.onContextChange)},e}();function r(e,t){var r=this.alphaMaskPool[this.alphaMaskIndex];r||(r=this.alphaMaskPool[this.alphaMaskIndex]=[new i.SpriteMaskFilter2d(t)]),r[0].resolution=this.renderer.resolution,r[0].maskSprite=t,e.filterArea=t.getBounds(!0),this.renderer.filterManager.pushFilter(e,r),this.alphaMaskIndex++}i.ProjectionsManager=e,PIXI.WebGLRenderer.registerPlugin("projections",e)}(pixi_projection||(pixi_projection={})),function(i){var u=new i.Matrix2d,e=function(r){function s(e){var t=r.call(this,"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec3 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n\tgl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n\tvTextureCoord = aTextureCoord;\n\tvMaskCoord = otherMatrix * vec3( aTextureCoord, 1.0);\n}\n","\nvarying vec3 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n vec2 uv = vMaskCoord.xy / vMaskCoord.z;\n \n float clip = step(3.5,\n step(maskClamp.x, uv.x) +\n step(maskClamp.y, uv.y) +\n step(uv.x, maskClamp.z) +\n step(uv.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, uv);\n \n original *= (masky.r * masky.a * alpha * clip);\n\n gl_FragColor = original;\n}\n")||this;return t.maskMatrix=new i.Matrix2d,e.renderable=!1,t.maskSprite=e,t}return __extends(s,r),s.prototype.apply=function(e,t,r,i,n){var o=this.maskSprite,a=this.maskSprite.texture;a.valid&&(a.transform||(a.transform=new PIXI.TextureMatrix(a,0)),a.transform.update(),this.uniforms.mask=o.texture,this.uniforms.otherMatrix=s.calculateSpriteMatrix(n,this.maskMatrix,o).prepend(a.transform.mapCoord),this.uniforms.alpha=o.worldAlpha,this.uniforms.maskClamp=a.transform.uClampFrame,e.applyFilter(this,t,r))},s.calculateSpriteMatrix=function(e,t,r){var i=r.proj,n=e.sourceFrame,o=e.renderTarget.size,a=i&&!i._affine?i.world.copyTo2dOr3d(u):u.copyFrom(r.transform.worldTransform),s=r.texture.orig;return t.set(o.width,0,0,o.height,n.x,n.y),a.invert(),t.setToMult(a,t),t.scaleAndTranslate(1/s.width,1/s.height,r.anchor.x,r.anchor.y),t},s}(PIXI.Filter);i.SpriteMaskFilter2d=e}(pixi_projection||(pixi_projection={})),function(o){o.container3dWorldTransform=function(){return this.proj.affine?this.transform.worldTransform:this.proj.world};var e=function(t){function e(){var e=t.call(this)||this;return e.proj=new o.Projection3d(e.transform),e}return __extends(e,t),e.prototype.isFrontFace=function(e){void 0===e&&(e=!1),e&&(this._recursivePostUpdateTransform(),this.displayObjectUpdateTransform());var t=this.proj.world.mat4,r=t[0]*t[15]-t[3]*t[12],i=t[1]*t[15]-t[3]*t[13],n=t[4]*t[15]-t[7]*t[12];return 0<r*(t[5]*t[15]-t[7]*t[13])-n*i},e.prototype.getDepth=function(e){void 0===e&&(e=!1),e&&(this._recursivePostUpdateTransform(),this.displayObjectUpdateTransform());var t=this.proj.world.mat4;return t[14]/t[15]},e.prototype.toLocal=function(e,t,r,i,n){return void 0===n&&(n=o.TRANSFORM_STEP.ALL),t&&(e=t.toGlobal(e,r,i)),i||this._recursivePostUpdateTransform(),n===o.TRANSFORM_STEP.ALL?(i||this.displayObjectUpdateTransform(),this.proj.affine?this.transform.worldTransform.applyInverse(e,r):this.proj.world.applyInverse(e,r)):(this.parent?r=this.parent.worldTransform.applyInverse(e,r):r.copy(e),n===o.TRANSFORM_STEP.NONE||(r=this.transform.localTransform.applyInverse(r,r),n===o.TRANSFORM_STEP.PROJ&&this.proj.cameraMode&&(r=this.proj.cameraMatrix.applyInverse(r,r))),r)},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position3d",{get:function(){return this.proj.position},set:function(e){this.proj.position.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale3d",{get:function(){return this.proj.scale},set:function(e){this.proj.scale.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"euler",{get:function(){return this.proj.euler},set:function(e){this.proj.euler.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pivot3d",{get:function(){return this.proj.pivot},set:function(e){this.proj.pivot.copy(e)},enumerable:!0,configurable:!0}),e}(PIXI.Container);o.Container3d=e,o.container3dToLocal=e.prototype.toLocal,o.container3dGetDepth=e.prototype.getDepth,o.container3dIsFrontFace=e.prototype.isFrontFace}(pixi_projection||(pixi_projection={})),function(e){var t=function(t){function e(){var e=t.call(this)||this;return e._far=0,e._near=0,e._focus=0,e._orthographic=!1,e.proj.cameraMode=!0,e.setPlanes(400,10,1e4,!1),e}return __extends(e,t),Object.defineProperty(e.prototype,"far",{get:function(){return this._far},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"near",{get:function(){return this._near},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focus",{get:function(){return this._focus},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ortographic",{get:function(){return this._orthographic},enumerable:!0,configurable:!0}),e.prototype.setPlanes=function(e,t,r,i){void 0===t&&(t=10),void 0===r&&(r=1e4),void 0===i&&(i=!1),this._focus=e,this._near=t,this._far=r,this._orthographic=i;var n=this.proj,o=n.cameraMatrix.mat4;n._projID++,o[10]=1/(r-t),o[14]=(e-t)/(r-t),this._orthographic?o[11]=0:o[11]=1/e},e}(e.Container3d);e.Camera3d=t}(pixi_projection||(pixi_projection={})),function(e){var t=function(){function e(e,t,r){this._quatUpdateId=-1,this._quatDirtyId=0,this._sign=1,this._x=e||0,this._y=t||0,this._z=r||0,this.quaternion=new Float64Array(4),this.quaternion[3]=1,this.update()}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._quatDirtyId++)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._quatDirtyId++)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(e){this._z!==e&&(this._z=e,this._quatDirtyId++)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pitch",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._quatDirtyId++)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"yaw",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._quatDirtyId++)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"roll",{get:function(){return this._z},set:function(e){this._z!==e&&(this._z=e,this._quatDirtyId++)},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t,r){var i=e||0,n=t||0,o=r||0;this._x===i&&this._y===n&&this._z===o||(this._x=i,this._y=n,this._z=o,this._quatDirtyId++)},e.prototype.copy=function(e){var t=e.x,r=e.y,i=e.z;this._x===t&&this._y===r&&this._z===i||(this._x=t,this._y=r,this._z=i,this._quatDirtyId++)},e.prototype.clone=function(){return new e(this._x,this._y,this._z)},e.prototype.update=function(){if(this._quatUpdateId===this._quatDirtyId)return!1;this._quatUpdateId=this._quatDirtyId;var e=Math.cos(this._x/2),t=Math.cos(this._y/2),r=Math.cos(this._z/2),i=this._sign,n=i*Math.sin(this._x/2),o=i*Math.sin(this._y/2),a=i*Math.sin(this._z/2),s=this.quaternion;return s[0]=n*t*r+e*o*a,s[1]=e*o*r-n*t*a,s[2]=e*t*a+n*o*r,s[3]=e*t*r-n*o*a,!0},e}();e.Euler=t}(pixi_projection||(pixi_projection={})),function(b){var t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e=function(){function v(e){this.floatArray=null,this._dirtyId=0,this._updateId=-1,this._mat4inv=null,this.cacheInverse=!1,this.mat4=new Float64Array(e||t)}return Object.defineProperty(v.prototype,"a",{get:function(){return this.mat4[0]/this.mat4[15]},set:function(e){this.mat4[0]=e*this.mat4[15]},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"b",{get:function(){return this.mat4[1]/this.mat4[15]},set:function(e){this.mat4[1]=e*this.mat4[15]},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"c",{get:function(){return this.mat4[4]/this.mat4[15]},set:function(e){this.mat4[4]=e*this.mat4[15]},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"d",{get:function(){return this.mat4[5]/this.mat4[15]},set:function(e){this.mat4[5]=e*this.mat4[15]},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"tx",{get:function(){return this.mat4[12]/this.mat4[15]},set:function(e){this.mat4[12]=e*this.mat4[15]},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"ty",{get:function(){return this.mat4[13]/this.mat4[15]},set:function(e){this.mat4[13]=e*this.mat4[15]},enumerable:!0,configurable:!0}),v.prototype.set=function(e,t,r,i,n,o){var a=this.mat4;return a[0]=e,a[1]=t,a[2]=0,a[3]=0,a[4]=r,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=n,a[13]=o,a[14]=0,a[15]=1,this},v.prototype.toArray=function(e,t){this.floatArray||(this.floatArray=new Float32Array(9));var r=t||this.floatArray,i=this.mat4;return e?(r[0]=i[0],r[1]=i[1],r[2]=i[3],r[3]=i[4],r[4]=i[5],r[5]=i[7],r[6]=i[12],r[7]=i[13]):(r[0]=i[0],r[1]=i[4],r[2]=i[12],r[3]=i[2],r[4]=i[6],r[5]=i[13],r[6]=i[3],r[7]=i[7]),r[8]=i[15],r},v.prototype.setToTranslation=function(e,t,r){var i=this.mat4;i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=e,i[13]=t,i[14]=r,i[15]=1},v.prototype.setToRotationTranslationScale=function(e,t,r,i,n,o,a){var s=this.mat4,u=e[0],h=e[1],c=e[2],f=e[3],l=u+u,d=h+h,p=c+c,m=u*l,v=u*d,b=u*p,g=h*d,y=h*p,_=c*p,w=f*l,x=f*d,T=f*p;return s[0]=(1-(g+_))*n,s[1]=(v+T)*n,s[2]=(b-x)*n,s[3]=0,s[4]=(v-T)*o,s[5]=(1-(m+_))*o,s[6]=(y+w)*o,s[7]=0,s[8]=(b+x)*a,s[9]=(y-w)*a,s[10]=(1-(m+g))*a,s[11]=0,s[12]=t,s[13]=r,s[14]=i,s[15]=1,s},v.prototype.apply=function(e,t){t=t||new b.Point3d;var r=this.mat4,i=e.x,n=e.y,o=e.z,a=1/(r[3]*i+r[7]*n+r[11]*o+r[15]);return t.x=a*(r[0]*i+r[4]*n+r[8]*o+r[12]),t.y=a*(r[1]*i+r[5]*n+r[9]*o+r[13]),t.z=a*(r[2]*i+r[6]*n+r[10]*o+r[14]),t},v.prototype.translate=function(e,t,r){var i=this.mat4;return i[12]=i[0]*e+i[4]*t+i[8]*r+i[12],i[13]=i[1]*e+i[5]*t+i[9]*r+i[13],i[14]=i[2]*e+i[6]*t+i[10]*r+i[14],i[15]=i[3]*e+i[7]*t+i[11]*r+i[15],this},v.prototype.scale=function(e,t,r){var i=this.mat4;return i[0]*=e,i[1]*=e,i[2]*=e,i[3]*=e,i[4]*=t,i[5]*=t,i[6]*=t,i[7]*=t,void 0!==r&&(i[8]*=r,i[9]*=r,i[10]*=r,i[11]*=r),this},v.prototype.scaleAndTranslate=function(e,t,r,i,n,o){var a=this.mat4;a[0]=e*a[0]+i*a[3],a[1]=t*a[1]+n*a[3],a[2]=r*a[2]+o*a[3],a[4]=e*a[4]+i*a[7],a[5]=t*a[5]+n*a[7],a[6]=r*a[6]+o*a[7],a[8]=e*a[8]+i*a[11],a[9]=t*a[9]+n*a[11],a[10]=r*a[10]+o*a[11],a[12]=e*a[12]+i*a[15],a[13]=t*a[13]+n*a[15],a[14]=r*a[14]+o*a[15]},v.prototype.applyInverse=function(e,t){t=t||new b.Point3d,this._mat4inv||(this._mat4inv=new Float64Array(16));var r=this._mat4inv,i=this.mat4,n=e.x,o=e.y,a=e.z;this.cacheInverse&&this._updateId===this._dirtyId||(this._updateId=this._dirtyId,v.glMatrixMat4Invert(r,i));var s=1/(r[3]*n+r[7]*o+r[11]*a+r[15]),u=s*(r[0]*n+r[4]*o+r[8]*a+r[12]),h=s*(r[1]*n+r[5]*o+r[9]*a+r[13]),c=s*(r[2]*n+r[6]*o+r[10]*a+r[14]);a+=1;var f=1/(r[3]*n+r[7]*o+r[11]*a+r[15]),l=f*(r[0]*n+r[4]*o+r[8]*a+r[12]),d=f*(r[1]*n+r[5]*o+r[9]*a+r[13]),p=f*(r[2]*n+r[6]*o+r[10]*a+r[14]);Math.abs(c-p)<1e-10&&t.set(NaN,NaN,0);var m=(0-c)/(p-c);return t.set((l-u)*m+u,(d-h)*m+h,0),t},v.prototype.invert=function(){return v.glMatrixMat4Invert(this.mat4,this.mat4),this},v.prototype.invertCopyTo=function(e){this._mat4inv||(this._mat4inv=new Float64Array(16));var t=this._mat4inv,r=this.mat4;this.cacheInverse&&this._updateId===this._dirtyId||(this._updateId=this._dirtyId,v.glMatrixMat4Invert(t,r)),e.mat4.set(t)},v.prototype.identity=function(){var e=this.mat4;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},v.prototype.clone=function(){return new v(this.mat4)},v.prototype.copyTo=function(e){var t=this.mat4,r=e.mat4;return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],e},v.prototype.copyTo2d=function(e){var t=this.mat4,r=e.mat3;return r[0]=t[0],r[1]=t[1],r[2]=t[3],r[3]=t[4],r[4]=t[5],r[5]=t[7],r[6]=t[12],r[7]=t[13],r[8]=t[15],e},v.prototype.copyTo2dOr3d=function(e){return e instanceof b.Matrix2d?this.copyTo2d(e):this.copyTo(e)},v.prototype.copy=function(e,t,r){var i=this.mat4,n=1/i[15],o=i[12]*n,a=i[13]*n;if(e.a=(i[0]-i[3]*o)*n,e.b=(i[1]-i[3]*a)*n,e.c=(i[4]-i[7]*o)*n,e.d=(i[5]-i[7]*a)*n,e.tx=o,e.ty=a,2<=t){var s=e.a*e.d-e.b*e.c;r||(s=Math.abs(s)),t===b.AFFINE.POINT?(s=0<s?1:-1,e.a=s,e.b=0,e.c=0,e.d=s):t===b.AFFINE.AXIS_X?(s/=Math.sqrt(e.b*e.b+e.d*e.d),e.c=0,e.d=s):t===b.AFFINE.AXIS_Y&&(s/=Math.sqrt(e.a*e.a+e.c*e.c),e.a=s,e.c=0)}},v.prototype.copyFrom=function(e){var t=this.mat4;return t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.tx,t[13]=e.ty,t[14]=0,t[15]=1,this._dirtyId++,this},v.prototype.setToMultLegacy=function(e,t){var r=this.mat4,i=t.mat4,n=e.a,o=e.b,a=e.c,s=e.d,u=e.tx,h=e.ty,c=i[0],f=i[1],l=i[2],d=i[3];return r[0]=c*n+f*a+d*u,r[1]=c*o+f*s+d*h,r[2]=l,r[3]=d,c=i[4],f=i[5],l=i[6],d=i[7],r[4]=c*n+f*a+d*u,r[5]=c*o+f*s+d*h,r[6]=l,r[7]=d,c=i[8],f=i[9],l=i[10],d=i[11],r[8]=c*n+f*a+d*u,r[9]=c*o+f*s+d*h,r[10]=l,r[11]=d,c=i[12],f=i[13],l=i[14],d=i[15],r[12]=c*n+f*a+d*u,r[13]=c*o+f*s+d*h,r[14]=l,r[15]=d,this._dirtyId++,this},v.prototype.setToMultLegacy2=function(e,t){var r=this.mat4,i=e.mat4,n=i[0],o=i[1],a=i[2],s=i[3],u=i[4],h=i[5],c=i[6],f=i[7],l=t.a,d=t.b,p=t.c,m=t.d,v=t.tx,b=t.ty;return r[0]=l*n+d*u,r[1]=l*o+d*h,r[2]=l*a+d*c,r[3]=l*s+d*f,r[4]=p*n+m*u,r[5]=p*o+m*h,r[6]=p*a+m*c,r[7]=p*s+m*f,r[8]=i[8],r[9]=i[9],r[10]=i[10],r[11]=i[11],r[12]=v*n+b*u+i[12],r[13]=v*o+b*h+i[13],r[14]=v*a+b*c+i[14],r[15]=v*s+b*f+i[15],this._dirtyId++,this},v.prototype.setToMult=function(e,t){return v.glMatrixMat4Multiply(this.mat4,e.mat4,t.mat4),this._dirtyId++,this},v.prototype.prepend=function(e){e.mat4?this.setToMult(e,this):this.setToMultLegacy(e,this)},v.glMatrixMat4Invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=t[8],f=t[9],l=t[10],d=t[11],p=t[12],m=t[13],v=t[14],b=t[15],g=r*s-i*a,y=r*u-n*a,_=r*h-o*a,w=i*u-n*s,x=i*h-o*s,T=n*h-o*u,S=c*m-f*p,E=c*v-l*p,A=c*b-d*p,P=f*v-l*m,M=f*b-d*m,C=l*b-d*v,k=g*C-y*M+_*P+w*A-x*E+T*S;return k?(k=1/k,e[0]=(s*C-u*M+h*P)*k,e[1]=(n*M-i*C-o*P)*k,e[2]=(m*T-v*x+b*w)*k,e[3]=(l*x-f*T-d*w)*k,e[4]=(u*A-a*C-h*E)*k,e[5]=(r*C-n*A+o*E)*k,e[6]=(v*_-p*T-b*y)*k,e[7]=(c*T-l*_+d*y)*k,e[8]=(a*M-s*A+h*S)*k,e[9]=(i*A-r*M-o*S)*k,e[10]=(p*x-m*_+b*g)*k,e[11]=(f*_-c*x-d*g)*k,e[12]=(s*E-a*P-u*S)*k,e[13]=(r*P-i*E+n*S)*k,e[14]=(m*y-p*w-v*g)*k,e[15]=(c*w-f*y+l*g)*k,e):null},v.glMatrixMat4Multiply=function(e,t,r){var i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],u=t[5],h=t[6],c=t[7],f=t[8],l=t[9],d=t[10],p=t[11],m=t[12],v=t[13],b=t[14],g=t[15],y=r[0],_=r[1],w=r[2],x=r[3];return e[0]=y*i+_*s+w*f+x*m,e[1]=y*n+_*u+w*l+x*v,e[2]=y*o+_*h+w*d+x*b,e[3]=y*a+_*c+w*p+x*g,y=r[4],_=r[5],w=r[6],x=r[7],e[4]=y*i+_*s+w*f+x*m,e[5]=y*n+_*u+w*l+x*v,e[6]=y*o+_*h+w*d+x*b,e[7]=y*a+_*c+w*p+x*g,y=r[8],_=r[9],w=r[10],x=r[11],e[8]=y*i+_*s+w*f+x*m,e[9]=y*n+_*u+w*l+x*v,e[10]=y*o+_*h+w*d+x*b,e[11]=y*a+_*c+w*p+x*g,y=r[12],_=r[13],w=r[14],x=r[15],e[12]=y*i+_*s+w*f+x*m,e[13]=y*n+_*u+w*l+x*v,e[14]=y*o+_*h+w*d+x*b,e[15]=y*a+_*c+w*p+x*g,e},v.IDENTITY=new v,v.TEMP_MATRIX=new v,v}();b.Matrix3d=e}(pixi_projection||(pixi_projection={})),function(t){var e=function(){function e(e,t,r,i,n){this.cb=e,this.scope=t,this._quatUpdateId=-1,this._quatDirtyId=0,this._sign=1,this._x=r||0,this._y=i||0,this._z=n||0,this.quaternion=new Float64Array(4),this.quaternion[3]=1,this.update()}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._quatDirtyId++,this.cb.call(this.scope))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._quatDirtyId++,this.cb.call(this.scope))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(e){this._z!==e&&(this._z=e,this._quatDirtyId++,this.cb.call(this.scope))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pitch",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._quatDirtyId++,this.cb.call(this.scope))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"yaw",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._quatDirtyId++,this.cb.call(this.scope))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"roll",{get:function(){return this._z},set:function(e){this._z!==e&&(this._z=e,this._quatDirtyId++,this.cb.call(this.scope))},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t,r){var i=e||0,n=t||0,o=r||0;this._x===i&&this._y===n&&this._z===o||(this._x=i,this._y=n,this._z=o,this._quatDirtyId++,this.cb.call(this.scope))},e.prototype.copy=function(e){var t=e.x,r=e.y,i=e.z;this._x===t&&this._y===r&&this._z===i||(this._x=t,this._y=r,this._z=i,this._quatDirtyId++,this.cb.call(this.scope))},e.prototype.clone=function(){return new t.Euler(this._x,this._y,this._z)},e.prototype.update=function(){if(this._quatUpdateId===this._quatDirtyId)return!1;this._quatUpdateId=this._quatDirtyId;var e=Math.cos(this._x/2),t=Math.cos(this._y/2),r=Math.cos(this._z/2),i=this._sign,n=i*Math.sin(this._x/2),o=i*Math.sin(this._y/2),a=i*Math.sin(this._z/2),s=this.quaternion;return s[0]=n*t*r+e*o*a,s[1]=e*o*r-n*t*a,s[2]=e*t*a+n*o*r,s[3]=e*t*r-n*o*a,!0},e}();t.ObservableEuler=e}(pixi_projection||(pixi_projection={})),function(e){PIXI.Point.prototype.z=0,PIXI.Point.prototype.set=function(e,t,r){this.x=e||0,this.y=void 0===t?this.x:t||0,this.z=void 0===t?this.x:r||0},PIXI.Point.prototype.copy=function(e){this.set(e.x,e.y,e.z)},PIXI.ObservablePoint.prototype._z=0,PIXI.ObservablePoint.prototype.set=function(e,t,r){var i=e||0,n=void 0===t?i:t||0,o=void 0===t?i:r||0;this._x===i&&this._y===n&&this._z===o||(this._x=i,this._y=n,this._z=o,this.cb.call(this.scope))},Object.defineProperty(PIXI.ObservablePoint.prototype,"z",{get:function(){return this._z},set:function(e){this._z!==e&&(this._z=e,this.cb.call(this.scope))},enumerable:!0,configurable:!0}),PIXI.ObservablePoint.prototype.copy=function(e){this._x===e.x&&this._y===e.y&&this._z===e.z||(this._x=e.x,this._y=e.y,this._z=e.z,this.cb.call(this.scope))};var t=function(n){function e(e,t,r){var i=n.call(this,e,t)||this;return i.z=r,i}return __extends(e,n),e}(PIXI.Point);e.Point3d=t,PIXI.Point3d=t}(pixi_projection||(pixi_projection={})),function(n){var a=new n.Matrix3d,e=function(i){function e(e,t){var r=i.call(this,e,t)||this;return r.cameraMatrix=null,r._cameraMode=!1,r.position=new PIXI.ObservablePoint(r.onChange,r,0,0),r.scale=new PIXI.ObservablePoint(r.onChange,r,1,1),r.euler=new n.ObservableEuler(r.onChange,r,0,0,0),r.pivot=new PIXI.ObservablePoint(r.onChange,r,0,0),r.local=new n.Matrix3d,r.world=new n.Matrix3d,r.local.cacheInverse=!0,r.world.cacheInverse=!0,r.position._z=0,r.scale._z=1,r.pivot._z=0,r}return __extends(e,i),Object.defineProperty(e.prototype,"cameraMode",{get:function(){return this._cameraMode},set:function(e){this._cameraMode!==e&&(this._cameraMode=e,this.euler._sign=this._cameraMode?-1:1,this.euler._quatDirtyId++,e&&(this.cameraMatrix=new n.Matrix3d))},enumerable:!0,configurable:!0}),e.prototype.onChange=function(){this._projID++},e.prototype.clear=function(){this.cameraMatrix&&this.cameraMatrix.identity(),this.position.set(0,0,0),this.scale.set(1,1,1),this.euler.set(0,0,0),this.pivot.set(0,0,0),i.prototype.clear.call(this)},e.prototype.updateLocalTransform=function(e){if(0!==this._projID){var t=this.local,r=this.euler,i=this.position,n=this.scale,o=this.pivot;if(r.update(),!this.cameraMode)return t.setToRotationTranslationScale(r.quaternion,i._x,i._y,i._z,n._x,n._y,n._z),t.translate(-o._x,-o._y,-o._z),void t.setToMultLegacy(e,t);t.setToMultLegacy(e,this.cameraMatrix),t.translate(o._x,o._y,o._z),t.scale(1/n._x,1/n._y,1/n._z),a.setToRotationTranslationScale(r.quaternion,0,0,0,1,1,1),t.setToMult(t,a),t.translate(-i._x,-i._y,-i._z),this.local._dirtyId++}else this.local.copyFrom(e)},e}(n.LinearProjection);n.Projection3d=e}(pixi_projection||(pixi_projection={})),function(s){var e=function(a){function e(e,t,r,i,n){var o=a.call(this,e,t,r,i,n)||this;return o.proj=new s.Projection3d(o.transform),o.pluginName="mesh2d",o}return __extends(e,a),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e.prototype.toLocal=function(e,t,r,i,n){return void 0===n&&(n=s.TRANSFORM_STEP.ALL),s.container3dToLocal.call(this,e,t,r,i,n)},e.prototype.isFrontFace=function(e){return s.container3dIsFrontFace.call(this,e)},e.prototype.getDepth=function(e){return s.container3dGetDepth.call(this,e)},Object.defineProperty(e.prototype,"position3d",{get:function(){return this.proj.position},set:function(e){this.proj.position.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale3d",{get:function(){return this.proj.scale},set:function(e){this.proj.scale.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"euler",{get:function(){return this.proj.euler},set:function(e){this.proj.euler.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pivot3d",{get:function(){return this.proj.pivot},set:function(e){this.proj.pivot.copy(e)},enumerable:!0,configurable:!0}),e}(PIXI.mesh.Mesh);s.Mesh3d=e}(pixi_projection||(pixi_projection={})),function(e){var t={worldTransform:{get:e.container3dWorldTransform,enumerable:!0,configurable:!0},position3d:{get:function(){return this.proj.position},set:function(e){this.proj.position.copy(e)}},scale3d:{get:function(){return this.proj.scale},set:function(e){this.proj.scale.copy(e)}},pivot3d:{get:function(){return this.proj.pivot},set:function(e){this.proj.pivot.copy(e)}},euler:{get:function(){return this.proj.euler},set:function(e){this.proj.euler.copy(e)}}};function r(){this.proj||(this.proj=new e.Projection3d(this.transform),this.toLocal=e.Container3d.prototype.toLocal,this.isFrontFace=e.Container3d.prototype.isFrontFace,this.getDepth=e.Container3d.prototype.getDepth,Object.defineProperties(this,t))}PIXI.Container.prototype.convertTo3d=r,PIXI.Sprite.prototype.convertTo3d=function(){this.proj||(this.calculateVertices=e.Sprite3d.prototype.calculateVertices,this.calculateTrimmedVertices=e.Sprite3d.prototype.calculateTrimmedVertices,this._calculateBounds=e.Sprite3d.prototype._calculateBounds,this.containsPoint=e.Sprite3d.prototype.containsPoint,this.pluginName="sprite2d",this.vertexData=new Float32Array(12),r.call(this))},PIXI.mesh.Mesh.prototype.convertTo3d=function(){this.proj||(this.pluginName="mesh2d",r.call(this))},PIXI.Container.prototype.convertSubtreeTo3d=function(){this.convertTo3d();for(var e=0;e<this.children.length;e++)this.children[e].convertSubtreeTo3d()}}(pixi_projection||(pixi_projection={})),function(o){var e=function(p){function e(e){var t=p.call(this,e)||this;return t.culledByFrustrum=!1,t.trimmedCulledByFrustrum=!1,t.proj=new o.Projection3d(t.transform),t.pluginName="sprite2d",t.vertexData=new Float32Array(12),t}return __extends(e,p),e.prototype._calculateBounds=function(){this.calculateVertices(),this.culledByFrustrum||(this.calculateTrimmedVertices(),this.trimmedCulledByFrustrum||this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.calculateVertices=function(){if(this.proj._affine)return 8!=this.vertexData.length&&(this.vertexData=new Float32Array(8)),void p.prototype.calculateVertices.call(this);12!=this.vertexData.length&&(this.vertexData=new Float32Array(12));var e=this.transform._worldID,t=this._texture._updateID;if(this._transformID!==e||this._textureID!==t){this._transformID=e,this._textureID=t;var r=this._texture,i=this.proj.world.mat4,n=this.vertexData,o=r.trim,a=r.orig,s=this._anchor,u=0,h=0,c=0,f=0;c=o?(u=(h=o.x-s._x*a.width)+o.width,(f=o.y-s._y*a.height)+o.height):(u=(h=-s._x*a.width)+a.width,(f=-s._y*a.height)+a.height);var l,d=!1;n[0]=i[0]*h+i[4]*f+i[12],n[1]=i[1]*h+i[5]*f+i[13],l=i[2]*h+i[6]*f+i[14],n[2]=i[3]*h+i[7]*f+i[15],d=d||l<0,n[3]=i[0]*u+i[4]*f+i[12],n[4]=i[1]*u+i[5]*f+i[13],l=i[2]*u+i[6]*f+i[14],n[5]=i[3]*u+i[7]*f+i[15],d=d||l<0,n[6]=i[0]*u+i[4]*c+i[12],n[7]=i[1]*u+i[5]*c+i[13],l=i[2]*u+i[6]*c+i[14],n[8]=i[3]*u+i[7]*c+i[15],d=d||l<0,n[9]=i[0]*h+i[4]*c+i[12],n[10]=i[1]*h+i[5]*c+i[13],l=i[2]*h+i[6]*c+i[14],n[11]=i[3]*h+i[7]*c+i[15],d=d||l<0,this.culledByFrustrum=d}},e.prototype.calculateTrimmedVertices=function(){if(this.proj._affine)p.prototype.calculateTrimmedVertices.call(this);else{var e=this.transform._worldID,t=this._texture._updateID;if(this.vertexTrimmedData){if(this._transformTrimmedID===e&&this._textureTrimmedID===t)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=e,this._textureTrimmedID=t;var r=this._texture,i=this.vertexTrimmedData,n=r.orig,o=this._anchor,a=this.proj.world.mat4,s=-o._x*n.width,u=s+n.width,h=-o._y*n.height,c=h+n.height,f=!1,l=1/(a[3]*s+a[7]*h+a[15]);i[0]=l*(a[0]*s+a[4]*h+a[12]),i[1]=l*(a[1]*s+a[5]*h+a[13]);var d=a[2]*s+a[6]*h+a[14];f=f||d<0,l=1/(a[3]*u+a[7]*h+a[15]),i[2]=l*(a[0]*u+a[4]*h+a[12]),i[3]=l*(a[1]*u+a[5]*h+a[13]),d=a[2]*u+a[6]*h+a[14],f=f||d<0,l=1/(a[3]*u+a[7]*c+a[15]),i[4]=l*(a[0]*u+a[4]*c+a[12]),i[5]=l*(a[1]*u+a[5]*c+a[13]),d=a[2]*u+a[6]*c+a[14],f=f||d<0,l=1/(a[3]*s+a[7]*c+a[15]),i[6]=l*(a[0]*s+a[4]*c+a[12]),i[7]=l*(a[1]*s+a[5]*c+a[13]),d=a[2]*s+a[6]*c+a[14],f=f||d<0,this.trimmedCulledByFrustrum=f}},e.prototype._renderWebGL=function(e){this.calculateVertices(),this.culledByFrustrum||(e.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this))},e.prototype.containsPoint=function(e){return!this.culledByFrustrum&&p.prototype.containsPoint.call(this,e)},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e.prototype.toLocal=function(e,t,r,i,n){return void 0===n&&(n=o.TRANSFORM_STEP.ALL),o.container3dToLocal.call(this,e,t,r,i,n)},e.prototype.isFrontFace=function(e){return o.container3dIsFrontFace.call(this,e)},e.prototype.getDepth=function(e){return o.container3dGetDepth.call(this,e)},Object.defineProperty(e.prototype,"position3d",{get:function(){return this.proj.position},set:function(e){this.proj.position.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale3d",{get:function(){return this.proj.scale},set:function(e){this.proj.scale.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"euler",{get:function(){return this.proj.euler},set:function(e){this.proj.euler.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pivot3d",{get:function(){return this.proj.pivot},set:function(e){this.proj.pivot.copy(e)},enumerable:!0,configurable:!0}),e}(PIXI.Sprite);o.Sprite3d=e}(pixi_projection||(pixi_projection={})),function(o){var e=function(n){function e(e,t,r){var i=n.call(this,e,t,r)||this;return i.proj=new o.Projection3d(i.transform),i.pluginName="sprite2d",i.vertexData=new Float32Array(12),i}return __extends(e,n),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e.prototype.toLocal=function(e,t,r,i,n){return void 0===n&&(n=o.TRANSFORM_STEP.ALL),o.container3dToLocal.call(this,e,t,r,i,n)},e.prototype.isFrontFace=function(e){return o.container3dIsFrontFace.call(this,e)},e.prototype.getDepth=function(e){return o.container3dGetDepth.call(this,e)},Object.defineProperty(e.prototype,"position3d",{get:function(){return this.proj.position},set:function(e){this.proj.position.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale3d",{get:function(){return this.proj.scale},set:function(e){this.proj.scale.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"euler",{get:function(){return this.proj.euler},set:function(e){this.proj.euler.copy(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pivot3d",{get:function(){return this.proj.pivot},set:function(e){this.proj.pivot.copy(e)},enumerable:!0,configurable:!0}),e}(PIXI.Text);(o.Text3d=e).prototype.calculateVertices=o.Sprite3d.prototype.calculateVertices,e.prototype.calculateTrimmedVertices=o.Sprite3d.prototype.calculateTrimmedVertices,e.prototype._calculateBounds=o.Sprite3d.prototype._calculateBounds,e.prototype.containsPoint=o.Sprite3d.prototype.containsPoint,e.prototype._renderWebGL=o.Sprite3d.prototype._renderWebGL}(pixi_projection||(pixi_projection={})),function(l,d){"use strict";var p={},i=l.document,m=l.GreenSockGlobals=l.GreenSockGlobals||l,e=m[d];if(e)return"undefined"!=typeof module&&module.exports&&(module.exports=e);var t,r,n,v,b,o,a,g=function(e){var t,r=e.split("."),i=m;for(t=0;t<r.length;t++)i[r[t]]=i=i[r[t]]||{};return i},f=g("com.greensock"),y=1e-8,u=function(e){var t,r=[],i=e.length;for(t=0;t!==i;r.push(e[t++]));return r},_=function(){},w=(o=Object.prototype.toString,a=o.call([]),function(e){return null!=e&&(e instanceof Array||"object"==typeof e&&!!e.push&&o.call(e)===a)}),x={},T=function(s,u,h,c){this.sc=x[s]?x[s].sc:[],(x[s]=this).gsClass=null,this.func=h;var f=[];this.check=function(e){for(var t,r,i,n,o=u.length,a=o;-1<--o;)(t=x[u[o]]||new T(u[o],[])).gsClass?(f[o]=t.gsClass,a--):e&&t.sc.push(this);if(0===a&&h){if(i=(r=("com.greensock."+s).split(".")).pop(),n=g(r.join("."))[i]=this.gsClass=h.apply(h,f),c)if(m[i]=p[i]=n,"undefined"!=typeof module&&module.exports)if(s===d)for(o in module.exports=p[d]=n,p)n[o]=p[o];else p[d]&&(p[d][i]=n);else"function"==typeof define&&define.amd&&define((l.GreenSockAMDPath?l.GreenSockAMDPath+"/":"")+s.split(".").pop(),[],function(){return n});for(o=0;o<this.sc.length;o++)this.sc[o].check()}},this.check(!0)},s=l._gsDefine=function(e,t,r,i){return new T(e,t,r,i)},S=f._class=function(e,t,r){return t=t||function(){},s(e,[],function(){return t},r),t};s.globals=m;var h=[0,0,1,1],E=S("easing.Ease",function(e,t,r,i){this._func=e,this._type=r||0,this._power=i||0,this._params=t?h.concat(t):h},!0),A=E.map={},c=E.register=function(e,t,r,i){for(var n,o,a,s,u=t.split(","),h=u.length,c=(r||"easeIn,easeOut,easeInOut").split(",");-1<--h;)for(o=u[h],n=i?S("easing."+o,null,!0):f.easing[o]||{},a=c.length;-1<--a;)s=c[a],A[o+"."+s]=A[s+o]=n[s]=e.getRatio?e:e[s]||new e};for((n=E.prototype)._calcEnd=!1,n.getRatio=function(e){if(this._func)return this._params[0]=e,this._func.apply(null,this._params);var t=this._type,r=this._power,i=1===t?1-e:2===t?e:e<.5?2*e:2*(1-e);return 1===r?i*=i:2===r?i*=i*i:3===r?i*=i*i*i:4===r&&(i*=i*i*i*i),1===t?1-i:2===t?i:e<.5?i/2:1-i/2},r=(t=["Linear","Quad","Cubic","Quart","Quint,Strong"]).length;-1<--r;)n=t[r]+",Power"+r,c(new E(null,null,1,r),n,"easeOut",!0),c(new E(null,null,2,r),n,"easeIn"+(0===r?",easeNone":"")),c(new E(null,null,3,r),n,"easeInOut");A.linear=f.easing.Linear.easeIn,A.swing=f.easing.Quad.easeInOut;var P=S("events.EventDispatcher",function(e){this._listeners={},this._eventTarget=e||this});(n=P.prototype).addEventListener=function(e,t,r,i,n){n=n||0;var o,a,s=this._listeners[e],u=0;for(this!==v||b||v.wake(),null==s&&(this._listeners[e]=s=[]),a=s.length;-1<--a;)(o=s[a]).c===t&&o.s===r?s.splice(a,1):0===u&&o.pr<n&&(u=a+1);s.splice(u,0,{c:t,s:r,up:i,pr:n})},n.removeEventListener=function(e,t){var r,i=this._listeners[e];if(i)for(r=i.length;-1<--r;)if(i[r].c===t)return void i.splice(r,1)},n.dispatchEvent=function(e){var t,r,i,n=this._listeners[e];if(n)for(1<(t=n.length)&&(n=n.slice(0)),r=this._eventTarget;-1<--t;)(i=n[t])&&(i.up?i.c.call(i.s||r,{type:e,target:r}):i.c.call(i.s||r))};var M=l.requestAnimationFrame,C=l.cancelAnimationFrame,k=Date.now||function(){return(new Date).getTime()},I=k();for(r=(t=["ms","moz","webkit","o"]).length;-1<--r&&!M;)M=l[t[r]+"RequestAnimationFrame"],C=l[t[r]+"CancelAnimationFrame"]||l[t[r]+"CancelRequestAnimationFrame"];S("Ticker",function(e,t){var n,o,a,s,u,h=this,c=k(),r=!(!1===t||!M)&&"auto",f=500,l=33,d=function(e){var t,r,i=k()-I;f<i&&(c+=i-l),I+=i,h.time=(I-c)/1e3,t=h.time-u,(!n||0<t||!0===e)&&(h.frame++,u+=t+(s<=t?.004:s-t),r=!0),!0!==e&&(a=o(d)),r&&h.dispatchEvent("tick")};P.call(h),h.time=h.frame=0,h.tick=function(){d(!0)},h.lagSmoothing=function(e,t){if(!arguments.length)return f<1e8;f=e||1e8,l=Math.min(t,f,0)},h.sleep=function(){null!=a&&(r&&C?C(a):clearTimeout(a),o=_,a=null,h===v&&(b=!1))},h.wake=function(e){null!==a?h.sleep():e?c+=-I+(I=k()):10<h.frame&&(I=k()-f+5),o=0===n?_:r&&M?M:function(e){return setTimeout(e,1e3*(u-h.time)+1|0)},h===v&&(b=!0),d(2)},h.fps=function(e){if(!arguments.length)return n;s=1/((n=e)||60),u=this.time+s,h.wake()},h.useRAF=function(e){if(!arguments.length)return r;h.sleep(),r=e,h.fps(n)},h.fps(e),setTimeout(function(){"auto"===r&&h.frame<5&&"hidden"!==(i||{}).visibilityState&&h.useRAF(!1)},1500)}),(n=f.Ticker.prototype=new f.events.EventDispatcher).constructor=f.Ticker;var R=S("core.Animation",function(e,t){if(this.vars=t=t||{},this._duration=this._totalDuration=e||0,this._delay=Number(t.delay)||0,this._timeScale=1,this._active=!!t.immediateRender,this.data=t.data,this._reversed=!!t.reversed,Q){b||v.wake();var r=this.vars.useFrames?Z:Q;r.add(this,r._time),this.vars.paused&&this.paused(!0)}});v=R.ticker=new f.Ticker,(n=R.prototype)._dirty=n._gc=n._initted=n._paused=!1,n._totalTime=n._time=0,n._rawPrevTime=-1,n._next=n._last=n._onUpdate=n._timeline=n.timeline=null,n._paused=!1;var O=function(){b&&2e3<k()-I&&("hidden"!==(i||{}).visibilityState||!v.lagSmoothing())&&v.wake();var e=setTimeout(O,2e3);e.unref&&e.unref()};O(),n.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},n.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},n.resume=function(e,t){return null!=e&&this.seek(e,t),this.paused(!1)},n.seek=function(e,t){return this.totalTime(Number(e),!1!==t)},n.restart=function(e,t){return this.reversed(!1).paused(!1).totalTime(e?-this._delay:0,!1!==t,!0)},n.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},n.render=function(e,t,r){},n.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,!this._gc&&this.timeline||this._enabled(!0),this},n.isActive=function(){var e,t=this._timeline,r=this._startTime;return!t||!this._gc&&!this._paused&&t.isActive()&&(e=t.rawTime(!0))>=r&&e<r+this.totalDuration()/this._timeScale-y},n._enabled=function(e,t){return b||v.wake(),this._gc=!e,this._active=this.isActive(),!0!==t&&(e&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!e&&this.timeline&&this._timeline._remove(this,!0)),!1},n._kill=function(e,t){return this._enabled(!1,!1)},n.kill=function(e,t){return this._kill(e,t),this},n._uncache=function(e){for(var t=e?this:this.timeline;t;)t._dirty=!0,t=t.timeline;return this},n._swapSelfInParams=function(e){for(var t=e.length,r=e.concat();-1<--t;)"{self}"===e[t]&&(r[t]=this);return r},n._callback=function(e){var t=this.vars,r=t[e],i=t[e+"Params"],n=t[e+"Scope"]||t.callbackScope||this;switch(i?i.length:0){case 0:r.call(n);break;case 1:r.call(n,i[0]);break;case 2:r.call(n,i[0],i[1]);break;default:r.apply(n,i)}},n.eventCallback=function(e,t,r,i){if("on"===(e||"").substr(0,2)){var n=this.vars;if(1===arguments.length)return n[e];null==t?delete n[e]:(n[e]=t,n[e+"Params"]=w(r)&&-1!==r.join("").indexOf("{self}")?this._swapSelfInParams(r):r,n[e+"Scope"]=i),"onUpdate"===e&&(this._onUpdate=t)}return this},n.delay=function(e){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+e-this._delay),this._delay=e,this):this._delay},n.duration=function(e){return arguments.length?(this._duration=this._totalDuration=e,this._uncache(!0),this._timeline.smoothChildTiming&&0<this._time&&this._time<this._duration&&0!==e&&this.totalTime(this._totalTime*(e/this._duration),!0),this):(this._dirty=!1,this._duration)},n.totalDuration=function(e){return this._dirty=!1,arguments.length?this.duration(e):this._totalDuration},n.time=function(e,t){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(e>this._duration?this._duration:e,t)):this._time},n.totalTime=function(e,t,r){if(b||v.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(e<0&&!r&&(e+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var i=this._totalDuration,n=this._timeline;if(i<e&&!r&&(e=i),this._startTime=(this._paused?this._pauseTime:n._time)-(this._reversed?i-e:e)/this._timeScale,n._dirty||this._uncache(!1),n._timeline)for(;n._timeline;)n._timeline._time!==(n._startTime+n._totalTime)/n._timeScale&&n.totalTime(n._totalTime,!0),n=n._timeline}this._gc&&this._enabled(!0,!1),this._totalTime===e&&0!==this._duration||(j.length&&ee(),this.render(e,t,!1),j.length&&ee())}return this},n.progress=n.totalProgress=function(e,t){var r=this.duration();return arguments.length?this.totalTime(r*e,t):r?this._time/r:this.ratio},n.startTime=function(e){return arguments.length?(e!==this._startTime&&(this._startTime=e,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,e-this._delay)),this):this._startTime},n.endTime=function(e){return this._startTime+(0!=e?this.totalDuration():this.duration())/this._timeScale},n.timeScale=function(e){if(!arguments.length)return this._timeScale;var t,r;for(e=e||y,this._timeline&&this._timeline.smoothChildTiming&&(r=(t=this._pauseTime)||0===t?t:this._timeline.totalTime(),this._startTime=r-(r-this._startTime)*this._timeScale/e),this._timeScale=e,r=this.timeline;r&&r.timeline;)r._dirty=!0,r.totalDuration(),r=r.timeline;return this},n.reversed=function(e){return arguments.length?(e!=this._reversed&&(this._reversed=e,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},n.paused=function(e){if(!arguments.length)return this._paused;var t,r,i=this._timeline;return e!=this._paused&&i&&(b||e||v.wake(),r=(t=i.rawTime())-this._pauseTime,!e&&i.smoothChildTiming&&(this._startTime+=r,this._uncache(!1)),this._pauseTime=e?t:null,this._paused=e,this._active=this.isActive(),!e&&0!=r&&this._initted&&this.duration()&&(t=i.smoothChildTiming?this._totalTime:(t-this._startTime)/this._timeScale,this.render(t,t===this._totalTime,!0))),this._gc&&!e&&this._enabled(!0,!1),this};var D=S("core.SimpleTimeline",function(e){R.call(this,0,e),this.autoRemoveChildren=this.smoothChildTiming=!0});(n=D.prototype=new R).constructor=D,n.kill()._gc=!1,n._first=n._last=n._recent=null,n._sortChildren=!1,n.add=n.insert=function(e,t,r,i){var n,o;if(e._startTime=Number(t||0)+e._delay,e._paused&&this!==e._timeline&&(e._pauseTime=this.rawTime()-(e._timeline.rawTime()-e._pauseTime)),e.timeline&&e.timeline._remove(e,!0),e.timeline=e._timeline=this,e._gc&&e._enabled(!0,!0),n=this._last,this._sortChildren)for(o=e._startTime;n&&n._startTime>o;)n=n._prev;return n?(e._next=n._next,n._next=e):(e._next=this._first,this._first=e),e._next?e._next._prev=e:this._last=e,e._prev=n,this._recent=e,this._timeline&&this._uncache(!0),this},n._remove=function(e,t){return e.timeline===this&&(t||e._enabled(!1,!0),e._prev?e._prev._next=e._next:this._first===e&&(this._first=e._next),e._next?e._next._prev=e._prev:this._last===e&&(this._last=e._prev),e._next=e._prev=e.timeline=null,e===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(e,t,r){var i,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=e;n;)i=n._next,(n._active||e>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(e-n._startTime)*n._timeScale,t,r):n.render((e-n._startTime)*n._timeScale,t,r)),n=i},n.rawTime=function(){return b||v.wake(),this._totalTime};var L=S("TweenLite",function(e,t,r){if(R.call(this,t,r),this.render=L.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:L.selector(e)||e;var i,n,o,a=e.jquery||e.length&&e!==l&&e[0]&&(e[0]===l||e[0].nodeType&&e[0].style&&!e.nodeType),s=this.vars.overwrite;if(this._overwrite=s=null==s?K[L.defaultOverwrite]:"number"==typeof s?s>>0:K[s],(a||e instanceof Array||e.push&&w(e))&&"number"!=typeof e[0])for(this._targets=o=u(e),this._propLookup=[],this._siblings=[],i=0;i<o.length;i++)(n=o[i])?"string"!=typeof n?n.length&&n!==l&&n[0]&&(n[0]===l||n[0].nodeType&&n[0].style&&!n.nodeType)?(o.splice(i--,1),this._targets=o=o.concat(u(n))):(this._siblings[i]=te(n,this,!1),1===s&&1<this._siblings[i].length&&ie(n,this,null,1,this._siblings[i])):"string"==typeof(n=o[i--]=L.selector(n))&&o.splice(i+1,1):o.splice(i--,1);else this._propLookup={},this._siblings=te(e,this,!1),1===s&&1<this._siblings.length&&ie(e,this,null,1,this._siblings);(this.vars.immediateRender||0===t&&0===this._delay&&!1!==this.vars.immediateRender)&&(this._time=-y,this.render(Math.min(0,-this._delay)))},!0),F=function(e){return e&&e.length&&e!==l&&e[0]&&(e[0]===l||e[0].nodeType&&e[0].style&&!e.nodeType)};(n=L.prototype=new R).constructor=L,n.kill()._gc=!1,n.ratio=0,n._firstPT=n._targets=n._overwrittenProps=n._startAt=null,n._notifyPluginsOfEnabled=n._lazy=!1,L.version="2.1.2",L.defaultEase=n._ease=new E(null,null,1,1),L.defaultOverwrite="auto",L.ticker=v,L.autoSleep=120,L.lagSmoothing=function(e,t){v.lagSmoothing(e,t)},L.selector=l.$||l.jQuery||function(e){var t=l.$||l.jQuery;return t?(L.selector=t)(e):(i||(i=l.document),i?i.querySelectorAll?i.querySelectorAll(e):i.getElementById("#"===e.charAt(0)?e.substr(1):e):e)};var j=[],B={},N=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,U=/[\+-]=-?[\.\d]/,z=function(e){for(var t,r=this._firstPT;r;)t=r.blob?1===e&&null!=this.end?this.end:e?this.join(""):this.start:r.c*e+r.s,r.m?t=r.m.call(this._tween,t,this._target||r.t,this._tween):t<1e-6&&-1e-6<t&&!r.blob&&(t=0),r.f?r.fp?r.t[r.p](r.fp,t):r.t[r.p](t):r.t[r.p]=t,r=r._next},X=function(e){return(1e3*e|0)/1e3+""},q=function(e,t,r,i){var n,o,a,s,u,h,c,f=[],l=0,d="",p=0;for(f.start=e,f.end=t,e=f[0]=e+"",t=f[1]=t+"",r&&(r(f),e=f[0],t=f[1]),f.length=0,n=e.match(N)||[],o=t.match(N)||[],i&&(i._next=null,i.blob=1,f._firstPT=f._applyPT=i),u=o.length,s=0;s<u;s++)c=o[s],d+=(h=t.substr(l,t.indexOf(c,l)-l))||!s?h:",",l+=h.length,p?p=(p+1)%5:"rgba("===h.substr(-5)&&(p=1),c===n[s]||n.length<=s?d+=c:(d&&(f.push(d),d=""),a=parseFloat(n[s]),f.push(a),f._firstPT={_next:f._firstPT,t:f,p:f.length-1,s:a,c:("="===c.charAt(1)?parseInt(c.charAt(0)+"1",10)*parseFloat(c.substr(2)):parseFloat(c)-a)||0,f:0,m:p&&p<4?Math.round:X}),l+=c.length;return(d+=t.substr(l))&&f.push(d),f.setRatio=z,U.test(t)&&(f.end=null),f},H=function(e,t,r,i,n,o,a,s,u){"function"==typeof i&&(i=i(u||0,e));var h=typeof e[t],c="function"!=h?"":t.indexOf("set")||"function"!=typeof e["get"+t.substr(3)]?t:"get"+t.substr(3),f="get"!==r?r:c?a?e[c](a):e[c]():e[t],l="string"==typeof i&&"="===i.charAt(1),d={t:e,p:t,s:f,f:"function"==h,pg:0,n:n||t,m:o?"function"==typeof o?o:Math.round:0,pr:0,c:l?parseInt(i.charAt(0)+"1",10)*parseFloat(i.substr(2)):parseFloat(i)-f||0};if(("number"!=typeof f||"number"!=typeof i&&!l)&&(a||isNaN(f)||!l&&isNaN(i)||"boolean"==typeof f||"boolean"==typeof i?(d.fp=a,d={t:q(f,l?parseFloat(d.s)+d.c+(d.s+"").replace(/[0-9\-\.]/g,""):i,s||L.defaultStringFilter,d),p:"setRatio",s:0,c:1,f:2,pg:0,n:n||t,pr:0,m:0}):(d.s=parseFloat(f),l||(d.c=parseFloat(i)-d.s||0))),d.c)return(d._next=this._firstPT)&&(d._next._prev=d),this._firstPT=d},G=L._internals={isArray:w,isSelector:F,lazyTweens:j,blobDif:q},V=L._plugins={},Y=G.tweenLookup={},W=0,J=G.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1,callbackScope:1,stringFilter:1,id:1,yoyoEase:1,stagger:1},K={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,true:1,false:0},Z=R._rootFramesTimeline=new D,Q=R._rootTimeline=new D,$=30,ee=G.lazyRender=function(){var e,t,r=j.length;for(B={},e=0;e<r;e++)(t=j[e])&&!1!==t._lazy&&(t.render(t._lazy[0],t._lazy[1],!0),t._lazy=!1);j.length=0};Q._startTime=v.time,Z._startTime=v.frame,Q._active=Z._active=!0,setTimeout(ee,1),R._updateRoot=L.render=function(){var e,t,r;if(j.length&&ee(),Q.render((v.time-Q._startTime)*Q._timeScale,!1,!1),Z.render((v.frame-Z._startTime)*Z._timeScale,!1,!1),j.length&&ee(),v.frame>=$){for(r in $=v.frame+(parseInt(L.autoSleep,10)||120),Y){for(e=(t=Y[r].tweens).length;-1<--e;)t[e]._gc&&t.splice(e,1);0===t.length&&delete Y[r]}if((!(r=Q._first)||r._paused)&&L.autoSleep&&!Z._first&&1===v._listeners.tick.length){for(;r&&r._paused;)r=r._next;r||v.sleep()}}},v.addEventListener("tick",R._updateRoot);var te=function(e,t,r){var i,n,o=e._gsTweenID;if(Y[o||(e._gsTweenID=o="t"+W++)]||(Y[o]={target:e,tweens:[]}),t&&((i=Y[o].tweens)[n=i.length]=t,r))for(;-1<--n;)i[n]===t&&i.splice(n,1);return Y[o].tweens},re=function(e,t,r,i){var n,o,a=e.vars.onOverwrite;return a&&(n=a(e,t,r,i)),(a=L.onOverwrite)&&(o=a(e,t,r,i)),!1!==n&&!1!==o},ie=function(e,t,r,i,n){var o,a,s,u;if(1===i||4<=i){for(u=n.length,o=0;o<u;o++)if((s=n[o])!==t)s._gc||s._kill(null,e,t)&&(a=!0);else if(5===i)break;return a}var h,c=t._startTime+y,f=[],l=0,d=0===t._duration;for(o=n.length;-1<--o;)(s=n[o])===t||s._gc||s._paused||(s._timeline!==t._timeline?(h=h||ne(t,0,d),0===ne(s,h,d)&&(f[l++]=s)):s._startTime<=c&&s._startTime+s.totalDuration()/s._timeScale>c&&((d||!s._initted)&&c-s._startTime<=2e-8||(f[l++]=s)));for(o=l;-1<--o;)if(u=(s=f[o])._firstPT,2===i&&s._kill(r,e,t)&&(a=!0),2!==i||!s._firstPT&&s._initted&&u){if(2!==i&&!re(s,t))continue;s._enabled(!1,!1)&&(a=!0)}return a},ne=function(e,t,r){for(var i=e._timeline,n=i._timeScale,o=e._startTime;i._timeline;){if(o+=i._startTime,n*=i._timeScale,i._paused)return-100;i=i._timeline}return t<(o/=n)?o-t:r&&o===t||!e._initted&&o-t<2e-8?y:(o+=e.totalDuration()/e._timeScale/n)>t+y?0:o-t-y};n._init=function(){var e,t,r,i,n,o,a=this.vars,s=this._overwrittenProps,u=this._duration,h=!!a.immediateRender,c=a.ease,f=this._startAt;if(a.startAt){for(i in f&&(f.render(-1,!0),f.kill()),n={},a.startAt)n[i]=a.startAt[i];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=h&&!1!==a.lazy,n.startAt=n.delay=null,n.onUpdate=a.onUpdate,n.onUpdateParams=a.onUpdateParams,n.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=L.to(this.target||{},0,n),h)if(0<this._time)this._startAt=null;else if(0!==u)return}else if(a.runBackwards&&0!==u)if(f)f.render(-1,!0),f.kill(),this._startAt=null;else{for(i in 0!==this._time&&(h=!1),r={},a)J[i]&&"autoCSS"!==i||(r[i]=a[i]);if(r.overwrite=0,r.data="isFromStart",r.lazy=h&&!1!==a.lazy,r.immediateRender=h,this._startAt=L.to(this.target,0,r),h){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=c=c?c instanceof E?c:"function"==typeof c?new E(c,a.easeParams):A[c]||L.defaultEase:L.defaultEase,a.easeParams instanceof Array&&c.config&&(this._ease=c.config.apply(c,a.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(o=this._targets.length,e=0;e<o;e++)this._initProps(this._targets[e],this._propLookup[e]={},this._siblings[e],s?s[e]:null,e)&&(t=!0);else t=this._initProps(this.target,this._propLookup,this._siblings,s,0);if(t&&L._onPluginEvent("_onInitAllProps",this),s&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),a.runBackwards)for(r=this._firstPT;r;)r.s+=r.c,r.c=-r.c,r=r._next;this._onUpdate=a.onUpdate,this._initted=!0},n._initProps=function(e,t,r,i,n){var o,a,s,u,h,c;if(null==e)return!1;for(o in B[e._gsTweenID]&&ee(),this.vars.css||e.style&&e!==l&&e.nodeType&&V.css&&!1!==this.vars.autoCSS&&function(e,t){var r,i={};for(r in e)J[r]||r in t&&"transform"!==r&&"x"!==r&&"y"!==r&&"width"!==r&&"height"!==r&&"className"!==r&&"border"!==r||!(!V[r]||V[r]&&V[r]._autoCSS)||(i[r]=e[r],delete e[r]);e.css=i}(this.vars,e),this.vars)if(c=this.vars[o],J[o])c&&(c instanceof Array||c.push&&w(c))&&-1!==c.join("").indexOf("{self}")&&(this.vars[o]=c=this._swapSelfInParams(c,this));else if(V[o]&&(u=new V[o])._onInitTween(e,this.vars[o],this,n)){for(this._firstPT=h={_next:this._firstPT,t:u,p:"setRatio",s:0,c:1,f:1,n:o,pg:1,pr:u._priority,m:0},a=u._overwriteProps.length;-1<--a;)t[u._overwriteProps[a]]=this._firstPT;(u._priority||u._onInitAllProps)&&(s=!0),(u._onDisable||u._onEnable)&&(this._notifyPluginsOfEnabled=!0),h._next&&(h._next._prev=h)}else t[o]=H.call(this,e,o,"get",c,o,0,null,this.vars.stringFilter,n);return i&&this._kill(i,e)?this._initProps(e,t,r,i,n):1<this._overwrite&&this._firstPT&&1<r.length&&ie(e,this,t,this._overwrite,r)?(this._kill(t,e),this._initProps(e,t,r,i,n)):(this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration)&&(B[e._gsTweenID]=!0),s)},n.render=function(e,t,r){var i,n,o,a,s=this,u=s._time,h=s._duration,c=s._rawPrevTime;if(h-y<=e&&0<=e)s._totalTime=s._time=h,s.ratio=s._ease._calcEnd?s._ease.getRatio(1):1,s._reversed||(i=!0,n="onComplete",r=r||s._timeline.autoRemoveChildren),0===h&&(s._initted||!s.vars.lazy||r)&&(s._startTime===s._timeline._duration&&(e=0),(c<0||e<=0&&-y<=e||c===y&&"isPause"!==s.data)&&c!==e&&(r=!0,y<c&&(n="onReverseComplete")),s._rawPrevTime=a=!t||e||c===e?e:y);else if(e<y)s._totalTime=s._time=0,s.ratio=s._ease._calcEnd?s._ease.getRatio(0):0,(0!==u||0===h&&0<c)&&(n="onReverseComplete",i=s._reversed),-y<e?e=0:e<0&&(s._active=!1,0===h&&(s._initted||!s.vars.lazy||r)&&(0<=c&&(c!==y||"isPause"!==s.data)&&(r=!0),s._rawPrevTime=a=!t||e||c===e?e:y)),(!s._initted||s._startAt&&s._startAt.progress())&&(r=!0);else if(s._totalTime=s._time=e,s._easeType){var f=e/h,l=s._easeType,d=s._easePower;(1===l||3===l&&.5<=f)&&(f=1-f),3===l&&(f*=2),1===d?f*=f:2===d?f*=f*f:3===d?f*=f*f*f:4===d&&(f*=f*f*f*f),s.ratio=1===l?1-f:2===l?f:e/h<.5?f/2:1-f/2}else s.ratio=s._ease.getRatio(e/h);if(s._time!==u||r){if(!s._initted){if(s._init(),!s._initted||s._gc)return;if(!r&&s._firstPT&&(!1!==s.vars.lazy&&s._duration||s.vars.lazy&&!s._duration))return s._time=s._totalTime=u,s._rawPrevTime=c,j.push(s),void(s._lazy=[e,t]);s._time&&!i?s.ratio=s._ease.getRatio(s._time/h):i&&s._ease._calcEnd&&(s.ratio=s._ease.getRatio(0===s._time?0:1))}for(!1!==s._lazy&&(s._lazy=!1),s._active||!s._paused&&s._time!==u&&0<=e&&(s._active=!0),0===u&&(s._startAt&&(0<=e?s._startAt.render(e,!0,r):n||(n="_dummyGS")),s.vars.onStart&&(0===s._time&&0!==h||t||s._callback("onStart"))),o=s._firstPT;o;)o.f?o.t[o.p](o.c*s.ratio+o.s):o.t[o.p]=o.c*s.ratio+o.s,o=o._next;s._onUpdate&&(e<0&&s._startAt&&-1e-4!==e&&s._startAt.render(e,!0,r),t||(s._time!==u||i||r)&&s._callback("onUpdate")),n&&(s._gc&&!r||(e<0&&s._startAt&&!s._onUpdate&&-1e-4!==e&&s._startAt.render(e,!0,r),i&&(s._timeline.autoRemoveChildren&&s._enabled(!1,!1),s._active=!1),!t&&s.vars[n]&&s._callback(n),0===h&&s._rawPrevTime===y&&a!==y&&(s._rawPrevTime=0)))}},n._kill=function(e,t,r){if("all"===e&&(e=null),null==e&&(null==t||t===this.target))return this._lazy=!1,this._enabled(!1,!1);t="string"!=typeof t?t||this._targets||this.target:L.selector(t)||t;var i,n,o,a,s,u,h,c,f,l=r&&this._time&&r._startTime===this._startTime&&this._timeline===r._timeline,d=this._firstPT;if((w(t)||F(t))&&"number"!=typeof t[0])for(i=t.length;-1<--i;)this._kill(e,t[i],r)&&(u=!0);else{if(this._targets){for(i=this._targets.length;-1<--i;)if(t===this._targets[i]){s=this._propLookup[i]||{},this._overwrittenProps=this._overwrittenProps||[],n=this._overwrittenProps[i]=e?this._overwrittenProps[i]||{}:"all";break}}else{if(t!==this.target)return!1;s=this._propLookup,n=this._overwrittenProps=e?this._overwrittenProps||{}:"all"}if(s){if(h=e||s,c=e!==n&&"all"!==n&&e!==s&&("object"!=typeof e||!e._tempKill),r&&(L.onOverwrite||this.vars.onOverwrite)){for(o in h)s[o]&&(f||(f=[]),f.push(o));if((f||!e)&&!re(this,r,t,f))return!1}for(o in h)(a=s[o])&&(l&&(a.f?a.t[a.p](a.s):a.t[a.p]=a.s,u=!0),a.pg&&a.t._kill(h)&&(u=!0),a.pg&&0!==a.t._overwriteProps.length||(a._prev?a._prev._next=a._next:a===this._firstPT&&(this._firstPT=a._next),a._next&&(a._next._prev=a._prev),a._next=a._prev=null),delete s[o]),c&&(n[o]=1);!this._firstPT&&this._initted&&d&&this._enabled(!1,!1)}}return u},n.invalidate=function(){this._notifyPluginsOfEnabled&&L._onPluginEvent("_onDisable",this);var e=this._time;return this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],R.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-y,this.render(e,!1,!1!==this.vars.lazy)),this},n._enabled=function(e,t){if(b||v.wake(),e&&this._gc){var r,i=this._targets;if(i)for(r=i.length;-1<--r;)this._siblings[r]=te(i[r],this,!0);else this._siblings=te(this.target,this,!0)}return R.prototype._enabled.call(this,e,t),!(!this._notifyPluginsOfEnabled||!this._firstPT)&&L._onPluginEvent(e?"_onEnable":"_onDisable",this)},L.to=function(e,t,r){return new L(e,t,r)},L.from=function(e,t,r){return r.runBackwards=!0,r.immediateRender=0!=r.immediateRender,new L(e,t,r)},L.fromTo=function(e,t,r,i){return i.startAt=r,i.immediateRender=0!=i.immediateRender&&0!=r.immediateRender,new L(e,t,i)},L.delayedCall=function(e,t,r,i,n){return new L(t,0,{delay:e,onComplete:t,onCompleteParams:r,callbackScope:i,onReverseComplete:t,onReverseCompleteParams:r,immediateRender:!1,lazy:!1,useFrames:n,overwrite:0})},L.set=function(e,t){return new L(e,0,t)},L.getTweensOf=function(e,t){if(null==e)return[];var r,i,n,o;if(e="string"!=typeof e?e:L.selector(e)||e,(w(e)||F(e))&&"number"!=typeof e[0]){for(r=e.length,i=[];-1<--r;)i=i.concat(L.getTweensOf(e[r],t));for(r=i.length;-1<--r;)for(o=i[r],n=r;-1<--n;)o===i[n]&&i.splice(r,1)}else if(e._gsTweenID)for(r=(i=te(e).concat()).length;-1<--r;)(i[r]._gc||t&&!i[r].isActive())&&i.splice(r,1);return i||[]},L.killTweensOf=L.killDelayedCallsTo=function(e,t,r){"object"==typeof t&&(r=t,t=!1);for(var i=L.getTweensOf(e,t),n=i.length;-1<--n;)i[n]._kill(r,e)};var oe=S("plugins.TweenPlugin",function(e,t){this._overwriteProps=(e||"").split(","),this._propName=this._overwriteProps[0],this._priority=t||0,this._super=oe.prototype},!0);if(n=oe.prototype,oe.version="1.19.0",oe.API=2,n._firstPT=null,n._addTween=H,n.setRatio=z,n._kill=function(e){var t,r=this._overwriteProps,i=this._firstPT;if(null!=e[this._propName])this._overwriteProps=[];else for(t=r.length;-1<--t;)null!=e[r[t]]&&r.splice(t,1);for(;i;)null!=e[i.n]&&(i._next&&(i._next._prev=i._prev),i._prev?(i._prev._next=i._next,i._prev=null):this._firstPT===i&&(this._firstPT=i._next)),i=i._next;return!1},n._mod=n._roundProps=function(e){for(var t,r=this._firstPT;r;)(t=e[this._propName]||null!=r.n&&e[r.n.split(this._propName+"_").join("")])&&"function"==typeof t&&(2===r.f?r.t._applyPT.m=t:r.m=t),r=r._next},L._onPluginEvent=function(e,t){var r,i,n,o,a,s=t._firstPT;if("_onInitAllProps"===e){for(;s;){for(a=s._next,i=n;i&&i.pr>s.pr;)i=i._next;(s._prev=i?i._prev:o)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:o=s,s=a}s=t._firstPT=n}for(;s;)s.pg&&"function"==typeof s.t[e]&&s.t[e]()&&(r=!0),s=s._next;return r},oe.activate=function(e){for(var t=e.length;-1<--t;)e[t].API===oe.API&&(V[(new e[t])._propName]=e[t]);return!0},s.plugin=function(e){if(!(e&&e.propName&&e.init&&e.API))throw"illegal plugin definition.";var t,r=e.propName,i=e.priority||0,n=e.overwriteProps,o={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=S("plugins."+r.charAt(0).toUpperCase()+r.substr(1)+"Plugin",function(){oe.call(this,r,i),this._overwriteProps=n||[]},!0===e.global),s=a.prototype=new oe(r);for(t in(s.constructor=a).API=e.API,o)"function"==typeof e[t]&&(s[o[t]]=e[t]);return a.version=e.version,oe.activate([a]),a},t=l._gsQueue){for(r=0;r<t.length;r++)t[r]();for(n in x)x[n].func||l.console.log("GSAP encountered missing dependency: "+n)}b=!1}("undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,"TweenLite"),function(){"use strict";var f="undefined"==typeof WebKitCSSMatrix?new DOMMatrix:new WebKitCSSMatrix;function l(e,t,r){this.x=e,this.y=t,this.z=r}function d(t){try{return"undefined"==typeof WebKitCSSMatrix?new DOMMatrix(t):new WebKitCSSMatrix(t)}catch(e){return console.warn(t),console.warn(e.toString()),f}}function i(e){for(var t=f,r=e;null!=r&&r!==r.ownerDocument.documentElement;){var i=window.getComputedStyle(r,void 0).transform||"none";t=("none"===i?f:d(i)).multiply(t),r=r.parentNode}for(var n=e.offsetWidth,o=e.offsetHeight,a=4,s=1/0,u=1/0;0<=--a;){var h=new l(0===a||1===a?0:n,0===a||3===a?0:o,0).transformBy(t);h.x<s&&(s=h.x),h.y<u&&(u=h.y)}var c=e.getBoundingClientRect();return t=f.translate(window.pageXOffset+c.left-s,window.pageYOffset+c.top-u,0).multiply(t)}l.prototype.transformBy=function(e){var t=e.multiply(f.translate(this.x,this.y,this.z));return new l(t.m41,t.m42,t.m43)},window.convertPointFromPageToNode=function(e,t,r){return new l(t,r,0).transformBy(i(e).inverse())},window.convertPointFromNodeToPage=function(e,t,r){return new l(t,r,0).transformBy(i(e))}}();