Ricky Reusser 5bb63050f3 😊
2020-03-12 10:42:39 -07:00

1 line
147 KiB
JavaScript

!function(){return function e(t,n,r){function i(o,u){if(!n[o]){if(!t[o]){var s="function"==typeof require&&require;if(!u&&s)return s(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return i(n||e)},f,f.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}}()({1:[function(e,t,n){t.exports=function(e,t,n){return t<n?e<t?t:e>n?n:e:e<n?n:e>t?t:e}},{}],2:[function(e,t,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],3:[function(e,t,n){(function(n){"use strict";var r=e("color-name"),i=e("is-plain-obj"),a=e("defined");t.exports=function(e){var t,u,s=[],c=1;if("string"==typeof e)if(r[e])s=r[e].slice(),u="rgb";else if("transparent"===e)c=0,u="rgb",s=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var f=e.slice(1),l=f.length,p=l<=4;c=1,p?(s=[parseInt(f[0]+f[0],16),parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16)],4===l&&(c=parseInt(f[3]+f[3],16)/255)):(s=[parseInt(f[0]+f[1],16),parseInt(f[2]+f[3],16),parseInt(f[4]+f[5],16)],8===l&&(c=parseInt(f[6]+f[7],16)/255)),s[0]||(s[0]=0),s[1]||(s[1]=0),s[2]||(s[2]=0),u="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var d=t[1],f=d.replace(/a$/,"");u=f;var l="cmyk"===f?4:"gray"===f?1:3;s=t[2].trim().split(/\s*,\s*/).map(function(e,t){if(/%$/.test(e))return t===l?parseFloat(e)/100:"rgb"===f?255*parseFloat(e)/100:parseFloat(e);if("h"===f[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==o[e])return o[e]}return parseFloat(e)}),d===f&&s.push(1),c=void 0===s[l]?1:s[l],s=s.slice(0,l)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(s=e.match(/([0-9]+)/g).map(function(e){return parseFloat(e)}),u=e.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(e))if(i(e)){var h=a(e.r,e.red,e.R,null);null!==h?(u="rgb",s=[h,a(e.g,e.green,e.G),a(e.b,e.blue,e.B)]):(u="hsl",s=[a(e.h,e.hue,e.H),a(e.s,e.saturation,e.S),a(e.l,e.lightness,e.L,e.b,e.brightness)]),c=a(e.a,e.alpha,e.opacity,1),null!=e.opacity&&(c/=100)}else(Array.isArray(e)||n.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(e))&&(s=[e[0],e[1],e[2]],u="rgb",c=4===e.length?e[3]:1);else u="rgb",s=[e>>>16,(65280&e)>>>8,255&e];return{space:u,values:s,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":2,defined:8,"is-plain-obj":16}],4:[function(e,t,n){"use strict";var r=e("color-parse"),i=e("color-space/hsl"),a=e("clamp");t.exports=function(e){var t,n=r(e);return n.space?((t=Array(3))[0]=a(n.values[0],0,255),t[1]=a(n.values[1],0,255),t[2]=a(n.values[2],0,255),"h"===n.space[0]&&(t=i.rgb(t)),t.push(a(n.alpha,0,1)),t):[]}},{clamp:1,"color-parse":3,"color-space/hsl":5}],5:[function(e,t,n){"use strict";var r=e("./rgb");t.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t,n,r,i,a,o=e[0]/360,u=e[1]/100,s=e[2]/100;if(0===u)return[a=255*s,a,a];t=2*s-(n=s<.5?s*(1+u):s+u-s*u),i=[0,0,0];for(var c=0;c<3;c++)(r=o+1/3*-(c-1))<0?r++:r>1&&r--,a=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[c]=255*a;return i}},r.hsl=function(e){var t,n,r=e[0]/255,i=e[1]/255,a=e[2]/255,o=Math.min(r,i,a),u=Math.max(r,i,a),s=u-o;return u===o?t=0:r===u?t=(i-a)/s:i===u?t=2+(a-r)/s:a===u&&(t=4+(r-i)/s),(t=Math.min(60*t,360))<0&&(t+=360),n=(o+u)/2,[t,100*(u===o?0:n<=.5?s/(u+o):s/(2-u-o)),100*n]}},{"./rgb":6}],6:[function(e,t,n){"use strict";t.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],7:[function(e,t,n){"use strict";t.exports=function e(t,n){if(!Array.isArray(t)&&t.values){var r=t;if(1===r.alpha||void 0===r.alpha)return e(r.values,n||r.space);var t=r.values.slice();return t.push(r.alpha),e(t,n||r.space)}if("hex"===n){var a=t.slice(0,3).map(function(e){return(e<16?"0":"")+e.toString(16)}).join("");return a[0]===a[1]&&a[2]===a[3]&&a[4]===a[5]&&(a=a[0]+a[2]+a[4]),"#"+a}if("keyword"===n)return i[t];if("adobe1"===n)return"R:"+t[0]+", G:"+t[1]+", B:"+t[2];if("adobe2"===n)return"(R"+t[0]+" / G"+t[1]+" / B"+t[2]+")";var o,u;"percent"===n&&(n="rgb",t=t.map(function(e,t){return 3===t?e:Math.round(100*e/255)}),o=!0,u=!0);n=n||"rgb";o=o||"h"===n[0];u=u||/rgb|hs[lv]/i.test(n);u&&"a"===n[n.length-1]&&(n=n.slice(0,-1));var s=1;t.length>n.length&&(s=t.pop());var c=u&&s<1?"a":"";var a=n+c;a+="("+t.map(function(e,t){return o&&"h"!==n[t]?e+"%":e}).join(", ");a+=(s<1?", "+s:"")+")";return a};var r=e("color-name"),i={};for(var a in r)i[r[a]]=a},{"color-name":2}],8:[function(e,t,n){t.exports=function(){for(var e=0;e<arguments.length;e++)if(void 0!==arguments[e])return arguments[e]}},{}],9:[function(e,t,n){"use strict";var r=e("h");t.exports=function(e,t){return t=t||{},function(n,i){if(!n)return e&&e(i);if(n instanceof Error)n=n.name+": "+n.message;else if("string"!=typeof n)throw new Error("fail-nicely: Oops! the message must be a String or an Error. How ironic.");var a=void 0===t.zIndex?9999:parseInt(t.zIndex),o=void 0===t.bg?"#333":t.bg,u=void 0===t.fg?"#fff":t.fg,s=void 0===t.title?"Sorry!":t.title,c=void 0===t.fontFamily?"Helvetica, Arial, sans-serif":t.fontFamily,f=void 0===t.position?"fixed":t.position;if(void 0!==t.invert&&t.invert){var l=u;u=o,o=l}var p={position:f,top:0,right:0,bottom:0,left:0,"background-color":o,color:u,"text-align":"center","z-index":a},d={"font-family":c},h={"font-family":c,"max-width":"640px","margin-left":"auto","margin-right":"auto","line-height":"1.4",padding:"0 15px"};document.body.appendChild(r("div",{style:p},[r("div",{style:{transform:"translate(0, -50%)","margin-top":"50vh"}},[r("h1",s,{style:d}),r("p",n,{style:h})])]))}}},{h:14}],10:[function(e,t,n){t.exports=function(e){var t,n,r,i,a,o=e[0],u=e[1],s=e[2];if(0===u)return[a=s,a,a];n=s<.5?s*(1+u):s+u-s*u;t=2*s-n,i=[0,0,0];for(var c=0;c<3;c++)(r=o+1/3*-(c-1))<0&&r++,r>1&&r--,a=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[c]=a;return i}},{}],11:[function(e,t,n){t.exports=function(e){var t,n,r,i=e[0],a=e[1],o=e[2],u=Math.min(i,a,o),s=Math.max(i,a,o),c=s-u;s===u?t=0:i===s?t=(a-o)/c:a===s?t=2+(o-i)/c:o===s&&(t=4+(i-a)/c);(t=Math.min(60*t,360))<0&&(t+=360);r=(u+s)/2,n=s===u?0:r<=.5?c/(s+u):c/(2-s-u);return[t/360,n,r]}},{}],12:[function(e,t,n){var r=e("is-power-of-two");function i(e,t){if(!r(t))throw new Error(e+" must be a power of two. got "+e+" = "+t)}t.exports=function(e){var t,n,r,a,o,u,s;function c(){o=n,n=r,r=o}if((e=e||{}).forward=void 0===e.forward||e.forward,e.splitNormalization=void 0===e.splitNormalization||e.splitNormalization,void 0!==e.size)i("size",u=s=e.size);else{if(void 0===e.width||void 0===e.height)throw new Error("either size or both width and height must provided.");u=e.width,s=e.height,i("width",u),i("height",u)}n=e.ping,e.input===e.pong&&(n=e.pong),r=n===e.ping?e.pong:e.ping;var f=[],l=Math.round(Math.log(u)/Math.log(2)),p=l+Math.round(Math.log(s)/Math.log(2));if(e.output===(p%2==0?r:n)&&c(),e.input===r)throw new Error(["not enough framebuffers to compute without copying data. You may perform","the computation with only two framebuffers, but the output must equal","the input when an even number of iterations are required."].join(" "));for(t=0;t<p;t++)a={input:n,output:r,horizontal:t<l,forward:!!e.forward,resolution:[1/u,1/s]},0===t?a.input=e.input:t===p-1&&(a.output=e.output),0===t?e.splitNormalization?a.normalization=1/Math.sqrt(u*s):e.forward?a.normalization=1:a.normalization=1/u/s:a.normalization=1,a.subtransformSize=Math.pow(2,(a.horizontal?t:t-l)+1),f.push(a),c();return f}},{"is-power-of-two":17}],13:[function(e,t,n){t.exports=function(e){"string"==typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),n=[],r=0;r<e.length-1;r++)n.push(e[r],t[r]||"");return n.push(e[r]),n.join("")}},{}],14:[function(e,t,n){!function(){function e(){var e=[].slice.call(arguments),t=null;function n(e){if(null==e);else if("string"==typeof e)t?t.appendChild(document.createTextNode(e)):e.split(/([\.#]?[a-zA-Z0-9_-]+)/).forEach(function(e){var n=e.substring(1,e.length);e&&(t?"."===e[0]?t.classList.add(n):"#"===e[0]&&t.setAttribute("id",n):t=document.createElement(e))});else if("number"==typeof e||"boolean"==typeof e||e instanceof Date||e instanceof RegExp)t.appendChild(document.createTextNode(e.toString()));else if(Array.isArray(e))e.forEach(n);else if(e instanceof HTMLElement)t.appendChild(e);else if("object"==typeof e)for(var r in e)if("function"==typeof e[r])t.addEventListener(r,e[r]);else if("style"===r)for(var i in e[r])t.style.setProperty(i,e[r][i]);else t.setAttribute(r,e[r])}for(;e.length;)n(e.shift());return t}"object"==typeof t?t.exports=e:this.h=e}()},{}],15:[function(e,t,n){var r=[],i=[],a="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function o(e,t){if(t=t||{},void 0===e)throw new Error(a);var n,o=!0===t.prepend?"prepend":"append",u=void 0!==t.container?t.container:document.querySelector("head"),s=r.indexOf(u);return-1===s&&(s=r.push(u)-1,i[s]={}),void 0!==i[s]&&void 0!==i[s][o]?n=i[s][o]:(n=i[s][o]=function(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}(),"prepend"===o?u.insertBefore(n,u.childNodes[0]):u.appendChild(n)),65279===e.charCodeAt(0)&&(e=e.substr(1,e.length)),n.styleSheet?n.styleSheet.cssText+=e:n.textContent+=e,n}t.exports=o,t.exports.insertCss=o},{}],16:[function(e,t,n){"use strict";var r=Object.prototype.toString;t.exports=function(e){var t;return"[object Object]"===r.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}},{}],17:[function(e,t,n){t.exports=function(e){return 0!==e&&0==(e&e-1)}},{}],18:[function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=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={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,o,u=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var c in n=Object(arguments[s]))i.call(n,c)&&(u[c]=n[c]);if(r){o=r(n);for(var f=0;f<o.length;f++)a.call(n,o[f])&&(u[o[f]]=n[o[f]])}}return u}},{}],19:[function(e,t,n){(function(r){var i,a;i=this,a=function(e,t){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n="a abbr address area article aside audio b base bdi bdo big blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track u ul var video wbr circle clipPath defs ellipse g image line linearGradient mask path pattern polygon polyline radialGradient rect stop svg text tspan".split(" "),i="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,a="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("__preactCompatWrapper"):"__preactCompatWrapper",o={constructor:1,render:1,shouldComponentUpdate:1,componentWillReceiveProps:1,componentWillUpdate:1,componentDidUpdate:1,componentWillMount:1,componentDidMount:1,componentWillUnmount:1,componentDidUnmount:1},u=/^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vector|vert|word|writing|x)[A-Z]/,s={},c=!1;try{c="production"!==r.env.NODE_ENV}catch(e){}function f(){return null}var l=t.h("a",null).constructor;l.prototype.$$typeof=i,l.prototype.preactCompatUpgraded=!1,l.prototype.preactCompatNormalized=!1,Object.defineProperty(l.prototype,"type",{get:function(){return this.nodeName},set:function(e){this.nodeName=e},configurable:!0}),Object.defineProperty(l.prototype,"props",{get:function(){return this.attributes},set:function(e){this.attributes=e},configurable:!0});var p=t.options.event;t.options.event=function(e){return p&&(e=p(e)),e.persist=Object,e.nativeEvent=e,e};var d=t.options.vnode;function h(e,n,r){var i=n&&n._preactCompatRendered&&n._preactCompatRendered.base;i&&i.parentNode!==n&&(i=null),!i&&n&&(i=n.firstElementChild);for(var a=n.childNodes.length;a--;)n.childNodes[a]!==i&&n.removeChild(n.childNodes[a]);var o=t.render(e,n,i);return n&&(n._preactCompatRendered=o&&(o._component||{base:o})),"function"==typeof r&&r(),o&&o._component||o}t.options.vnode=function(e){if(!e.preactCompatUpgraded){e.preactCompatUpgraded=!0;var t=e.nodeName,n=e.attributes=null==e.attributes?{}:D({},e.attributes);"function"==typeof t?(!0===t[a]||t.prototype&&"isReactComponent"in t.prototype)&&(e.children&&""===String(e.children)&&(e.children=void 0),e.children&&(n.children=e.children),e.preactCompatNormalized||E(e),function(e){var t=e.nodeName,n=e.attributes;e.attributes={},t.defaultProps&&D(e.attributes,t.defaultProps);n&&D(e.attributes,n)}(e)):(e.children&&""===String(e.children)&&(e.children=void 0),e.children&&(n.children=e.children),n.defaultValue&&(n.value||0===n.value||(n.value=n.defaultValue),delete n.defaultValue),function(e,t){var n,r,i;if(t){for(i in t)if(n=u.test(i))break;if(n)for(i in r=e.attributes={},t)t.hasOwnProperty(i)&&(r[u.test(i)?i.replace(/([A-Z0-9])/,"-$1").toLowerCase():i]=t[i])}}(e,n))}d&&d(e)};var m=function(){};function b(e,n,r,i){var a=h(t.h(m,{context:e.context},n),r),o=a._component||a.base;return i&&i.call(o,a),o}function g(e){b(this,e.vnode,e.container)}m.prototype.getChildContext=function(){return this.props.context},m.prototype.render=function(e){return e.children[0]};var v,y=[],x={map:function(e,t,n){return null==e?null:(e=x.toArray(e),n&&n!==e&&(t=t.bind(n)),e.map(t))},forEach:function(e,t,n){if(null==e)return null;e=x.toArray(e),n&&n!==e&&(t=t.bind(n)),e.forEach(t)},count:function(e){return e&&e.length||0},only:function(e){if(1!==(e=x.toArray(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:function(e){return null==e?[]:y.concat(e)}};function w(e){return C.bind(null,e)}for(var _={},k=n.length;k--;)_[n[k]]=w(n[k]);function A(e){var t,n=e[a];return n?!0===n?e:n:(n=I({displayName:(t=e).displayName||t.name,render:function(){return t(this.props,this.context)}}),Object.defineProperty(n,a,{configurable:!0,value:!0}),n.displayName=e.displayName,n.propTypes=e.propTypes,n.defaultProps=e.defaultProps,Object.defineProperty(e,a,{configurable:!0,value:n}),n)}function C(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return function e(t,n){for(var r=n||0;r<t.length;r++){var i=t[r];Array.isArray(i)?e(i):i&&"object"==typeof i&&!T(i)&&(i.props&&i.type||i.attributes&&i.nodeName||i.children)&&(t[r]=C(i.type||i.nodeName,i.props||i.attributes,i.children))}}(e,2),E(t.h.apply(void 0,e))}function E(e){var t;e.preactCompatNormalized=!0,function(e){var t=e.attributes||(e.attributes={});S.enumerable="className"in t,t.className&&(t.class=t.className);Object.defineProperty(t,"className",S)}(e),"function"!=typeof(t=e.nodeName)||t.prototype&&t.prototype.render||(e.nodeName=A(e.nodeName));var n,r,i=e.attributes.ref,a=i&&typeof i;return!v||"string"!==a&&"number"!==a||(e.attributes.ref=(n=i,(r=v)._refProxies[n]||(r._refProxies[n]=function(e){r&&r.refs&&(r.refs[n]=e,null===e&&(delete r._refProxies[n],r=null))}))),function(e){var t=e.nodeName,n=e.attributes;if(!n||"string"!=typeof t)return;var r={};for(var i in n)r[i.toLowerCase()]=i;r.ondoubleclick&&(n.ondblclick=n[r.ondoubleclick],delete n[r.ondoubleclick]);if(r.onchange&&("textarea"===t||"input"===t.toLowerCase()&&!/^fil|che|rad/i.test(n.type))){var a=r.oninput||"oninput";n[a]||(n[a]=P([n[a],n[r.onchange]]),delete n[r.onchange])}}(e),e}function T(e){return e&&(e instanceof l||e.$$typeof===i)}var S={configurable:!0,get:function(){return this.class},set:function(e){this.class=e}};function D(e,t){for(var n=arguments,r=1,i=void 0;r<arguments.length;r++)if(i=n[r])for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a]);return e}function O(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}function j(){}function I(e){function t(e,t){!function(e){for(var t in e){var n=e[t];"function"!=typeof n||n.__bound||o.hasOwnProperty(t)||((e[t]=n.bind(e)).__bound=!0)}}(this),B.call(this,e,t,s),F.call(this,e,t)}return(e=D({constructor:t},e)).mixins&&function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=P(t[n].concat(e[n]||y),"getDefaultProps"===n||"getInitialState"===n||"getChildContext"===n))}(e,function(e){for(var t={},n=0;n<e.length;n++){var r=e[n];for(var i in r)r.hasOwnProperty(i)&&"function"==typeof r[i]&&(t[i]||(t[i]=[])).push(r[i])}return t}(e.mixins)),e.statics&&D(t,e.statics),e.propTypes&&(t.propTypes=e.propTypes),e.defaultProps&&(t.defaultProps=e.defaultProps),e.getDefaultProps&&(t.defaultProps=e.getDefaultProps.call(t)),j.prototype=B.prototype,t.prototype=D(new j,e),t.displayName=e.displayName||"Component",t}function R(e,t,n){if("string"==typeof t&&(t=e.constructor.prototype[t]),"function"==typeof t)return t.apply(e,n)}function P(e,t){return function(){for(var n,r=arguments,i=0;i<e.length;i++){var a=R(this,e[i],r);if(t&&null!=a)for(var o in n||(n={}),a)a.hasOwnProperty(o)&&(n[o]=a[o]);else void 0!==a&&(n=a)}return n}}function F(e,t){z.call(this,e,t),this.componentWillReceiveProps=P([z,this.componentWillReceiveProps||"componentWillReceiveProps"]),this.render=P([z,N,this.render||"render",M])}function z(t,n){if(t){var r=t.children;if(r&&Array.isArray(r)&&1===r.length&&("string"==typeof r[0]||"function"==typeof r[0]||r[0]instanceof l)&&(t.children=r[0],t.children&&"object"==typeof t.children&&(t.children.length=1,t.children[0]=t.children)),c){var i="function"==typeof this?this:this.constructor,a=this.propTypes||i.propTypes,o=this.displayName||i.name;a&&e.checkPropTypes(a,t,"prop",o)}}}function N(e){v=this}function M(){v===this&&(v=null)}function B(e,n,r){t.Component.call(this,e,n),this.state=this.getInitialState?this.getInitialState():{},this.refs={},this._refProxies={},r!==s&&F.call(this,e,n)}function L(e,t){B.call(this,e,t)}return D(B.prototype=new t.Component,{constructor:B,isReactComponent:{},replaceState:function(e,t){for(var n in this.setState(e,t),this.state)n in e||delete this.state[n]},getDOMNode:function(){return this.base},isMounted:function(){return!!this.base}}),j.prototype=B.prototype,L.prototype=new j,L.prototype.isPureReactComponent=!0,L.prototype.shouldComponentUpdate=function(e,t){return O(this.props,e)||O(this.state,t)},{version:"15.1.0",DOM:_,PropTypes:e,Children:x,render:h,createClass:I,createPortal:function(e,n){return t.h(g,{vnode:e,container:n})},createFactory:w,createElement:C,cloneElement:function(e,n){for(var r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];if(!T(e))return e;var a=e.attributes||e.props,o=[t.h(e.nodeName||e.type,D({},a),e.children||a&&a.children),n];return r&&r.length?o.push(r):n&&n.children&&o.push(n.children),E(t.cloneElement.apply(void 0,o))},isValidElement:T,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},unmountComponentAtNode:function(e){var n=e._preactCompatRendered&&e._preactCompatRendered.base;return!(!n||n.parentNode!==e||(t.render(t.h(f),e,n),0))},Component:B,PureComponent:L,unstable_renderSubtreeIntoContainer:b,unstable_batchedUpdates:function(e){e()},__spread:D}},"object"==typeof n&&void 0!==t?t.exports=a(e("prop-types"),e("preact")):"function"==typeof define&&define.amd?define(["prop-types","preact"],a):i.preactCompat=a(i.PropTypes,i.preact)}).call(this,e("_process"))},{_process:27,preact:26,"prop-types":24}],20:[function(e,t,n){t.exports=e("preact-compat").createClass},{"preact-compat":19}],21:[function(e,t,n){(function(n){"use strict";var r=function(){};if("production"!==n.env.NODE_ENV){var i=e("./lib/ReactPropTypesSecret"),a={};r=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}t.exports=function(e,t,o,u,s){if("production"!==n.env.NODE_ENV)for(var c in e)if(e.hasOwnProperty(c)){var f;try{if("function"!=typeof e[c]){var l=Error((u||"React class")+": "+o+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.");throw l.name="Invariant Violation",l}f=e[c](t,c,u,o,null,i)}catch(e){f=e}if(!f||f instanceof Error||r((u||"React class")+": type specification of "+o+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in a)){a[f.message]=!0;var p=s?s():"";r("Failed "+o+" type: "+f.message+(null!=p?p:""))}}}}).call(this,e("_process"))},{"./lib/ReactPropTypesSecret":25,_process:27}],22:[function(e,t,n){"use strict";var r=e("./lib/ReactPropTypesSecret");function i(){}t.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=i,n.PropTypes=n,n}},{"./lib/ReactPropTypesSecret":25}],23:[function(e,t,n){(function(n){"use strict";var r=e("object-assign"),i=e("./lib/ReactPropTypesSecret"),a=e("./checkPropTypes"),o=function(){};function u(){return null}"production"!==n.env.NODE_ENV&&(o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),t.exports=function(e,t){var s="function"==typeof Symbol&&Symbol.iterator,c="@@iterator";var f="<<anonymous>>",l={array:m("array"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:h(u),arrayOf:function(e){return h(function(t,n,r,a,o){if("function"!=typeof e)return new d("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var u=t[n];if(!Array.isArray(u)){var s=g(u);return new d("Invalid "+a+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected an array.")}for(var c=0;c<u.length;c++){var f=e(u,c,r,a,o+"["+c+"]",i);if(f instanceof Error)return f}return null})},element:function(){return h(function(t,n,r,i,a){var o=t[n];if(!e(o)){var u=g(o);return new d("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected a single ReactElement.")}return null})}(),instanceOf:function(e){return h(function(t,n,r,i,a){if(!(t[n]instanceof e)){var o=e.name||f,u=function(e){if(!e.constructor||!e.constructor.name)return f;return e.constructor.name}(t[n]);return new d("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected instance of `"+o+"`.")}return null})},node:function(){return h(function(e,t,n,r,i){if(!b(e[t]))return new d("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.");return null})}(),objectOf:function(e){return h(function(t,n,r,a,o){if("function"!=typeof e)return new d("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var u=t[n],s=g(u);if("object"!==s)return new d("Invalid "+a+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var c in u)if(u.hasOwnProperty(c)){var f=e(u,c,r,a,o+"."+c,i);if(f instanceof Error)return f}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==n.env.NODE_ENV&&o("Invalid argument supplied to oneOf, expected an instance of array."),u;return h(function(t,n,r,i,a){for(var o=t[n],u=0;u<e.length;u++)if(p(o,e[u]))return null;var s=JSON.stringify(e);return new d("Invalid "+i+" `"+a+"` of value `"+o+"` supplied to `"+r+"`, expected one of "+s+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==n.env.NODE_ENV&&o("Invalid argument supplied to oneOfType, expected an instance of array."),u;for(var t=0;t<e.length;t++){var r=e[t];if("function"!=typeof r)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+y(r)+" at index "+t+"."),u}return h(function(t,n,r,a,o){for(var u=0;u<e.length;u++){var s=e[u];if(null==s(t,n,r,a,o,i))return null}return new d("Invalid "+a+" `"+o+"` supplied to `"+r+"`.")})},shape:function(e){return h(function(t,n,r,a,o){var u=t[n],s=g(u);if("object"!==s)return new d("Invalid "+a+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected `object`.");for(var c in e){var f=e[c];if(f){var l=f(u,c,r,a,o+"."+c,i);if(l)return l}}return null})},exact:function(e){return h(function(t,n,a,o,u){var s=t[n],c=g(s);if("object"!==c)return new d("Invalid "+o+" `"+u+"` of type `"+c+"` supplied to `"+a+"`, expected `object`.");var f=r({},t[n],e);for(var l in f){var p=e[l];if(!p)return new d("Invalid "+o+" `"+u+"` key `"+l+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=p(s,l,a,o,u+"."+l,i);if(h)return h}return null})}};function p(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){this.message=e,this.stack=""}function h(e){if("production"!==n.env.NODE_ENV)var r={},a=0;function u(u,s,c,l,p,h,m){if(l=l||f,h=h||c,m!==i){if(t){var b=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw b.name="Invariant Violation",b}if("production"!==n.env.NODE_ENV&&"undefined"!=typeof console){var g=l+":"+c;!r[g]&&a<3&&(o("You are manually calling a React.PropTypes validation function for the `"+h+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),r[g]=!0,a++)}}return null==s[c]?u?null===s[c]?new d("The "+p+" `"+h+"` is marked as required in `"+l+"`, but its value is `null`."):new d("The "+p+" `"+h+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:e(s,c,l,p,h)}var s=u.bind(null,!1);return s.isRequired=u.bind(null,!0),s}function m(e){return h(function(t,n,r,i,a,o){var u=t[n];return g(u)!==e?new d("Invalid "+i+" `"+a+"` of type `"+v(u)+"` supplied to `"+r+"`, expected `"+e+"`."):null})}function b(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(b);if(null===t||e(t))return!0;var n=function(e){var t=e&&(s&&e[s]||e[c]);if("function"==typeof t)return t}(t);if(!n)return!1;var r,i=n.call(t);if(n!==t.entries){for(;!(r=i.next()).done;)if(!b(r.value))return!1}else for(;!(r=i.next()).done;){var a=r.value;if(a&&!b(a[1]))return!1}return!0;default:return!1}}function g(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}(t,e)?"symbol":t}function v(e){if(void 0===e||null===e)return""+e;var t=g(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function y(e){var t=v(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return d.prototype=Error.prototype,l.checkPropTypes=a,l.PropTypes=l,l}}).call(this,e("_process"))},{"./checkPropTypes":21,"./lib/ReactPropTypesSecret":25,_process:27,"object-assign":18}],24:[function(e,t,n){(function(n){if("production"!==n.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=e("./factoryWithTypeCheckers")(function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},!0)}else t.exports=e("./factoryWithThrowingShims")()}).call(this,e("_process"))},{"./factoryWithThrowingShims":22,"./factoryWithTypeCheckers":23,_process:27}],25:[function(e,t,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},{}],26:[function(e,t,n){!function(){"use strict";function e(e,t){var n,r,i,a,o=A;for(a=arguments.length;a-- >2;)k.push(arguments[a]);for(t&&null!=t.children&&(k.length||k.push(t.children),delete t.children);k.length;)if((r=k.pop())&&void 0!==r.pop)for(a=r.length;a--;)k.push(r[a]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof e)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&n?o[o.length-1]+=r:o===A?o=[r]:o.push(r),n=i;var u=new w;return u.nodeName=e,u.children=o,u.attributes=null==t?void 0:t,u.key=null==t?void 0:t.key,void 0!==_.vnode&&_.vnode(u),u}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==T.push(e)&&(_.debounceRendering||C)(i)}function i(){var e,t=T;for(T=[];e=t.pop();)e.__d&&v(e)}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function o(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var i in r)void 0===t[i]&&(t[i]=r[i]);return t}function u(e){var t=e.parentNode;t&&t.removeChild(e)}function s(e,t,n,r,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||i)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var a in n)a in r||(e.style[a]="");for(var a in r)e.style[a]="number"==typeof r[a]&&!1===E.test(a)?r[a]+"px":r[a]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var o=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,c,o):e.removeEventListener(t,c,o),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!i&&t in e){try{e[t]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t)}else{var u=i&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?u?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(u?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function c(e){return this.__l[e.type](_.event&&_.event(e)||e)}function f(){for(var e;e=S.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function l(e,t,n,r,i,a){D++||(O=null!=i&&void 0!==i.ownerSVGElement,j=null!=e&&!("__preactattr_"in e));var o=p(e,t,n,r,a);return i&&o.parentNode!==i&&i.appendChild(o),--D||(j=!1,a||f()),o}function p(e,t,n,r,i){var c=e,f=O;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||i)?e.nodeValue!=t&&(e.nodeValue=t):(c=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(c,e),d(e,!0))),c.__preactattr_=!0,c;var l,h,b=t.nodeName;if("function"==typeof b)return function(e,t,n,r){var i=e&&e._component,a=i,u=e,s=i&&e._componentConstructor===t.nodeName,c=s,f=o(t);for(;i&&!c&&(i=i.__u);)c=i.constructor===t.nodeName;i&&c&&(!r||i._component)?(g(i,f,3,n,r),e=i.base):(a&&!s&&(y(a),e=u=null),i=m(t.nodeName,f,n),e&&!i.__b&&(i.__b=e,u=null),g(i,f,1,n,r),e=i.base,u&&e!==u&&(u._component=null,d(u,!1)));return e}(e,t,n,r);if(O="svg"===b||"foreignObject"!==b&&O,b=String(b),(!e||!a(e,b))&&(l=b,(h=O?document.createElementNS("http://www.w3.org/2000/svg",l):document.createElement(l)).__n=l,c=h,e)){for(;e.firstChild;)c.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(c,e),d(e,!0)}var v=c.firstChild,x=c.__preactattr_,w=t.children;if(null==x){x=c.__preactattr_={};for(var _=c.attributes,k=_.length;k--;)x[_[k].name]=_[k].value}return!j&&w&&1===w.length&&"string"==typeof w[0]&&null!=v&&void 0!==v.splitText&&null==v.nextSibling?v.nodeValue!=w[0]&&(v.nodeValue=w[0]):(w&&w.length||null!=v)&&function(e,t,n,r,i){var o,s,c,f,l,h=e.childNodes,m=[],b={},g=0,v=0,y=h.length,x=0,w=t?t.length:0;if(0!==y)for(var _=0;_<y;_++){var k=h[_],A=k.__preactattr_,C=w&&A?k._component?k._component.__k:A.key:null;null!=C?(g++,b[C]=k):(A||(void 0!==k.splitText?!i||k.nodeValue.trim():i))&&(m[x++]=k)}if(0!==w)for(var _=0;_<w;_++){f=t[_],l=null;var C=f.key;if(null!=C)g&&void 0!==b[C]&&(l=b[C],b[C]=void 0,g--);else if(v<x)for(o=v;o<x;o++)if(void 0!==m[o]&&(E=s=m[o],S=i,"string"==typeof(T=f)||"number"==typeof T?void 0!==E.splitText:"string"==typeof T.nodeName?!E._componentConstructor&&a(E,T.nodeName):S||E._componentConstructor===T.nodeName)){l=s,m[o]=void 0,o===x-1&&x--,o===v&&v++;break}l=p(l,f,n,r),c=h[_],l&&l!==e&&l!==c&&(null==c?e.appendChild(l):l===c.nextSibling?u(c):e.insertBefore(l,c))}var E,T,S;if(g)for(var _ in b)void 0!==b[_]&&d(b[_],!1);for(;v<=x;)void 0!==(l=m[x--])&&d(l,!1)}(c,w,n,r,j||null!=x.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||s(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||s(e,r,n[r],n[r]=t[r],O)}(c,t.attributes,x),O=f,c}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||u(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function m(e,t,n){var r,i=I.length;for(e.prototype&&e.prototype.render?(r=new e(t,n),x.call(r,t,n)):((r=new x(t,n)).constructor=e,r.render=b);i--;)if(I[i].constructor===e)return r.__b=I[i].__b,I.splice(i,1),r;return r}function b(e,t,n){return this.constructor(e,n)}function g(e,t,n,i,a){e.__x||(e.__x=!0,e.__r=t.ref,e.__k=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||a?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,i)),i&&i!==e.context&&(e.__c||(e.__c=e.context),e.context=i),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):v(e,1,a)),e.__r&&e.__r(e))}function v(e,t,r,i){if(!e.__x){var a,u,s,c=e.props,p=e.state,h=e.context,b=e.__p||c,x=e.__s||p,w=e.__c||h,k=e.base,A=e.__b,C=k||A,E=e._component,T=!1,O=w;if(e.constructor.getDerivedStateFromProps&&(p=n(n({},p),e.constructor.getDerivedStateFromProps(c,p)),e.state=p),k&&(e.props=b,e.state=x,e.context=w,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(c,p,h)?T=!0:e.componentWillUpdate&&e.componentWillUpdate(c,p,h),e.props=c,e.state=p,e.context=h),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!T){a=e.render(c,p,h),e.getChildContext&&(h=n(n({},h),e.getChildContext())),k&&e.getSnapshotBeforeUpdate&&(O=e.getSnapshotBeforeUpdate(b,x));var j,I,R=a&&a.nodeName;if("function"==typeof R){var P=o(a);(u=E)&&u.constructor===R&&P.key==u.__k?g(u,P,1,h,!1):(j=u,e._component=u=m(R,P,h),u.__b=u.__b||A,u.__u=e,g(u,P,0,h,!1),v(u,1,r,!0)),I=u.base}else s=C,(j=E)&&(s=e._component=null),(C||1===t)&&(s&&(s._component=null),I=l(s,a,h,r||!k,C&&C.parentNode,!0));if(C&&I!==C&&u!==E){var F=C.parentNode;F&&I!==F&&(F.replaceChild(I,C),j||(C._component=null,d(C,!1)))}if(j&&y(j),e.base=I,I&&!i){for(var z=e,N=e;N=N.__u;)(z=N).base=I;I._component=z,I._componentConstructor=z.constructor}}for(!k||r?S.unshift(e):T||(e.componentDidUpdate&&e.componentDidUpdate(b,x,O),_.afterUpdate&&_.afterUpdate(e));e.__h.length;)e.__h.pop().call(e);D||i||f()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,u(t),I.push(e),h(t)),e.__r&&e.__r(null)}function x(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{},this.__h=[]}var w=function(){},_={},k=[],A=[],C="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,E=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,T=[],S=[],D=0,O=!1,j=!1,I=[];n(x.prototype,{setState:function(e,t){this.__s||(this.__s=this.state),this.state=n(n({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this.__h.push(t),r(this)},forceUpdate:function(e){e&&this.__h.push(e),v(this,2)},render:function(){}});var R={h:e,createElement:e,cloneElement:function(t,r){return e(t.nodeName,n(n({},t.attributes),r),arguments.length>2?[].slice.call(arguments,2):t.children)},Component:x,render:function(e,t,n){return l(n,e,{},!1,t,!1)},rerender:i,options:_};void 0!==t?t.exports=R:self.preact=R}()},{}],27:[function(e,t,n){var r,i,a=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{i="function"==typeof clearTimeout?clearTimeout:u}catch(e){i=u}}();var c,f=[],l=!1,p=-1;function d(){l&&c&&(l=!1,c.length?f=c.concat(f):p=-1,f.length&&h())}function h(){if(!l){var e=s(d);l=!0;for(var t=f.length;t;){for(c=f,f=[];++p<t;)c&&c[p].run();p=-1,t=f.length}c=null,l=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===u||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function b(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new m(e,t)),1!==f.length||l||s(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=b,a.addListener=b,a.once=b,a.off=b,a.removeListener=b,a.removeAllListeners=b,a.emit=b,a.prependListener=b,a.prependOnceListener=b,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],28:[function(e,t,n){"use strict";var r=e("strict-uri-encode"),i=e("object-assign");function a(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}n.extract=function(e){return e.split("?")[1]||""},n.parse=function(e,t){var n=function(e){var t;switch(e.arrayFormat){case"index":return function(e,n,r){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return function(e,n,r){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};default:return function(e,t,n){void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t=i({arrayFormat:"none"},t)),r=Object.create(null);return"string"!=typeof e?r:(e=e.trim().replace(/^(\?|#|&)/,""))?(e.split("&").forEach(function(e){var t=e.replace(/\+/g," ").split("="),i=t.shift(),a=t.length>0?t.join("="):void 0;a=void 0===a?null:decodeURIComponent(a),n(decodeURIComponent(i),a,r)}),Object.keys(r).sort().reduce(function(e,t){var n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort(function(e,t){return Number(e)-Number(t)}).map(function(e){return t[e]}):t}(n):e[t]=n,e},Object.create(null))):r},n.stringify=function(e,t){var n=function(e){switch(e.arrayFormat){case"index":return function(t,n,r){return null===n?[a(t,e),"[",r,"]"].join(""):[a(t,e),"[",a(r,e),"]=",a(n,e)].join("")};case"bracket":return function(t,n){return null===n?a(t,e):[a(t,e),"[]=",a(n,e)].join("")};default:return function(t,n){return null===n?a(t,e):[a(t,e),"=",a(n,e)].join("")}}}(t=i({encode:!0,strict:!0,arrayFormat:"none"},t));return e?Object.keys(e).sort().map(function(r){var i=e[r];if(void 0===i)return"";if(null===i)return a(r,t);if(Array.isArray(i)){var o=[];return i.slice().forEach(function(e){void 0!==e&&o.push(n(r,e,o.length))}),o.join("&")}return a(r,t)+"="+a(i,t)}).filter(function(e){return e.length>0}).join("&"):""}},{"object-assign":18,"strict-uri-encode":30}],29:[function(e,t,n){var r,i;r=this,i=function(){function e(e,t){this.id=U++,this.type=e,this.data=t}function t(e){return"["+function e(t){if(0===t.length)return[];var n=t.charAt(0),r=t.charAt(t.length-1);if(1<t.length&&n===r&&('"'===n||"'"===n))return['"'+t.substr(1,t.length-2).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];if(n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t))return e(t.substr(0,n.index)).concat(e(n[1])).concat(e(t.substr(n.index+n[0].length)));if(1===(n=t.split(".")).length)return['"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'];for(t=[],r=0;r<n.length;++r)t=t.concat(e(n[r]));return t}(e).join("][")+"]"}function n(e){return"string"==typeof e?e.split():e}function r(e){return"string"==typeof e?document.querySelector(e):e}function i(e){var t,i,a,o,u=e||{};e={};var s=[],c=[],f="undefined"==typeof window?1:window.devicePixelRatio,l=!1,p=function(e){},d=function(){};if("string"==typeof u?t=document.querySelector(u):"object"==typeof u&&("string"==typeof u.nodeName&&"function"==typeof u.appendChild&&"function"==typeof u.getBoundingClientRect?t=u:"function"==typeof u.drawArrays||"function"==typeof u.drawElements?a=(o=u).canvas:("gl"in u?o=u.gl:"canvas"in u?a=r(u.canvas):"container"in u&&(i=r(u.container)),"attributes"in u&&(e=u.attributes),"extensions"in u&&(s=n(u.extensions)),"optionalExtensions"in u&&(c=n(u.optionalExtensions)),"onDone"in u&&(p=u.onDone),"profile"in u&&(l=!!u.profile),"pixelRatio"in u&&(f=+u.pixelRatio))),t&&("canvas"===t.nodeName.toLowerCase()?a=t:i=t),!o){if(!a){if(!(t=function(e,t,n){function r(){var t=window.innerWidth,r=window.innerHeight;e!==document.body&&(t=(r=e.getBoundingClientRect()).right-r.left,r=r.bottom-r.top),i.width=n*t,i.height=n*r,L(i.style,{width:t+"px",height:r+"px"})}var i=document.createElement("canvas");return L(i.style,{border:0,margin:0,padding:0,top:0,left:0}),e.appendChild(i),e===document.body&&(i.style.position="absolute",L(e.style,{margin:0,padding:0})),window.addEventListener("resize",r,!1),r(),{canvas:i,onDestroy:function(){window.removeEventListener("resize",r),e.removeChild(i)}}}(i||document.body,0,f)))return null;a=t.canvas,d=t.onDestroy}o=function(e,t){function n(n){try{return e.getContext(n,t)}catch(e){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(a,e)}return o?{gl:o,canvas:a,container:i,extensions:s,optionalExtensions:c,pixelRatio:f,profile:l,onDone:p,onDestroy:d}:(d(),p("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function a(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t(r);return n}function o(e){var t,n;return t=(65535<e)<<4,t|=n=(255<(e>>>=t))<<3,(t|=n=(15<(e>>>=n))<<2)|(n=(3<(e>>>=n))<<1)|e>>>n>>1}function u(){function e(e){e:{for(var t=16;268435456>=t;t*=16)if(e<=t){e=t;break e}e=0}return 0<(t=n[o(e)>>2]).length?t.pop():new ArrayBuffer(e)}function t(e){n[o(e.byteLength)>>2].push(e)}var n=a(8,function(){return[]});return{alloc:e,free:t,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(e){t(e.buffer)}}}function s(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||Q(e.data))}function c(e,t,n,r,i,a){for(var o=0;o<t;++o)for(var u=e[o],s=0;s<n;++s)for(var c=u[s],f=0;f<r;++f)i[a++]=c[f]}function f(e){return 0|X[Object.prototype.toString.call(e)]}function l(e,t){for(var n=0;n<t.length;++n)e[n]=t[n]}function p(e,t,n,r,i,a,o){for(var u=0,s=0;s<n;++s)for(var c=0;c<r;++c)e[u++]=t[i*s+a*c+o]}function d(e,t,n,r){function i(t){this.id=c++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=5121,this.persistentData=null,n.profile&&(this.stats={size:0})}function a(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function o(e,t,n,r,i,o){if(e.usage=n,Array.isArray(t)){if(e.dtype=r||5126,0<t.length)if(Array.isArray(t[0])){i=ee(t);for(var u=r=1;u<i.length;++u)r*=i[u];e.dimension=r,a(e,t=Z(t,i,e.dtype),n),o?e.persistentData=t:q.freeType(t)}else"number"==typeof t[0]?(e.dimension=i,l(i=q.allocType(e.dtype,t.length),t),a(e,i,n),o?e.persistentData=i:q.freeType(i)):Q(t[0])&&(e.dimension=t[0].length,e.dtype=r||f(t[0])||5126,a(e,t=Z(t,[t.length,t[0].length],e.dtype),n),o?e.persistentData=t:q.freeType(t))}else if(Q(t))e.dtype=r||f(t),e.dimension=i,a(e,t,n),o&&(e.persistentData=new Uint8Array(new Uint8Array(t.buffer)));else if(s(t)){i=t.shape;var c=t.stride,d=(u=t.offset,0),h=0,m=0,b=0;1===i.length?(d=i[0],h=1,m=c[0],b=0):2===i.length&&(d=i[0],h=i[1],m=c[0],b=c[1]),e.dtype=r||f(t.data)||5126,e.dimension=h,p(i=q.allocType(e.dtype,d*h),t.data,d,h,m,b,u),a(e,i,n),o?e.persistentData=i:q.freeType(i)}}function u(n){t.bufferCount--;for(var i=0;i<r.state.length;++i){var a=r.state[i];a.buffer===n&&(e.disableVertexAttribArray(i),a.buffer=null)}e.deleteBuffer(n.buffer),n.buffer=null,delete d[n.id]}var c=0,d={};i.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},i.prototype.destroy=function(){u(this)};var h=[];return n.profile&&(t.getTotalBufferSize=function(){var e=0;return Object.keys(d).forEach(function(t){e+=d[t].stats.size}),e}),{create:function(r,a,c,h){function m(t){var r=35044,i=null,a=0,u=0,c=1;return Array.isArray(t)||Q(t)||s(t)?i=t:"number"==typeof t?a=0|t:t&&("data"in t&&(i=t.data),"usage"in t&&(r=K[t.usage]),"type"in t&&(u=J[t.type]),"dimension"in t&&(c=0|t.dimension),"length"in t&&(a=0|t.length)),b.bind(),i?o(b,i,r,u,c,h):(a&&e.bufferData(b.type,a,r),b.dtype=u||5121,b.usage=r,b.dimension=c,b.byteLength=a),n.profile&&(b.stats.size=b.byteLength*te[b.dtype]),m}t.bufferCount++;var b=new i(a);return d[b.id]=b,c||m(r),m._reglType="buffer",m._buffer=b,m.subdata=function(t,n){var r,i=0|(n||0);if(b.bind(),Q(t))e.bufferSubData(b.type,i,t);else if(Array.isArray(t)){if(0<t.length)if("number"==typeof t[0]){var a=q.allocType(b.dtype,t.length);l(a,t),e.bufferSubData(b.type,i,a),q.freeType(a)}else(Array.isArray(t[0])||Q(t[0]))&&(r=ee(t),a=Z(t,r,b.dtype),e.bufferSubData(b.type,i,a),q.freeType(a))}else if(s(t)){r=t.shape;var o=t.stride,u=a=0,c=0,d=0;1===r.length?(a=r[0],u=1,c=o[0],d=0):2===r.length&&(a=r[0],u=r[1],c=o[0],d=o[1]),r=Array.isArray(t.data)?b.dtype:f(t.data),p(r=q.allocType(r,a*u),t.data,a,u,c,d,t.offset),e.bufferSubData(b.type,i,r),q.freeType(r)}return m},n.profile&&(m.stats=b.stats),m.destroy=function(){u(b)},m},createStream:function(e,t){var n=h.pop();return n||(n=new i(e)),n.bind(),o(n,t,35040,0,1,!1),n},destroyStream:function(e){h.push(e)},clear:function(){$(d).forEach(u),h.forEach(u)},getBuffer:function(e){return e&&e._buffer instanceof i?e._buffer:null},restore:function(){$(d).forEach(function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)})},_initBuffer:o}}function h(e,t,n,r){function i(e){this.id=c++,u[this.id]=this,this.buffer=e,this.primType=4,this.type=this.vertCount=0}function a(r,i,a,o,u,c,f){if(r.buffer.bind(),i){var l=f;f||Q(i)&&(!s(i)||Q(i.data))||(l=t.oes_element_index_uint?5125:5123),n._initBuffer(r.buffer,i,a,l,3)}else e.bufferData(34963,c,a),r.buffer.dtype=l||5121,r.buffer.usage=a,r.buffer.dimension=3,r.buffer.byteLength=c;if(l=f,!f){switch(r.buffer.dtype){case 5121:case 5120:l=5121;break;case 5123:case 5122:l=5123;break;case 5125:case 5124:l=5125}r.buffer.dtype=l}r.type=l,0>(i=u)&&(i=r.buffer.byteLength,5123===l?i>>=1:5125===l&&(i>>=2)),r.vertCount=i,i=o,0>o&&(i=4,1===(o=r.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),r.primType=i}function o(e){r.elementsCount--,delete u[e.id],e.buffer.destroy(),e.buffer=null}var u={},c=0,f={uint8:5121,uint16:5123};t.oes_element_index_uint&&(f.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var l=[];return{create:function(e,t){function u(e){if(e)if("number"==typeof e)c(e),l.primType=4,l.vertCount=0|e,l.type=5121;else{var t=null,n=35044,r=-1,i=-1,o=0,p=0;Array.isArray(e)||Q(e)||s(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(n=K[e.usage]),"primitive"in e&&(r=ne[e.primitive]),"count"in e&&(i=0|e.count),"type"in e&&(p=f[e.type]),"length"in e?o=0|e.length:(o=i,5123===p||5122===p?o*=2:5125!==p&&5124!==p||(o*=4))),a(l,t,n,r,i,o,p)}else c(),l.primType=4,l.vertCount=0,l.type=5121;return u}var c=n.create(null,34963,!0),l=new i(c._buffer);return r.elementsCount++,u(e),u._reglType="elements",u._elements=l,u.subdata=function(e,t){return c.subdata(e,t),u},u.destroy=function(){o(l)},u},createStream:function(e){var t=l.pop();return t||(t=new i(n.create(null,34963,!0,!1)._buffer)),a(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){l.push(e)},getElements:function(e){return"function"==typeof e&&e._elements instanceof i?e._elements:null},clear:function(){$(u).forEach(o)}}}function m(e){for(var t=q.allocType(5123,e.length),n=0;n<e.length;++n)if(isNaN(e[n]))t[n]=65535;else if(1/0===e[n])t[n]=31744;else if(-1/0===e[n])t[n]=64512;else{re[0]=e[n];var r=(a=ie[0])>>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;t[n]=-24>i?r:-14>i?r+(a+1024>>-14-i):15<i?r+31744:r+(i+15<<10)+a}return t}function b(e){return Array.isArray(e)||Q(e)}function g(e){return"[object "+e+"]"}function v(e){return Array.isArray(e)&&(0===e.length||"number"==typeof e[0])}function y(e){return!(!Array.isArray(e)||0===e.length||!b(e[0]))}function x(e){return Object.prototype.toString.call(e)}function w(e){if(!e)return!1;var t=x(e);return 0<=de.indexOf(t)||(v(e)||y(e)||s(e))}function _(e,t){36193===e.type?(e.data=m(t),q.freeType(t)):e.data=t}function k(e,t,n,r,i,a){if(e=void 0!==me[e]?me[e]:ue[e]*he[t],a&&(e*=6),i){for(r=0;1<=n;)r+=e*n*n,n/=2;return r}return e*n*r}function A(e,t,n,r,i,a,o){function u(){this.format=this.internalformat=6408,this.type=5121,this.flipY=this.premultiplyAlpha=this.compressed=!1,this.unpackAlignment=1,this.colorSpace=37444,this.channels=this.height=this.width=0}function c(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function f(e,t){if("object"==typeof t&&t){"premultiplyAlpha"in t&&(e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(e.flipY=t.flipY),"alignment"in t&&(e.unpackAlignment=t.alignment),"colorSpace"in t&&(e.colorSpace=W[t.colorSpace]),"type"in t&&(e.type=V[t.type]);var n=e.width,r=e.height,i=e.channels,a=!1;"shape"in t?(n=t.shape[0],r=t.shape[1],3===t.shape.length&&(i=t.shape[2],a=!0)):("radius"in t&&(n=r=t.radius),"width"in t&&(n=t.width),"height"in t&&(r=t.height),"channels"in t&&(i=t.channels,a=!0)),e.width=0|n,e.height=0|r,e.channels=0|i,n=!1,"format"in t&&(n=t.format,r=e.internalformat=H[n],e.format=ie[r],n in V&&!("type"in t)&&(e.type=V[n]),n in G&&(e.compressed=!0),n=!0),!a&&n?e.channels=ue[e.format]:a&&!n&&e.channels!==oe[e.format]&&(e.format=e.internalformat=oe[e.channels])}}function l(t){e.pixelStorei(37440,t.flipY),e.pixelStorei(37441,t.premultiplyAlpha),e.pixelStorei(37443,t.colorSpace),e.pixelStorei(3317,t.unpackAlignment)}function p(){u.call(this),this.yOffset=this.xOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function d(e,t){var n=null;if(w(t)?n=t:t&&(f(e,t),"x"in t&&(e.xOffset=0|t.x),"y"in t&&(e.yOffset=0|t.y),w(t.data)&&(n=t.data)),t.copy){var r=i.viewportWidth,a=i.viewportHeight;e.width=e.width||r-e.xOffset,e.height=e.height||a-e.yOffset,e.needsCopy=!0}else if(n){if(Q(n))e.channels=e.channels||4,e.data=n,"type"in t||5121!==e.type||(e.type=0|X[Object.prototype.toString.call(n)]);else if(v(n)){switch(e.channels=e.channels||4,a=(r=n).length,e.type){case 5121:case 5123:case 5125:case 5126:(a=q.allocType(e.type,a)).set(r),e.data=a;break;case 36193:e.data=m(r)}e.alignment=1,e.needsFree=!0}else if(s(n)){r=n.data,Array.isArray(r)||5121!==e.type||(e.type=0|X[Object.prototype.toString.call(r)]);a=n.shape;var o,u,c,l,p=n.stride;3===a.length?(c=a[2],l=p[2]):l=c=1,o=a[0],u=a[1],a=p[0],p=p[1],e.alignment=1,e.width=o,e.height=u,e.channels=c,e.format=e.internalformat=oe[c],e.needsFree=!0,o=l,n=n.offset,c=e.width,l=e.height,u=e.channels;for(var d=q.allocType(36193===e.type?5126:e.type,c*l*u),h=0,g=0;g<l;++g)for(var k=0;k<c;++k)for(var A=0;A<u;++A)d[h++]=r[a*k+p*g+o*A+n];_(e,d)}else if(x(n)===se||x(n)===ce)x(n)===se?e.element=n:e.element=n.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(x(n)===fe)e.element=n,e.width=n.width,e.height=n.height,e.channels=4;else if(x(n)===le)e.element=n,e.width=n.naturalWidth,e.height=n.naturalHeight,e.channels=4;else if(x(n)===pe)e.element=n,e.width=n.videoWidth,e.height=n.videoHeight,e.channels=4;else if(y(n)){for(r=e.width||n[0].length,a=e.height||n.length,p=e.channels,p=b(n[0][0])?p||n[0][0].length:p||1,o=Y.shape(n),c=1,l=0;l<o.length;++l)c*=o[l];c=q.allocType(36193===e.type?5126:e.type,c),Y.flatten(n,o,"",c),_(e,c),e.alignment=1,e.width=r,e.height=a,e.channels=p,e.format=e.internalformat=oe[p],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4}function h(t,n,i,a,o){var u=t.element,s=t.data,c=t.internalformat,f=t.format,p=t.type,d=t.width,h=t.height;l(t),u?e.texSubImage2D(n,o,i,a,f,p,u):t.compressed?e.compressedTexSubImage2D(n,o,i,a,c,d,h,s):t.needsCopy?(r(),e.copyTexSubImage2D(n,o,i,a,t.xOffset,t.yOffset,d,h)):e.texSubImage2D(n,o,i,a,d,h,f,p,s)}function g(){return de.pop()||new p}function A(e){e.needsFree&&q.freeType(e.data),p.call(e),de.push(e)}function C(e,t,n){var r=e.images[0]=g();e.mipmask=1,r.width=e.width=t,r.height=e.height=n,r.channels=e.channels=4}function E(e,t){var n=null;if(w(t))c(n=e.images[0]=g(),e),d(n,t),e.mipmask=1;else if(f(e,t),Array.isArray(t.mipmap))for(var r=t.mipmap,i=0;i<r.length;++i)c(n=e.images[i]=g(),e),n.width>>=i,n.height>>=i,d(n,r[i]),e.mipmask|=1<<i;else c(n=e.images[0]=g(),e),d(n,t),e.mipmask=1;c(e,e.images[0])}function T(t,n){for(var i=t.images,a=0;a<i.length&&i[a];++a){var o=i[a],u=n,s=a,c=o.element,f=o.data,p=o.internalformat,d=o.format,h=o.type,m=o.width,b=o.height,g=o.channels;l(o),c?e.texImage2D(u,s,d,d,h,c):o.compressed?e.compressedTexImage2D(u,s,p,m,b,0,f):o.needsCopy?(r(),e.copyTexImage2D(u,s,d,o.xOffset,o.yOffset,m,b,0)):((o=!f)&&(f=q.zero.allocType(h,m*b*g)),e.texImage2D(u,s,d,m,b,0,d,h,f),o&&f&&q.zero.freeType(f))}}function S(){var e=he.pop()||new function(){u.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)};u.call(e);for(var t=e.mipmask=0;16>t;++t)e.images[t]=null;return e}function D(e){for(var t=e.images,n=0;n<t.length;++n)t[n]&&A(t[n]),t[n]=null;he.push(e)}function O(){this.magFilter=this.minFilter=9728,this.wrapT=this.wrapS=33071,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=4352}function j(e,t){"min"in t&&(e.minFilter=U[t.min],0<=ae.indexOf(e.minFilter)&&!("faces"in t)&&(e.genMipmaps=!0)),"mag"in t&&(e.magFilter=B[t.mag]);var n=e.wrapS,r=e.wrapT;if("wrap"in t){var i=t.wrap;"string"==typeof i?n=r=M[i]:Array.isArray(i)&&(n=M[i[0]],r=M[i[1]])}else"wrapS"in t&&(n=M[t.wrapS]),"wrapT"in t&&(r=M[t.wrapT]);if(e.wrapS=n,e.wrapT=r,"anisotropic"in t&&(e.anisotropic=t.anisotropic),"mipmap"in t){switch(n=!1,typeof t.mipmap){case"string":e.mipmapHint=N[t.mipmap],n=e.genMipmaps=!0;break;case"boolean":n=e.genMipmaps=t.mipmap;break;case"object":e.genMipmaps=!1,n=!0}!n||"min"in t||(e.minFilter=9984)}}function I(n,r){e.texParameteri(r,10241,n.minFilter),e.texParameteri(r,10240,n.magFilter),e.texParameteri(r,10242,n.wrapS),e.texParameteri(r,10243,n.wrapT),t.ext_texture_filter_anisotropic&&e.texParameteri(r,34046,n.anisotropic),n.genMipmaps&&(e.hint(33170,n.mipmapHint),e.generateMipmap(r))}function R(t){u.call(this),this.mipmask=0,this.internalformat=6408,this.id=me++,this.refCount=1,this.target=t,this.texture=e.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new O,o.profile&&(this.stats={size:0})}function P(t){e.activeTexture(33984),e.bindTexture(t.target,t.texture)}function F(){var t=ve[0];t?e.bindTexture(t.target,t.texture):e.bindTexture(3553,null)}function z(t){var n=t.texture,r=t.unit,i=t.target;0<=r&&(e.activeTexture(33984+r),e.bindTexture(i,null),ve[r]=null),e.deleteTexture(n),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete be[t.id],a.textureCount--}var N={"don't care":4352,"dont care":4352,nice:4354,fast:4353},M={repeat:10497,clamp:33071,mirror:33648},B={nearest:9728,linear:9729},U=L({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},B),W={none:0,browser:37444},V={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},H={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},G={};t.ext_srgb&&(H.srgb=35904,H.srgba=35906),t.oes_texture_float&&(V.float32=V.float=5126),t.oes_texture_half_float&&(V.float16=V["half float"]=36193),t.webgl_depth_texture&&(L(H,{depth:6402,"depth stencil":34041}),L(V,{uint16:5123,uint32:5125,"depth stencil":34042})),t.webgl_compressed_texture_s3tc&&L(G,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),t.webgl_compressed_texture_atc&&L(G,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),t.webgl_compressed_texture_pvrtc&&L(G,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),t.webgl_compressed_texture_etc1&&(G["rgb etc1"]=36196);var J=Array.prototype.slice.call(e.getParameter(34467));Object.keys(G).forEach(function(e){var t=G[e];0<=J.indexOf(t)&&(H[e]=t)});var K=Object.keys(H);n.textureFormats=K;var Z=[];Object.keys(H).forEach(function(e){Z[H[e]]=e});var ee=[];Object.keys(V).forEach(function(e){ee[V[e]]=e});var te=[];Object.keys(B).forEach(function(e){te[B[e]]=e});var ne=[];Object.keys(U).forEach(function(e){ne[U[e]]=e});var re=[];Object.keys(M).forEach(function(e){re[M[e]]=e});var ie=K.reduce(function(e,t){var n=H[t];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n?e[n]=n:32855===n||0<=t.indexOf("rgba")?e[n]=6408:e[n]=6407,e},{}),de=[],he=[],me=0,be={},ge=n.maxTextureUnits,ve=Array(ge).map(function(){return null});return L(R.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(0>t){for(var n=0;n<ge;++n){var r=ve[n];if(r){if(0<r.bindCount)continue;r.unit=-1}ve[n]=this,t=n;break}o.profile&&a.maxTextureUnits<t+1&&(a.maxTextureUnits=t+1),this.unit=t,e.activeTexture(33984+t),e.bindTexture(this.target,this.texture)}return t},unbind:function(){--this.bindCount},decRef:function(){0>=--this.refCount&&z(this)}}),o.profile&&(a.getTotalTextureSize=function(){var e=0;return Object.keys(be).forEach(function(t){e+=be[t].stats.size}),e}),{create2D:function(t,n){function r(e,t){var n=i.texInfo;O.call(n);var a=S();return"number"==typeof e?C(a,0|e,"number"==typeof t?0|t:0|e):e?(j(n,e),E(a,e)):C(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,r.width=a.width,r.height=a.height,P(i),T(a,3553),I(n,3553),F(),D(a),o.profile&&(i.stats.size=k(i.internalformat,i.type,a.width,a.height,n.genMipmaps,!1)),r.format=Z[i.internalformat],r.type=ee[i.type],r.mag=te[n.magFilter],r.min=ne[n.minFilter],r.wrapS=re[n.wrapS],r.wrapT=re[n.wrapT],r}var i=new R(3553);return be[i.id]=i,a.textureCount++,r(t,n),r.subimage=function(e,t,n,a){t|=0,n|=0,a|=0;var o=g();return c(o,i),o.width=0,o.height=0,d(o,e),o.width=o.width||(i.width>>a)-t,o.height=o.height||(i.height>>a)-n,P(i),h(o,3553,t,n,a),F(),A(o),r},r.resize=function(t,n){var a=0|t,u=0|n||a;if(a===i.width&&u===i.height)return r;r.width=i.width=a,r.height=i.height=u,P(i);for(var s,c=i.channels,f=i.type,l=0;i.mipmask>>l;++l){var p=a>>l,d=u>>l;if(!p||!d)break;s=q.zero.allocType(f,p*d*c),e.texImage2D(3553,l,i.format,p,d,0,i.format,i.type,s),s&&q.zero.freeType(s)}return F(),o.profile&&(i.stats.size=k(i.internalformat,i.type,a,u,!1,!1)),r},r._reglType="texture2d",r._texture=i,o.profile&&(r.stats=i.stats),r.destroy=function(){i.decRef()},r},createCube:function(t,n,r,i,u,s){function l(e,t,n,r,i,a){var u,s=p.texInfo;for(O.call(s),u=0;6>u;++u)m[u]=S();if("number"!=typeof e&&e){if("object"==typeof e)if(t)E(m[0],e),E(m[1],t),E(m[2],n),E(m[3],r),E(m[4],i),E(m[5],a);else if(j(s,e),f(p,e),"faces"in e)for(e=e.faces,u=0;6>u;++u)c(m[u],p),E(m[u],e[u]);else for(u=0;6>u;++u)E(m[u],e)}else for(e=0|e||1,u=0;6>u;++u)C(m[u],e,e);for(c(p,m[0]),p.mipmask=s.genMipmaps?(m[0].width<<1)-1:m[0].mipmask,p.internalformat=m[0].internalformat,l.width=m[0].width,l.height=m[0].height,P(p),u=0;6>u;++u)T(m[u],34069+u);for(I(s,34067),F(),o.profile&&(p.stats.size=k(p.internalformat,p.type,l.width,l.height,s.genMipmaps,!0)),l.format=Z[p.internalformat],l.type=ee[p.type],l.mag=te[s.magFilter],l.min=ne[s.minFilter],l.wrapS=re[s.wrapS],l.wrapT=re[s.wrapT],u=0;6>u;++u)D(m[u]);return l}var p=new R(34067);be[p.id]=p,a.cubeCount++;var m=Array(6);return l(t,n,r,i,u,s),l.subimage=function(e,t,n,r,i){n|=0,r|=0,i|=0;var a=g();return c(a,p),a.width=0,a.height=0,d(a,t),a.width=a.width||(p.width>>i)-n,a.height=a.height||(p.height>>i)-r,P(p),h(a,34069+e,n,r,i),F(),A(a),l},l.resize=function(t){if((t|=0)!==p.width){l.width=p.width=t,l.height=p.height=t,P(p);for(var n=0;6>n;++n)for(var r=0;p.mipmask>>r;++r)e.texImage2D(34069+n,r,p.format,t>>r,t>>r,0,p.format,p.type,null);return F(),o.profile&&(p.stats.size=k(p.internalformat,p.type,l.width,l.height,!1,!0)),l}},l._reglType="textureCube",l._texture=p,o.profile&&(l.stats=p.stats),l.destroy=function(){p.decRef()},l},clear:function(){for(var t=0;t<ge;++t)e.activeTexture(33984+t),e.bindTexture(3553,null),ve[t]=null;$(be).forEach(z),a.cubeCount=0,a.textureCount=0},getTexture:function(e){return null},restore:function(){$(be).forEach(function(t){t.texture=e.createTexture(),e.bindTexture(t.target,t.texture);for(var n=0;32>n;++n)if(0!=(t.mipmask&1<<n))if(3553===t.target)e.texImage2D(3553,n,t.internalformat,t.width>>n,t.height>>n,0,t.internalformat,t.type,null);else for(var r=0;6>r;++r)e.texImage2D(34069+r,n,t.internalformat,t.width>>n,t.height>>n,0,t.internalformat,t.type,null);I(t.texInfo,t.target)})}}}function C(e,t,n,r,i,a){function o(e,t,n){this.target=e,this.texture=t,this.renderbuffer=n;var r=e=0;t?(e=t.width,r=t.height):n&&(e=n.width,r=n.height),this.width=e,this.height=r}function u(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function s(e,t,n){e&&(e.texture?e.texture._texture.refCount+=1:e.renderbuffer._renderbuffer.refCount+=1)}function c(t,n){n&&(n.texture?e.framebufferTexture2D(36160,t,n.target,n.texture._texture.texture,0):e.framebufferRenderbuffer(36160,t,36161,n.renderbuffer._renderbuffer.renderbuffer))}function f(e){var t=3553,n=null,r=null,i=e;return"object"==typeof e&&(i=e.data,"target"in e&&(t=0|e.target)),"texture2d"===(e=i._reglType)?n=i:"textureCube"===e?n=i:"renderbuffer"===e&&(r=i,t=36161),new o(t,n,r)}function l(e,t,n,a,u){return n?((e=r.create2D({width:e,height:t,format:a,type:u}))._texture.refCount=0,new o(3553,e,null)):((e=i.create({width:e,height:t,format:a}))._renderbuffer.refCount=0,new o(36161,null,e))}function p(e){return e&&(e.texture||e.renderbuffer)}function d(e,t,n){e&&(e.texture?e.texture.resize(t,n):e.renderbuffer&&e.renderbuffer.resize(t,n))}function h(){this.id=k++,A[this.id]=this,this.framebuffer=e.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(e){e.colorAttachments.forEach(u),u(e.depthAttachment),u(e.stencilAttachment),u(e.depthStencilAttachment)}function b(t){e.deleteFramebuffer(t.framebuffer),t.framebuffer=null,a.framebufferCount--,delete A[t.id]}function g(t){var r;e.bindFramebuffer(36160,t.framebuffer);var i=t.colorAttachments;for(r=0;r<i.length;++r)c(36064+r,i[r]);for(r=i.length;r<n.maxColorAttachments;++r)e.framebufferTexture2D(36160,36064+r,3553,null,0);e.framebufferTexture2D(36160,33306,3553,null,0),e.framebufferTexture2D(36160,36096,3553,null,0),e.framebufferTexture2D(36160,36128,3553,null,0),c(36096,t.depthAttachment),c(36128,t.stencilAttachment),c(33306,t.depthStencilAttachment),e.checkFramebufferStatus(36160),e.bindFramebuffer(36160,y.next?y.next.framebuffer:null),y.cur=y.next,e.getError()}function v(e,t){function n(e,t){var i,a=0,o=0,u=!0,c=!0;i=null;var d=!0,h="rgba",b="uint8",v=1,y=null,_=null,k=null,A=!1;"number"==typeof e?(a=0|e,o=0|t||a):e?("shape"in e?(a=(o=e.shape)[0],o=o[1]):("radius"in e&&(a=o=e.radius),"width"in e&&(a=e.width),"height"in e&&(o=e.height)),("color"in e||"colors"in e)&&(i=e.color||e.colors,Array.isArray(i)),i||("colorCount"in e&&(v=0|e.colorCount),"colorTexture"in e&&(d=!!e.colorTexture,h="rgba4"),"colorType"in e&&(b=e.colorType,!d)&&("half float"===b||"float16"===b?h="rgba16f":"float"!==b&&"float32"!==b||(h="rgba32f")),"colorFormat"in e&&(h=e.colorFormat,0<=x.indexOf(h)?d=!0:0<=w.indexOf(h)&&(d=!1))),("depthTexture"in e||"depthStencilTexture"in e)&&(A=!(!e.depthTexture&&!e.depthStencilTexture)),"depth"in e&&("boolean"==typeof e.depth?u=e.depth:(y=e.depth,c=!1)),"stencil"in e&&("boolean"==typeof e.stencil?c=e.stencil:(_=e.stencil,u=!1)),"depthStencil"in e&&("boolean"==typeof e.depthStencil?u=c=e.depthStencil:(k=e.depthStencil,c=u=!1))):a=o=1;var C=null,E=null,T=null,S=null;if(Array.isArray(i))C=i.map(f);else if(i)C=[f(i)];else for(C=Array(v),i=0;i<v;++i)C[i]=l(a,o,d,h,b);for(a=a||C[0].width,o=o||C[0].height,y?E=f(y):u&&!c&&(E=l(a,o,A,"depth","uint32")),_?T=f(_):c&&!u&&(T=l(a,o,!1,"stencil","uint8")),k?S=f(k):!y&&!_&&c&&u&&(S=l(a,o,A,"depth stencil","depth stencil")),u=null,i=0;i<C.length;++i)s(C[i]),C[i]&&C[i].texture&&(c=ve[C[i].texture._texture.format]*ye[C[i].texture._texture.type],null===u&&(u=c));return s(E),s(T),s(S),m(r),r.width=a,r.height=o,r.colorAttachments=C,r.depthAttachment=E,r.stencilAttachment=T,r.depthStencilAttachment=S,n.color=C.map(p),n.depth=p(E),n.stencil=p(T),n.depthStencil=p(S),n.width=r.width,n.height=r.height,g(r),n}var r=new h;return a.framebufferCount++,n(e,t),L(n,{resize:function(e,t){var i=0|e,a=0|t||i;if(i===r.width&&a===r.height)return n;for(var o=r.colorAttachments,u=0;u<o.length;++u)d(o[u],i,a);return d(r.depthAttachment,i,a),d(r.stencilAttachment,i,a),d(r.depthStencilAttachment,i,a),r.width=n.width=i,r.height=n.height=a,g(r),n},_reglType:"framebuffer",_framebuffer:r,destroy:function(){b(r),m(r)},use:function(e){y.setFBO({framebuffer:n},e)}})}var y={cur:null,next:null,dirty:!1,setFBO:null},x=["rgba"],w=["rgba4","rgb565","rgb5 a1"];t.ext_srgb&&w.push("srgba"),t.ext_color_buffer_half_float&&w.push("rgba16f","rgb16f"),t.webgl_color_buffer_float&&w.push("rgba32f");var _=["uint8"];t.oes_texture_half_float&&_.push("half float","float16"),t.oes_texture_float&&_.push("float","float32");var k=0,A={};return L(y,{getFramebuffer:function(e){return"function"==typeof e&&"framebuffer"===e._reglType&&(e=e._framebuffer)instanceof h?e:null},create:v,createCube:function(e){function t(e){var i,a={color:null},o=0,u=null;i="rgba";var s="uint8",c=1;if("number"==typeof e?o=0|e:e?("shape"in e?o=e.shape[0]:("radius"in e&&(o=0|e.radius),"width"in e?o=0|e.width:"height"in e&&(o=0|e.height)),("color"in e||"colors"in e)&&(u=e.color||e.colors,Array.isArray(u)),u||("colorCount"in e&&(c=0|e.colorCount),"colorType"in e&&(s=e.colorType),"colorFormat"in e&&(i=e.colorFormat)),"depth"in e&&(a.depth=e.depth),"stencil"in e&&(a.stencil=e.stencil),"depthStencil"in e&&(a.depthStencil=e.depthStencil)):o=1,u)if(Array.isArray(u))for(e=[],i=0;i<u.length;++i)e[i]=u[i];else e=[u];else for(e=Array(c),u={radius:o,format:i,type:s},i=0;i<c;++i)e[i]=r.createCube(u);for(a.color=Array(e.length),i=0;i<e.length;++i)c=e[i],o=o||c.width,a.color[i]={target:34069,data:e[i]};for(i=0;6>i;++i){for(c=0;c<e.length;++c)a.color[c].target=34069+i;0<i&&(a.depth=n[0].depth,a.stencil=n[0].stencil,a.depthStencil=n[0].depthStencil),n[i]?n[i](a):n[i]=v(a)}return L(t,{width:o,height:o,color:e})}var n=Array(6);return t(e),L(t,{faces:n,resize:function(e){var r=0|e;if(r===t.width)return t;var i=t.color;for(e=0;e<i.length;++e)i[e].resize(r);for(e=0;6>e;++e)n[e].resize(r);return t.width=t.height=r,t},_reglType:"framebufferCube",destroy:function(){n.forEach(function(e){e.destroy()})}})},clear:function(){$(A).forEach(b)},restore:function(){$(A).forEach(function(t){t.framebuffer=e.createFramebuffer(),g(t)})}})}function E(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function T(e,t,n,r){function i(e,t,n,r){this.name=e,this.id=t,this.location=n,this.info=r}function a(e,t){for(var n=0;n<e.length;++n)if(e[n].id===t.id)return void(e[n].location=t.location);e.push(t)}function o(n,r,i){if(!(o=(i=35632===n?c:f)[r])){var a=t.str(r),o=e.createShader(n);e.shaderSource(o,a),e.compileShader(o),i[r]=o}return o}function u(e,t){this.id=d++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],r.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function s(n,u){var s,c;s=o(35632,n.fragId),c=o(35633,n.vertId);var f=n.program=e.createProgram();e.attachShader(f,s),e.attachShader(f,c),e.linkProgram(f);var l=e.getProgramParameter(f,35718);r.profile&&(n.stats.uniformsCount=l);var p=n.uniforms;for(s=0;s<l;++s)if(c=e.getActiveUniform(f,s))if(1<c.size)for(var d=0;d<c.size;++d){var h=c.name.replace("[0]","["+d+"]");a(p,new i(h,t.id(h),e.getUniformLocation(f,h),c))}else a(p,new i(c.name,t.id(c.name),e.getUniformLocation(f,c.name),c));for(l=e.getProgramParameter(f,35721),r.profile&&(n.stats.attributesCount=l),p=n.attributes,s=0;s<l;++s)(c=e.getActiveAttrib(f,s))&&a(p,new i(c.name,t.id(c.name),e.getAttribLocation(f,c.name),c))}var c={},f={},l={},p=[],d=0;return r.profile&&(n.getMaxUniformsCount=function(){var e=0;return p.forEach(function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)}),e},n.getMaxAttributesCount=function(){var e=0;return p.forEach(function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)}),e}),{clear:function(){var t=e.deleteShader.bind(e);$(c).forEach(t),c={},$(f).forEach(t),f={},p.forEach(function(t){e.deleteProgram(t.program)}),p.length=0,l={},n.shaderCount=0},program:function(e,t,r){var i=l[t];i||(i=l[t]={});var a=i[e];return a||(a=new u(t,e),n.shaderCount++,s(a),i[e]=a,p.push(a)),a},restore:function(){c={},f={};for(var e=0;e<p.length;++e)s(p[e])},shader:o,frag:-1,vert:-1}}function S(e,t,n,r,i,a,o){function u(i){var a;a=null===t.next?5121:t.next.colorAttachments[0].texture._texture.type;var o=0,u=0,s=r.framebufferWidth,c=r.framebufferHeight,f=null;return Q(i)?f=i:i&&(o=0|i.x,u=0|i.y,s=0|(i.width||r.framebufferWidth-o),c=0|(i.height||r.framebufferHeight-u),f=i.data||null),n(),i=s*c*4,f||(5121===a?f=new Uint8Array(i):5126===a&&(f=f||new Float32Array(i))),e.pixelStorei(3333,4),e.readPixels(o,u,s,c,6408,a,f),f}return function(e){return e&&"framebuffer"in e?function(e){var n;return t.setFBO({framebuffer:e.framebuffer},function(){n=u(e)}),n}(e):u(e)}}function D(e){return Array.prototype.slice.call(e)}function O(e){return D(e).join("")}function j(){function e(){var e=[],t=[];return L(function(){e.push.apply(e,D(arguments))},{def:function(){var r="v"+n++;return t.push(r),0<arguments.length&&(e.push(r,"="),e.push.apply(e,D(arguments)),e.push(";")),r},toString:function(){return O([0<t.length?"var "+t+";":"",O(e)])}})}function t(){function t(e,t){r(e,t,"=",n.def(e,t),";")}var n=e(),r=e(),i=n.toString,a=r.toString;return L(function(){n.apply(n,D(arguments))},{def:n.def,entry:n,exit:r,save:t,set:function(e,r,i){t(e,r),n(e,r,"=",i,";")},toString:function(){return i()+a()}})}var n=0,r=[],i=[],a=e(),o={};return{global:a,link:function(e){for(var t=0;t<i.length;++t)if(i[t]===e)return r[t];return t="g"+n++,r.push(t),i.push(e),t},block:e,proc:function(e,n){function r(){var e="a"+i.length;return i.push(e),e}var i=[];n=n||0;for(var a=0;a<n;++a)r();var u=(a=t()).toString;return o[e]=L(a,{arg:r,toString:function(){return O(["function(",i.join(),"){",u(),"}"])}})},scope:t,cond:function(){var e=O(arguments),n=t(),r=t(),i=n.toString,a=r.toString;return L(n,{then:function(){return n.apply(n,D(arguments)),this},else:function(){return r.apply(r,D(arguments)),this},toString:function(){var t=a();return t&&(t="else{"+t+"}"),O(["if(",e,"){",i(),"}",t])}})},compile:function(){var e=['"use strict";',a,"return {"];Object.keys(o).forEach(function(t){e.push('"',t,'":',o[t].toString(),",")}),e.push("}");var t=O(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,r.concat(t)).apply(null,i)}}}function I(e){return Array.isArray(e)||Q(e)||s(e)}function R(e){return e.sort(function(e,t){return"viewport"===e?-1:"viewport"===t?1:e<t?-1:1})}function P(e,t,n,r){this.thisDep=e,this.contextDep=t,this.propDep=n,this.append=r}function F(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function z(e){return new P(!1,!1,!1,e)}function N(e,t){var n=e.type;return 0===n?new P(!0,1<=(n=e.data.length),2<=n,t):4===n?new P((n=e.data).thisDep,n.contextDep,n.propDep,t):new P(3===n,2===n,1===n,t)}function M(e,t,n,r,i,o,u,s,c,f,l,p,d,h,m){function g(e){return e.replace(".","_")}function v(e,t,n){var r=g(e);re.push(e),te[r]=ee[r]=!!n,ie[r]=t}function y(e,t,n){var r=g(e);re.push(e),Array.isArray(n)?(ee[r]=n.slice(),te[r]=n.slice()):ee[r]=te[r]=n,ae[r]=t}function x(){var e=j(),n=e.link,r=e.global;e.id=se++,e.batchId="0";var i=n(oe),a=e.shared={props:"a0"};Object.keys(oe).forEach(function(e){a[e]=r.def(i,".",e)});var o=e.next={},u=e.current={};Object.keys(ae).forEach(function(e){Array.isArray(ee[e])&&(o[e]=r.def(a.next,".",e),u[e]=r.def(a.current,".",e))});var s=e.constants={};Object.keys(ue).forEach(function(e){s[e]=r.def(JSON.stringify(ue[e]))}),e.invoke=function(t,r){switch(r.type){case 0:var i=["this",a.context,a.props,e.batchId];return t.def(n(r.data),".call(",i.slice(0,Math.max(r.data.length+1,4)),")");case 1:return t.def(a.props,r.data);case 2:return t.def(a.context,r.data);case 3:return t.def("this",r.data);case 4:return r.data.append(e,t),r.data.ref}},e.attribCache={};var c={};return e.scopeAttrib=function(e){if((e=t.id(e))in c)return c[e];var r=f.scope[e];return r||(r=f.scope[e]=new Y),c[e]=n(r)},e}function w(e,t){var n=e.static,r=e.dynamic;if("framebuffer"in n){var i=n.framebuffer;return i?(i=s.getFramebuffer(i),z(function(e,t){var n=e.link(i),r=e.shared;return t.set(r.framebuffer,".next",n),r=r.context,t.set(r,".framebufferWidth",n+".width"),t.set(r,".framebufferHeight",n+".height"),n})):z(function(e,t){var n=e.shared;return t.set(n.framebuffer,".next","null"),n=n.context,t.set(n,".framebufferWidth",n+".drawingBufferWidth"),t.set(n,".framebufferHeight",n+".drawingBufferHeight"),"null"})}if("framebuffer"in r){var a=r.framebuffer;return N(a,function(e,t){var n=e.invoke(t,a),r=e.shared,i=r.framebuffer;n=t.def(i,".getFramebuffer(",n,")");return t.set(i,".next",n),r=r.context,t.set(r,".framebufferWidth",n+"?"+n+".width:"+r+".drawingBufferWidth"),t.set(r,".framebufferHeight",n+"?"+n+".height:"+r+".drawingBufferHeight"),n})}return null}function _(e){function n(e){if(e in r){var n=t.id(r[e]);return(e=z(function(){return n})).id=n,e}if(e in i){var a=i[e];return N(a,function(e,t){var n=e.invoke(t,a);return t.def(e.shared.strings,".id(",n,")")})}return null}var r=e.static,i=e.dynamic,a=n("frag"),o=n("vert"),u=null;return F(a)&&F(o)?(u=l.program(o.id,a.id),e=z(function(e,t){return e.link(u)})):e=new P(a&&a.thisDep||o&&o.thisDep,a&&a.contextDep||o&&o.contextDep,a&&a.propDep||o&&o.propDep,function(e,t){var n,r,i=e.shared.shader;return n=a?a.append(e,t):t.def(i,".","frag"),r=o?o.append(e,t):t.def(i,".","vert"),t.def(i+".program("+r+","+n+")")}),{frag:a,vert:o,progVar:e,program:u}}function k(e,t){function n(e,t){if(e in r){var n=0|r[e];return z(function(e,r){return t&&(e.OFFSET=n),n})}if(e in i){var o=i[e];return N(o,function(e,n){var r=e.invoke(n,o);return t&&(e.OFFSET=r),r})}return t&&a?z(function(e,t){return e.OFFSET="0",0}):null}var r=e.static,i=e.dynamic,a=function(){if("elements"in r){var e=r.elements;I(e)?e=o.getElements(o.create(e,!0)):e&&(e=o.getElements(e));var t=z(function(t,n){if(e){var r=t.link(e);return t.ELEMENTS=r}return t.ELEMENTS=null});return t.value=e,t}if("elements"in i){var n=i.elements;return N(n,function(e,t){var r=(i=e.shared).isBufferArgs,i=i.elements,a=e.invoke(t,n),o=t.def("null");r=t.def(r,"(",a,")"),a=e.cond(r).then(o,"=",i,".createStream(",a,");").else(o,"=",i,".getElements(",a,");");return t.entry(a),t.exit(e.cond(r).then(i,".destroyStream(",o,");")),e.ELEMENTS=o})}return null}(),u=n("offset",!0);return{elements:a,primitive:function(){if("primitive"in r){var e=r.primitive;return z(function(t,n){return ne[e]})}if("primitive"in i){var t=i.primitive;return N(t,function(e,n){var r=e.constants.primTypes,i=e.invoke(n,t);return n.def(r,"[",i,"]")})}return a?F(a)?a.value?z(function(e,t){return t.def(e.ELEMENTS,".primType")}):z(function(){return 4}):new P(a.thisDep,a.contextDep,a.propDep,function(e,t){var n=e.ELEMENTS;return t.def(n,"?",n,".primType:",4)}):null}(),count:function(){if("count"in r){var e=0|r.count;return z(function(){return e})}if("count"in i){var t=i.count;return N(t,function(e,n){return e.invoke(n,t)})}return a?F(a)?a?u?new P(u.thisDep,u.contextDep,u.propDep,function(e,t){return t.def(e.ELEMENTS,".vertCount-",e.OFFSET)}):z(function(e,t){return t.def(e.ELEMENTS,".vertCount")}):z(function(){return-1}):new P(a.thisDep||u.thisDep,a.contextDep||u.contextDep,a.propDep||u.propDep,function(e,t){var n=e.ELEMENTS;return e.OFFSET?t.def(n,"?",n,".vertCount-",e.OFFSET,":-1"):t.def(n,"?",n,".vertCount:-1")}):null}(),instances:n("instances",!1),offset:u}}function A(e,n){var r=e.static,a=e.dynamic,o={};return Object.keys(r).forEach(function(e){var n=r[e],a=t.id(e),u=new Y;if(I(n))u.state=1,u.buffer=i.getBuffer(i.create(n,34962,!1,!0)),u.type=0;else if(c=i.getBuffer(n))u.state=1,u.buffer=c,u.type=0;else if("constant"in n){var s=n.constant;u.buffer="null",u.state=2,"number"==typeof s?u.x=s:xe.forEach(function(e,t){t<s.length&&(u[e]=s[t])})}else{var c=I(n.buffer)?i.getBuffer(i.create(n.buffer,34962,!1,!0)):i.getBuffer(n.buffer),f=0|n.offset,l=0|n.stride,p=0|n.size,d=!!n.normalized,h=0;"type"in n&&(h=J[n.type]),n=0|n.divisor,u.buffer=c,u.state=1,u.size=p,u.normalized=d,u.type=h||c.dtype,u.offset=f,u.stride=l,u.divisor=n}o[e]=z(function(e,t){var n=e.attribCache;if(a in n)return n[a];var r={isStream:!1};return Object.keys(u).forEach(function(e){r[e]=u[e]}),u.buffer&&(r.buffer=e.link(u.buffer),r.type=r.type||r.buffer+".dtype"),n[a]=r})}),Object.keys(a).forEach(function(e){var t=a[e];o[e]=N(t,function(e,n){function r(e){n(s[e],"=",i,".",e,"|0;")}var i=e.invoke(n,t),a=e.shared,o=a.isBufferArgs,u=a.buffer,s={isStream:n.def(!1)},c=new Y;c.state=1,Object.keys(c).forEach(function(e){s[e]=n.def(""+c[e])});var f=s.buffer,l=s.type;return n("if(",o,"(",i,")){",s.isStream,"=true;",f,"=",u,".createStream(",34962,",",i,");",l,"=",f,".dtype;","}else{",f,"=",u,".getBuffer(",i,");","if(",f,"){",l,"=",f,".dtype;",'}else if("constant" in ',i,"){",s.state,"=",2,";","if(typeof "+i+'.constant === "number"){',s[xe[0]],"=",i,".constant;",xe.slice(1).map(function(e){return s[e]}).join("="),"=0;","}else{",xe.map(function(e,t){return s[e]+"="+i+".constant.length>"+t+"?"+i+".constant["+t+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",f,"=",u,".createStream(",34962,",",i,".buffer);","}else{",f,"=",u,".getBuffer(",i,".buffer);","}",l,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",f,".dtype;",s.normalized,"=!!",i,".normalized;"),r("size"),r("offset"),r("stride"),r("divisor"),n("}}"),n.exit("if(",s.isStream,"){",u,".destroyStream(",f,");","}"),s})}),o}function C(e,t,n,r,i){var o=w(e),u=function(e,t,n){function r(e){if(e in i){var n=i[e];e=!0;var r,o,u=0|n.x,s=0|n.y;return"width"in n?r=0|n.width:e=!1,"height"in n?o=0|n.height:e=!1,new P(!e&&t&&t.thisDep,!e&&t&&t.contextDep,!e&&t&&t.propDep,function(e,t){var i=e.shared.context,a=r;"width"in n||(a=t.def(i,".","framebufferWidth","-",u));var c=o;return"height"in n||(c=t.def(i,".","framebufferHeight","-",s)),[u,s,a,c]})}if(e in a){var c=a[e];return e=N(c,function(e,t){var n=e.invoke(t,c),r=e.shared.context,i=t.def(n,".x|0"),a=t.def(n,".y|0");return[i,a,t.def('"width" in ',n,"?",n,".width|0:","(",r,".","framebufferWidth","-",i,")"),n=t.def('"height" in ',n,"?",n,".height|0:","(",r,".","framebufferHeight","-",a,")")]}),t&&(e.thisDep=e.thisDep||t.thisDep,e.contextDep=e.contextDep||t.contextDep,e.propDep=e.propDep||t.propDep),e}return t?new P(t.thisDep,t.contextDep,t.propDep,function(e,t){var n=e.shared.context;return[0,0,t.def(n,".","framebufferWidth"),t.def(n,".","framebufferHeight")]}):null}var i=e.static,a=e.dynamic;if(e=r("viewport")){var o=e;e=new P(e.thisDep,e.contextDep,e.propDep,function(e,t){var n=o.append(e,t),r=e.shared.context;return t.set(r,".viewportWidth",n[2]),t.set(r,".viewportHeight",n[3]),n})}return{viewport:e,scissor_box:r("scissor.box")}}(e,o),s=k(e),c=function(e,t){var n=e.static,r=e.dynamic,i={};return re.forEach(function(e){function t(t,a){if(e in n){var u=t(n[e]);i[o]=z(function(){return u})}else if(e in r){var s=r[e];i[o]=N(s,function(e,t){return a(e,t,e.invoke(t,s))})}}var o=g(e);switch(e){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return t(function(e){return e},function(e,t,n){return n});case"depth.func":return t(function(e){return ke[e]},function(e,t,n){return t.def(e.constants.compareFuncs,"[",n,"]")});case"depth.range":return t(function(e){return e},function(e,t,n){return[t.def("+",n,"[0]"),t=t.def("+",n,"[1]")]});case"blend.func":return t(function(e){return[_e["srcRGB"in e?e.srcRGB:e.src],_e["dstRGB"in e?e.dstRGB:e.dst],_e["srcAlpha"in e?e.srcAlpha:e.src],_e["dstAlpha"in e?e.dstAlpha:e.dst]]},function(e,t,n){function r(e,r){return t.def('"',e,r,'" in ',n,"?",n,".",e,r,":",n,".",e)}e=e.constants.blendFuncs;var i=r("src","RGB"),a=r("dst","RGB"),o=(i=t.def(e,"[",i,"]"),t.def(e,"[",r("src","Alpha"),"]"));return[i,a=t.def(e,"[",a,"]"),o,e=t.def(e,"[",r("dst","Alpha"),"]")]});case"blend.equation":return t(function(e){return"string"==typeof e?[X[e],X[e]]:"object"==typeof e?[X[e.rgb],X[e.alpha]]:void 0},function(e,t,n){var r=e.constants.blendEquations,i=t.def(),a=t.def();return(e=e.cond("typeof ",n,'==="string"')).then(i,"=",a,"=",r,"[",n,"];"),e.else(i,"=",r,"[",n,".rgb];",a,"=",r,"[",n,".alpha];"),t(e),[i,a]});case"blend.color":return t(function(e){return a(4,function(t){return+e[t]})},function(e,t,n){return a(4,function(e){return t.def("+",n,"[",e,"]")})});case"stencil.mask":return t(function(e){return 0|e},function(e,t,n){return t.def(n,"|0")});case"stencil.func":return t(function(e){return[ke[e.cmp||"keep"],e.ref||0,"mask"in e?e.mask:-1]},function(e,t,n){return[e=t.def('"cmp" in ',n,"?",e.constants.compareFuncs,"[",n,".cmp]",":",7680),t.def(n,".ref|0"),t=t.def('"mask" in ',n,"?",n,".mask|0:-1")]});case"stencil.opFront":case"stencil.opBack":return t(function(t){return["stencil.opBack"===e?1029:1028,Ae[t.fail||"keep"],Ae[t.zfail||"keep"],Ae[t.zpass||"keep"]]},function(t,n,r){function i(e){return n.def('"',e,'" in ',r,"?",a,"[",r,".",e,"]:",7680)}var a=t.constants.stencilOps;return["stencil.opBack"===e?1029:1028,i("fail"),i("zfail"),i("zpass")]});case"polygonOffset.offset":return t(function(e){return[0|e.factor,0|e.units]},function(e,t,n){return[t.def(n,".factor|0"),t=t.def(n,".units|0")]});case"cull.face":return t(function(e){var t=0;return"front"===e?t=1028:"back"===e&&(t=1029),t},function(e,t,n){return t.def(n,'==="front"?',1028,":",1029)});case"lineWidth":return t(function(e){return e},function(e,t,n){return n});case"frontFace":return t(function(e){return Ce[e]},function(e,t,n){return t.def(n+'==="cw"?2304:2305')});case"colorMask":return t(function(e){return e.map(function(e){return!!e})},function(e,t,n){return a(4,function(e){return"!!"+n+"["+e+"]"})});case"sample.coverage":return t(function(e){return["value"in e?e.value:1,!!e.invert]},function(e,t,n){return[t.def('"value" in ',n,"?+",n,".value:1"),t=t.def("!!",n,".invert")]})}}),i}(e),f=_(e),l=u.viewport;return l&&(c.viewport=l),(u=u[l=g("scissor.box")])&&(c[l]=u),(o={framebuffer:o,draw:s,shader:f,state:c,dirty:u=0<Object.keys(c).length}).profile=function(e){var t,n=e.static;if(e=e.dynamic,"profile"in n){var r=!!n.profile;(t=z(function(e,t){return r})).enable=r}else if("profile"in e){var i=e.profile;t=N(i,function(e,t){return e.invoke(t,i)})}return t}(e),o.uniforms=function(e,t){var n=e.static,r=e.dynamic,i={};return Object.keys(n).forEach(function(e){var t,r=n[e];if("number"==typeof r||"boolean"==typeof r)t=z(function(){return r});else if("function"==typeof r){var o=r._reglType;"texture2d"===o||"textureCube"===o?t=z(function(e){return e.link(r)}):"framebuffer"!==o&&"framebufferCube"!==o||(t=z(function(e){return e.link(r.color[0])}))}else b(r)&&(t=z(function(e){return e.global.def("[",a(r.length,function(e){return r[e]}),"]")}));t.value=r,i[e]=t}),Object.keys(r).forEach(function(e){var t=r[e];i[e]=N(t,function(e,n){return e.invoke(n,t)})}),i}(n),o.attributes=A(t),o.context=function(e){var t=e.static,n=e.dynamic,r={};return Object.keys(t).forEach(function(e){var n=t[e];r[e]=z(function(e,t){return"number"==typeof n||"boolean"==typeof n?""+n:e.link(n)})}),Object.keys(n).forEach(function(e){var t=n[e];r[e]=N(t,function(e,n){return e.invoke(n,t)})}),r}(r),o}function E(e,t,n){var r=e.shared.context,i=e.scope();Object.keys(n).forEach(function(a){t.save(r,"."+a),i(r,".",a,"=",n[a].append(e,t),";")}),t(i)}function T(e,t,n,r){var i,a=(u=e.shared).gl,o=u.framebuffer;Z&&(i=t.def(u.extensions,".webgl_draw_buffers"));var u=(s=e.constants).drawBuffer,s=s.backBuffer;e=n?n.append(e,t):t.def(o,".next"),r||t("if(",e,"!==",o,".cur){"),t("if(",e,"){",a,".bindFramebuffer(",36160,",",e,".framebuffer);"),Z&&t(i,".drawBuffersWEBGL(",u,"[",e,".colorAttachments.length]);"),t("}else{",a,".bindFramebuffer(",36160,",null);"),Z&&t(i,".drawBuffersWEBGL(",s,");"),t("}",o,".cur=",e,";"),r||t("}")}function S(e,t,n){var r=e.shared,i=r.gl,o=e.current,u=e.next,s=r.current,c=r.next,f=e.cond(s,".dirty");re.forEach(function(t){var r,l;if(!((t=g(t))in n.state))if(t in u){r=u[t],l=o[t];var p=a(ee[t].length,function(e){return f.def(r,"[",e,"]")});f(e.cond(p.map(function(e,t){return e+"!=="+l+"["+t+"]"}).join("||")).then(i,".",ae[t],"(",p,");",p.map(function(e,t){return l+"["+t+"]="+e}).join(";"),";"))}else r=f.def(c,".",t),p=e.cond(r,"!==",s,".",t),f(p),t in ie?p(e.cond(r).then(i,".enable(",ie[t],");").else(i,".disable(",ie[t],");"),s,".",t,"=",r,";"):p(i,".",ae[t],"(",r,");",s,".",t,"=",r,";")}),0===Object.keys(n.state).length&&f(s,".dirty=false;"),t(f)}function D(e,t,n,r){var i=e.shared,a=e.current,o=i.current,u=i.gl;R(Object.keys(n)).forEach(function(i){var s=n[i];if(!r||r(s)){var c=s.append(e,t);if(ie[i]){var f=ie[i];F(s)?t(u,c?".enable(":".disable(",f,");"):t(e.cond(c).then(u,".enable(",f,");").else(u,".disable(",f,");")),t(o,".",i,"=",c,";")}else if(b(c)){var l=a[i];t(u,".",ae[i],"(",c,");",c.map(function(e,t){return l+"["+t+"]="+e}).join(";"),";")}else t(u,".",ae[i],"(",c,");",o,".",i,"=",c,";")}})}function O(e,t){K&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function M(e,t,n,r,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(e){e(c=t.def(),"=",a(),";"),"string"==typeof i?e(p,".count+=",i,";"):e(p,".count++;"),h&&(r?e(f=t.def(),"=",m,".getNumPendingQueries();"):e(m,".beginQuery(",p,");"))}function u(e){e(p,".cpuTime+=",a(),"-",c,";"),h&&(r?e(m,".pushScopeStats(",f,",",m,".getNumPendingQueries(),",p,");"):e(m,".endQuery();"))}function s(e){var n=t.def(d,".profile");t(d,".profile=",e,";"),t.exit(d,".profile=",n,";")}var c,f,l=e.shared,p=e.stats,d=l.current,m=l.timer;if(n=n.profile){if(F(n))return void(n.enable?(o(t),u(t.exit),s("true")):s("false"));s(n=n.append(e,t))}else n=t.def(d,".profile");o(l=e.block()),t("if(",n,"){",l,"}"),u(e=e.block()),t.exit("if(",n,"){",e,"}")}function B(e,t,n,r,i){function a(n,r,i){function a(){t("if(!",f,".buffer){",s,".enableVertexAttribArray(",c,");}");var n,a=i.type;n=i.size?t.def(i.size,"||",r):r,t("if(",f,".type!==",a,"||",f,".size!==",n,"||",d.map(function(e){return f+"."+e+"!=="+i[e]}).join("||"),"){",s,".bindBuffer(",34962,",",l,".buffer);",s,".vertexAttribPointer(",[c,n,a,i.normalized,i.stride,i.offset],");",f,".type=",a,";",f,".size=",n,";",d.map(function(e){return f+"."+e+"="+i[e]+";"}).join(""),"}"),K&&(a=i.divisor,t("if(",f,".divisor!==",a,"){",e.instancing,".vertexAttribDivisorANGLE(",[c,a],");",f,".divisor=",a,";}"))}function u(){t("if(",f,".buffer){",s,".disableVertexAttribArray(",c,");","}if(",xe.map(function(e,t){return f+"."+e+"!=="+p[t]}).join("||"),"){",s,".vertexAttrib4f(",c,",",p,");",xe.map(function(e,t){return f+"."+e+"="+p[t]+";"}).join(""),"}")}var s=o.gl,c=t.def(n,".location"),f=t.def(o.attributes,"[",c,"]");n=i.state;var l=i.buffer,p=[i.x,i.y,i.z,i.w],d=["buffer","normalized","offset","stride"];1===n?a():2===n?u():(t("if(",n,"===",1,"){"),a(),t("}else{"),u(),t("}"))}var o=e.shared;r.forEach(function(r){var o,u=r.name,s=n.attributes[u];if(s){if(!i(s))return;o=s.append(e,t)}else{if(!i(Ee))return;var c=e.scopeAttrib(u);o={},Object.keys(new Y).forEach(function(e){o[e]=t.def(c,".",e)})}a(e.link(r),function(e){switch(e){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(r.info.type),o)})}function L(e,n,r,i,o){for(var u,s=e.shared,c=s.gl,f=0;f<i.length;++f){var l,p=(m=i[f]).name,d=m.info.type,h=r.uniforms[p],m=e.link(m)+".location";if(h){if(!o(h))continue;if(F(h)){if(p=h.value,35678===d||35680===d)n(c,".uniform1i(",m,",",(d=e.link(p._texture||p.color[0]._texture))+".bind());"),n.exit(d,".unbind();");else if(35674===d||35675===d||35676===d)p=e.global.def("new Float32Array(["+Array.prototype.slice.call(p)+"])"),h=2,35675===d?h=3:35676===d&&(h=4),n(c,".uniformMatrix",h,"fv(",m,",false,",p,");");else{switch(d){case 5126:u="1f";break;case 35664:u="2f";break;case 35665:u="3f";break;case 35666:u="4f";break;case 35670:case 5124:u="1i";break;case 35671:case 35667:u="2i";break;case 35672:case 35668:u="3i";break;case 35673:u="4i";break;case 35669:u="4i"}n(c,".uniform",u,"(",m,",",b(p)?Array.prototype.slice.call(p):p,");")}continue}l=h.append(e,n)}else{if(!o(Ee))continue;l=n.def(s.uniforms,"[",t.id(p),"]")}switch(35678===d?n("if(",l,"&&",l,'._reglType==="framebuffer"){',l,"=",l,".color[0];","}"):35680===d&&n("if(",l,"&&",l,'._reglType==="framebufferCube"){',l,"=",l,".color[0];","}"),p=1,d){case 35678:case 35680:n(c,".uniform1i(",m,",",d=n.def(l,"._texture"),".bind());"),n.exit(d,".unbind();");continue;case 5124:case 35670:u="1i";break;case 35667:case 35671:u="2i",p=2;break;case 35668:case 35672:u="3i",p=3;break;case 35669:case 35673:u="4i",p=4;break;case 5126:u="1f";break;case 35664:u="2f",p=2;break;case 35665:u="3f",p=3;break;case 35666:u="4f",p=4;break;case 35674:u="Matrix2fv";break;case 35675:u="Matrix3fv";break;case 35676:u="Matrix4fv"}if(n(c,".uniform",u,"(",m,","),"M"===u.charAt(0)){m=Math.pow(d-35674+2,2);var g=e.global.def("new Float32Array(",m,")");n("false,(Array.isArray(",l,")||",l," instanceof Float32Array)?",l,":(",a(m,function(e){return g+"["+e+"]="+l+"["+e+"]"}),",",g,")")}else n(1<p?a(p,function(e){return l+"["+e+"]"}):l);n(");")}}function U(e,t,n,r){function i(i){var a=p[i];return a?a.contextDep&&r.contextDynamic||a.propDep?a.append(e,n):a.append(e,t):t.def(l,".",i)}function a(){function e(){n(s,".drawElementsInstancedANGLE(",[h,b,g,m+"<<(("+g+"-5121)>>1)",u],");")}function t(){n(s,".drawArraysInstancedANGLE(",[h,m,b,u],");")}d?v?e():(n("if(",d,"){"),e(),n("}else{"),t(),n("}")):t()}function o(){function e(){n(f+".drawElements("+[h,b,g,m+"<<(("+g+"-5121)>>1)"]+");")}function t(){n(f+".drawArrays("+[h,m,b]+");")}d?v?e():(n("if(",d,"){"),e(),n("}else{"),t(),n("}")):t()}var u,s,c=e.shared,f=c.gl,l=c.draw,p=r.draw,d=function(){var i=p.elements,a=t;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(a=n),i=i.append(e,a)):i=a.def(l,".","elements"),i&&a("if("+i+")"+f+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),h=i("primitive"),m=i("offset"),b=function(){var i=p.count,a=t;return i?((i.contextDep&&r.contextDynamic||i.propDep)&&(a=n),i=i.append(e,a)):i=a.def(l,".","count"),i}();if("number"==typeof b){if(0===b)return}else n("if(",b,"){"),n.exit("}");K&&(u=i("instances"),s=e.instancing);var g=d+".type",v=p.elements&&F(p.elements);K&&("number"!=typeof u||0<=u)?"string"==typeof u?(n("if(",u,">0){"),a(),n("}else if(",u,"<0){"),o(),n("}")):a():o()}function V(e,t,n,r,i){return i=(t=x()).proc("body",i),K&&(t.instancing=i.def(t.shared.extensions,".angle_instanced_arrays")),e(t,i,n,r),t.compile().body}function H(e,t,n,r){O(e,t),B(e,t,n,r.attributes,function(){return!0}),L(e,t,n,r.uniforms,function(){return!0}),U(e,t,t,n)}function q(e,t,n,r){function i(){return!0}e.batchId="a1",O(e,t),B(e,t,n,r.attributes,i),L(e,t,n,r.uniforms,i),U(e,t,t,n)}function G(e,t,n,r){function i(e){return e.contextDep&&o||e.propDep}function a(e){return!i(e)}O(e,t);var o=n.contextDep,u=t.def(),s=t.def();e.shared.props=s,e.batchId=u;var c=e.scope(),f=e.scope();t(c.entry,"for(",u,"=0;",u,"<","a1",";++",u,"){",s,"=","a0","[",u,"];",f,"}",c.exit),n.needsContext&&E(e,f,n.context),n.needsFramebuffer&&T(e,f,n.framebuffer),D(e,f,n.state,i),n.profile&&i(n.profile)&&M(e,f,n,!1,!0),r?(B(e,c,n,r.attributes,a),B(e,f,n,r.attributes,i),L(e,c,n,r.uniforms,a),L(e,f,n,r.uniforms,i),U(e,c,f,n)):(t=e.global.def("{}"),r=n.shader.progVar.append(e,f),s=f.def(r,".id"),c=f.def(t,"[",s,"]"),f(e.shared.gl,".useProgram(",r,".program);","if(!",c,"){",c,"=",t,"[",s,"]=",e.link(function(t){return V(q,e,n,t,2)}),"(",r,");}",c,".call(this,a0[",u,"],",u,");"))}function Q(e,n){function r(t){var r=n.shader[t];r&&i.set(a.shader,"."+t,r.append(e,i))}var i=e.proc("scope",3);e.batchId="a2";var a=e.shared,o=a.current;E(e,i,n.context),n.framebuffer&&n.framebuffer.append(e,i),R(Object.keys(n.state)).forEach(function(t){var r=n.state[t].append(e,i);b(r)?r.forEach(function(n,r){i.set(e.next[t],"["+r+"]",n)}):i.set(a.next,"."+t,r)}),M(e,i,n,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(t){var r=n.draw[t];r&&i.set(a.draw,"."+t,""+r.append(e,i))}),Object.keys(n.uniforms).forEach(function(r){i.set(a.uniforms,"["+t.id(r)+"]",n.uniforms[r].append(e,i))}),Object.keys(n.attributes).forEach(function(t){var r=n.attributes[t].append(e,i),a=e.scopeAttrib(t);Object.keys(new Y).forEach(function(e){i.set(a,"."+e,r[e])})}),r("vert"),r("frag"),0<Object.keys(n.state).length&&(i(o,".dirty=true;"),i.exit(o,".dirty=true;")),i("a1(",e.shared.context,",a0,",e.batchId,");")}function $(e,t,n){var r=t.static[n];if(r&&function(e){if("object"==typeof e&&!b(e)){for(var t=Object.keys(e),n=0;n<t.length;++n)if(W.isDynamic(e[t[n]]))return!0;return!1}}(r)){var i=e.global,a=Object.keys(r),o=!1,u=!1,s=!1,c=e.global.def("{}");a.forEach(function(t){var n=r[t];if(W.isDynamic(n))"function"==typeof n&&(n=r[t]=W.unbox(n)),t=N(n,null),o=o||t.thisDep,s=s||t.propDep,u=u||t.contextDep;else{switch(i(c,".",t,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(e.link(n))}i(";")}}),t.dynamic[n]=new W.DynamicVariable(4,{thisDep:o,contextDep:u,propDep:s,ref:c,append:function(e,t){a.forEach(function(n){var i=r[n];W.isDynamic(i)&&(i=e.invoke(t,i),t(c,".",n,"=",i,";"))})}}),delete t.static[n]}}var Y=f.Record,X={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(X.min=32775,X.max=32776);var K=n.angle_instanced_arrays,Z=n.webgl_draw_buffers,ee={dirty:!0,profile:m.profile},te={},re=[],ie={},ae={};v("dither",3024),v("blend.enable",3042),y("blend.color","blendColor",[0,0,0,0]),y("blend.equation","blendEquationSeparate",[32774,32774]),y("blend.func","blendFuncSeparate",[1,0,1,0]),v("depth.enable",2929,!0),y("depth.func","depthFunc",513),y("depth.range","depthRange",[0,1]),y("depth.mask","depthMask",!0),y("colorMask","colorMask",[!0,!0,!0,!0]),v("cull.enable",2884),y("cull.face","cullFace",1029),y("frontFace","frontFace",2305),y("lineWidth","lineWidth",1),v("polygonOffset.enable",32823),y("polygonOffset.offset","polygonOffset",[0,0]),v("sample.alpha",32926),v("sample.enable",32928),y("sample.coverage","sampleCoverage",[1,!1]),v("stencil.enable",2960),y("stencil.mask","stencilMask",-1),y("stencil.func","stencilFunc",[519,0,-1]),y("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),y("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),v("scissor.enable",3089),y("scissor.box","scissor",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]),y("viewport","viewport",[0,0,e.drawingBufferWidth,e.drawingBufferHeight]);var oe={gl:e,context:d,strings:t,next:te,current:ee,draw:p,elements:o,buffer:i,shader:l,attributes:f.state,uniforms:c,framebuffer:s,extensions:n,timer:h,isBufferArgs:I},ue={primTypes:ne,compareFuncs:ke,blendFuncs:_e,blendEquations:X,stencilOps:Ae,glTypes:J,orientationType:Ce};Z&&(ue.backBuffer=[1029],ue.drawBuffer=a(r.maxDrawbuffers,function(e){return 0===e?[0]:a(e,function(e){return 36064+e})}));var se=0;return{next:te,current:ee,procs:function(){var e=x(),t=e.proc("poll"),n=e.proc("refresh"),i=e.block();t(i),n(i);var o,u=e.shared,s=u.gl,c=u.next,f=u.current;i(f,".dirty=false;"),T(e,t),T(e,n,null,!0),K&&(o=e.link(K));for(var l=0;l<r.maxAttributes;++l){var p=n.def(u.attributes,"[",l,"]"),d=e.cond(p,".buffer");d.then(s,".enableVertexAttribArray(",l,");",s,".bindBuffer(",34962,",",p,".buffer.buffer);",s,".vertexAttribPointer(",l,",",p,".size,",p,".type,",p,".normalized,",p,".stride,",p,".offset);").else(s,".disableVertexAttribArray(",l,");",s,".vertexAttrib4f(",l,",",p,".x,",p,".y,",p,".z,",p,".w);",p,".buffer=null;"),n(d),K&&n(o,".vertexAttribDivisorANGLE(",l,",",p,".divisor);")}return Object.keys(ie).forEach(function(r){var a=ie[r],o=i.def(c,".",r),u=e.block();u("if(",o,"){",s,".enable(",a,")}else{",s,".disable(",a,")}",f,".",r,"=",o,";"),n(u),t("if(",o,"!==",f,".",r,"){",u,"}")}),Object.keys(ae).forEach(function(r){var o,u,l=ae[r],p=ee[r],d=e.block();d(s,".",l,"("),b(p)?(l=p.length,o=e.global.def(c,".",r),u=e.global.def(f,".",r),d(a(l,function(e){return o+"["+e+"]"}),");",a(l,function(e){return u+"["+e+"]="+o+"["+e+"];"}).join("")),t("if(",a(l,function(e){return o+"["+e+"]!=="+u+"["+e+"]"}).join("||"),"){",d,"}")):(o=i.def(c,".",r),u=i.def(f,".",r),d(o,");",f,".",r,"=",o,";"),t("if(",o,"!==",u,"){",d,"}")),n(d)}),e.compile()}(),compile:function(e,t,n,r,i){var a=x();return a.stats=a.link(i),Object.keys(t.static).forEach(function(e){$(a,t,e)}),we.forEach(function(t){$(a,e,t)}),n=C(e,t,n,r),function(e,t){var n=e.proc("draw",1);O(e,n),E(e,n,t.context),T(e,n,t.framebuffer),S(e,n,t),D(e,n,t.state),M(e,n,t,!1,!0);var r=t.shader.progVar.append(e,n);if(n(e.shared.gl,".useProgram(",r,".program);"),t.shader.program)H(e,n,t,t.shader.program);else{var i=e.global.def("{}"),a=n.def(r,".id"),o=n.def(i,"[",a,"]");n(e.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",e.link(function(n){return V(H,e,t,n,1)}),"(",r,");",o,".call(this,a0);"))}0<Object.keys(t.state).length&&n(e.shared.current,".dirty=true;")}(a,n),Q(a,n),function(e,t){function n(e){return e.contextDep&&i||e.propDep}var r=e.proc("batch",2);e.batchId="0",O(e,r);var i=!1,a=!0;Object.keys(t.context).forEach(function(e){i=i||t.context[e].propDep}),i||(E(e,r,t.context),a=!1);var o=!1;if((u=t.framebuffer)?(u.propDep?i=o=!0:u.contextDep&&i&&(o=!0),o||T(e,r,u)):T(e,r,null),t.state.viewport&&t.state.viewport.propDep&&(i=!0),S(e,r,t),D(e,r,t.state,function(e){return!n(e)}),t.profile&&n(t.profile)||M(e,r,t,!1,"a1"),t.contextDep=i,t.needsContext=a,t.needsFramebuffer=o,(a=t.shader.progVar).contextDep&&i||a.propDep)G(e,r,t,null);else if(a=a.append(e,r),r(e.shared.gl,".useProgram(",a,".program);"),t.shader.program)G(e,r,t,t.shader.program);else{var u=e.global.def("{}"),s=(o=r.def(a,".id"),r.def(u,"[",o,"]"));r(e.cond(s).then(s,".call(this,a0,a1);").else(s,"=",u,"[",o,"]=",e.link(function(n){return V(G,e,t,n,2)}),"(",a,");",s,".call(this,a0,a1);"))}0<Object.keys(t.state).length&&r(e.shared.current,".dirty=true;")}(a,n),a.compile()}}}function B(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var L=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;++r)e[n[r]]=t[n[r]];return e},U=0,W={DynamicVariable:e,define:function(n,r){return new e(n,t(r+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof e},unbox:function(t,n){return"function"==typeof t?new e(0,t):t},accessor:t},V={next:"function"==typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"==typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},H="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},q=u();q.zero=u();var G=function(e,t){var n=1;t.ext_texture_filter_anisotropic&&(n=e.getParameter(34047));var r=1,i=1;t.webgl_draw_buffers&&(r=e.getParameter(34852),i=e.getParameter(36063));var a=!!t.oes_texture_float;if(a){a=e.createTexture(),e.bindTexture(3553,a),e.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var o=e.createFramebuffer();if(e.bindFramebuffer(36160,o),e.framebufferTexture2D(36160,36064,3553,a,0),e.bindTexture(3553,null),36053!==e.checkFramebufferStatus(36160))a=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var u=q.allocType(5126,4);e.readPixels(0,0,1,1,6408,5126,u),e.getError()?a=!1:(e.deleteFramebuffer(o),e.deleteTexture(a),a=1===u[0]),q.freeType(u)}}return u=!0,u=e.createTexture(),o=q.allocType(5121,36),e.activeTexture(33984),e.bindTexture(34067,u),e.texImage2D(34069,0,6408,3,3,0,6408,5121,o),q.freeType(o),e.bindTexture(34067,null),e.deleteTexture(u),u=!e.getError(),{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter(function(e){return!!t[e]}),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:a,npotTextureCube:u}},Q=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray},$=function(e){return Object.keys(e).map(function(t){return e[t]})},Y={shape:function(e){for(var t=[];e.length;e=e[0])t.push(e.length);return t},flatten:function(e,t,n,r){var i=1;if(t.length)for(var a=0;a<t.length;++a)i*=t[a];else i=0;switch(n=r||q.allocType(n,i),t.length){case 0:break;case 1:for(r=t[0],t=0;t<r;++t)n[t]=e[t];break;case 2:for(r=t[0],t=t[1],a=i=0;a<r;++a)for(var o=e[a],u=0;u<t;++u)n[i++]=o[u];break;case 3:c(e,t[0],t[1],t[2],n,0);break;default:!function e(t,n,r,i,a){for(var o=1,u=r+1;u<n.length;++u)o*=n[u];var s=n[r];if(4==n.length-r){var f=n[r+1],l=n[r+2];for(n=n[r+3],u=0;u<s;++u)c(t[u],f,l,n,i,a),a+=o}else for(u=0;u<s;++u)e(t[u],n,r+1,i,a),a+=o}(e,t,0,n,0)}return n}},X={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},J={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},K={dynamic:35048,stream:35040,static:35044},Z=Y.flatten,ee=Y.shape,te=[];te[5120]=1,te[5122]=2,te[5124]=4,te[5121]=1,te[5123]=2,te[5125]=4,te[5126]=4;var ne={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},re=new Float32Array(1),ie=new Uint32Array(re.buffer),ae=[9984,9986,9985,9987],oe=[0,6409,6410,6407,6408],ue={};ue[6409]=ue[6406]=ue[6402]=1,ue[34041]=ue[6410]=2,ue[6407]=ue[35904]=3,ue[6408]=ue[35906]=4;var se=g("HTMLCanvasElement"),ce=g("CanvasRenderingContext2D"),fe=g("ImageBitmap"),le=g("HTMLImageElement"),pe=g("HTMLVideoElement"),de=Object.keys(X).concat([se,ce,fe,le,pe]),he=[];he[5121]=1,he[5126]=4,he[36193]=2,he[5123]=2,he[5125]=4;var me=[];me[32854]=2,me[32855]=2,me[36194]=2,me[34041]=4,me[33776]=.5,me[33777]=.5,me[33778]=1,me[33779]=1,me[35986]=.5,me[35987]=1,me[34798]=1,me[35840]=.5,me[35841]=.25,me[35842]=.5,me[35843]=.25,me[36196]=.5;var be=[];be[32854]=2,be[32855]=2,be[36194]=2,be[33189]=2,be[36168]=1,be[34041]=4,be[35907]=4,be[34836]=16,be[34842]=8,be[34843]=6;var ge=function(e,t,n,r,i){function a(e){this.id=c++,this.refCount=1,this.renderbuffer=e,this.format=32854,this.height=this.width=0,i.profile&&(this.stats={size:0})}function o(t){var n=t.renderbuffer;e.bindRenderbuffer(36161,null),e.deleteRenderbuffer(n),t.renderbuffer=null,t.refCount=0,delete f[t.id],r.renderbufferCount--}var u={rgba4:32854,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(u.srgba=35907),t.ext_color_buffer_half_float&&(u.rgba16f=34842,u.rgb16f=34843),t.webgl_color_buffer_float&&(u.rgba32f=34836);var s=[];Object.keys(u).forEach(function(e){s[u[e]]=e});var c=0,f={};return a.prototype.decRef=function(){0>=--this.refCount&&o(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var e=0;return Object.keys(f).forEach(function(t){e+=f[t].stats.size}),e}),{create:function(t,n){function o(t,n){var r=0,a=0,f=32854;if("object"==typeof t&&t?("shape"in t?(r=0|(a=t.shape)[0],a=0|a[1]):("radius"in t&&(r=a=0|t.radius),"width"in t&&(r=0|t.width),"height"in t&&(a=0|t.height)),"format"in t&&(f=u[t.format])):"number"==typeof t?(r=0|t,a="number"==typeof n?0|n:r):t||(r=a=1),r!==c.width||a!==c.height||f!==c.format)return o.width=c.width=r,o.height=c.height=a,c.format=f,e.bindRenderbuffer(36161,c.renderbuffer),e.renderbufferStorage(36161,f,r,a),i.profile&&(c.stats.size=be[c.format]*c.width*c.height),o.format=s[c.format],o}var c=new a(e.createRenderbuffer());return f[c.id]=c,r.renderbufferCount++,o(t,n),o.resize=function(t,n){var r=0|t,a=0|n||r;return r===c.width&&a===c.height?o:(o.width=c.width=r,o.height=c.height=a,e.bindRenderbuffer(36161,c.renderbuffer),e.renderbufferStorage(36161,c.format,r,a),i.profile&&(c.stats.size=be[c.format]*c.width*c.height),o)},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){$(f).forEach(o)},restore:function(){$(f).forEach(function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,t.renderbuffer),e.renderbufferStorage(36161,t.format,t.width,t.height)}),e.bindRenderbuffer(36161,null)}}},ve=[];ve[6408]=4,ve[6407]=3;var ye=[];ye[5121]=1,ye[5126]=4,ye[36193]=2;var xe=["x","y","z","w"],we="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),_e={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},ke={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ae={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ce={cw:2304,ccw:2305},Ee=new P(!1,!1,!1,function(){});return function(e){function t(){if(0===Y.length)_&&_.update(),Z=null;else{Z=V.next(t),l();for(var e=Y.length-1;0<=e;--e){var n=Y[e];n&&n(j,null,0)}b.flush(),_&&_.update()}}function n(){!Z&&0<Y.length&&(Z=V.next(t))}function r(){Z&&(V.cancel(t),Z=null)}function a(e){e.preventDefault(),r(),X.forEach(function(e){e()})}function o(e){b.getError(),v.restore(),F.restore(),R.restore(),z.restore(),N.restore(),U.restore(),_&&_.restore(),q.procs.refresh(),n(),J.forEach(function(e){e()})}function u(e){function t(e){var t={},n={};return Object.keys(e).forEach(function(r){var i=e[r];W.isDynamic(i)?n[r]=W.unbox(i,r):t[r]=i}),{dynamic:n,static:t}}var n=t(e.context||{}),r=t(e.uniforms||{}),i=t(e.attributes||{}),a=t(function(e){function t(e){if(e in n){var t=n[e];delete n[e],Object.keys(t).forEach(function(r){n[e+"."+r]=t[r]})}}var n=L({},e);return delete n.uniforms,delete n.attributes,delete n.context,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),t("blend"),t("depth"),t("cull"),t("stencil"),t("polygonOffset"),t("scissor"),t("sample"),n}(e));e={gpuTime:0,cpuTime:0,count:0};var o=(n=q.compile(a,i,r,n,e)).draw,u=n.batch,s=n.scope,c=[];return L(function(e,t){var n;if("function"==typeof e)return s.call(this,null,e,0);if("function"==typeof t)if("number"==typeof e)for(n=0;n<e;++n)s.call(this,null,t,n);else{if(!Array.isArray(e))return s.call(this,e,t,0);for(n=0;n<e.length;++n)s.call(this,e[n],t,n)}else if("number"==typeof e){if(0<e)return u.call(this,function(e){for(;c.length<e;)c.push(null);return c}(0|e),0|e)}else{if(!Array.isArray(e))return o.call(this,e);if(e.length)return u.call(this,e,e.length)}},{stats:e})}function s(e,t){var n=0;q.procs.poll();var r=t.color;r&&(b.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in t&&(b.clearDepth(+t.depth),n|=256),"stencil"in t&&(b.clearStencil(0|t.stencil),n|=1024),b.clear(n)}function c(e){return Y.push(e),n(),{cancel:function(){var t=B(Y,e);Y[t]=function e(){var t=B(Y,e);Y[t]=Y[Y.length-1],--Y.length,0>=Y.length&&r()}}}}function f(){var e=Q.viewport,t=Q.scissor_box;e[0]=e[1]=t[0]=t[1]=0,j.viewportWidth=j.framebufferWidth=j.drawingBufferWidth=e[2]=t[2]=b.drawingBufferWidth,j.viewportHeight=j.framebufferHeight=j.drawingBufferHeight=e[3]=t[3]=b.drawingBufferHeight}function l(){j.tick+=1,j.time=m(),f(),q.procs.poll()}function p(){f(),q.procs.refresh(),_&&_.update()}function m(){return(H()-k)/1e3}if(!(e=i(e)))return null;var b=e.gl,g=b.getContextAttributes();b.isContextLost();var v=function(e,t){function n(t){var n;t=t.toLowerCase();try{n=r[t]=e.getExtension(t)}catch(e){}return!!n}for(var r={},i=0;i<t.extensions.length;++i){var a=t.extensions[i];if(!n(a))return t.onDestroy(),t.onDone('"'+a+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return t.optionalExtensions.forEach(n),{extensions:r,restore:function(){Object.keys(r).forEach(function(e){if(!n(e))throw Error("(regl): error restoring extension "+e)})}}}(b,e);if(!v)return null;var y=function(){var e={"":0},t=[""];return{id:function(n){var r=e[n];return r||(r=e[n]=t.length,t.push(n),r)},str:function(e){return t[e]}}}(),x={bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},w=v.extensions,_=function(e,t){function n(e,t,n){var r=o.pop()||new function(){this.endQueryIndex=this.startQueryIndex=-1,this.sum=0,this.stats=null};r.startQueryIndex=e,r.endQueryIndex=t,r.sum=0,r.stats=n,u.push(r)}var r=t.ext_disjoint_timer_query;if(!r)return null;var i=[],a=[],o=[],u=[],s=[],c=[];return{beginQuery:function(e){var t=i.pop()||r.createQueryEXT();r.beginQueryEXT(35007,t),a.push(t),n(a.length-1,a.length,e)},endQuery:function(){r.endQueryEXT(35007)},pushScopeStats:n,update:function(){var e,t;if(0!==(e=a.length)){c.length=Math.max(c.length,e+1),s.length=Math.max(s.length,e+1),s[0]=0;var n=c[0]=0;for(t=e=0;t<a.length;++t){var f=a[t];r.getQueryObjectEXT(f,34919)?(n+=r.getQueryObjectEXT(f,34918),i.push(f)):a[e++]=f,s[t+1]=n,c[t+1]=e}for(a.length=e,t=e=0;t<u.length;++t){var l=(n=u[t]).startQueryIndex;f=n.endQueryIndex,n.sum+=s[f]-s[l],l=c[l],(f=c[f])===l?(n.stats.gpuTime+=n.sum/1e6,o.push(n)):(n.startQueryIndex=l,n.endQueryIndex=f,u[e++]=n)}u.length=e}},getNumPendingQueries:function(){return a.length},clear:function(){i.push.apply(i,a);for(var e=0;e<i.length;e++)r.deleteQueryEXT(i[e]);a.length=0,i.length=0},restore:function(){a.length=0,i.length=0}}}(0,w),k=H(),D=b.drawingBufferWidth,O=b.drawingBufferHeight,j={tick:0,time:0,viewportWidth:D,viewportHeight:O,framebufferWidth:D,framebufferHeight:O,drawingBufferWidth:D,drawingBufferHeight:O,pixelRatio:e.pixelRatio},I=G(b,w),R=(D=function(e,t,n,r){for(e=n.maxAttributes,t=Array(e),n=0;n<e;++n)t[n]=new E;return{Record:E,scope:{},state:t}}(b,w,I),d(b,x,e,D)),P=h(b,w,R,x),F=T(b,y,x,e),z=A(b,w,I,function(){q.procs.poll()},j,x,e),N=ge(b,w,0,x,e),U=C(b,w,I,z,N,x),q=M(b,y,w,I,R,P,0,U,{},D,F,{elements:null,primitive:4,count:-1,offset:0,instances:-1},j,_,e),Q=(y=S(b,U,q.procs.poll,j),q.next),$=b.canvas,Y=[],X=[],J=[],K=[e.onDestroy],Z=null;$&&($.addEventListener("webglcontextlost",a,!1),$.addEventListener("webglcontextrestored",o,!1));var ee=U.setFBO=u({framebuffer:W.define.call(null,1,"framebuffer")});return p(),g=L(u,{clear:function(e){if("framebuffer"in e)if(e.framebuffer&&"framebufferCube"===e.framebuffer_reglType)for(var t=0;6>t;++t)ee(L({framebuffer:e.framebuffer.faces[t]},e),s);else ee(e,s);else s(0,e)},prop:W.define.bind(null,1),context:W.define.bind(null,2),this:W.define.bind(null,3),draw:u({}),buffer:function(e){return R.create(e,34962,!1,!1)},elements:function(e){return P.create(e,!1)},texture:z.create2D,cube:z.createCube,renderbuffer:N.create,framebuffer:U.create,framebufferCube:U.createCube,attributes:g,frame:c,on:function(e,t){var n;switch(e){case"frame":return c(t);case"lost":n=X;break;case"restore":n=J;break;case"destroy":n=K}return n.push(t),{cancel:function(){for(var e=0;e<n.length;++e)if(n[e]===t){n[e]=n[n.length-1],n.pop();break}}}},limits:I,hasExtension:function(e){return 0<=I.extensions.indexOf(e.toLowerCase())},read:y,destroy:function(){Y.length=0,r(),$&&($.removeEventListener("webglcontextlost",a),$.removeEventListener("webglcontextrestored",o)),F.clear(),U.clear(),N.clear(),z.clear(),P.clear(),R.clear(),_&&_.clear(),K.forEach(function(e){e()})},_gl:b,_refresh:p,poll:function(){l(),_&&_.update()},now:m,stats:x}),e.onDone(null,g),g}},"object"==typeof n&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):r.createREGL=i()},{}],30:[function(e,t,n){"use strict";t.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},{}],31:[function(e,t,n){"use strict";var r=e("preact"),i=e("preact-compat/lib/create-react-class"),a=r.h;t.exports={createClass:function(e){return i({render:function(){return a("div",{className:e("field")},[a("button",{onClick:this.props.action,className:e("button")},this.props.label||this.props.name)])}})},createCss:function(e,t){return console.log("colors:",t),"\n ."+e("button")+" {\n margin: 3px 0 3px 30%;\n width: 70%;\n display: block;\n border: 0;\n background-color: "+t.track+";\n color: white;\n padding: 3px;\n }\n "}}},{preact:26,"preact-compat/lib/create-react-class":20}],32:[function(e,t,n){"use strict";var r=e("preact"),i=e("preact-compat/lib/create-react-class"),a=r.h;t.exports={createClass:function(e){return i({onInput:function(e){this.props.update(e.nativeEvent.target.value)},render:function(){var t=this.props.label||this.props.name;return a("div",{className:e("field")},[a("div",{className:e("container")},[a("label",{className:e("label"),htmlFor:e("input")},[a("span",{className:e("label-prefix")},t),a("span",{className:e("label-value")},this.props.value)]),a("input",{className:e("input"),id:e("input"),type:"color",value:this.props.value,onInput:this.onInput})])])}})},createCss:function(e,t){return"\n ."+e("container")+" {\n position: relative;\n }\n ."+e("label")+" {\n pointer-events: none;\n position: absolute;\n line-height: 20px;\n top: 0;\n right: 5px;\n bottom: 0;\n left: 5px;\n display: flex;\n flex-direction: row;\n }\n ."+e("label-prefix")+" {\n flex: 1;\n }\n ."+e("label-suffix")+" {\n }\n ."+e("input")+" {\n -webkit-appearance: none;\n margin: 3px 0 3px 30%;\n width: 20px;\n height: 20px;\n display: block;\n padding: 0;\n }\n ."+e("input")+":focus {\n outline: none;\n }\n ."+e("input")+"::-webkit-color-swatch-wrapper {\n padding: 0;\n }\n "}}},{preact:26,"preact-compat/lib/create-react-class":20}],33:[function(e,t,n){"use strict";var r=e("preact"),i=e("preact-compat/lib/create-react-class"),a=r.h;t.exports={createClass:function(e){return i({onInput:function(e){this.props.update(parseFloat(e.nativeEvent.target.value))},render:function(){return a("div",{className:e("field")},[a("h3",{className:e("heading")},this.props.label)])}})},createCss:function(e,t){return"\n ."+e("heading")+" {\n margin: 3px 0;\n }\n "}}},{preact:26,"preact-compat/lib/create-react-class":20}],34:[function(e,t,n){"use strict";var r=e("preact"),i=e("preact-compat/lib/create-react-class"),a=r.h;t.exports={createClass:function(e){return i({onInput:function(e){this.props.update(parseFloat(e.nativeEvent.target.value))},render:function(){var t=this.props.label||this.props.name;return a("div",{className:e("field")},[a("div",{className:e("container")},[a("label",{className:e("label"),htmlFor:e("input")},[a("span",{className:e("label-prefix")},t),a("span",{className:e("label-value")},""+function(e,t){if(0===e)return 0;var n=Math.max(Math.abs(e),1e-16),r=Math.log10(n),i=Math.round(r),a=Math.max(0,3-i),o=e.toFixed(a);return o=(o=o.replace(/\.([0-9]*[1-9]+)0*$/,".$1")).replace(/\.0*$/,"")}(this.props.value))]),a("input",{className:e("input"),id:e("input"),type:"range",min:this.props.min,max:this.props.max,step:this.props.step,value:this.props.value,onInput:this.onInput})])])}})},createCss:function(e,t){return"\n ."+e("container")+" {\n position: relative;\n }\n ."+e("label")+" {\n pointer-events: none;\n position: absolute;\n line-height: 20px;\n top: 0;\n right: 5px;\n bottom: 0;\n left: 5px;\n display: flex;\n flex-direction: row;\n }\n ."+e("label-prefix")+" {\n flex: 1;\n }\n ."+e("label-suffix")+" {\n }\n ."+e("input")+" {\n -webkit-appearance: none;\n margin: 3px 0 3px 30%;\n width: 70%;\n display: block;\n }\n ."+e("input")+":focus {\n outline: none;\n }\n ."+e("input")+"::-webkit-slider-runnable-track {\n width: 100%;\n height: 20px;\n cursor: ew-resize;\n background: "+t.track+";\n }\n ."+e("input")+"::-webkit-slider-thumb {\n height: 20px;\n width: 20px;\n background: "+t.thumb+";\n cursor: ew-resize;\n -webkit-appearance: none;\n margin-top: 0px;\n }\n ."+e("input")+":focus::-webkit-slider-runnable-track {\n background: "+t.track+";\n outline: none;\n }\n ."+e("input")+"::-moz-range-track {\n width: 100%;\n height: 20px;\n cursor: ew-resize;\n background: "+t.track+";\n }\n ."+e("input")+"::-moz-range-thumb {\n border: 0px solid rgba(0, 0, 0, 0);\n height: 20px;\n width: 20px;\n border-radius: 0px;\n background: "+t.thumb+";\n cursor: ew-resize;\n }\n ."+e("input")+"::-ms-track {\n width: 100%;\n height: 20px;\n cursor: ew-resize;\n background: transparent;\n border-color: transparent;\n color: transparent;\n }\n ."+e("input")+"::-ms-fill-lower {\n background: "+t.track+";\n }\n ."+e("input")+"::-ms-fill-upper {\n background: "+t.track+";\n }\n ."+e("input")+"::-ms-thumb {\n width: 20px;\n border-radius: 0px;\n background: "+t.thumb+";\n cursor: ew-resize;\n height: 20px;\n }\n ."+e("input")+":focus::-ms-fill-lower {\n background: "+t.track+";\n outline: none;\n }\n ."+e("input")+":focus::-ms-fill-upper {\n background: "+t.track+";\n outline: none;\n }\n "}}},{preact:26,"preact-compat/lib/create-react-class":20}],35:[function(e,t,n){"use strict";var r=e("preact"),i=e("preact-compat/lib/create-react-class"),a=r.h;t.exports={createClass:function(e){return i({onChange:function(e){console.log(e.nativeEvent.target.value),this.props.update(e.nativeEvent.target.value)},render:function(){var t=this.props.label||this.props.name;return a("div",{className:e("field")},[a("div",{className:e("container")},[a("label",{className:e("label"),htmlFor:e("input")},t),a("select",{className:e("input"),id:e("input"),type:"range",onChange:this.onChange,value:this.props.value},this.props.options.map(function(e,t){return a("option",{value:e},e)}))])])}})},createCss:function(e,t){return"\n ."+e("container")+" {\n position: relative;\n }\n ."+e("label")+" {\n pointer-events: none;\n position: absolute;\n line-height: 20px;\n top: 0;\n right: 5px;\n bottom: 0;\n left: 5px;\n display: flex;\n flex-direction: row;\n }\n ."+e("label-prefix")+" {\n flex: 1;\n }\n ."+e("label-suffix")+" {\n }\n ."+e("input")+" {\n margin: 3px 0 3px 30%;\n width: 70%;\n display: inline-block;\n line-height: 20px;\n vertical-align: middle;\n\n\t\t\t\t-webkit-appearance: none;\n\t\t\t\t-moz-appearance: none;\n\t\t\t\t-o-appearance:none;\n\t\t\t\tappearance:none;\n\n\n background-color: "+t.track+";\n border: none;\n color: white;\n padding: 0 5px;\n border-radius: 0;\n }\n ."+e("input")+":focus {\n outline: none;\n }\n "}}},{preact:26,"preact-compat/lib/create-react-class":20}],36:[function(e,t,n){"use strict";var r=e("preact"),i=r.h,a=e("preact-compat/lib/create-react-class"),o=e("insert-css");t.exports=function(t,n){var u=(n=n||{}).root||document.body,s=n.class||"controlPanel",c=Math.random().toString(36).substring(7),f={};function l(e){return s+"-"+c+(e?"-"+e:"")}function p(e){return function(t){return l(e+(t?"-"+t:""))}}var d,h={track:"#222",thumb:"#666"},m={color:e("./fields/color"),range:e("./fields/range"),heading:e("./fields/heading"),select:e("./fields/select"),button:e("./fields/button")};Object.keys(m).forEach(function(e){m[e].className=m[e].createClass(p(e))}),o("\n ."+l()+" {\n position: absolute;\n top: 0;\n left: 0;\n background-color: #444;\n color: #ccc;\n padding: 8px;\n font-family: sans-serif;\n font-size: 12px;\n width: 200px;\n }\n "+Object.keys(m).map(function(e){return m[e].createCss(p(e),h)}).join("\n")+"\n ");var b=a({componentDidMount:function(){var e=this;d=function(){return e.setState({counter:e.state.counter+1})}},getRef:function(e){var t=this;this._el=e,["click","mousedown","mouseup","mousemove","touchstart","touchmove","touchend","touchcancel"].forEach(function(e){t._el.addEventListener(e,function(e){return e.stopPropagation()})})},getInitialState:function(){return{counter:0}},setField:function(e,t){f[e]=t,n&&n.onInput(f),this.setState({counter:this.state.counter+1})},render:function(){return i("div",{className:l(),ref:this.getRef},t.map(function(e,t){var n=this;return void 0===f[e.name]&&(f[e.name]=e.initial),i(m[e.type].className,Object.assign({value:f[e.name],update:function(t){return n.setField(e.name,t)}},e))}.bind(this)))}});return r.render(i(b),u),{root:u,state:f,update:function(e){Object.assign(f,e),d()}}}},{"./fields/button":31,"./fields/color":32,"./fields/heading":33,"./fields/range":34,"./fields/select":35,"insert-css":15,preact:26,"preact-compat/lib/create-react-class":20}],37:[function(e,t,n){"use strict";var r=e("glslify");t.exports=function(e){return e({vert:"\n precision highp float;\n attribute vec2 xy;\n varying vec2 uv;\n void main () {\n uv = xy * 0.5 + 0.5;\n gl_Position = vec4(xy, 0, 1);\n }\n ",frag:r(["\n precision highp float;\n#define GLSLIFY 1\n\n varying vec2 uv;\n uniform sampler2D uInput, uKernel;\n void main () {\n vec4 src = texture2D(uInput, uv);\n vec4 kernel = texture2D(uKernel, uv);\n\n // (ar + ai i) * (br + bi i)\n // (ar * br - ai * bi) + (ar * bi + ai * br) i\n\n gl_FragColor = vec4(\n src.xz * kernel.xz - src.yw * kernel.yw,\n src.xz * kernel.yw + src.yw * kernel.xz\n ).xzyw;\n }\n ",""]),attributes:{xy:[-4,-4,0,4,4,-4]},uniforms:{uInput:e.prop("input.texture"),uKernel:e.prop("kernel.texture")},framebuffer:e.prop("output.fbo"),depth:{enable:!1},count:3})}},{glslify:13}],38:[function(e,t,n){"use strict";t.exports=function(e,t){return function(n,r,i){return new Array(n).fill(0).map(function(){var n=e.texture({width:r,height:i,type:t,wrapS:"repeat",wrapT:"repeat"});return{texture:n,fbo:e.framebuffer({color:n}),width:r,height:i}})}}},{}],39:[function(e,t,n){"use strict";var r=e("glslify");t.exports=function(e){var t={uInput:function(e,t){return t.input.texture},textureScale:function(e,t){return[t.input.width/e.framebufferWidth,t.input.height/e.framebufferHeight]}};return e.hasExtension("webgl_draw_buffers")&&(t.uColor=function(e,t){return t.input.color}),e({vert:"\n precision highp float;\n attribute vec2 xy;\n varying vec2 uv;\n uniform vec2 textureScale;\n void main () {\n uv = (xy * 0.5 + 0.5) / textureScale;\n gl_Position = vec4(xy, 0, 1);\n }\n ",frag:r(["\n precision highp float;\n#define GLSLIFY 1\n\n vec4 bone (float x_0) {\n const float e0 = 0.0;\n const vec4 v0 = vec4(0,0,0,1);\n const float e1 = 0.376;\n const vec4 v1 = vec4(0.32941176470588235,0.32941176470588235,0.4549019607843137,1);\n const float e2 = 0.753;\n const vec4 v2 = vec4(0.6627450980392157,0.7843137254901961,0.7843137254901961,1);\n const float e3 = 1.0;\n const vec4 v3 = vec4(1,1,1,1);\n float a0 = smoothstep(e0,e1,x_0);\n float a1 = smoothstep(e1,e2,x_0);\n float a2 = smoothstep(e2,e3,x_0);\n return max(mix(v0,v1,a0)*step(e0,x_0)*step(x_0,e1),\n max(mix(v1,v2,a1)*step(e1,x_0)*step(x_0,e2),mix(v2,v3,a2)*step(e2,x_0)*step(x_0,e3)\n ));\n}\n\n varying vec2 uv;\n uniform sampler2D uInput;\n ","\n\n vec3 yuv2rgb (vec3 yuv) {\n yuv.gb -= 0.5;\n return vec3(\n yuv.x * 1.0 + yuv.z * 1.4,\n yuv.x * 1.0 + yuv.y * -0.343 + yuv.z * -0.711,\n yuv.x * 1.0 + yuv.y * 1.765\n );\n }\n\n vec3 rgb2yuv (vec3 rgb) {\n return vec3(\n \trgb.r * 0.299 + rgb.g * 0.587 + rgb.b * 0.114,\n rgb.r * -0.169 + rgb.g * -0.331 + rgb.b * 0.5 + 0.5,\n rgb.r * 0.5 + rgb.g * -0.419 + rgb.b * -0.081 + 0.5\n );\n }\n\n void main () {\n float f = max(0.0, min(1.0, texture2D(uInput, uv).x));\n gl_FragColor = vec4(vec3(\n bone(f).rgb\n ), 1.0);\n\n //vec3 color = rgb2yuv(texture2D(uColor, uv).rgb);\n //color *= ;\n //color = yuv2rgb(color);\n //gl_FragColor = vec4(color, 1);\n\n ","\n }\n ",""],e.hasExtension("webgl_draw_buffers")?"uniform sampler2D uColor;":"",e.hasExtension("webgl_draw_buffers")?"\n //gl_FragColor.rgb = texture2D(uColor, uv).rgb * f;\n gl_FragColor.rgb = mix(f * texture2D(uColor, uv).rgb, gl_FragColor.rgb, (f - 0.5) * (f - 0.5) * 4.0);\n ":""),attributes:{xy:[-4,-4,0,4,4,-4]},uniforms:t,depth:{enable:!1},count:3})}},{glslify:13}],40:[function(e,t,n){"use strict";var r=e("glsl-fft"),i=e("glslify");t.exports=function(e){return function(t,n,a,o){var u={input:null,ping:{texture:a,fbo:a},pong:{texture:o,fbo:o},output:null},s=r({width:t,height:n,input:"input",ping:"ping",pong:"pong",output:"output",splitNormalization:!0,forward:!0}),c=r({width:t,height:n,input:"input",ping:"ping",pong:"pong",output:"output",splitNormalization:!0,forward:!1}),f=e({vert:"\n precision highp float;\n attribute vec2 xy;\n void main () {\n gl_Position = vec4(xy, 0, 1);\n }\n ",frag:i(["\n precision highp float;\n#define GLSLIFY 1\n\n\n const float TWOPI = 6.283185307179586;\n\nvec4 fft (\n sampler2D src,\n vec2 resolution_0,\n float subtransformSize_0,\n bool horizontal_0,\n bool forward_0,\n float normalization_0\n) {\n vec2 evenPos, oddPos, twiddle, outputA, outputB;\n vec4 even, odd;\n float index, evenIndex, twiddleArgument;\n\n index = (horizontal_0 ? gl_FragCoord.x : gl_FragCoord.y) - 0.5;\n\n evenIndex = floor(index / subtransformSize_0) *\n (subtransformSize_0 * 0.5) +\n mod(index, subtransformSize_0 * 0.5) +\n 0.5;\n\n if (horizontal_0) {\n evenPos = vec2(evenIndex, gl_FragCoord.y);\n oddPos = vec2(evenIndex, gl_FragCoord.y);\n } else {\n evenPos = vec2(gl_FragCoord.x, evenIndex);\n oddPos = vec2(gl_FragCoord.x, evenIndex);\n }\n\n evenPos *= resolution_0;\n oddPos *= resolution_0;\n\n if (horizontal_0) {\n oddPos.x += 0.5;\n } else {\n oddPos.y += 0.5;\n }\n\n even = texture2D(src, evenPos);\n odd = texture2D(src, oddPos);\n\n twiddleArgument = (forward_0 ? TWOPI : -TWOPI) * (index / subtransformSize_0);\n twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));\n\n return (even.rgba + vec4(\n twiddle.x * odd.xz - twiddle.y * odd.yw,\n twiddle.y * odd.xz + twiddle.x * odd.yw\n ).xzyw) * normalization_0;\n}\n\n uniform sampler2D uInput;\n uniform vec2 resolution;\n uniform float subtransformSize, normalization;\n uniform bool horizontal, forward;\n\n void main () {\n gl_FragColor = fft(\n uInput,\n resolution,\n subtransformSize,\n horizontal,\n forward,\n normalization\n );\n }\n ",""]),attributes:{xy:[-4,-4,0,4,4,-4]},uniforms:{uInput:function(e,t){return u[t.input].texture},resolution:e.prop("resolution"),subtransformSize:e.prop("subtransformSize"),normalization:e.prop("normalization"),horizontal:e.prop("horizontal"),forward:e.prop("forward")},framebuffer:function(e,t){return u[t.output].fbo},depth:{enable:!1},count:3});return{forward:function(e){return u.input=e.input,u.output=e.output,f(s)},inverse:function(e){return u.input=e.input,u.output=e.output,f(c)}}}}},{"glsl-fft":12,glslify:13}],41:[function(e,t,n){"use strict";var r=e("float-hsl2rgb"),i=(e("float-rgb2hsl"),e("./control-panel")),a=e("color-stringify"),o=e("color-rgba"),u=e("query-string"),s=u.parse(window.location.hash),c=parseFloat(s.pr||1),f=s.s||256,l=parseInt(s.scale2||0),p=Math.round(Math.log(f/256)/Math.log(2)),d=parseInt(s.halt||0),h="yes"===s.div,m=parseInt(s.seed||0);if(h){var b=document.createElement("div");b.style.textAlign="center";var g=document.createElement("div");g.style.display="inline-block",g.style.width=f/c+"px",g.style.height=f/c+"px",b.appendChild(g),document.body.appendChild(b)}e("regl")({pixelRatio:c,extensions:["oes_texture_float"],optionalExtensions:["webgl_draw_buffers"],container:h?g:null,attributes:{antialias:!1,depthStencil:!1,alpha:!1},onDone:e("fail-nicely")(function(t){h||(t._gl.canvas.style.position="fixed");var n=e("./convolve")(t),b=e("./initialize")(t),g=e("./initialize-kernel")(t),v=e("./draw-to-screen")(t),y=e("./create-state")(t,"float"),x=e("./fft")(t),w=e("./swap"),_=f,k=f;function A(){var e=f/1024;return{pr:c,s:f,ar:C.map(function(t){return t.activatorRadius/e}),ir:C.map(function(t){return t.inhibitorRadius/e}),k:C.map(function(e){return e.kernel}),a:C.map(function(e){return e.amount}),c:C.map(function(e){return T(e.color)}),halt:d,div:h?"yes":"no",seed:m,scale:p,scale2:l}}var C=[{activatorRadius:250,inhibitorRadius:500,amount:.05,kernel:"circular"},{activatorRadius:45,inhibitorRadius:90,amount:.04,kernel:"circular"},{activatorRadius:20,inhibitorRadius:40,amount:-.03,kernel:"circular"},{activatorRadius:10,inhibitorRadius:20,amount:.02,kernel:"circular"},{activatorRadius:3,inhibitorRadius:6,amount:.02,kernel:"circular"},{activatorRadius:1,inhibitorRadius:2,amount:.01,kernel:"circular"}];function E(e){e=e||f/1024;for(var t=0;t<C.length;t++)C[t].activatorRadius*=e,C[t].inhibitorRadius*=e}function T(e){return a([Math.max(0,Math.min(255,Math.floor(256*e[0]))),Math.max(0,Math.min(255,Math.floor(256*e[1]))),Math.max(0,Math.min(255,Math.floor(256*e[2]))),Math.max(0,Math.min(1,e[3]))],"hex")}function S(e){return o(e).slice(0,3).map(function(e){return e/255})}s.ir&&s.ir.forEach(function(e,t){return C[t].inhibitorRadius=parseFloat(e)});s.ar&&s.ar.forEach(function(e,t){return C[t].activatorRadius=parseFloat(e)});s.a&&s.a.forEach(function(e,t){return C[t].amount=parseFloat(e)});s.k&&s.k.forEach(function(e,t){return C[t].kernel=e});s.c?s.c.forEach(function(e,t){C[t].color=S(e)}):function(e,t){e[0].color=r([230/360,.7,.6]),e[1].color=r([240/360,.7,.5]),e[2].color=r([208/360,.8,.5]),e[3].color=r([210/360,.8,.5]),e[4].color=r([.75,.7,.5]),e[5].color=r([0,1,.81])}(C);E();var D=i([{name:"res",type:"range",min:8,max:13,initial:Math.round(Math.log(f)/Math.log(2))},{name:"pixelRat",type:"range",min:.5,max:4,step:.5,initial:parseFloat(c)},{name:"scale",type:"range",min:-8,max:8,step:1,initial:p},{name:"scale2",type:"range",min:-8,max:8,step:1,initial:l},{name:"halt",type:"range",min:0,max:1e3,step:1,initial:d},{name:"inDiv",type:"select",options:["yes","no"],initial:h?"yes":"no"},{name:"seed",type:"button",action:function(){H(m=Math.random())}},{name:"randomize",type:"button",action:function(){(function(){for(var e=0;e<C.length;e++){var t;switch(e){case 0:C[e].amount=.03+.02*Math.random(),t=256*(.125+.375*Math.random())*.6;break;case 1:C[e].amount=.05*Math.random()-.01,t=Math.max(.01,.25*Math.random()*Math.random()*256);break;default:C[e].amount=.01+.02*Math.random(),t=Math.max(.01,.125*Math.random()*Math.random()*256)}C[e].kernel=Math.random()>.5?"circular":"gaussian",C[e].activatorRadius=t,C[e].inhibitorRadius=2*t}U=Math.max.apply(null,C.map(function(e){return e.amount}))})(),j(),I=0,V(),O(),window.location.hash=u.stringify(A())}},{name:"randomize color",type:"button",action:function(){j(),I=0,V(),O(),window.location.hash=u.stringify(A())}}].concat(new Array(C.length).fill(0).map(function(e,t){return[{type:"heading",label:"Scale "+(t+1)},{name:"radius"+t,label:"Radius",type:"range",min:.05,max:100,step:.05,initial:C[t].activatorRadius},{name:"amount"+t,label:"Amount",type:"range",min:-.03,max:.05,step:.001,initial:C[t].amount},{name:"kernel"+t,label:"Kernel",type:"select",options:["gaussian","circular"],initial:C[t].kernel},{name:"color"+t,label:"Color",type:"color",min:0,max:360,step:1,initial:T(C[t].color)}]}).flat()),{onInput:function(e){d=e.halt;e.res;var t=!1;if(Math.pow(2,e.res)!==parseInt(f)||e.pixelRat!==c||"yes"===e.inDiv!==h){var n=Math.pow(2,e.res);(e.res===p||e.res<11||window.confirm("This resolution ("+n+"x"+n+") may lock up your browser or worse. Are you sure you want to continue?"))&&(t=!0,E(Math.pow(2,e.res)/f),f=Math.round(Math.pow(2,e.res)))}h="yes"===e.inDiv;var r=!1;e.scale===p&&l===e.scale2||(r=!0),l=e.scale2,p=e.scale;for(var i=0;i<C.length;i++)C[i].activatorRadius===e["radius"+i]&&C[i].kernel===e["kernel"+i]||(r=!0),C[i].activatorRadius=e["radius"+i],C[i].inhibitorRadius=2*e["radius"+i],C[i].amount=e["amount"+i],C[i].color=S(e["color"+i]),C[i].kernel=e["kernel"+i],r&&V();c=e.pixelRat,window.location.hash=u.stringify(A()),t&&setTimeout(function(){window.location.reload()},500)}});function O(){D.update({radius0:C[0].activatorRadius,radius1:C[1].activatorRadius,radius2:C[2].activatorRadius,radius3:C[3].activatorRadius,radius4:C[4].activatorRadius,radius5:C[5].activatorRadius,amount0:C[0].amount,amount1:C[1].amount,amount2:C[2].amount,amount3:C[3].amount,amount4:C[4].amount,amount5:C[5].amount,kernel0:C[0].kernel,kernel1:C[1].kernel,kernel2:C[2].kernel,kernel3:C[3].kernel,kernel4:C[4].kernel,kernel5:C[5].kernel,color0:T(C[0].color),color1:T(C[1].color),color2:T(C[2].color),color3:T(C[3].color),color4:T(C[4].color),color5:T(C[5].color)})}function j(){for(var e=0;e<C.length;e++)C[e].color=r([Math.random(),.9,.5+.4*Math.random()])}var I,R=e("./step")(t,C.length),P=new Array(2).fill(0).map(function(){var e=t.texture({width:_,height:k,type:"float",wrapS:"repeat",wrapT:"repeat"}),n={width:_,height:k,texture:e};return t.hasExtension("webgl_draw_buffers")?(n.color=t.texture({width:_,height:k,type:"float",wrapS:"repeat",wrapT:"repeat"}),n.fbo=t.framebuffer({colors:[e,n.color]})):n.fbo=t.framebuffer({color:e}),n}),F=Math.ceil(C.length/2),z=y(2,_,k),N=y(1,_,k)[0],M=y(F,_,k),B=y(2,_,k),L=y(F,_,k),U=Math.max.apply(null,C.map(function(e){return e.amount})),W=x(_,k,B[0].fbo,B[1].fbo);function V(){for(var e=0,t=0;e<F;e++,t+=2)g(Object.assign({output:N},{scale1:C[t],scale2:C[t+1],scaleFactor:Math.pow(2,p+l)})),W.forward({input:N,output:M[e]})}function H(e){I=0,b({output:P[0],seed:e}),V(),window.location.hash=u.stringify(A())}H(m);var q=!1;t.frame(function(e){e.tick;if(d>0&&I>d){if(!q)return;return v({input:P[0]}),void(q=!1)}I++,W.forward({input:P[0],output:z[0]});for(var t=0,r=0;t<F;t++,r+=2)n({input:z[0],kernel:M[t],output:z[1]}),W.inverse({input:z[1],output:L[t]});R({variations:L,scales:C,input:P[0],output:P[1],dt:1,maxAmount:U}),w(P),v({input:P[0]})}),window.addEventListener("resize",function(){q=!0})})})},{"./control-panel":36,"./convolve":37,"./create-state":38,"./draw-to-screen":39,"./fft":40,"./initialize":43,"./initialize-kernel":42,"./step":44,"./swap":45,"color-rgba":4,"color-stringify":7,"fail-nicely":9,"float-hsl2rgb":10,"float-rgb2hsl":11,"query-string":28,regl:29}],42:[function(e,t,n){"use strict";t.exports=function(e){return e({vert:"\n precision highp float;\n attribute vec2 xy;\n varying vec2 uv;\n void main () {\n uv = xy * 0.5 - 0.5;\n gl_Position = vec4(xy, 0, 1);\n }\n ",frag:"\n precision highp float;\n varying vec2 uv;\n uniform float uActivatorRadius1, uInhibitorRadius1;\n uniform float uActivatorRadius2, uInhibitorRadius2;\n uniform bool uCircular1, uCircular2;\n uniform vec2 uResolution;\n\n #define PI 3.14159265358979\n\n void main () {\n vec2 wrappedUv = mod(uv + 0.5 - 0.5 / uResolution, 1.0) - 0.5;\n float r = length(wrappedUv * uResolution);\n\n float gaussianScale = 0.5;\n\n float arInner1 = uActivatorRadius1 - 0.5;\n float arOuter1 = uActivatorRadius1 + 0.5;\n float irInner1 = uInhibitorRadius1 - 0.5;\n float irOuter1 = uInhibitorRadius1 + 0.5;\n\n float arInner2 = uActivatorRadius2 - 0.5;\n float arOuter2 = uActivatorRadius2 + 0.5;\n float irInner2 = uInhibitorRadius2 - 0.5;\n float irOuter2 = uInhibitorRadius2 + 0.5;\n \n if (uCircular1) {\n gl_FragColor.x = (1.0 - min(1.0, max(0.0, (r - arInner1) / (arOuter1 - arInner1)))) / (PI * uActivatorRadius1 * uActivatorRadius1);\n gl_FragColor.y = (1.0 - min(1.0, max(0.0, (r - irInner1) / (irOuter1 - irInner1)))) / (PI * uInhibitorRadius1 * uInhibitorRadius1);\n } else {\n gl_FragColor.x = exp(-0.5 * pow(r / (uActivatorRadius1 * gaussianScale), 2.0)) * 0.5 / 3.1415926 / pow(uActivatorRadius1 * gaussianScale, 2.0);\n gl_FragColor.y = exp(-0.5 * pow(r / (uInhibitorRadius1 * gaussianScale), 2.0)) * 0.5 / 3.1415926 / pow(uInhibitorRadius1 * gaussianScale, 2.0);\n }\n\n if (uCircular2) {\n gl_FragColor.z = (1.0 - min(1.0, max(0.0, (r - arInner2) / (arOuter2 - arInner2)))) / (PI * uActivatorRadius2 * uActivatorRadius2);\n gl_FragColor.w = (1.0 - min(1.0, max(0.0, (r - irInner2) / (irOuter2 - irInner2)))) / (PI * uInhibitorRadius2 * uInhibitorRadius2);\n } else {\n gl_FragColor.z = exp(-0.5 * pow(r / (uActivatorRadius2 * gaussianScale), 2.0)) * 0.5 / 3.1415926 / pow(uActivatorRadius2 * gaussianScale, 2.0);\n gl_FragColor.w = exp(-0.5 * pow(r / (uInhibitorRadius2 * gaussianScale), 2.0)) * 0.5 / 3.1415926 / pow(uInhibitorRadius2 * gaussianScale, 2.0);\n }\n }\n ",attributes:{xy:[-4,-4,0,4,4,-4]},uniforms:{uActivatorRadius1:function(e,t){return t.scale1.activatorRadius*t.scaleFactor},uInhibitorRadius1:function(e,t){return t.scale1.inhibitorRadius*t.scaleFactor},uActivatorRadius2:function(e,t){return t.scale2.activatorRadius*t.scaleFactor},uInhibitorRadius2:function(e,t){return t.scale2.inhibitorRadius*t.scaleFactor},uCircular1:function(e,t){return"circular"===t.scale1.kernel},uCircular2:function(e,t){return"circular"===t.scale2.kernel},uResolution:function(e){return[e.framebufferWidth,e.framebufferHeight]}},framebuffer:e.prop("output.fbo"),depth:{enable:!1},count:3})}},{}],43:[function(e,t,n){"use strict";var r=e("glslify");t.exports=function(e){return e({vert:"\n precision highp float;\n attribute vec2 xy;\n void main () {\n gl_Position = vec4(xy, 0, 1);\n }\n ",frag:r(["\n ","\n\n precision highp float;\n#define GLSLIFY 1\n\n highp float random(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt= dot(co.xy ,vec2(a,b));\n highp float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\n\n uniform float uSeed;\n void main () {\n gl_FragData[0] = vec4(random(gl_FragCoord.xy + uSeed) * 2.0 - 1.0);\n ","\n }\n ",""],e.hasExtension("webgl_draw_buffers")?"\n #extension GL_EXT_draw_buffers : enable\n ":"",e.hasExtension("webgl_draw_buffers")?"\n gl_FragData[1] = vec4(1);\n ":""),attributes:{xy:[-4,-4,0,4,4,-4]},uniforms:{uSeed:e.prop("seed")},framebuffer:e.prop("output.fbo"),depth:{enable:!1},count:3})}},{glslify:13}],44:[function(e,t,n){"use strict";t.exports=function(e,t){var n=new Array(t).fill(0).map(function(e,t){return t}),r={uInput:e.prop("input.texture"),uDt:e.prop("dt"),uRange:function(e,t){return[-(1+t.maxAmount*t.dt*2.2),1+t.maxAmount*t.dt*1.1]}};e.hasExtension("webgl_draw_buffers")&&(r.uColorInput=e.prop("input.color"));for(var i=Math.ceil(t/2),a=new Array(i).fill(0).map(function(e,t){return t}),o=0;o<i;o++)r["uVariation"+o]=e.prop("variations["+o+"].texture");for(o=0;o<n.length;o++)r["uAmount"+o]=e.prop("scales["+o+"].amount"),r["uActivatorRadius"+o]=e.prop("scales["+o+"].activatorRadius"),e.hasExtension("webgl_draw_buffers")&&(r["uColor"+o]=e.prop("scales["+o+"].color"));var u="\n "+(e.hasExtension("webgl_draw_buffers")?"\n #extension GL_EXT_draw_buffers : enable\n ":"")+"\n\n precision highp float;\n varying vec2 uv;\n uniform float uDt;\n uniform vec2 uRange;\n uniform sampler2D uInput;\n\n "+(e.hasExtension("webgl_draw_buffers")?"uniform sampler2D uColorInput;":"")+"\n\n "+a.map(function(e){return"uniform sampler2D uVariation"+e+";"}).join("\n ")+"\n "+n.map(function(e){return"uniform float uAmount"+e+";"}).join("\n ")+"\n "+n.map(function(e){return"uniform float uActivatorRadius"+e+";"}).join("\n ")+"\n "+n.map(function(t){return e.hasExtension("webgl_draw_buffers")?"uniform vec3 uColor"+t+";":""}).join("\n ")+"\n\n void main () {\n "+a.map(function(e){return"\n vec4 activatorInhibitor"+e+" = texture2D(uVariation"+e+", uv);\n float var"+2*e+" = abs(activatorInhibitor"+e+".x - activatorInhibitor"+e+".y);\n float step"+2*e+" = activatorInhibitor"+e+".x > activatorInhibitor"+e+".y ? uAmount"+2*e+" : -uAmount"+2*e+";\n float var"+(2*e+1)+" = abs(activatorInhibitor"+e+".z - activatorInhibitor"+e+".w);\n float step"+(2*e+1)+" = activatorInhibitor"+e+".z > activatorInhibitor"+e+".w ? uAmount"+(2*e+1)+" : -uAmount"+(2*e+1)+";\n "}).join("")+"\n\n float minVariation = var0;\n float step = step0;\n \n "+(e.hasExtension("webgl_draw_buffers")?"\n vec3 color = texture2D(uColorInput, uv).rgb;\n vec3 outputColor = mix(color, uColor0, uAmount0);":"")+"\n\n "+n.slice(1).map(function(t){return"\n if (uActivatorRadius"+t+" > 0.0 && var"+t+" < minVariation) {\n minVariation = var"+t+";\n step = step"+t+";\n "+(e.hasExtension("webgl_draw_buffers")?"outputColor = mix(color, uColor"+t+", uAmount"+t+");":"")+"\n }\n "}).join("")+"\n\n float y = texture2D(uInput, uv).x;\n gl_FragData[0] = vec4(\n (y + step * uDt - uRange.x) / (uRange.y - uRange.x) * 2.0 - 1.0,\n 0, 0, 0).xyxy;\n\n "+(e.hasExtension("webgl_draw_buffers")?"\n gl_FragData[1] = vec4(max(vec3(-2), min(vec3(3), outputColor)), 1);\n ":"")+"\n }\n ";return e({vert:"\n precision highp float;\n attribute vec2 xy;\n varying vec2 uv;\n void main () {\n uv = xy * 0.5 + 0.5;\n gl_Position = vec4(xy, 0, 1);\n }\n ",frag:u,attributes:{xy:[-4,-4,0,4,4,-4]},uniforms:r,framebuffer:e.prop("output.fbo"),depth:{enable:!1},count:3})}},{}],45:[function(e,t,n){"use strict";t.exports=function(e){var t=e[0];return e[0]=e[1],e[1]=t,e}},{}]},{},[41]);