@robotical/martyblocks 1.4.44 → 1.4.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.min.js +1 -1
- package/non-ascii-reader.js +15 -0
- package/package.json +1 -1
package/dist/lib.min.js
CHANGED
|
@@ -38,7 +38,7 @@ var t=i(1042),o=i(1043),n=i(446);function a(){return s.TYPED_ARRAY_SUPPORT?21474
|
|
|
38
38
|
* Available via the MIT license.
|
|
39
39
|
* see: http://github.com/greggman/twgl.js for details
|
|
40
40
|
*/
|
|
41
|
-
!function(e,i){A.exports=i()}("undefined"!=typeof self&&self,function(){return function(A){var e={};function i(t){if(e[t])return e[t].exports;var o=e[t]={i:t,l:!1,exports:{}};return A[t].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=A,i.c=e,i.d=function(A,e,t){i.o(A,e)||Object.defineProperty(A,e,{configurable:!1,enumerable:!0,get:t})},i.n=function(A){var e=A&&A.__esModule?function(){return A.default}:function(){return A};return i.d(e,"a",e),e},i.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},i.p="",i(i.s=9)}([function(A,e,i){"use strict";e.__esModule=!0,e.copyExistingProperties=function(A,e){Object.keys(e).forEach(function(i){e.hasOwnProperty(i)&&A.hasOwnProperty(i)&&(e[i]=A[i])})},e.copyNamedProperties=function(A,e,i){A.forEach(function(A){var t=e[A];void 0!==t&&(i[A]=t)})},e.isBuffer=function(A,e){n||(n=A.createBuffer());return e instanceof n.constructor},e.isRenderbuffer=function(A,e){a||(a=A.createRenderbuffer());return e instanceof a.constructor},e.isShader=function(A,e){r||(r=A.createShader(A.VERTEX_SHADER));return e instanceof r.constructor},e.isTexture=function(A,e){s||(s=A.createTexture());return e instanceof s.constructor},e.isSampler=function(A,e){if(!g){if(!A.createSampler)return!1;g=A.createSampler()}return e instanceof g.constructor},e.warn=e.error=void 0;var t=function(A){return A&&A.__esModule?A:{default:A}}(i(2));var o=t.default.console&&t.default.console.error&&"function"==typeof t.default.console.error?t.default.console.error.bind(t.default.console):function(){};e.error=o;var n,a,r,s,g,l=t.default.console&&t.default.console.warn&&"function"==typeof t.default.console.warn?t.default.console.warn.bind(t.default.console):function(){};e.warn=l},function(A,e,i){"use strict";e.__esModule=!0,e.getGLTypeForTypedArray=function(A){if(A instanceof Int8Array)return o;if(A instanceof Uint8Array)return n;if(A instanceof Uint8ClampedArray)return n;if(A instanceof Int16Array)return a;if(A instanceof Uint16Array)return r;if(A instanceof Int32Array)return s;if(A instanceof Uint32Array)return g;if(A instanceof Float32Array)return l;throw"unsupported typed array type"},e.getGLTypeForTypedArrayType=function(A){if(A===Int8Array)return o;if(A===Uint8Array)return n;if(A===Uint8ClampedArray)return n;if(A===Int16Array)return a;if(A===Uint16Array)return r;if(A===Int32Array)return s;if(A===Uint32Array)return g;if(A===Float32Array)return l;throw"unsupported typed array type"},e.getTypedArrayTypeForGLType=function(A){var e=c[A];if(!e)throw"unknown gl type";return e},e.isArrayBuffer=void 0;var t=function(A){return A&&A.__esModule?A:{default:A}}(i(2));var o=5120,n=5121,a=5122,r=5123,s=5124,g=5125,l=5126,c={},u=c;u[o]=Int8Array,u[n]=Uint8Array,u[a]=Int16Array,u[r]=Uint16Array,u[s]=Int32Array,u[g]=Uint32Array,u[l]=Float32Array,u[32819]=Uint16Array,u[32820]=Uint16Array,u[33635]=Uint16Array,u[5131]=Uint16Array,u[33640]=Uint32Array,u[35899]=Uint32Array,u[35902]=Uint32Array,u[36269]=Uint32Array,u[34042]=Uint32Array;var B=t.default.SharedArrayBuffer?function(A){return A&&A.buffer&&(A.buffer instanceof ArrayBuffer||A.buffer instanceof t.default.SharedArrayBuffer)}:function(A){return A&&A.buffer&&A.buffer instanceof ArrayBuffer};e.isArrayBuffer=B},function(A,e,i){"use strict";e.__esModule=!0,e.default=void 0;var t=void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};e.default=t},function(A,e,i){"use strict";e.__esModule=!0,e.add=function(A,e,i){return(i=i||new t(3))[0]=A[0]+e[0],i[1]=A[1]+e[1],i[2]=A[2]+e[2],i},e.copy=function(A,e){return(e=e||new t(3))[0]=A[0],e[1]=A[1],e[2]=A[2],e},e.create=function(A,e,i){var o=new t(3);A&&(o[0]=A);e&&(o[1]=e);i&&(o[2]=i);return o},e.cross=function(A,e,i){i=i||new t(3);var o=A[2]*e[0]-A[0]*e[2],n=A[0]*e[1]-A[1]*e[0];return i[0]=A[1]*e[2]-A[2]*e[1],i[1]=o,i[2]=n,i},e.distance=function(A,e){var i=A[0]-e[0],t=A[1]-e[1],o=A[2]-e[2];return Math.sqrt(i*i+t*t+o*o)},e.distanceSq=function(A,e){var i=A[0]-e[0],t=A[1]-e[1],o=A[2]-e[2];return i*i+t*t+o*o},e.divide=function(A,e,i){return(i=i||new t(3))[0]=A[0]/e[0],i[1]=A[1]/e[1],i[2]=A[2]/e[2],i},e.divScalar=function(A,e,i){return(i=i||new t(3))[0]=A[0]/e,i[1]=A[1]/e,i[2]=A[2]/e,i},e.dot=function(A,e){return A[0]*e[0]+A[1]*e[1]+A[2]*e[2]},e.lerp=function(A,e,i,o){return(o=o||new t(3))[0]=(1-i)*A[0]+i*e[0],o[1]=(1-i)*A[1]+i*e[1],o[2]=(1-i)*A[2]+i*e[2],o},e.length=function(A){return Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2])},e.lengthSq=function(A){return A[0]*A[0]+A[1]*A[1]+A[2]*A[2]},e.mulScalar=function(A,e,i){return(i=i||new t(3))[0]=A[0]*e,i[1]=A[1]*e,i[2]=A[2]*e,i},e.multiply=function(A,e,i){return(i=i||new t(3))[0]=A[0]*e[0],i[1]=A[1]*e[1],i[2]=A[2]*e[2],i},e.negate=function(A,e){return(e=e||new t(3))[0]=-A[0],e[1]=-A[1],e[2]=-A[2],e},e.normalize=function(A,e){e=e||new t(3);var i=A[0]*A[0]+A[1]*A[1]+A[2]*A[2],o=Math.sqrt(i);o>1e-5?(e[0]=A[0]/o,e[1]=A[1]/o,e[2]=A[2]/o):(e[0]=0,e[1]=0,e[2]=0);return e},e.setDefaultType=function(A){var e=t;return t=A,e},e.subtract=function(A,e,i){return(i=i||new t(3))[0]=A[0]-e[0],i[1]=A[1]-e[1],i[2]=A[2]-e[2],i};var t=Float32Array},function(A,e,i){"use strict";e.__esModule=!0,e.isWebGL1=function(A){return!A.texStorage2D},e.isWebGL2=function(A){return!!A.texStorage2D},e.glEnumToString=void 0;var t=function(){var A={},e={};return function(i,t){return function(i){var t=i.constructor.name;if(!A[t]){for(var o in i)if("number"==typeof i[o]){var n=e[i[o]];e[i[o]]=n?"".concat(n," | ").concat(o):o}A[t]=!0}}(i),e[t]||"0x"+t.toString(16)}}();e.glEnumToString=t},function(A,e,i){"use strict";e.__esModule=!0,e.createAttributeSetters=P,e.createProgram=F,e.createProgramFromScripts=function(A,e,i,t,o){for(var n=b(i,t,o),a=[],r=0;r<e.length;++r){var s=v(A,e[r],A[y[r]],n.errorCallback);if(!s)return null;a.push(s)}return F(A,a,n)},e.createProgramFromSources=S,e.createProgramInfo=function(A,e,i,t,o){var n=b(i,t,o),a=!0;if(e=e.map(function(A){if(A.indexOf("\n")<0){var e=g(A);e?A=e.text:(n.errorCallback("no element with id: "+A),a=!1)}return A}),!a)return null;var r=S(A,e,n);if(!r)return null;return _(A,r)},e.createProgramInfoFromProgram=_,e.createUniformSetters=R,e.createUniformBlockSpecFromProgram=U,e.createUniformBlockInfoFromProgram=H,e.createUniformBlockInfo=function(A,e,i){return H(A,e.program,e.uniformBlockSpec,i)},e.createTransformFeedback=function(A,e,i){var t=A.createTransformFeedback();return A.bindTransformFeedback(A.TRANSFORM_FEEDBACK,t),A.useProgram(e.program),Y(A,e,i),A.bindTransformFeedback(A.TRANSFORM_FEEDBACK,null),function(A,e,i){for(var t in e.transformFeedbackInfo&&(e=e.transformFeedbackInfo),i.attribs&&(i=i.attribs),i){var o=e[t];o&&A.bindBufferBase(A.TRANSFORM_FEEDBACK_BUFFER,o.index,null)}}(A,e,i),t},e.createTransformFeedbackInfo=O,e.bindTransformFeedbackInfo=Y,e.setAttributes=x,e.setBuffersAndAttributes=function(A,e,i){i.vertexArrayObject?A.bindVertexArray(i.vertexArrayObject):(x(e.attribSetters||e,i.attribs),i.indices&&A.bindBuffer(A.ELEMENT_ARRAY_BUFFER,i.indices))},e.setUniforms=function A(e,i){var t=e.uniformSetters||e;var o=arguments.length;for(var n=1;n<o;++n){var a=arguments[n];if(Array.isArray(a))for(var r=a.length,s=0;s<r;++s)A(t,a[s]);else for(var g in a){var l=t[g];l&&l(a[g])}}},e.setUniformBlock=function(A,e,i){L(A,e,i)&&A.bufferData(A.UNIFORM_BUFFER,i.array,A.DYNAMIC_DRAW)},e.setBlockUniforms=function(A,e){var i=A.uniforms;for(var t in e){var o=i[t];if(o){var n=e[t];n.length?o.set(n):o[0]=n}}},e.bindUniformBlock=L;var t=a(i(4)),o=a(i(0)),n=function(A){return A&&A.__esModule?A:{default:A}}(i(2));function a(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}var r=o.error,s=o.warn,g=n.default&&n.default.document&&n.default.document.getElementById?n.default.document.getElementById.bind(n.default.document):function(){return null},l={};function c(A,e){return l[e].bindPoint}function u(A,e){return function(i){A.uniform1i(e,i)}}function B(A,e){return function(i){A.uniform1iv(e,i)}}function d(A,e){return function(i){A.uniform2iv(e,i)}}function E(A,e){return function(i){A.uniform3iv(e,i)}}function h(A,e){return function(i){A.uniform4iv(e,i)}}function C(A,e,i,n){var a=c(0,e);return t.isWebGL2(A)?function(e){var t,r;o.isTexture(A,e)?(t=e,r=null):(t=e.texture,r=e.sampler),A.uniform1i(n,i),A.activeTexture(A.TEXTURE0+i),A.bindTexture(a,t),A.bindSampler(i,r)}:function(e){A.uniform1i(n,i),A.activeTexture(A.TEXTURE0+i),A.bindTexture(a,e)}}function w(A,e,i,n,a){for(var r=c(0,e),s=new Int32Array(a),g=0;g<a;++g)s[g]=i+g;return t.isWebGL2(A)?function(e){A.uniform1iv(n,s),e.forEach(function(e,t){var n,a;A.activeTexture(A.TEXTURE0+s[t]),o.isTexture(A,e)?(n=e,a=null):(n=e.texture,a=e.sampler),A.bindSampler(i,a),A.bindTexture(r,n)})}:function(e){A.uniform1iv(n,s),e.forEach(function(e,i){A.activeTexture(A.TEXTURE0+s[i]),A.bindTexture(r,e)})}}function m(A,e){return function(i){A.bindBuffer(A.ARRAY_BUFFER,i.buffer),A.enableVertexAttribArray(e),A.vertexAttribPointer(e,i.numComponents||i.size,i.type||A.FLOAT,i.normalize||!1,i.stride||0,i.offset||0),void 0!==i.divisor&&A.vertexAttribDivisor(e,i.divisor)}}function p(A,e){return function(i){A.bindBuffer(A.ARRAY_BUFFER,i.buffer),A.enableVertexAttribArray(e),A.vertexAttribIPointer(e,i.numComponents||i.size,i.type||A.INT,i.stride||0,i.offset||0),void 0!==i.divisor&&A.vertexAttribDivisor(e,i.divisor)}}function I(A,e,i){var t=i.size,o=i.count;return function(i){A.bindBuffer(A.ARRAY_BUFFER,i.buffer);for(var n=i.size||i.numComponents||t,a=n/o,r=i.type||A.FLOAT,s=l[r].size*n,g=i.normalize||!1,c=i.offset||0,u=s/o,B=0;B<o;++B)A.enableVertexAttribArray(e+B),A.vertexAttribPointer(e+B,a,r,g,s,c+u*B),void 0!==i.divisor&&A.vertexAttribDivisor(e+B,i.divisor)}}l[5126]={Type:Float32Array,size:4,setter:function(A,e){return function(i){A.uniform1f(e,i)}},arraySetter:function(A,e){return function(i){A.uniform1fv(e,i)}}},l[35664]={Type:Float32Array,size:8,setter:function(A,e){return function(i){A.uniform2fv(e,i)}}},l[35665]={Type:Float32Array,size:12,setter:function(A,e){return function(i){A.uniform3fv(e,i)}}},l[35666]={Type:Float32Array,size:16,setter:function(A,e){return function(i){A.uniform4fv(e,i)}}},l[5124]={Type:Int32Array,size:4,setter:u,arraySetter:B},l[35667]={Type:Int32Array,size:8,setter:d},l[35668]={Type:Int32Array,size:12,setter:E},l[35669]={Type:Int32Array,size:16,setter:h},l[5125]={Type:Uint32Array,size:4,setter:function(A,e){return function(i){A.uniform1ui(e,i)}},arraySetter:function(A,e){return function(i){A.uniform1uiv(e,i)}}},l[36294]={Type:Uint32Array,size:8,setter:function(A,e){return function(i){A.uniform2uiv(e,i)}}},l[36295]={Type:Uint32Array,size:12,setter:function(A,e){return function(i){A.uniform3uiv(e,i)}}},l[36296]={Type:Uint32Array,size:16,setter:function(A,e){return function(i){A.uniform4uiv(e,i)}}},l[35670]={Type:Uint32Array,size:4,setter:u,arraySetter:B},l[35671]={Type:Uint32Array,size:8,setter:d},l[35672]={Type:Uint32Array,size:12,setter:E},l[35673]={Type:Uint32Array,size:16,setter:h},l[35674]={Type:Float32Array,size:16,setter:function(A,e){return function(i){A.uniformMatrix2fv(e,!1,i)}}},l[35675]={Type:Float32Array,size:36,setter:function(A,e){return function(i){A.uniformMatrix3fv(e,!1,i)}}},l[35676]={Type:Float32Array,size:64,setter:function(A,e){return function(i){A.uniformMatrix4fv(e,!1,i)}}},l[35685]={Type:Float32Array,size:24,setter:function(A,e){return function(i){A.uniformMatrix2x3fv(e,!1,i)}}},l[35686]={Type:Float32Array,size:32,setter:function(A,e){return function(i){A.uniformMatrix2x4fv(e,!1,i)}}},l[35687]={Type:Float32Array,size:24,setter:function(A,e){return function(i){A.uniformMatrix3x2fv(e,!1,i)}}},l[35688]={Type:Float32Array,size:48,setter:function(A,e){return function(i){A.uniformMatrix3x4fv(e,!1,i)}}},l[35689]={Type:Float32Array,size:32,setter:function(A,e){return function(i){A.uniformMatrix4x2fv(e,!1,i)}}},l[35690]={Type:Float32Array,size:48,setter:function(A,e){return function(i){A.uniformMatrix4x3fv(e,!1,i)}}},l[35678]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:3553},l[35680]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:34067},l[35679]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:32879},l[35682]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:3553},l[36289]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:35866},l[36292]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:35866},l[36293]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:34067},l[36298]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:3553},l[36299]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:32879},l[36300]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:34067},l[36303]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:35866},l[36306]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:3553},l[36307]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:32879},l[36308]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:34067},l[36311]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:35866};var f={};f[5126]={size:4,setter:m},f[35664]={size:8,setter:m},f[35665]={size:12,setter:m},f[35666]={size:16,setter:m},f[5124]={size:4,setter:p},f[35667]={size:8,setter:p},f[35668]={size:12,setter:p},f[35669]={size:16,setter:p},f[5125]={size:4,setter:p},f[36294]={size:8,setter:p},f[36295]={size:12,setter:p},f[36296]={size:16,setter:p},f[35670]={size:4,setter:p},f[35671]={size:8,setter:p},f[35672]={size:12,setter:p},f[35673]={size:16,setter:p},f[35674]={size:4,setter:I,count:2},f[35675]={size:9,setter:I,count:3},f[35676]={size:16,setter:I,count:4};var Q=void 0;var D=/^[ \t]*\n/;function M(A,e,i,t){var o=t||r,n=A.createShader(i),a=0;if(D.test(e)&&(a=1,e=e.replace(D,"")),A.shaderSource(n,e),A.compileShader(n),!A.getShaderParameter(n,A.COMPILE_STATUS)){var s=A.getShaderInfoLog(n);return o(function(A,e){return e=e||0,++e,A.split("\n").map(function(A,i){return i+e+": "+A}).join("\n")}(e,a)+"\n*** Error compiling shader: "+s),A.deleteShader(n),null}return n}function b(A,e,i){var t;if("function"==typeof e&&(i=e,e=void 0),"function"==typeof A)i=A,A=void 0;else if(A&&!Array.isArray(A)){if(A.errorCallback)return A;var o=A;i=o.errorCallback,A=o.attribLocations,t=o.transformFeedbackVaryings}var n={errorCallback:i||r,transformFeedbackVaryings:t};if(A){var a={};Array.isArray(A)?A.forEach(function(A,i){a[A]=e?e[i]:i}):a=A,n.attribLocations=a}return n}var y=["VERTEX_SHADER","FRAGMENT_SHADER"];function T(A){return A.indexOf("frag")>=0?Q.FRAGMENT_SHADER:A.indexOf("vert")>=0?Q.VERTEX_SHADER:void 0}function k(A,e){e.forEach(function(e){A.deleteShader(e)})}function F(A,e,i,t,n){for(var a=b(i,t,n),r=[],s=[],l=0;l<e.length;++l){var c=e[l];if("string"==typeof c){var u=g(c),B=u?u.text:c,d=A[y[l]];u&&u.type&&(d=T(u.type)||d),c=M(A,B,d,a.errorCallback),s.push(c)}o.isShader(A,c)&&r.push(c)}if(r.length!==e.length)return a.errorCallback("not enough shaders for program"),k(A,s),null;var E=A.createProgram();r.forEach(function(e){A.attachShader(E,e)}),a.attribLocations&&Object.keys(a.attribLocations).forEach(function(e){A.bindAttribLocation(E,a.attribLocations[e],e)});var h=a.transformFeedbackVaryings;if(h&&(h.attribs&&(h=h.attribs),Array.isArray(h)||(h=Object.keys(h)),A.transformFeedbackVaryings(E,h,a.transformFeedbackMode||A.SEPARATE_ATTRIBS)),A.linkProgram(E),!A.getProgramParameter(E,A.LINK_STATUS)){var C=A.getProgramInfoLog(E);return a.errorCallback("Error in program linking:"+C),A.deleteProgram(E),k(A,s),null}return E}function v(A,e,i,t){var o,n=g(e);if(!n)throw"*** Error: unknown script element"+e;o=n.text;var a=i||T(n.type);if(!a)throw"*** Error: unknown shader type";return M(A,o,a,t)}function S(A,e,i,t,o){for(var n=b(i,t,o),a=[],r=0;r<e.length;++r){var s=M(A,e[r],A[y[r]],n.errorCallback);if(!s)return null;a.push(s)}return F(A,a,n)}function N(A){var e=A.name;return e.startsWith("gl_")||e.startsWith("webgl_")}function R(A,e){var i=0;function t(e,t){var o,n=A.getUniformLocation(e,t.name),a=t.size>1&&"[0]"===t.name.substr(-3),r=t.type,s=l[r];if(!s)throw"unknown type: 0x"+r.toString(16);if(s.bindPoint){var g=i;i+=t.size,o=a?s.arraySetter(A,r,g,n,t.size):s.setter(A,r,g,n,t.size)}else o=s.arraySetter&&a?s.arraySetter(A,n):s.setter(A,n);return o.location=n,o}for(var o={},n=A.getProgramParameter(e,A.ACTIVE_UNIFORMS),a=0;a<n;++a){var r=A.getActiveUniform(e,a);if(!N(r)){var s=r.name;"[0]"===s.substr(-3)&&(s=s.substr(0,s.length-3));var g=t(e,r);o[s]=g}}return o}function O(A,e){for(var i={},t=A.getProgramParameter(e,A.TRANSFORM_FEEDBACK_VARYINGS),o=0;o<t;++o){var n=A.getTransformFeedbackVarying(e,o);i[n.name]={index:o,type:n.type,size:n.size}}return i}function Y(A,e,i){for(var t in e.transformFeedbackInfo&&(e=e.transformFeedbackInfo),i.attribs&&(i=i.attribs),i){var o=e[t];if(o){var n=i[t];n.offset?A.bindBufferRange(A.TRANSFORM_FEEDBACK_BUFFER,o.index,n.buffer,n.offset,n.size):A.bindBufferBase(A.TRANSFORM_FEEDBACK_BUFFER,o.index,n.buffer)}}}function U(A,e){for(var i=A.getProgramParameter(e,A.ACTIVE_UNIFORMS),t=[],o=[],n=0;n<i;++n){o.push(n),t.push({});var a=A.getActiveUniform(e,n);if(N(a))break;t[n].name=a.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach(function(i){var n=i[0],a=i[1];A.getActiveUniforms(e,o,A[n]).forEach(function(A,e){t[e][a]=A})});for(var r={},s=A.getProgramParameter(e,A.ACTIVE_UNIFORM_BLOCKS),g=0;g<s;++g){var l=A.getActiveUniformBlockName(e,g),c={index:g,usedByVertexShader:A.getActiveUniformBlockParameter(e,g,A.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),usedByFragmentShader:A.getActiveUniformBlockParameter(e,g,A.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),size:A.getActiveUniformBlockParameter(e,g,A.UNIFORM_BLOCK_DATA_SIZE),uniformIndices:A.getActiveUniformBlockParameter(e,g,A.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES)};c.used=c.usedByVertexSahder||c.usedByFragmentShader,r[l]=c}return{blockSpecs:r,uniformData:t}}var G=/\[\d+\]\.$/;function H(A,e,i,t){var o=i.blockSpecs,n=i.uniformData,a=o[t];if(!a)return s("no uniform block object named:",t),{name:t,uniforms:{}};var r=new ArrayBuffer(a.size),g=A.createBuffer(),c=a.index;A.bindBuffer(A.UNIFORM_BUFFER,g),A.uniformBlockBinding(e,a.index,c);var u=t+".";G.test(u)&&(u=u.replace(G,"."));var B={};return a.uniformIndices.forEach(function(A){var e=n[A],i=l[e.type],t=i.Type,o=e.size*i.size,a=e.name;a.substr(0,u.length)===u&&(a=a.substr(u.length)),B[a]=new t(r,e.offset,o/t.BYTES_PER_ELEMENT)}),{name:t,array:r,asFloat:new Float32Array(r),buffer:g,uniforms:B}}function L(A,e,i){var t=(e.uniformBlockSpec||e).blockSpecs[i.name];if(t){var o=t.index;return A.bindBufferRange(A.UNIFORM_BUFFER,o,i.buffer,i.offset||0,i.array.byteLength),!0}return!1}function P(A,e){for(var i={},t=A.getProgramParameter(e,A.ACTIVE_ATTRIBUTES),o=0;o<t;++o){var n=A.getActiveAttrib(e,o);if(!N(n)){var a=A.getAttribLocation(e,n.name),r=f[n.type],s=r.setter(A,a,r);s.location=a,i[n.name]=s}}return i}function x(A,e){for(var i in e){var t=A[i];t&&t(e[i])}}function _(A,e){var i={program:e,uniformSetters:R(A,e),attribSetters:P(A,e)};return t.isWebGL2(A)&&(i.uniformBlockSpec=U(A,e),i.transformFeedbackInfo=O(A,e)),i}},function(A,e,i){"use strict";e.__esModule=!0,e.axisRotate=function(A,e,i,t){t=t||new o(16);var n=e[0],a=e[1],r=e[2],s=Math.sqrt(n*n+a*a+r*r),g=(n/=s)*n,l=(a/=s)*a,c=(r/=s)*r,u=Math.cos(i),B=Math.sin(i),d=1-u,E=g+(1-g)*u,h=n*a*d+r*B,C=n*r*d-a*B,w=n*a*d-r*B,m=l+(1-l)*u,p=a*r*d+n*B,I=n*r*d+a*B,f=a*r*d-n*B,Q=c+(1-c)*u,D=A[0],M=A[1],b=A[2],y=A[3],T=A[4],k=A[5],F=A[6],v=A[7],S=A[8],N=A[9],R=A[10],O=A[11];t[0]=E*D+h*T+C*S,t[1]=E*M+h*k+C*N,t[2]=E*b+h*F+C*R,t[3]=E*y+h*v+C*O,t[4]=w*D+m*T+p*S,t[5]=w*M+m*k+p*N,t[6]=w*b+m*F+p*R,t[7]=w*y+m*v+p*O,t[8]=I*D+f*T+Q*S,t[9]=I*M+f*k+Q*N,t[10]=I*b+f*F+Q*R,t[11]=I*y+f*v+Q*O,A!==t&&(t[12]=A[12],t[13]=A[13],t[14]=A[14],t[15]=A[15]);return t},e.axisRotation=function(A,e,i){i=i||new o(16);var t=A[0],n=A[1],a=A[2],r=Math.sqrt(t*t+n*n+a*a),s=(t/=r)*t,g=(n/=r)*n,l=(a/=r)*a,c=Math.cos(e),u=Math.sin(e),B=1-c;return i[0]=s+(1-s)*c,i[1]=t*n*B+a*u,i[2]=t*a*B-n*u,i[3]=0,i[4]=t*n*B-a*u,i[5]=g+(1-g)*c,i[6]=n*a*B+t*u,i[7]=0,i[8]=t*a*B+n*u,i[9]=n*a*B-t*u,i[10]=l+(1-l)*c,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},e.copy=s,e.frustum=function(A,e,i,t,n,a,r){r=r||new o(16);var s=e-A,g=t-i,l=n-a;return r[0]=2*n/s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2*n/g,r[6]=0,r[7]=0,r[8]=(A+e)/s,r[9]=(t+i)/g,r[10]=a/l,r[11]=-1,r[12]=0,r[13]=0,r[14]=n*a/l,r[15]=0,r},e.getAxis=function(A,e,i){i=i||t.create();var o=4*e;return i[0]=A[o+0],i[1]=A[o+1],i[2]=A[o+2],i},e.getTranslation=function(A,e){return(e=e||t.create())[0]=A[12],e[1]=A[13],e[2]=A[14],e},e.identity=g,e.inverse=l,e.lookAt=function(A,e,i,s){s=s||new o(16);var g=n,l=a,c=r;return t.normalize(t.subtract(A,e,c),c),t.normalize(t.cross(i,c,g),g),t.normalize(t.cross(c,g,l),l),s[0]=g[0],s[1]=g[1],s[2]=g[2],s[3]=0,s[4]=l[0],s[5]=l[1],s[6]=l[2],s[7]=0,s[8]=c[0],s[9]=c[1],s[10]=c[2],s[11]=0,s[12]=A[0],s[13]=A[1],s[14]=A[2],s[15]=1,s},e.multiply=function(A,e,i){i=i||new o(16);var t=A[0],n=A[1],a=A[2],r=A[3],s=A[4],g=A[5],l=A[6],c=A[7],u=A[8],B=A[9],d=A[10],E=A[11],h=A[12],C=A[13],w=A[14],m=A[15],p=e[0],I=e[1],f=e[2],Q=e[3],D=e[4],M=e[5],b=e[6],y=e[7],T=e[8],k=e[9],F=e[10],v=e[11],S=e[12],N=e[13],R=e[14],O=e[15];return i[0]=t*p+s*I+u*f+h*Q,i[1]=n*p+g*I+B*f+C*Q,i[2]=a*p+l*I+d*f+w*Q,i[3]=r*p+c*I+E*f+m*Q,i[4]=t*D+s*M+u*b+h*y,i[5]=n*D+g*M+B*b+C*y,i[6]=a*D+l*M+d*b+w*y,i[7]=r*D+c*M+E*b+m*y,i[8]=t*T+s*k+u*F+h*v,i[9]=n*T+g*k+B*F+C*v,i[10]=a*T+l*k+d*F+w*v,i[11]=r*T+c*k+E*F+m*v,i[12]=t*S+s*N+u*R+h*O,i[13]=n*S+g*N+B*R+C*O,i[14]=a*S+l*N+d*R+w*O,i[15]=r*S+c*N+E*R+m*O,i},e.negate=function(A,e){return(e=e||new o(16))[0]=-A[0],e[1]=-A[1],e[2]=-A[2],e[3]=-A[3],e[4]=-A[4],e[5]=-A[5],e[6]=-A[6],e[7]=-A[7],e[8]=-A[8],e[9]=-A[9],e[10]=-A[10],e[11]=-A[11],e[12]=-A[12],e[13]=-A[13],e[14]=-A[14],e[15]=-A[15],e},e.ortho=function(A,e,i,t,n,a,r){return(r=r||new o(16))[0]=2/(e-A),r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2/(t-i),r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2/(n-a),r[11]=0,r[12]=(e+A)/(A-e),r[13]=(t+i)/(i-t),r[14]=(a+n)/(n-a),r[15]=1,r},e.perspective=function(A,e,i,t,n){n=n||new o(16);var a=Math.tan(.5*Math.PI-.5*A),r=1/(i-t);return n[0]=a/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=(i+t)*r,n[11]=-1,n[12]=0,n[13]=0,n[14]=i*t*r*2,n[15]=0,n},e.rotateX=function(A,e,i){i=i||new o(16);var t=A[4],n=A[5],a=A[6],r=A[7],s=A[8],g=A[9],l=A[10],c=A[11],u=Math.cos(e),B=Math.sin(e);i[4]=u*t+B*s,i[5]=u*n+B*g,i[6]=u*a+B*l,i[7]=u*r+B*c,i[8]=u*s-B*t,i[9]=u*g-B*n,i[10]=u*l-B*a,i[11]=u*c-B*r,A!==i&&(i[0]=A[0],i[1]=A[1],i[2]=A[2],i[3]=A[3],i[12]=A[12],i[13]=A[13],i[14]=A[14],i[15]=A[15]);return i},e.rotateY=function(A,e,i){i=i||new o(16);var t=A[0],n=A[1],a=A[2],r=A[3],s=A[8],g=A[9],l=A[10],c=A[11],u=Math.cos(e),B=Math.sin(e);i[0]=u*t-B*s,i[1]=u*n-B*g,i[2]=u*a-B*l,i[3]=u*r-B*c,i[8]=u*s+B*t,i[9]=u*g+B*n,i[10]=u*l+B*a,i[11]=u*c+B*r,A!==i&&(i[4]=A[4],i[5]=A[5],i[6]=A[6],i[7]=A[7],i[12]=A[12],i[13]=A[13],i[14]=A[14],i[15]=A[15]);return i},e.rotateZ=function(A,e,i){i=i||new o(16);var t=A[0],n=A[1],a=A[2],r=A[3],s=A[4],g=A[5],l=A[6],c=A[7],u=Math.cos(e),B=Math.sin(e);i[0]=u*t+B*s,i[1]=u*n+B*g,i[2]=u*a+B*l,i[3]=u*r+B*c,i[4]=u*s-B*t,i[5]=u*g-B*n,i[6]=u*l-B*a,i[7]=u*c-B*r,A!==i&&(i[8]=A[8],i[9]=A[9],i[10]=A[10],i[11]=A[11],i[12]=A[12],i[13]=A[13],i[14]=A[14],i[15]=A[15]);return i},e.rotationX=function(A,e){e=e||new o(16);var i=Math.cos(A),t=Math.sin(A);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=t,e[7]=0,e[8]=0,e[9]=-t,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.rotationY=function(A,e){e=e||new o(16);var i=Math.cos(A),t=Math.sin(A);return e[0]=i,e[1]=0,e[2]=-t,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=t,e[9]=0,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.rotationZ=function(A,e){e=e||new o(16);var i=Math.cos(A),t=Math.sin(A);return e[0]=i,e[1]=t,e[2]=0,e[3]=0,e[4]=-t,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.scale=function(A,e,i){i=i||new o(16);var t=e[0],n=e[1],a=e[2];i[0]=t*A[0],i[1]=t*A[1],i[2]=t*A[2],i[3]=t*A[3],i[4]=n*A[4],i[5]=n*A[5],i[6]=n*A[6],i[7]=n*A[7],i[8]=a*A[8],i[9]=a*A[9],i[10]=a*A[10],i[11]=a*A[11],A!==i&&(i[12]=A[12],i[13]=A[13],i[14]=A[14],i[15]=A[15]);return i},e.scaling=function(A,e){return(e=e||new o(16))[0]=A[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=A[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=A[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.setAxis=function(A,e,i,t){t!==A&&(t=s(A,t));var o=4*i;return t[o+0]=e[0],t[o+1]=e[1],t[o+2]=e[2],t},e.setDefaultType=function(A){var e=o;return o=A,e},e.setTranslation=function(A,e,i){i=i||g(),A!==i&&(i[0]=A[0],i[1]=A[1],i[2]=A[2],i[3]=A[3],i[4]=A[4],i[5]=A[5],i[6]=A[6],i[7]=A[7],i[8]=A[8],i[9]=A[9],i[10]=A[10],i[11]=A[11]);return i[12]=e[0],i[13]=e[1],i[14]=e[2],i[15]=1,i},e.transformDirection=function(A,e,i){i=i||t.create();var o=e[0],n=e[1],a=e[2];return i[0]=o*A[0]+n*A[4]+a*A[8],i[1]=o*A[1]+n*A[5]+a*A[9],i[2]=o*A[2]+n*A[6]+a*A[10],i},e.transformNormal=function(A,e,i){i=i||t.create();var o=l(A),n=e[0],a=e[1],r=e[2];return i[0]=n*o[0]+a*o[1]+r*o[2],i[1]=n*o[4]+a*o[5]+r*o[6],i[2]=n*o[8]+a*o[9]+r*o[10],i},e.transformPoint=function(A,e,i){i=i||t.create();var o=e[0],n=e[1],a=e[2],r=o*A[3]+n*A[7]+a*A[11]+A[15];return i[0]=(o*A[0]+n*A[4]+a*A[8]+A[12])/r,i[1]=(o*A[1]+n*A[5]+a*A[9]+A[13])/r,i[2]=(o*A[2]+n*A[6]+a*A[10]+A[14])/r,i},e.translate=function(A,e,i){i=i||new o(16);var t=e[0],n=e[1],a=e[2],r=A[0],s=A[1],g=A[2],l=A[3],c=A[4],u=A[5],B=A[6],d=A[7],E=A[8],h=A[9],C=A[10],w=A[11],m=A[12],p=A[13],I=A[14],f=A[15];A!==i&&(i[0]=r,i[1]=s,i[2]=g,i[3]=l,i[4]=c,i[5]=u,i[6]=B,i[7]=d,i[8]=E,i[9]=h,i[10]=C,i[11]=w);return i[12]=r*t+c*n+E*a+m,i[13]=s*t+u*n+h*a+p,i[14]=g*t+B*n+C*a+I,i[15]=l*t+d*n+w*a+f,i},e.translation=function(A,e){return(e=e||new o(16))[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=A[0],e[13]=A[1],e[14]=A[2],e[15]=1,e},e.transpose=function(A,e){if((e=e||new o(16))===A){var i;return i=A[1],A[1]=A[4],A[4]=i,i=A[2],A[2]=A[8],A[8]=i,i=A[3],A[3]=A[12],A[12]=i,i=A[6],A[6]=A[9],A[9]=i,i=A[7],A[7]=A[13],A[13]=i,i=A[11],A[11]=A[14],A[14]=i,e}var t=A[0],n=A[1],a=A[2],r=A[3],s=A[4],g=A[5],l=A[6],c=A[7],u=A[8],B=A[9],d=A[10],E=A[11],h=A[12],C=A[13],w=A[14],m=A[15];return e[0]=t,e[1]=s,e[2]=u,e[3]=h,e[4]=n,e[5]=g,e[6]=B,e[7]=C,e[8]=a,e[9]=l,e[10]=d,e[11]=w,e[12]=r,e[13]=c,e[14]=E,e[15]=m,e};var t=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}(i(3));var o=Float32Array,n=t.create(),a=t.create(),r=t.create();function s(A,e){return(e=e||new o(16))[0]=A[0],e[1]=A[1],e[2]=A[2],e[3]=A[3],e[4]=A[4],e[5]=A[5],e[6]=A[6],e[7]=A[7],e[8]=A[8],e[9]=A[9],e[10]=A[10],e[11]=A[11],e[12]=A[12],e[13]=A[13],e[14]=A[14],e[15]=A[15],e}function g(A){return(A=A||new o(16))[0]=1,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=1,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function l(A,e){e=e||new o(16);var i=A[0],t=A[1],n=A[2],a=A[3],r=A[4],s=A[5],g=A[6],l=A[7],c=A[8],u=A[9],B=A[10],d=A[11],E=A[12],h=A[13],C=A[14],w=A[15],m=B*w,p=C*d,I=g*w,f=C*l,Q=g*d,D=B*l,M=n*w,b=C*a,y=n*d,T=B*a,k=n*l,F=g*a,v=c*h,S=E*u,N=r*h,R=E*s,O=r*u,Y=c*s,U=i*h,G=E*t,H=i*u,L=c*t,P=i*s,x=r*t,_=m*s+f*u+Q*h-(p*s+I*u+D*h),j=p*t+M*u+T*h-(m*t+b*u+y*h),J=I*t+b*s+k*h-(f*t+M*s+F*h),z=D*t+y*s+F*u-(Q*t+T*s+k*u),K=1/(i*_+r*j+c*J+E*z);return e[0]=K*_,e[1]=K*j,e[2]=K*J,e[3]=K*z,e[4]=K*(p*r+I*c+D*E-(m*r+f*c+Q*E)),e[5]=K*(m*i+b*c+y*E-(p*i+M*c+T*E)),e[6]=K*(f*i+M*r+F*E-(I*i+b*r+k*E)),e[7]=K*(Q*i+T*r+k*c-(D*i+y*r+F*c)),e[8]=K*(v*l+R*d+O*w-(S*l+N*d+Y*w)),e[9]=K*(S*a+U*d+L*w-(v*a+G*d+H*w)),e[10]=K*(N*a+G*l+P*w-(R*a+U*l+x*w)),e[11]=K*(Y*a+H*l+x*d-(O*a+L*l+P*d)),e[12]=K*(N*B+Y*C+S*g-(O*C+v*g+R*B)),e[13]=K*(H*C+v*n+G*B-(U*B+L*C+S*n)),e[14]=K*(U*g+x*C+R*n-(P*C+N*n+G*g)),e[15]=K*(P*B+O*n+L*g-(H*g+x*B+Y*n)),e}},function(A,e,i){"use strict";e.__esModule=!0,e.createAttribsFromArrays=h,e.createBuffersFromArrays=function(A,e){var i={};Object.keys(e).forEach(function(t){i[t]=w(A,e[t],t)}),e.indices?(i.numElements=e.indices.length,i.elementType=t.getGLTypeForTypedArray(E(e.indices),"indices")):i.numElements=function(A){for(var e,i=0;i<C.length&&!((e=C[i])in A);++i);ii===C.length&&(e=Object.keys(A)[0]);var t=A[e],o=l(t).length,n=d(t,e),a=o/n;if(o%n>0)throw"numComponents "+n+" not correct for length "+o;return a}(e);return i},e.createBufferFromArray=w,e.createBufferFromTypedArray=s,e.createBufferInfoFromArrays=function(A,e){var i={attribs:h(A,e)},o=e.indices;if(o){var n=E(o,"indices");i.indices=s(A,n,A.ELEMENT_ARRAY_BUFFER),i.numElements=n.length,i.elementType=t.getGLTypeForTypedArray(n)}else i.numElements=function(A,e){var i,t;for(t=0;t<C.length&&!((i=C[t])in e)&&!((i=a.attribPrefix+i)in e);++t);t===C.length&&(i=Object.keys(e)[0]);var o=e[i];A.bindBuffer(A.ARRAY_BUFFER,o.buffer);var n=A.getBufferParameter(A.ARRAY_BUFFER,A.BUFFER_SIZE);A.bindBuffer(A.ARRAY_BUFFER,null);var r=function(A,e){return e===A.BYTE?1:e===A.UNSIGNED_BYTE?1:e===A.SHORT?2:e===A.UNSIGNED_SHORT?2:e===A.INT?4:e===A.UNSIGNED_INT?4:e===A.FLOAT?4:0}(A,o.type),s=n/r,g=o.numComponents||o.size,l=s/g;if(l%1!=0)throw"numComponents "+g+" not correct for length "+length;return l}(A,i.attribs);return i},e.setAttribInfoBufferFromArray=function(A,e,i,t){i=E(i),void 0!==t?(A.bindBuffer(A.ARRAY_BUFFER,e.buffer),A.bufferSubData(A.ARRAY_BUFFER,t,i)):r(A,A.ARRAY_BUFFER,e.buffer,i,e.drawType)},e.setAttributePrefix=function(A){a.attribPrefix=A},e.setAttributeDefaults_=function(A){o.copyExistingProperties(A,a)},e.getNumComponents_=d,e.getArray_=l;var t=n(i(1)),o=n(i(0));function n(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}var a={attribPrefix:""};function r(A,e,i,t,o){A.bindBuffer(e,i),A.bufferData(e,t,o||A.STATIC_DRAW)}function s(A,e,i,t){if(o.isBuffer(A,e))return e;i=i||A.ARRAY_BUFFER;var n=A.createBuffer();return r(A,i,n,e,t),n}function g(A){return"indices"===A}function l(A){return A.length?A:A.data}var c=/coord|texture/i,u=/color|colour/i;function B(A,e){var i;if(e%(i=c.test(A)?2:u.test(A)?4:3)>0)throw"Can not guess numComponents for attribute '"+A+"'. Tried "+i+" but "+e+" values is not evenly divisible by "+i+". You should specify it.";return i}function d(A,e){return A.numComponents||A.size||B(e,l(A).length)}function E(A,e){if(t.isArrayBuffer(A))return A;if(t.isArrayBuffer(A.data))return A.data;Array.isArray(A)&&(A={data:A});var i=A.type;return i||(i=g(e)?Uint16Array:Float32Array),new i(A.data)}function h(A,e){var i={};return Object.keys(e).forEach(function(o){if(!g(o)){var n,r,l,c,u,h=e[o],C=h.attrib||h.name||h.attribName||a.attribPrefix+o;if("number"==typeof h||"number"==typeof h.data){u=h.data||h;var w=h.type||Float32Array,m=u*w.BYTES_PER_ELEMENT;r=t.getGLTypeForTypedArrayType(w),l=void 0!==h.normalize?h.normalize:function(A){return A===Int8Array||A===Uint8Array}(w),c=h.numComponents||h.size||B(o,u),n=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,n),A.bufferData(A.ARRAY_BUFFER,m,h.drawType||A.STATIC_DRAW)}else{var p=E(h,o);n=s(A,p,void 0,h.drawType),r=t.getGLTypeForTypedArray(p),l=void 0!==h.normalize?h.normalize:function(A){return A instanceof Int8Array||A instanceof Uint8Array}(p),c=d(h,o),u=p.length}i[C]={buffer:n,numComponents:c,type:r,normalize:l,stride:h.stride||0,offset:h.offset||0,divisor:void 0===h.divisor?void 0:h.divisor,drawType:h.drawType}}}),A.bindBuffer(A.ARRAY_BUFFER,null),i}var C=["position","positions","a_position"];function w(A,e,i){var t="indices"===i?A.ELEMENT_ARRAY_BUFFER:A.ARRAY_BUFFER;return s(A,E(e,i),t)}},function(A,e,i){"use strict";e.__esModule=!0,e.setTextureDefaults_=function(A){n.copyExistingProperties(A,s),A.textureColor&&f(A.textureColor)},e.createSampler=v,e.createSamplers=function(A,e){var i={};return Object.keys(e).forEach(function(t){i[t]=v(A,e[t])}),i},e.setSamplerParameters=F,e.createTexture=z,e.setEmptyTexture=J,e.setTextureFromArray=j,e.loadTextureFromUrl=P,e.setTextureFromElement=Y,e.setTextureFilteringForSize=S,e.setTextureParameters=k,e.setDefaultTextureColor=f,e.createTextures=function(A,e,i){i=i||U;var t=0,o=[],n={},a={};function r(){0===t&&setTimeout(function(){i(o.length?o:void 0,n,a)},0)}return Object.keys(e).forEach(function(i){var s,g=e[i];(function(A){return"string"==typeof A||Array.isArray(A)&&"string"==typeof A[0]})(g.src)&&(s=function(A,e,n){a[i]=n,--t,A&&o.push(A),r()},++t),n[i]=z(A,g,s)}),r(),n},e.resizeTexture=function(A,e,i,t,o){t=t||i.width,o=o||i.height;var n=i.target||A.TEXTURE_2D;A.bindTexture(n,e);var a,r=i.level||0,s=i.internalFormat||i.format||A.RGBA,l=w(s),c=i.format||l.format,u=i.src;a=u&&(g(u)||Array.isArray(u)&&"number"==typeof u[0])?i.type||p(A,u,l.type):i.type||l.type;if(n===A.TEXTURE_CUBE_MAP)for(var B=0;B<6;++B)A.texImage2D(A.TEXTURE_CUBE_MAP_POSITIVE_X+B,r,s,t,o,0,c,a,null);else A.texImage2D(n,r,s,t,o,0,c,a,null)},e.getNumComponentsForFormat=function(A){var e=B[A];if(!e)throw"unknown format: "+A;return e.numColorComponents},e.getBytesPerElementForInternalFormat=C;var t=r(i(4)),o=r(i(1)),n=r(i(0)),a=function(A){return A&&A.__esModule?A:{default:A}}(i(2));function r(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}var s={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},g=o.isArrayBuffer,l=a.default.document&&a.default.document.createElement?a.default.document.createElement("canvas").getContext("2d"):null,c=6407,u=33319,B={},d=B;d[6406]={numColorComponents:1},d[6409]={numColorComponents:1},d[6410]={numColorComponents:2},d[c]={numColorComponents:3},d[6408]={numColorComponents:4},d[6403]={numColorComponents:1},d[36244]={numColorComponents:1},d[u]={numColorComponents:2},d[33320]={numColorComponents:2},d[c]={numColorComponents:3},d[36248]={numColorComponents:3},d[6408]={numColorComponents:4},d[36249]={numColorComponents:4},d[6402]={numColorComponents:1},d[34041]={numColorComponents:2};var E={},h=E;function C(A,e){var i=E[A];if(!i)throw"unknown internal format";var t=i.bytesPerElementMap[e];if(void 0===t)throw"unknown internal format";return t}function w(A){var e=E[A];if(!e)throw"unknown internal format";return{format:e.textureFormat,type:Array.isArray(e.type)?e.type[0]:e.type}}function m(A){return 0==(A&A-1)}function p(A,e,i){return g(e)?o.getGLTypeForTypedArray(e):i||A.UNSIGNED_BYTE}function I(A,e,i,t,o){if(o%1!=0)throw"can't guess dimensions";if(i||t){if(t){if(!i&&(i=o/t)%1)throw"can't guess dimensions"}else if((t=o/i)%1)throw"can't guess dimensions"}else{var n=Math.sqrt(o/(e===A.TEXTURE_CUBE_MAP?6:1));n%1==0?(i=n,t=n):(i=o,t=1)}return{width:i,height:t}}function f(A){s.textureColor=new Uint8Array([255*A[0],255*A[1],255*A[2],255*A[3]])}h[6406]={textureFormat:6406,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},h[6409]={textureFormat:6409,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},h[6410]={textureFormat:6410,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[5121,5131,36193,5126]},h[c]={textureFormat:c,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[5121,5131,36193,5126,33635]},h[6408]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[5121,5131,36193,5126,32819,32820]},h[33321]={textureFormat:6403,colorRenderable:!0,textureFilterable:!0,bytesPerElement:1,type:5121},h[36756]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:1,type:5120},h[33325]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[5126,5131]},h[33326]={textureFormat:6403,colorRenderable:!1,textureFilterable:!1,bytesPerElement:4,type:5126},h[33330]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:5121},h[33329]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:5120},h[33332]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5123},h[33331]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5122},h[33334]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5125},h[33333]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5124},h[33323]={textureFormat:u,colorRenderable:!0,textureFilterable:!0,bytesPerElement:2,type:5121},h[36757]={textureFormat:u,colorRenderable:!1,textureFilterable:!0,bytesPerElement:2,type:5120},h[33327]={textureFormat:u,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[5126,5131]},h[33328]={textureFormat:u,colorRenderable:!1,textureFilterable:!1,bytesPerElement:8,type:5126},h[33336]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5121},h[33335]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5120},h[33338]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5123},h[33337]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5122},h[33340]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5125},h[33339]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5124},h[32849]={textureFormat:c,colorRenderable:!0,textureFilterable:!0,bytesPerElement:3,type:5121},h[35905]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:5121},h[36194]={textureFormat:c,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[5121,33635]},h[36758]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:5120},h[35898]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35899]},h[35901]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35902]},h[34843]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[5126,5131]},h[34837]={textureFormat:c,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5126},h[36221]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:5121},h[36239]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:5120},h[36215]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:5123},h[36233]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:5122},h[36209]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5125},h[36227]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5124},h[32856]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:5121},h[35907]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:5121},h[36759]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:4,type:5120},h[32855]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[5121,32820,33640]},h[32854]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[5121,32819]},h[32857]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:33640},h[34842]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[5126,5131]},h[34836]={textureFormat:6408,colorRenderable:!1,textureFilterable:!1,bytesPerElement:16,type:5126},h[36220]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5121},h[36238]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5120},h[36975]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:33640},h[36214]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5123},h[36232]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5122},h[36226]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:5124},h[36208]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:5125},h[33189]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[5123,5125]},h[33190]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5125},h[36012]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5126},h[35056]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:34042},h[36013]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:36269},Object.keys(h).forEach(function(A){var e=h[A];if(e.bytesPerElementMap={},Array.isArray(e.bytesPerElement))e.bytesPerElement.forEach(function(A,i){var t=e.type[i];e.bytesPerElementMap[t]=A});else{var i=e.type;e.bytesPerElementMap[i]=e.bytesPerElement}});var Q={};function D(A,e){void 0!==e.colorspaceConversion&&(Q.colorspaceConversion=A.getParameter(A.UNPACK_COLORSPACE_CONVERSION_WEBGL),A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.colorspaceConversion)),void 0!==e.premultiplyAlpha&&(Q.premultiplyAlpha=A.getParameter(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL),A.pixelStorei(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha)),void 0!==e.flipY&&(Q.flipY=A.getParameter(A.UNPACK_FLIP_Y_WEBGL),A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,e.flipY))}function M(A,e){void 0!==e.colorspaceConversion&&A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,Q.colorspaceConversion),void 0!==e.premultiplyAlpha&&A.pixelStorei(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Q.premultiplyAlpha),void 0!==e.flipY&&A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,Q.flipY)}function b(A){Q.unpackAlignment=A.getParameter(A.UNPACK_ALIGNMENT),t.isWebGL2(A)&&(Q.unpackRowLength=A.getParameter(A.UNPACK_ROW_LENGTH),Q.unpackImageHeight=A.getParameter(A.UNPACK_IMAGE_HEIGHT),Q.unpackSkipPixels=A.getParameter(A.UNPACK_SKIP_PIXELS),Q.unpackSkipRows=A.getParameter(A.UNPACK_SKIP_ROWS),Q.unpackSkipImages=A.getParameter(A.UNPACK_SKIP_IMAGES))}function y(A){A.pixelStorei(A.UNPACK_ALIGNMENT,Q.unpackAlignment),t.isWebGL2(A)&&(A.pixelStorei(A.UNPACK_ROW_LENGTH,Q.unpackRowLength),A.pixelStorei(A.UNPACK_IMAGE_HEIGHT,Q.unpackImageHeight),A.pixelStorei(A.UNPACK_SKIP_PIXELS,Q.unpackSkipPixels),A.pixelStorei(A.UNPACK_SKIP_ROWS,Q.unpackSkipRows),A.pixelStorei(A.UNPACK_SKIP_IMAGES,Q.unpackSkipImages))}function T(A,e,i,t){t.minMag&&(i.call(A,e,A.TEXTURE_MIN_FILTER,t.minMag),i.call(A,e,A.TEXTURE_MAG_FILTER,t.minMag)),t.min&&i.call(A,e,A.TEXTURE_MIN_FILTER,t.min),t.mag&&i.call(A,e,A.TEXTURE_MAG_FILTER,t.mag),t.wrap&&(i.call(A,e,A.TEXTURE_WRAP_S,t.wrap),i.call(A,e,A.TEXTURE_WRAP_T,t.wrap),(e===A.TEXTURE_3D||n.isSampler(A,e))&&i.call(A,e,A.TEXTURE_WRAP_R,t.wrap)),t.wrapR&&i.call(A,e,A.TEXTURE_WRAP_R,t.wrapR),t.wrapS&&i.call(A,e,A.TEXTURE_WRAP_S,t.wrapS),t.wrapT&&i.call(A,e,A.TEXTURE_WRAP_T,t.wrapT),t.minLod&&i.call(A,e,A.TEXTURE_MIN_LOD,t.minLod),t.maxLod&&i.call(A,e,A.TEXTURE_MAX_LOD,t.maxLod),t.baseLevel&&i.call(A,e,A.TEXTURE_BASE_LEVEL,t.baseLevel),t.maxLevel&&i.call(A,e,A.TEXTURE_MAX_LEVEL,t.maxLevel)}function k(A,e,i){var t=i.target||A.TEXTURE_2D;A.bindTexture(t,e),T(A,t,A.texParameteri,i)}function F(A,e,i){T(A,e,A.samplerParameteri,i)}function v(A,e){var i=A.createSampler();return F(A,i,e),i}function S(A,e,i,o,n,a,r){i=i||s.textureOptions,a=a||A.RGBA,r=r||A.UNSIGNED_BYTE;var g=i.target||A.TEXTURE_2D;if(o=o||i.width,n=n||i.height,A.bindTexture(g,e),function(A,e,i,o){if(!t.isWebGL2(A))return m(e)&&m(i);var n=E[o];if(!n)throw"unknown internal format";return n.colorRenderable&&n.textureFilterable}(A,o,n,a))A.generateMipmap(g);else{var l=function(A){var e=E[A];if(!e)throw"unknown internal format";return e.textureFilterable}(a)?A.LINEAR:A.NEAREST;A.texParameteri(g,A.TEXTURE_MIN_FILTER,l),A.texParameteri(g,A.TEXTURE_MAG_FILTER,l),A.texParameteri(g,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(g,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE)}}function N(A){return!0===A.auto||void 0===A.auto&&void 0===A.level}function R(A,e){return(e=e||{}).cubeFaceOrder||[A.TEXTURE_CUBE_MAP_POSITIVE_X,A.TEXTURE_CUBE_MAP_NEGATIVE_X,A.TEXTURE_CUBE_MAP_POSITIVE_Y,A.TEXTURE_CUBE_MAP_NEGATIVE_Y,A.TEXTURE_CUBE_MAP_POSITIVE_Z,A.TEXTURE_CUBE_MAP_NEGATIVE_Z]}function O(A,e){var i=R(A,e).map(function(A,e){return{face:A,ndx:e}});return i.sort(function(A,e){return A.face-e.face}),i}function Y(A,e,i,t){var o=(t=t||s.textureOptions).target||A.TEXTURE_2D,n=t.level||0,r=i.width,g=i.height,c=t.internalFormat||t.format||A.RGBA,u=w(c),B=t.format||u.format,d=t.type||u.type;if(D(A,t),A.bindTexture(o,e),o===A.TEXTURE_CUBE_MAP){var E,h,C=i.width,m=i.height;if(C/6===m)E=m,h=[0,0,1,0,2,0,3,0,4,0,5,0];else if(m/6===C)E=C,h=[0,0,0,1,0,2,0,3,0,4,0,5];else if(C/3==m/2)E=C/3,h=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(C/2!=m/3)throw"can't figure out cube map from element: "+(i.src?i.src:i.nodeName);E=C/2,h=[0,0,1,0,0,1,1,1,0,2,1,2]}l?(l.canvas.width=E,l.canvas.height=E,r=E,g=E,O(A,t).forEach(function(e){var t=h[2*e.ndx+0]*E,o=h[2*e.ndx+1]*E;l.drawImage(i,t,o,E,E,0,0,E,E),A.texImage2D(e.face,n,c,B,d,l.canvas)}),l.canvas.width=1,l.canvas.height=1):a.default.createImageBitmap&&(r=E,g=E,O(A,t).forEach(function(s){var l=h[2*s.ndx+0]*E,u=h[2*s.ndx+1]*E;A.texImage2D(s.face,n,c,E,E,0,B,d,null),a.default.createImageBitmap(i,l,u,E,E,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(function(i){D(A,t),A.bindTexture(o,e),A.texImage2D(s.face,n,c,B,d,i),M(A,t),N(t)&&S(A,e,t,r,g,c,d)})}))}else if(o===A.TEXTURE_3D||o===A.TEXTURE_2D_ARRAY){var p=Math.min(i.width,i.height),I=Math.max(i.width,i.height),f=I/p;if(f%1!=0)throw"can not compute 3D dimensions of element";var Q=i.width===I?1:0,T=i.height===I?1:0;b(A),A.pixelStorei(A.UNPACK_ALIGNMENT,1),A.pixelStorei(A.UNPACK_ROW_LENGTH,i.width),A.pixelStorei(A.UNPACK_IMAGE_HEIGHT,0),A.pixelStorei(A.UNPACK_SKIP_IMAGES,0),A.texImage3D(o,n,c,p,p,p,0,B,d,null);for(var F=0;F<f;++F){var v=F*p*Q,R=F*p*T;A.pixelStorei(A.UNPACK_SKIP_PIXELS,v),A.pixelStorei(A.UNPACK_SKIP_ROWS,R),A.texSubImage3D(o,n,0,0,F,p,p,1,B,d,i)}y(A)}else A.texImage2D(o,n,c,B,d,i);M(A,t),N(t)&&S(A,e,t,r,g,c,d),k(A,e,t)}function U(){}function G(A){return a.default.ImageBitmap&&A instanceof a.default.ImageBitmap||a.default.ImageData&&A instanceof a.default.ImageData||a.default.HTMLElement&&A instanceof a.default.HTMLElement}function H(A,e,i){return G(A)?(setTimeout(function(){i(null,A)}),A):function(A,e,i){var t;if(i=i||U,a.default.Image){t=new a.default.Image,void 0!==(e=void 0!==e?e:s.crossOrigin)&&(t.crossOrigin=e);var o=function(){t.removeEventListener("error",r),t.removeEventListener("load",g),t=null},r=function(){var e="couldn't load image: "+A;n.error(e),i(e,t),o()},g=function(){i(null,t),o()};return t.addEventListener("error",r),t.addEventListener("load",g),t.src=A,t}if(a.default.ImageBitmap){var l,c,u=function(){i(l,c)},B={};e&&(B.mode="cors"),fetch(A,B).then(function(A){if(!A.ok)throw A;return A.blob()}).then(function(A){return a.default.createImageBitmap(A,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}).then(function(A){c=A,setTimeout(u)}).catch(function(A){l=A,setTimeout(u)}),t=null}return t}(A,e,i)}function L(A,e,i){var t=(i=i||s.textureOptions).target||A.TEXTURE_2D;if(A.bindTexture(t,e),!1!==i.color){var o=function(A){return A=A||s.textureColor,g(A)?A:new Uint8Array([255*A[0],255*A[1],255*A[2],255*A[3]])}(i.color);if(t===A.TEXTURE_CUBE_MAP)for(var n=0;n<6;++n)A.texImage2D(A.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,A.RGBA,1,1,0,A.RGBA,A.UNSIGNED_BYTE,o);else t===A.TEXTURE_3D||t===A.TEXTURE_2D_ARRAY?A.texImage3D(t,0,A.RGBA,1,1,1,0,A.RGBA,A.UNSIGNED_BYTE,o):A.texImage2D(t,0,A.RGBA,1,1,0,A.RGBA,A.UNSIGNED_BYTE,o)}}function P(A,e,i,t){return t=t||U,i=i||s.textureOptions,L(A,e,i),H((i=Object.assign({},i)).src,i.crossOrigin,function(o,n){o?t(o,e,n):(Y(A,e,n,i),t(null,e,n))})}function x(A,e,i,t){t=t||U;var o=i.src;if(6!==o.length)throw"there must be 6 urls for a cubemap";var n=i.level||0,a=i.internalFormat||i.format||A.RGBA,r=w(a),s=i.format||r.format,g=i.type||A.UNSIGNED_BYTE,l=i.target||A.TEXTURE_2D;if(l!==A.TEXTURE_CUBE_MAP)throw"target must be TEXTURE_CUBE_MAP";L(A,e,i),i=Object.assign({},i);var c,u=6,B=[],d=R(A,i);c=o.map(function(o,r){return H(o,i.crossOrigin,function(o){return function(r,d){--u,r?B.push(r):d.width!==d.height?B.push("cubemap face img is not a square: "+d.src):(D(A,i),A.bindTexture(l,e),5===u?R(A).forEach(function(e){A.texImage2D(e,n,a,s,g,d)}):A.texImage2D(o,n,a,s,g,d),M(A,i),N(i)&&A.generateMipmap(l)),0===u&&t(B.length?B:void 0,e,c)}}(d[r]))})}function _(A,e,i,t){t=t||U;var o=i.src,n=i.internalFormat||i.format||A.RGBA,a=w(n),r=i.format||a.format,s=i.type||A.UNSIGNED_BYTE,g=i.target||A.TEXTURE_2D_ARRAY;if(g!==A.TEXTURE_3D&&g!==A.TEXTURE_2D_ARRAY)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";L(A,e,i),i=Object.assign({},i);var c,u=o.length,B=[],d=i.level||0,E=i.width,h=i.height,C=o.length,m=!0;c=o.map(function(o,a){return H(o,i.crossOrigin,function(o){return function(a,w){if(--u,a)B.push(a);else{if(D(A,i),A.bindTexture(g,e),m){m=!1,E=i.width||w.width,h=i.height||w.height,A.texImage3D(g,d,n,E,h,C,0,r,s,null);for(var p=0;p<C;++p)A.texSubImage3D(g,d,0,0,p,E,h,1,r,s,w)}else{var I=w;w.width===E&&w.height===h||(I=l.canvas,l.canvas.width=E,l.canvas.height=h,l.drawImage(w,0,0,E,h)),A.texSubImage3D(g,d,0,0,o,E,h,1,r,s,I),I===l.canvas&&(l.canvas.width=0,l.canvas.height=0)}M(A,i),N(i)&&A.generateMipmap(g)}0===u&&t(B.length?B:void 0,e,c)}}(a))})}function j(A,e,i,n){var a=(n=n||s.textureOptions).target||A.TEXTURE_2D;A.bindTexture(a,e);var r=n.width,l=n.height,c=n.depth,u=n.level||0,B=n.internalFormat||n.format||A.RGBA,d=w(B),E=n.format||d.format,h=n.type||p(A,i,d.type);if(g(i))i instanceof Uint8ClampedArray&&(i=new Uint8Array(i.buffer));else{var m=o.getTypedArrayTypeForGLType(h);i=new m(i)}var f,Q=C(B,h),T=i.byteLength/Q;if(T%1)throw"length wrong size for format: "+t.glEnumToString(A,E);if(a===A.TEXTURE_3D)if(r||l||c)!r||l&&c?!l||r&&c?(f=I(A,a,r,l,T/c),r=f.width,l=f.height):(f=I(A,a,r,c,T/l),r=f.width,c=f.height):(f=I(A,a,l,c,T/r),l=f.width,c=f.height);else{var k=Math.cbrt(T);if(k%1!=0)throw"can't guess cube size of array of numElements: "+T;r=k,l=k,c=k}else f=I(A,a,r,l,T),r=f.width,l=f.height;if(b(A),A.pixelStorei(A.UNPACK_ALIGNMENT,n.unpackAlignment||1),D(A,n),a===A.TEXTURE_CUBE_MAP){var F=T/6*(Q/i.BYTES_PER_ELEMENT);O(A,n).forEach(function(e){var t=F*e.ndx,o=i.subarray(t,t+F);A.texImage2D(e.face,u,B,r,l,0,E,h,o)})}else a===A.TEXTURE_3D?A.texImage3D(a,u,B,r,l,c,0,E,h,i):A.texImage2D(a,u,B,r,l,0,E,h,i);return M(A,n),y(A),{width:r,height:l,depth:c,type:h}}function J(A,e,i){var t=i.target||A.TEXTURE_2D;A.bindTexture(t,e);var o=i.level||0,n=i.internalFormat||i.format||A.RGBA,a=w(n),r=i.format||a.format,s=i.type||a.type;if(D(A,i),t===A.TEXTURE_CUBE_MAP)for(var g=0;g<6;++g)A.texImage2D(A.TEXTURE_CUBE_MAP_POSITIVE_X+g,o,n,i.width,i.height,0,r,s,null);else t===A.TEXTURE_3D?A.texImage3D(t,o,n,i.width,i.height,i.depth,0,r,s,null):A.texImage2D(t,o,n,i.width,i.height,0,r,s,null);M(A,i)}function z(A,e,i){i=i||U,e=e||s.textureOptions;var t=A.createTexture(),o=e.target||A.TEXTURE_2D,n=e.width||1,a=e.height||1,r=e.internalFormat||A.RGBA,l=w(r),c=e.type||l.type;A.bindTexture(o,t),o===A.TEXTURE_CUBE_MAP&&(A.texParameteri(o,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(o,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE));var u=e.src;if(u)if("function"==typeof u&&(u=u(A,e)),"string"==typeof u)P(A,t,e,i);else if(g(u)||Array.isArray(u)&&("number"==typeof u[0]||Array.isArray(u[0])||g(u[0]))){var B=j(A,t,u,e);n=B.width,a=B.height,c=B.type}else if(Array.isArray(u)&&("string"==typeof u[0]||G(u[0])))o===A.TEXTURE_CUBE_MAP?x(A,t,e,i):_(A,t,e,i);else{if(!G(u))throw"unsupported src type";Y(A,t,u,e),n=u.width,a=u.height}else J(A,t,e);return N(e)&&S(A,t,e,n,a,r,c),k(A,t,e),t}},function(A,e,i){"use strict";e.__esModule=!0;var t={m4:!0,v3:!0,primitives:!0};e.primitives=e.v3=e.m4=void 0;var o=s(i(6));e.m4=o;var n=s(i(3));e.v3=n;var a=s(i(10));e.primitives=a;var r=i(11);function s(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}Object.keys(r).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=r[A]))})},function(A,e,i){"use strict";e.__esModule=!0,e.create3DFVertices=y,e.createAugmentedTypedArray=u,e.createCubeVertices=D,e.createPlaneVertices=I,e.createSphereVertices=f,e.createTruncatedConeVertices=M,e.createXYQuadVertices=p,e.createCresentVertices=T,e.createCylinderVertices=k,e.createTorusVertices=F,e.createDiscVertices=v,e.deindexVertices=function(A){var e=A.indices,i={},t=e.length;return Object.keys(A).filter(B).forEach(function(o){for(var n=A[o],a=n.numComponents,r=u(a,t,n.constructor),s=0;s<t;++s)for(var g=e[s],l=g*a,c=0;c<a;++c)r.push(n[l+c]);i[o]=r}),i},e.flattenNormals=function(A){if(A.indices)throw"can't flatten normals of indexed vertices. deindex them first";for(var e=A.normal,i=e.length,t=0;t<i;t+=9){var o=e[t+0],n=e[t+1],a=e[t+2],r=e[t+3],s=e[t+4],g=e[t+5],l=e[t+6],c=e[t+7],u=e[t+8],B=o+r+l,d=n+s+c,E=a+g+u,h=Math.sqrt(B*B+d*d+E*E);B/=h,d/=h,E/=h,e[t+0]=B,e[t+1]=d,e[t+2]=E,e[t+3]=B,e[t+4]=d,e[t+5]=E,e[t+6]=B,e[t+7]=d,e[t+8]=E}return A},e.makeRandomVertexColors=function(A,e){e=e||{};var i=A.position.numElements,t=u(4,i,Uint8Array),o=e.rand||function(A,e){return e<3?function(A){return Math.random()*A|0}(256):255};if(A.color=t,A.indices)for(var n=0;n<i;++n)t.push(o(n,0),o(n,1),o(n,2),o(n,3));else for(var a=e.vertsPerColor||3,r=i/a,s=0;s<r;++s)for(var g=[o(s,0),o(s,1),o(s,2),o(s,3)],l=0;l<a;++l)t.push(g);return A},e.reorientDirections=h,e.reorientNormals=C,e.reorientPositions=w,e.reorientVertices=m,e.concatVertices=function(A){for(var e,i={},t=function(t){var o=A[t];Object.keys(o).forEach(function(A){i[A]||(i[A]=[]),e||"indices"===A||(e=A);var t=o[A],n=l(t,A),a=g(t),r=a.length/n;i[A].push(r)})},o=0;o<A.length;++o)t(o);var n=i[e],a={};return Object.keys(i).forEach(function(e){var i=function(e){for(var i,t=0,o=0;o<A.length;++o){var n=A[o],a=n[e],r=g(a);t+=r.length,i&&!a.data||(i=a)}return{length:t,spec:i}}(e),t=Y(i.spec,i.length);!function(e,i,t){for(var o=0,n=0,a=0;a<A.length;++a){var r=A[a],s=r[e],l=g(s);"indices"===e?(O(l,t,n,o),o+=i[a]):O(l,t,n),n+=l.length}}(e,n,g(t)),a[e]=t}),a},e.duplicateVertices=function(A){var e={};return Object.keys(A).forEach(function(i){var t=A[i],o=g(t),n=Y(t,o.length);O(o,g(n),0),e[i]=n}),e},e.createDiscBuffers=e.createDiscBufferInfo=e.createTorusBuffers=e.createTorusBufferInfo=e.createCylinderBuffers=e.createCylinderBufferInfo=e.createCresentBuffers=e.createCresentBufferInfo=e.createXYQuadBuffers=e.createXYQuadBufferInfo=e.createTruncatedConeBuffers=e.createTruncatedConeBufferInfo=e.createSphereBuffers=e.createSphereBufferInfo=e.createPlaneBuffers=e.createPlaneBufferInfo=e.createCubeBuffers=e.createCubeBufferInfo=e.create3DFBuffers=e.create3DFBufferInfo=void 0;var t=s(i(7)),o=s(i(0)),n=s(i(1)),a=s(i(6)),r=s(i(3));function s(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}var g=t.getArray_,l=t.getNumComponents_;function c(A,e){var i=0;return A.push=function(){for(var e=0;e<arguments.length;++e){var t=arguments[e];if(t instanceof Array||n.isArrayBuffer(t))for(var o=0;o<t.length;++o)A[i++]=t[o];else A[i++]=t}},A.reset=function(A){i=A||0},A.numComponents=e,Object.defineProperty(A,"numElements",{get:function(){return this.length/this.numComponents|0}}),A}function u(A,e,i){return c(new(i||Float32Array)(A*e),A)}function B(A){return"indices"!==A}function d(A,e,i){for(var t=A.length,o=new Float32Array(3),n=0;n<t;n+=3)i(e,[A[n],A[n+1],A[n+2]],o),A[n]=o[0],A[n+1]=o[1],A[n+2]=o[2]}function E(A,e,i){i=i||r.create();var t=e[0],o=e[1],n=e[2];return i[0]=t*A[0]+o*A[1]+n*A[2],i[1]=t*A[4]+o*A[5]+n*A[6],i[2]=t*A[8]+o*A[9]+n*A[10],i}function h(A,e){return d(A,e,a.transformDirection),A}function C(A,e){return d(A,a.inverse(e),E),A}function w(A,e){return d(A,e,a.transformPoint),A}function m(A,e){return Object.keys(A).forEach(function(i){var t=A[i];i.indexOf("pos")>=0?w(t,e):i.indexOf("tan")>=0||i.indexOf("binorm")>=0?h(t,e):i.indexOf("norm")>=0&&C(t,e)}),A}function p(A,e,i){return A=A||2,{position:{numComponents:2,data:[(e=e||0)+-1*(A*=.5),(i=i||0)+-1*A,e+1*A,i+-1*A,e+-1*A,i+1*A,e+1*A,i+1*A]},normal:[0,0,1,0,0,1,0,0,1,0,0,1],texcoord:[0,0,1,0,0,1,1,1],indices:[0,1,2,2,1,3]}}function I(A,e,i,t,o){A=A||1,e=e||1,i=i||1,t=t||1,o=o||a.identity();for(var n=(i+1)*(t+1),r=u(3,n),s=u(3,n),g=u(2,n),l=0;l<=t;l++)for(var c=0;c<=i;c++){var B=c/i,d=l/t;r.push(A*B-.5*A,0,e*d-.5*e),s.push(0,1,0),g.push(B,d)}for(var E=i+1,h=u(3,i*t*2,Uint16Array),C=0;C<t;C++)for(var w=0;w<i;w++)h.push((C+0)*E+w,(C+1)*E+w,(C+0)*E+w+1),h.push((C+1)*E+w,(C+1)*E+w+1,(C+0)*E+w+1);return m({position:r,normal:s,texcoord:g,indices:h},o)}function f(A,e,i,t,o,n,a){if(e<=0||i<=0)throw Error("subdivisionAxis and subdivisionHeight must be > 0");t=t||0,o=o||Math.PI,n=n||0;for(var r=o-t,s=(a=a||2*Math.PI)-n,g=(e+1)*(i+1),l=u(3,g),c=u(3,g),B=u(2,g),d=0;d<=i;d++)for(var E=0;E<=e;E++){var h=E/e,C=d/i,w=s*h,m=r*C,p=Math.sin(w),I=Math.cos(w),f=Math.sin(m),Q=I*f,D=Math.cos(m),M=p*f;l.push(A*Q,A*D,A*M),c.push(Q,D,M),B.push(1-h,C)}for(var b=e+1,y=u(3,e*i*2,Uint16Array),T=0;T<e;T++)for(var k=0;k<i;k++)y.push((k+0)*b+T,(k+0)*b+T+1,(k+1)*b+T),y.push((k+1)*b+T,(k+0)*b+T+1,(k+1)*b+T+1);return{position:l,normal:c,texcoord:B,indices:y}}var Q=[[3,7,5,1],[6,2,0,4],[6,7,3,2],[0,1,5,4],[7,6,4,5],[2,3,1,0]];function D(A){for(var e=(A=A||1)/2,i=[[-e,-e,-e],[+e,-e,-e],[-e,+e,-e],[+e,+e,-e],[-e,-e,+e],[+e,-e,+e],[-e,+e,+e],[+e,+e,+e]],t=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],o=[[1,0],[0,0],[0,1],[1,1]],n=u(3,24),a=u(3,24),r=u(2,24),s=u(3,12,Uint16Array),g=0;g<6;++g){for(var l=Q[g],c=0;c<4;++c){var B=i[l[c]],d=t[g],E=o[c];n.push(B),a.push(d),r.push(E)}var h=4*g;s.push(h+0,h+1,h+2),s.push(h+0,h+2,h+3)}return{position:n,normal:a,texcoord:r,indices:s}}function M(A,e,i,t,o,n,a){if(t<3)throw Error("radialSubdivisions must be 3 or greater");if(o<1)throw Error("verticalSubdivisions must be 1 or greater");for(var r=void 0===n||n,s=void 0===a||a,g=(r?2:0)+(s?2:0),l=(t+1)*(o+1+g),c=u(3,l),B=u(3,l),d=u(2,l),E=u(3,t*(o+g)*2,Uint16Array),h=t+1,C=Math.atan2(A-e,i),w=Math.cos(C),m=Math.sin(C),p=o+(s?2:0),I=r?-2:0;I<=p;++I){var f=I/o,Q=i*f,D=void 0;I<0?(Q=0,f=1,D=A):I>o?(Q=i,f=1,D=e):D=A+I/o*(e-A),-2!==I&&I!==o+2||(D=0,f=0),Q-=i/2;for(var M=0;M<h;++M){var b=Math.sin(M*Math.PI*2/t),y=Math.cos(M*Math.PI*2/t);c.push(b*D,Q,y*D),B.push(I<0||I>o?0:b*w,I<0?-1:I>o?1:m,I<0||I>o?0:y*w),d.push(M/t,1-f)}}for(var T=0;T<o+g;++T)for(var k=0;k<t;++k)E.push(h*(T+0)+0+k,h*(T+0)+1+k,h*(T+1)+1+k),E.push(h*(T+0)+0+k,h*(T+1)+1+k,h*(T+1)+0+k);return{position:c,normal:B,texcoord:d,indices:E}}function b(A,e){e=e||[];for(var i=[],t=0;t<A.length;t+=4){var o=A[t],n=A.slice(t+1,t+4);n.push.apply(n,e);for(var a=0;a<o;++a)i.push.apply(i,n)}return i}function y(){var A=[0,0,0,0,150,0,30,0,0,0,150,0,30,150,0,30,0,0,30,0,0,30,30,0,100,0,0,30,30,0,100,30,0,100,0,0,30,60,0,30,90,0,67,60,0,30,90,0,67,90,0,67,60,0,0,0,30,30,0,30,0,150,30,0,150,30,30,0,30,30,150,30,30,0,30,100,0,30,30,30,30,30,30,30,100,0,30,100,30,30,30,60,30,67,60,30,30,90,30,30,90,30,67,60,30,67,90,30,0,0,0,100,0,0,100,0,30,0,0,0,100,0,30,0,0,30,100,0,0,100,30,0,100,30,30,100,0,0,100,30,30,100,0,30,30,30,0,30,30,30,100,30,30,30,30,0,100,30,30,100,30,0,30,30,0,30,60,30,30,30,30,30,30,0,30,60,0,30,60,30,30,60,0,67,60,30,30,60,30,30,60,0,67,60,0,67,60,30,67,60,0,67,90,30,67,60,30,67,60,0,67,90,0,67,90,30,30,90,0,30,90,30,67,90,30,30,90,0,67,90,30,67,90,0,30,90,0,30,150,30,30,90,30,30,90,0,30,150,0,30,150,30,0,150,0,0,150,30,30,150,30,0,150,0,30,150,30,30,150,0,0,0,0,0,0,30,0,150,30,0,0,0,0,150,30,0,150,0],e=b([18,0,0,1,18,0,0,-1,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,-1,0,6,-1,0,0]),i=b([18,200,70,120,18,80,70,200,6,70,200,210,6,200,200,70,6,210,100,70,6,210,160,70,6,70,180,210,6,100,70,210,6,76,210,100,6,140,210,80,6,90,130,110,6,160,160,220],[255]),t=A.length/3,o={position:u(3,t),texcoord:u(2,t),normal:u(3,t),color:u(4,t,Uint8Array),indices:u(3,t/3,Uint16Array)};o.position.push(A),o.texcoord.push([.22,.19,.22,.79,.34,.19,.22,.79,.34,.79,.34,.19,.34,.19,.34,.31,.62,.19,.34,.31,.62,.31,.62,.19,.34,.43,.34,.55,.49,.43,.34,.55,.49,.55,.49,.43,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0]),o.normal.push(e),o.color.push(i);for(var n=0;n<t;++n)o.indices.push(n);return o}function T(A,e,i,t,o,n,a){if(o<=0)throw Error("subdivisionDown must be > 0");n=n||0;var s=2,g=(a=a||1)-n,l=2*(o+1)*(2+s),c=u(3,l),B=u(3,l),d=u(2,l);function E(A,e,i){return A+(e-A)*i}function h(e,i,a,l,u,h){for(var C=0;C<=o;C++){var w=i/(s-1),m=C/o,p=2*(w-.5),I=(n+m*g)*Math.PI,f=Math.sin(I),Q=Math.cos(I),D=E(A,e,f),M=p*t,b=Q*A,y=f*D;c.push(M,b,y);var T=r.add(r.multiply([0,f,Q],a),l);B.push(T),d.push(w*u+h,m)}}for(var C=0;C<s;C++){var w=2*(C/(s-1)-.5);h(e,C,[1,1,1],[0,0,0],1,0),h(e,C,[0,0,0],[w,0,0],0,0),h(i,C,[1,1,1],[0,0,0],1,0),h(i,C,[0,0,0],[w,0,0],0,1)}var m=u(3,2*o*(2+s),Uint16Array);function p(A,e){for(var i=0;i<o;++i)m.push(A+i+0,A+i+1,e+i+0),m.push(A+i+1,e+i+1,e+i+0)}var I=o+1;return p(0*I,4*I),p(5*I,7*I),p(6*I,2*I),p(3*I,1*I),{position:c,normal:B,texcoord:d,indices:m}}function k(A,e,i,t,o,n){return M(A,A,e,i,t,o,n)}function F(A,e,i,t,o,n){if(i<3)throw Error("radialSubdivisions must be 3 or greater");if(t<3)throw Error("verticalSubdivisions must be 3 or greater");o=o||0;for(var a=(n=n||2*Math.PI)-o,r=i+1,s=t+1,g=r*s,l=u(3,g),c=u(3,g),B=u(2,g),d=u(3,i*t*2,Uint16Array),E=0;E<s;++E)for(var h=E/t,C=h*Math.PI*2,w=Math.sin(C),m=A+w*e,p=Math.cos(C),I=p*e,f=0;f<r;++f){var Q=f/i,D=o+Q*a,M=Math.sin(D),b=Math.cos(D),y=M*m,T=b*m,k=M*w,F=b*w;l.push(y,I,T),c.push(k,p,F),B.push(Q,1-h)}for(var v=0;v<t;++v)for(var S=0;S<i;++S){var N=1+S,R=1+v;d.push(r*v+S,r*R+S,r*v+N),d.push(r*R+S,r*R+N,r*v+N)}return{position:l,normal:c,texcoord:B,indices:d}}function v(A,e,i,t,o){if(e<3)throw Error("divisions must be at least 3");i=i||1,o=o||1,t=t||0;for(var n=(e+1)*(i+1),a=u(3,n),r=u(3,n),s=u(2,n),g=u(3,i*e*2,Uint16Array),l=0,c=A-t,B=e+1,d=0;d<=i;++d){for(var E=t+c*Math.pow(d/i,o),h=0;h<=e;++h){var C=2*Math.PI*h/e,w=E*Math.cos(C),m=E*Math.sin(C);if(a.push(w,0,m),r.push(0,1,0),s.push(1-h/e,d/i),d>0&&h!==e){var p=l+(h+1),I=l+h,f=l+h-B,Q=l+(h+1)-B;g.push(p,I,f),g.push(p,f,Q)}}l+=e+1}return{position:a,normal:r,texcoord:s,indices:g}}function S(A){return function(e){var i=A.apply(this,Array.prototype.slice.call(arguments,1));return t.createBuffersFromArrays(e,i)}}function N(A){return function(e){var i=A.apply(null,Array.prototype.slice.call(arguments,1));return t.createBufferInfoFromArrays(e,i)}}var R=["numComponents","size","type","normalize","stride","offset","attrib","name","attribName"];function O(A,e,i,t){t=t||0;for(var o=A.length,n=0;n<o;++n)e[i+n]=A[n]+t}function Y(A,e){var i=g(A),t=new i.constructor(e),n=t;return i.numComponents&&i.numElements&&c(t,i.numComponents),A.data&&(n={data:t},o.copyNamedProperties(R,A,n)),n}var U=N(y);e.create3DFBufferInfo=U;var G=S(y);e.create3DFBuffers=G;var H=N(D);e.createCubeBufferInfo=H;var L=S(D);e.createCubeBuffers=L;var P=N(I);e.createPlaneBufferInfo=P;var x=S(I);e.createPlaneBuffers=x;var _=N(f);e.createSphereBufferInfo=_;var j=S(f);e.createSphereBuffers=j;var J=N(M);e.createTruncatedConeBufferInfo=J;var z=S(M);e.createTruncatedConeBuffers=z;var K=N(p);e.createXYQuadBufferInfo=K;var W=S(p);e.createXYQuadBuffers=W;var V=N(T);e.createCresentBufferInfo=V;var X=S(T);e.createCresentBuffers=X;var Z=N(k);e.createCylinderBufferInfo=Z;var q=S(k);e.createCylinderBuffers=q;var $=N(F);e.createTorusBufferInfo=$;var AA=S(F);e.createTorusBuffers=AA;var eA=N(v);e.createDiscBufferInfo=eA;var iA=S(v);e.createDiscBuffers=iA},function(A,e,i){"use strict";e.__esModule=!0;var t={addExtensionsToContext:!0,getContext:!0,getWebGLContext:!0,resizeCanvasToDisplaySize:!0,setDefaults:!0};e.addExtensionsToContext=w,e.getContext=function(A,e){return function(A,e){for(var i=["webgl2","webgl","experimental-webgl"],t=null,o=0;o<i.length;++o)if(t=A.getContext(i[o],e)){d.addExtensionsToContext&&w(t);break}return t}(A,e)},e.getWebGLContext=function(A,e){return function(A,e){for(var i=["webgl","experimental-webgl"],t=null,o=0;o<i.length;++o)if(t=A.getContext(i[o],e)){d.addExtensionsToContext&&w(t);break}return t}(A,e)},e.resizeCanvasToDisplaySize=function(A,e){e=e||1,e=Math.max(0,e);var i=A.clientWidth*e|0,t=A.clientHeight*e|0;if(A.width!==i||A.height!==t)return A.width=i,A.height=t,!0;return!1},e.setDefaults=function(A){a.copyExistingProperties(A,d),o.setAttributeDefaults_(A),n.setTextureDefaults_(A)};var o=B(i(7));Object.keys(o).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=o[A]))});var n=B(i(8));Object.keys(n).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=n[A]))});var a=B(i(0)),r=B(i(4));Object.keys(r).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=r[A]))});var s=i(12);Object.keys(s).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=s[A]))});var g=i(13);Object.keys(g).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=g[A]))});var l=i(5);Object.keys(l).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=l[A]))});var c=i(1);Object.keys(c).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=c[A]))});var u=i(14);function B(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}Object.keys(u).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=u[A]))});var d={addExtensionsToContext:!0};var E=/^(.*?)_/;function h(A,e){r.glEnumToString(A,0);var i=A.getExtension(e);if(i){var t={},o=E.exec(e)[1],n="_"+o;for(var s in i){var g=i[s],l="function"==typeof g,c=l?o:n,u=s;s.endsWith(c)&&(u=s.substring(0,s.length-c.length)),void 0!==A[u]?l||A[u]===g||a.warn(u,A[u],g,s):l?A[u]=function(A){return function(){return A.apply(i,arguments)}}(g):(A[u]=g,t[u]=g)}t.constructor={name:i.constructor.name},r.glEnumToString(t,0)}return i}var C=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_frag_depth","EXT_sRGB","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_depth_texture","WEBGL_draw_buffers"];function w(A){for(var e=0;e<C.length;++e)h(A,C[e])}},function(A,e,i){"use strict";e.__esModule=!0,e.drawBufferInfo=o,e.drawObjectList=function(A,e){var i=null,n=null;e.forEach(function(e){if(!1!==e.active){var a=e.programInfo,r=e.vertexArrayInfo||e.bufferInfo,s=!1,g=void 0===e.type?A.TRIANGLES:e.type;a!==i&&(i=a,A.useProgram(a.program),s=!0),(s||r!==n)&&(n&&n.vertexArrayObject&&!r.vertexArrayObject&&A.bindVertexArray(null),n=r,t.setBuffersAndAttributes(A,a,r)),t.setUniforms(a,e.uniforms),o(A,r,g,e.count,e.offset,e.instanceCount)}}),n.vertexArrayObject&&A.bindVertexArray(null)};var t=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}(i(5));function o(A,e,i,t,o,n){i=void 0===i?A.TRIANGLES:i;var a=e.indices,r=e.elementType,s=void 0===t?e.numElements:t;o=void 0===o?0:o,r||a?void 0!==n?A.drawElementsInstanced(i,s,void 0===r?A.UNSIGNED_SHORT:e.elementType,o,n):A.drawElements(i,s,void 0===r?A.UNSIGNED_SHORT:e.elementType,o):void 0!==n?A.drawArraysInstanced(i,o,s,n):A.drawArrays(i,o,s)}},function(A,e,i){"use strict";e.__esModule=!0,e.bindFramebufferInfo=function(A,e,i){i=i||A.FRAMEBUFFER,e?(A.bindFramebuffer(i,e.framebuffer),A.viewport(0,0,e.width,e.height)):(A.bindFramebuffer(i,null),A.viewport(0,0,A.drawingBufferWidth,A.drawingBufferHeight))},e.createFramebufferInfo=function(A,e,i,n){var l=A.FRAMEBUFFER,c=A.createFramebuffer();A.bindFramebuffer(l,c),i=i||A.drawingBufferWidth,n=n||A.drawingBufferHeight;var u=0,B={framebuffer:c,attachments:[],width:i,height:n};return(e=e||r).forEach(function(e){var r=e.attachment,c=e.format,d=function(A){return s[A]}(c);if(d||(d=a+u++),!r)if(function(A){return g[A]}(c))r=A.createRenderbuffer(),A.bindRenderbuffer(A.RENDERBUFFER,r),A.renderbufferStorage(A.RENDERBUFFER,c,i,n);else{var E=Object.assign({},e);E.width=i,E.height=n,void 0===E.auto&&(E.auto=!1,E.min=E.min||E.minMag||A.LINEAR,E.mag=E.mag||E.minMag||A.LINEAR,E.wrapS=E.wrapS||E.wrap||A.CLAMP_TO_EDGE,E.wrapT=E.wrapT||E.wrap||A.CLAMP_TO_EDGE),r=t.createTexture(A,E)}if(o.isRenderbuffer(A,r))A.framebufferRenderbuffer(l,d,A.RENDERBUFFER,r);else{if(!o.isTexture(A,r))throw"unknown attachment type";A.framebufferTexture2D(l,d,e.texTarget||A.TEXTURE_2D,r,e.level||0)}B.attachments.push(r)}),B},e.resizeFramebufferInfo=function(A,e,i,n,a){n=n||A.drawingBufferWidth,a=a||A.drawingBufferHeight,e.width=n,e.height=a,(i=i||r).forEach(function(i,r){var s=e.attachments[r],g=i.format;if(o.isRenderbuffer(A,s))A.bindRenderbuffer(A.RENDERBUFFER,s),A.renderbufferStorage(A.RENDERBUFFER,g,n,a);else{if(!o.isTexture(A,s))throw"unknown attachment type";t.resizeTexture(A,s,i,n,a)}})};var t=n(i(8)),o=n(i(0));function n(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}var a=36064,r=[{format:6408,type:5121,min:9729,wrap:33071},{format:34041}],s={};s[34041]=33306,s[6401]=36128,s[36168]=36128,s[6402]=36096,s[33189]=36096;var g={};g[32854]=!0,g[32855]=!0,g[36194]=!0,g[34041]=!0,g[33189]=!0,g[6401]=!0,g[36168]=!0},function(A,e,i){"use strict";e.__esModule=!0,e.createVertexArrayInfo=function(A,e,i){var o=A.createVertexArray();A.bindVertexArray(o),e.length||(e=[e]);return e.forEach(function(e){t.setBuffersAndAttributes(A,e,i)}),A.bindVertexArray(null),{numElements:i.numElements,elementType:i.elementType,vertexArrayObject:o}},e.createVAOAndSetAttributes=o,e.createVAOFromBufferInfo=function(A,e,i){return o(A,e.attribSetters||e,i.attribs,i.indices)};var t=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}(i(5));function o(A,e,i,o){var n=A.createVertexArray();return A.bindVertexArray(n),t.setAttributes(e,i),o&&A.bindBuffer(A.ELEMENT_ARRAY_BUFFER,o),A.bindVertexArray(null),n}}])})},function(A,e,i){"use strict";i.d(e,"a",function(){return o}),i.d(e,"b",function(){return t}),i.d(e,"c",function(){return n}),i.d(e,"d",function(){return a});var t={sprite:null,receivedBlocks:!1},o=function(A,e){switch(void 0===A&&(A=t),e.type){case"scratch-gui/hovered-target/SET_HOVERED_SPRITE":return{sprite:e.spriteId,receivedBlocks:!1};case"scratch-gui/hovered-target/SET_RECEIVED_BLOCKS":return{sprite:A.sprite,receivedBlocks:e.receivedBlocks};default:return A}},n=function(A){return{type:"scratch-gui/hovered-target/SET_HOVERED_SPRITE",spriteId:A,meta:{throttle:30}}},a=function(A){return{type:"scratch-gui/hovered-target/SET_RECEIVED_BLOCKS",receivedBlocks:A}}},function(A,e,i){"use strict";i.d(e,"a",function(){return o}),i.d(e,"b",function(){return t}),i.d(e,"c",function(){return n});var t="",o=function(A,e){switch(void 0===A&&(A=t),e.type){case"projectTitle/SET_PROJECT_TITLE":return e.title;default:return A}},n=function(A){return{type:"projectTitle/SET_PROJECT_TITLE",title:A}}},function(A,e,i){"use strict";i.d(e,"a",function(){return n}),i.d(e,"b",function(){return o}),i.d(e,"c",function(){return a});var t="scratch-gui/restore-deletion/RESTORE_UPDATE",o={restoreFun:null,deletedItem:""},n=function(A,e){switch(void 0===A&&(A=o),e.type){case t:return Object.assign({},A,e.state);default:return A}},a=function(A){return{type:t,state:{restoreFun:A.restoreFun,deletedItem:A.deletedItem}}}},function(A,e,i){var t=i(1493),o=i(1496),n=i(548),a=i(544),r=i(1498),s=i(547),g=i(346),l=i(545);A.exports={BitmapAdapter:o,convertFonts:l,inlineSvgFonts:n,loadSvgString:a,sanitizeSvg:r,serializeSvgToString:s,SvgElement:g,SVGRenderer:t}},function(A,e,i){"use strict";var t=i(0),o=i.n(t),n=i(1),a=i.n(n),r=i(41),s=i(6),g=i(77),l=i.n(g),c=i(11),u=i.n(c),B=i(2),d=i(57),E=i(13),h=i(19),C=i(24),w=i(51),m=i.n(w),p=i(208);function I(A){"@babel/helpers - typeof";return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function f(A,e){var i="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!i){if(Array.isArray(A)||(i=function(A,e){if(!A)return;if("string"==typeof A)return Q(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Q(A,e)}(A))||e&&A&&"number"==typeof A.length){i&&(A=i);var t=0,o=function(){};return{s:o,n:function(){return t>=A.length?{done:!0}:{done:!1,value:A[t++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,r=!1;return{s:function(){i=i.call(A)},n:function(){var A=i.next();return a=A.done,A},e:function(A){r=!0,n=A},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw n}}}}function Q(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function D(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function M(A,e){return(M=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function b(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=y(A);if(e){var o=y(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===I(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function y(A){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var T=["Sans Serif","Serif","Handwriting","Marker","Curly","Pixel","Scratch"],k=i(259);function F(A){"@babel/helpers - typeof";return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var v=["locale","onSetLanguage"];function S(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function N(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function R(A,e){return(R=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function O(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Y(A);if(e){var o=Y(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===F(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function Y(A){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var U=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&R(A,e)}(t,a.a.Component);var i=O(t);function t(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i.apply(this,arguments)}return function(A,e,i){e&&N(A.prototype,e),i&&N(A,i)}(t,[{key:"componentDidUpdate",value:function(A){A.locale!==this.props.locale&&this.props.onSetLanguage(this.props.locale)}},{key:"render",value:function(){var e=this.props,i=(e.locale,e.onSetLanguage,S(e,v));return a.a.createElement(k.a,null,a.a.createElement(A,i))}}]),t}();e.propTypes={locale:o.a.string,onSetLanguage:o.a.func},e.defaultProps={onSetLanguage:function(){}};return Object(s.b)(function(A){return{locale:A.locales.locale}},function(){return{}})(e)},G=i(5),H=i.n(G),L=i(26),P=i(87),x=i(113),_=i(43);function j(A){"@babel/helpers - typeof";return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var J=["cancelFileUpload","closeFileMenu","isLoadingUpload","isShowingWithoutId","loadingState","onLoadingFinished","onLoadingStarted","onSetProjectTitle","projectChanged","requestProjectUpload","userOwnsProject"];function z(){return(z=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function K(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function W(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function V(A,e){return(V=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function X(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=q(A);if(e){var o=q(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===j(e)||"function"==typeof e))return e;return Z(A)}(this,i)}}function Z(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function q(A){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var $=Object(B.d)({loadError:{id:"gui.projectLoader.loadError",defaultMessage:"The project file that was selected failed to load."}}),AA=i(86),eA=i(42);function iA(A){"@babel/helpers - typeof";return(iA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var tA=["assetHost","intl","isLoadingProject","loadingState","onActivateTab","onError","onFetchedProjectData","onProjectUnchanged","projectHost","projectId","reduxProjectId","setProjectId","isFetchingWithId"];function oA(){return(oA=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function nA(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function aA(A,e,i,t,o,n,a){try{var r=A[n](a),s=r.value}catch(A){return void i(A)}r.done?e(s):Promise.resolve(s).then(t,o)}function rA(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function sA(A,e){return(sA=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function gA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=cA(A);if(e){var o=cA(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===iA(e)||"function"==typeof e))return e;return lA(A)}(this,i)}}function lA(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function cA(A){return(cA=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}function uA(A){"@babel/helpers - typeof";return(uA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var BA=["intl","isAnyCreatingNewState","isShowingWithoutId","onChangedProjectTitle","onUpdateProjectTitle","projectTitle","reduxProjectTitle"];function dA(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function EA(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function hA(A,e){return(hA=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function CA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=wA(A);if(e){var o=wA(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===uA(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function wA(A){return(wA=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var mA=Object(B.d)({defaultProjectTitle:{id:"gui.gui.defaultProjectTitle",defaultMessage:"Scratch Project"}});function pA(A,e){var i="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!i){if(Array.isArray(A)||(i=function(A,e){if(!A)return;if("string"==typeof A)return IA(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return IA(A,e)}(A))||e&&A&&"number"==typeof A.length){i&&(A=i);var t=0,o=function(){};return{s:o,n:function(){return t>=A.length?{done:!0}:{done:!1,value:A[t++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,r=!1;return{s:function(){i=i.call(A)},n:function(){var A=i.next();return a=A.done,A},e:function(A){r=!0,n=A},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw n}}}}function IA(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}var fA=function(A){var e,i={projectName:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",language:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",spriteCount:0,blocksCount:0,costumesCount:0,listsCount:0,scriptCount:0,soundsCount:0,variablesCount:0},t=pA(A.runtime.targets);try{for(t.s();!(e=t.n()).done;){var o=e.value;for(var n in++i.spriteCount,i.blocksCount+=Object.keys(o.sprite.blocks._blocks).length,i.costumesCount+=o.sprite.costumes_.length,i.scriptCount+=o.sprite.blocks._scripts.length,i.soundsCount+=o.sprite.sounds.length,o.variables)"list"===o.variables[n].type?++i.listsCount:++i.variablesCount}}catch(A){t.e(A)}finally{t.f()}return i};var QA=i(171),DA=i.n(QA),MA=i(158),bA=i.n(MA),yA=function(A,e,i){var t={body:e,headers:{"Content-Type":"application/json"},withCredentials:!0},o=null===A||void 0===A,n={};i.hasOwnProperty("originalId")&&(n.original_id=i.originalId),i.hasOwnProperty("isCopy")&&(n.is_copy=i.isCopy),i.hasOwnProperty("isRemix")&&(n.is_remix=i.isRemix),i.hasOwnProperty("title")&&(n.title=i.title);var a=DA.a.stringify(n);return a&&(a="?".concat(a)),o?Object.assign(t,{method:"post",url:"".concat(eA.a.projectHost,"/").concat(a)}):Object.assign(t,{method:"put",url:"".concat(eA.a.projectHost,"/").concat(A).concat(a)}),new Promise(function(e,i){bA()(t,function(t,n){if(t)return i(t);if(200!==n.statusCode)return i(n.statusCode);var a;try{a=JSON.parse(n.body)}catch(A){return i(A)}a.id=A,o&&(a.id=a["content-name"]),e(a)})})},TA=i(35),kA=i(209),FA=["autoSaveTimeoutId","autoSaveIntervalSecs","isCreatingCopy","isCreatingNew","projectChanged","isAnyCreatingNewState","isLoading","isManualUpdating","isRemixing","isShowingSaveable","isShowingWithId","isShowingWithoutId","isUpdating","loadingState","onAutoUpdateProject","onCreatedProject","onCreateProject","onProjectError","onRemixing","onSetProjectUnchanged","onSetProjectThumbnailer","onSetProjectSaver","onShowAlert","onShowCopySuccessAlert","onShowRemixSuccessAlert","onShowCreatingCopyAlert","onShowCreatingRemixAlert","onShowSaveSuccessAlert","onShowSavingAlert","onUpdatedProject","onUpdateProjectData","onUpdateProjectThumbnail","reduxProjectId","reduxProjectTitle","setAutoSaveTimeoutId"];function vA(){return(vA=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function SA(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function NA(A){"@babel/helpers - typeof";return(NA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function RA(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function OA(A,e){return(OA=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function YA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=GA(A);if(e){var o=GA(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===NA(e)||"function"==typeof e))return e;return UA(A)}(this,i)}}function UA(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function GA(A){return(GA=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var HA=i(65),LA=i(78),PA=function(A){var e=Array.isArray(A.tutorial)?A.tutorial[0]:A.tutorial;return void 0===e?null:"all"===e?e:function(A){for(var e in HA.a)if(HA.a[e].urlId===A)return LA.a.event({category:"how-to",action:"load from url",label:"".concat(e)}),e;return null}(e)},xA=i(61);function _A(A){"@babel/helpers - typeof";return(_A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var jA=["onOpenTipsLibrary","onUpdateReduxDeck"];function JA(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function zA(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function KA(A,e){return(KA=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function WA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=VA(A);if(e){var o=VA(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===_A(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function VA(A){return(VA=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var XA=i(202),ZA=i.n(XA),qA=i(156),$A=i(205),Ae=i(207),ee=i(119),ie=i(206);!function(){function A(){var A=this;return new Promise(function(e){var i=new FileReader;i.onload=function(){e(i.result)},i.readAsArrayBuffer(A)})}File.prototype.arrayBuffer=File.prototype.arrayBuffer||A,Blob.prototype.arrayBuffer=Blob.prototype.arrayBuffer||A}();var te=function(A){return new Promise(function(e){var i=new FileReader;i.readAsDataURL(A),i.onloadend=function(){e(i.result)}})};function oe(A){"@babel/helpers - typeof";return(oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var ne=["attachKeyboardEvents","projectChanged","shouldUpdateTargets","shouldUpdateProjectChanged","onBlockDragUpdate","onGreenFlag","onKeyDown","onKeyUp","onMicListeningUpdate","onMonitorsUpdate","onTargetsUpdate","onProjectChanged","onProjectRunStart","onProjectRunStop","onProjectSaved","onRuntimeStarted","onTurboModeOff","onTurboModeOn","onShowExtensionAlert"];function ae(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function re(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function se(A,e){return(se=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ge(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=ce(A);if(e){var o=ce(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===oe(e)||"function"==typeof e))return e;return le(A)}(this,i)}}function le(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function ce(A){return(ce=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ue=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&se(A,e)}(t,a.a.Component);var i=ge(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(le(e),["handleKeyDown","handleKeyUp","handleProjectChanged","handleTargetsUpdate","handleProjectRunStart"]),e.props.vm.on("targetsUpdate",e.handleTargetsUpdate),e.props.vm.on("MONITORS_UPDATE",e.props.onMonitorsUpdate),e.props.vm.on("BLOCK_DRAG_UPDATE",e.props.onBlockDragUpdate),e.props.vm.on("TURBO_MODE_ON",e.props.onTurboModeOn),e.props.vm.on("TURBO_MODE_OFF",e.props.onTurboModeOff),e.props.vm.on("PROJECT_RUN_START",e.handleProjectRunStart),e.props.vm.on("PROJECT_RUN_STOP",e.props.onProjectRunStop),e.props.vm.on("PROJECT_CHANGED",e.handleProjectChanged),e.props.vm.on("RUNTIME_STARTED",e.props.onRuntimeStarted),e.props.vm.on("PROJECT_START",e.props.onGreenFlag),e.props.vm.on("PERIPHERAL_CONNECTION_LOST_ERROR",e.props.onShowExtensionAlert),e.props.vm.on("MIC_LISTENING",e.props.onMicListeningUpdate),e.autoSaveProject=ZA()(e.autoSaveProject.bind(le(e)),1e3),e}return function(A,e,i){e&&re(A.prototype,e),i&&re(A,i)}(t,[{key:"componentDidMount",value:function(){this.props.attachKeyboardEvents&&(document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)),this.props.vm.postIOData("userData",{username:this.props.username})}},{key:"componentDidUpdate",value:function(A){A.username!==this.props.username&&this.props.vm.postIOData("userData",{username:this.props.username}),this.props.shouldUpdateTargets&&!A.shouldUpdateTargets&&this.props.vm.emitTargetsUpdate(!1)}},{key:"componentWillUnmount",value:function(){this.props.vm.removeListener("PERIPHERAL_CONNECTION_LOST_ERROR",this.props.onShowExtensionAlert),this.props.attachKeyboardEvents&&(document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp))}},{key:"handleProjectRunStart",value:function(){this.props.onProjectRunStart()}},{key:"handleProjectChanged",value:function(){this.props.shouldUpdateProjectChanged&&!this.props.projectChanged&&this.props.onProjectChanged(),this.autoSaveProject()}},{key:"autoSaveProject",value:function(){console.log('Saving project to "__autosave"'),this.props.vm.saveProjectSb3().then(function(A){te(A).then(function(A){try{mv2Interface.saveScratchFile("__autosave",A)}catch(A){console.error("Failed to auto save project",A.message)}})})}},{key:"handleTargetsUpdate",value:function(A){this.props.shouldUpdateTargets&&this.props.onTargetsUpdate(A)}},{key:"handleKeyDown",value:function(A){if(A.target===document||A.target===document.body){var e=A.key&&"Dead"!==A.key?A.key:A.keyCode;this.props.vm.postIOData("keyboard",{key:e,isDown:!0}),(32===A.keyCode||A.keyCode>=37&&A.keyCode<=40)&&A.preventDefault()}}},{key:"handleKeyUp",value:function(A){var e=A.key&&"Dead"!==A.key?A.key:A.keyCode;this.props.vm.postIOData("keyboard",{key:e,isDown:!1}),A.target!==document&&A.target!==document.body&&A.preventDefault()}},{key:"render",value:function(){var e=this.props,i=(e.attachKeyboardEvents,e.projectChanged,e.shouldUpdateTargets,e.shouldUpdateProjectChanged,e.onBlockDragUpdate,e.onGreenFlag,e.onKeyDown,e.onKeyUp,e.onMicListeningUpdate,e.onMonitorsUpdate,e.onTargetsUpdate,e.onProjectChanged,e.onProjectRunStart,e.onProjectRunStop,e.onProjectSaved,e.onRuntimeStarted,e.onTurboModeOff,e.onTurboModeOn,e.onShowExtensionAlert,ae(e,ne));return a.a.createElement(A,i)}}]),t}();e.propTypes={attachKeyboardEvents:o.a.bool,onBlockDragUpdate:o.a.func.isRequired,onGreenFlag:o.a.func,onKeyDown:o.a.func,onKeyUp:o.a.func,onMicListeningUpdate:o.a.func.isRequired,onMonitorsUpdate:o.a.func.isRequired,onProjectChanged:o.a.func.isRequired,onProjectRunStart:o.a.func.isRequired,onProjectRunStop:o.a.func.isRequired,onProjectSaved:o.a.func.isRequired,onRuntimeStarted:o.a.func.isRequired,onShowExtensionAlert:o.a.func.isRequired,onTargetsUpdate:o.a.func.isRequired,onTurboModeOff:o.a.func.isRequired,onTurboModeOn:o.a.func.isRequired,projectChanged:o.a.bool,shouldUpdateTargets:o.a.bool,shouldUpdateProjectChanged:o.a.bool,username:o.a.string,vm:o.a.instanceOf(u.a).isRequired},e.defaultProps={attachKeyboardEvents:!0,onGreenFlag:function(){return{}}};return Object(s.b)(function(A){return{projectChanged:A.scratchGui.projectChanged,shouldUpdateTargets:!A.scratchGui.mode.isFullScreen&&!A.scratchGui.mode.isPlayerOnly&&!A.scratchGui.modals.soundRecorder,shouldUpdateProjectChanged:!A.scratchGui.mode.isFullScreen&&!A.scratchGui.mode.isPlayerOnly,vm:A.scratchGui.vm,username:A.session&&A.session.session&&A.session.session.user?A.session.session.user.username:""}},function(A){return{onTargetsUpdate:function(e){A(Object(qA.d)(e.targetList,e.editingTarget))},onMonitorsUpdate:function(e){A(Object(Ae.c)(e))},onBlockDragUpdate:function(e){A(Object($A.c)(e))},onProjectRunStart:function(){return A(Object(ee.b)(!0))},onProjectRunStop:function(){return A(Object(ee.b)(!1))},onProjectChanged:function(){return A(Object(AA.c)())},onProjectSaved:function(){return A(Object(AA.d)())},onRuntimeStarted:function(){return A(Object(ee.c)(!0))},onTurboModeOn:function(){return A(Object(ee.d)(!0))},onTurboModeOff:function(){return A(Object(ee.d)(!1))},onShowExtensionAlert:function(e){A(Object(TA.g)(e))},onMicListeningUpdate:function(e){A(Object(ie.c)(e))}}})(e)},Be=i(274),de=i.n(Be);function Ee(A){"@babel/helpers - typeof";return(Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var he=["fontsLoaded","loadingState","locale","messages","isStarted","onError","onLoadedProject","onSetProjectUnchanged","projectData","isLoadingWithId","vm"];function Ce(){return(Ce=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function we(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function me(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function pe(A,e){return(pe=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Ie(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Qe(A);if(e){var o=Qe(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ee(e)||"function"==typeof e))return e;return fe(A)}(this,i)}}function fe(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Qe(A){return(Qe=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var De=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&pe(A,e)}(t,a.a.Component);var i=Ie(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(fe(e),["loadProject"]),e}return function(A,e,i){e&&me(A.prototype,e),i&&me(A,i)}(t,[{key:"componentDidMount",value:function(){this.props.vm.initialized||(this.audioEngine=new de.a,this.props.vm.attachAudioEngine(this.audioEngine),this.props.vm.setCompatibilityMode(!0),this.props.vm.initialized=!0,this.props.vm.setLocale(this.props.locale,this.props.messages)),this.props.isPlayerOnly||this.props.isStarted||this.props.vm.start()}},{key:"componentDidUpdate",value:function(A){!this.props.isLoadingWithId||!this.props.fontsLoaded||A.isLoadingWithId&&A.fontsLoaded||this.loadProject(),this.props.isPlayerOnly||this.props.isStarted||this.props.vm.start()}},{key:"loadProject",value:function(){var A=this;return this.props.vm.loadProject(this.props.projectData).then(function(){A.props.onLoadedProject(A.props.loadingState,A.props.canSave),setTimeout(function(){return A.props.onSetProjectUnchanged()}),A.props.isStarted||setTimeout(function(){return A.props.vm.renderer.draw()})}).catch(function(e){A.props.onError(e)})}},{key:"render",value:function(){var e=this.props,i=(e.fontsLoaded,e.loadingState,e.locale,e.messages,e.isStarted,e.onError,e.onLoadedProject,e.onSetProjectUnchanged,e.projectData,e.isLoadingWithId),t=e.vm,o=we(e,he);return a.a.createElement(A,Ce({isLoading:i,vm:t},o))}}]),t}();e.propTypes={canSave:o.a.bool,cloudHost:o.a.string,fontsLoaded:o.a.bool,isLoadingWithId:o.a.bool,isPlayerOnly:o.a.bool,isStarted:o.a.bool,loadingState:o.a.oneOf(E.a),locale:o.a.string,messages:o.a.objectOf(o.a.string),onError:o.a.func,onLoadedProject:o.a.func,onSetProjectUnchanged:o.a.func,projectData:o.a.oneOfType([o.a.object,o.a.string]),projectId:o.a.oneOfType([o.a.string,o.a.number]),username:o.a.string,vm:o.a.instanceOf(u.a).isRequired};return Object(s.b)(function(A){var e=A.scratchGui.projectState.loadingState;return{fontsLoaded:A.scratchGui.fontsLoaded,isLoadingWithId:Object(E.p)(e),locale:A.locales.locale,messages:A.locales.messages,projectData:A.scratchGui.projectState.projectData,projectId:A.scratchGui.projectState.projectId,loadingState:e,isPlayerOnly:A.scratchGui.mode.isPlayerOnly,isStarted:A.scratchGui.vmStatus.started}},function(A){return{onError:function(e){return A(Object(E.z)(e))},onLoadedProject:function(e,i){return A(Object(E.y)(e,i,!0))},onSetProjectUnchanged:function(){return A(Object(AA.d)())}}},function(A,e,i){return Object.assign({},A,e,i)})(e)},Me=i(362),be=i.n(Me);function ye(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var Te=function(){function A(e,i,t,o){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.vm=i,this.username=t,this.projectId=o,this.cloudHost=e,this.connectionAttempts=0,this.queuedData=[],this.openConnection(),this.sendCloudData=be()(this._sendCloudData,100)}return function(A,e,i){e&&ye(A.prototype,e),i&&ye(A,i)}(A,[{key:"openConnection",value:function(){this.connectionAttempts+=1;try{this.connection=new WebSocket(("http:"===location.protocol?"ws://":"wss://")+this.cloudHost)}catch(A){return L.a.warn("Websocket support is not available in this browser",A),void(this.connection=null)}this.connection.onerror=this.onError.bind(this),this.connection.onmessage=this.onMessage.bind(this),this.connection.onopen=this.onOpen.bind(this),this.connection.onclose=this.onClose.bind(this)}},{key:"onError",value:function(A){L.a.error("Websocket connection error: ".concat(JSON.stringify(A)))}},{key:"onMessage",value:function(A){var e=this;A.data.split("\n").forEach(function(A){if(A){var i=e.parseMessage(JSON.parse(A));e.vm.postIOData("cloud",i)}})}},{key:"onOpen",value:function(){var A=this;this.connectionAttempts=1,this.writeToServer("handshake"),L.a.info("Successfully connected to clouddata server."),this.queuedData.forEach(function(e){A.sendCloudData(e)}),this.queuedData=[]}},{key:"onClose",value:function(){L.a.info("Closed connection to websocket");var A=this.randomizeDuration(this.exponentialTimeout());this.setTimeout(this.openConnection.bind(this),A)}},{key:"exponentialTimeout",value:function(){return 1e3*(Math.pow(2,Math.min(this.connectionAttempts,5))-1)}},{key:"randomizeDuration",value:function(A){return Math.random()*A}},{key:"setTimeout",value:function(A,e){L.a.info("Reconnecting in ".concat((e/1e3).toFixed(1),"s, attempt ").concat(this.connectionAttempts)),this._connectionTimeout=window.setTimeout(A,e)}},{key:"parseMessage",value:function(A){var e={};switch(A.method){case"set":e.varUpdate={name:A.name,value:A.value}}return e}},{key:"writeToServer",value:function(A,e,i,t){var o={};o.method=A,o.user=this.username,o.project_id=this.projectId,e&&(o.name=e),t&&(o.new_name=t),void 0!==i&&null!==i&&(o.value=i);var n=JSON.stringify(o);this.connection&&this.connection.readyState===WebSocket.OPEN?this.sendCloudData(n):"create"!==o.method&&"delete"!==o.method&&"rename"!==o.method||this.queuedData.push(n)}},{key:"_sendCloudData",value:function(A){this.connection.send("".concat(A,"\n"))}},{key:"createVariable",value:function(A,e){this.writeToServer("create",A,e)}},{key:"updateVariable",value:function(A,e){this.writeToServer("set",A,e)}},{key:"renameVariable",value:function(A,e){this.writeToServer("rename",A,null,e)}},{key:"deleteVariable",value:function(A){this.writeToServer("delete",A)}},{key:"requestCloseConnection",value:function(){this.connection&&this.connection.readyState!==WebSocket.CLOSING&&this.connection.readyState!==WebSocket.CLOSED&&(L.a.info("Request close cloud connection without reconnecting"),this.connection.onclose=function(){},this.connection.onerror=function(){},this.connection.close()),this.clear()}},{key:"clear",value:function(){this.connection=null,this.vm=null,this.username=null,this.projectId=null,this._connectionTimeout&&(clearTimeout(this._connectionTimeout),this._connectionTimeout=null),this.connectionAttempts=0}}]),A}();function ke(A){"@babel/helpers - typeof";return(ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var Fe=["canModifyCloudData","cloudHost","projectId","username","hasCloudPermission","isShowingWithId","onShowCloudInfo","vm"];function ve(){return(ve=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Se(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Ne(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Re(A,e){return(Re=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Oe(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Ue(A);if(e){var o=Ue(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ke(e)||"function"==typeof e))return e;return Ye(A)}(this,i)}}function Ye(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Ue(A){return(Ue=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ge=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Re(A,e)}(t,a.a.Component);var i=Oe(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=i.call(this,A)).cloudProvider=null,H()(Ye(e),["handleCloudDataUpdate"]),e.props.vm.on("HAS_CLOUD_DATA_UPDATE",e.handleCloudDataUpdate),e}return function(A,e,i){e&&Ne(A.prototype,e),i&&Ne(A,i)}(t,[{key:"componentDidMount",value:function(){this.shouldConnect(this.props)&&this.connectToCloud()}},{key:"componentDidUpdate",value:function(A){this.shouldConnect(this.props)&&!this.shouldConnect(A)&&this.connectToCloud(),this.shouldDisconnect(this.props,A)&&this.disconnectFromCloud()}},{key:"componentWillUnmount",value:function(){this.disconnectFromCloud()}},{key:"canUseCloud",value:function(A){return!!(A.cloudHost&&A.username&&A.vm&&A.projectId&&A.hasCloudPermission)}},{key:"shouldConnect",value:function(A){return!this.isConnected()&&this.canUseCloud(A)&&A.isShowingWithId&&A.vm.runtime.hasCloudData()&&A.canModifyCloudData}},{key:"shouldDisconnect",value:function(A,e){return this.isConnected()&&(!this.canUseCloud(A)||!A.vm.runtime.hasCloudData()||A.projectId!==e.projectId||A.username!==e.username||!A.canModifyCloudData)}},{key:"isConnected",value:function(){return this.cloudProvider&&!!this.cloudProvider.connection}},{key:"connectToCloud",value:function(){this.cloudProvider=new Te(this.props.cloudHost,this.props.vm,this.props.username,this.props.projectId),this.props.vm.setCloudProvider(this.cloudProvider)}},{key:"disconnectFromCloud",value:function(){this.cloudProvider&&(this.cloudProvider.requestCloseConnection(),this.cloudProvider=null,this.props.vm.setCloudProvider(null))}},{key:"handleCloudDataUpdate",value:function(A){this.isConnected()&&!A?this.disconnectFromCloud():this.shouldConnect(this.props)&&(this.props.onShowCloudInfo(),this.connectToCloud())}},{key:"render",value:function(){var e=this.props,i=(e.canModifyCloudData,e.cloudHost,e.projectId,e.username,e.hasCloudPermission,e.isShowingWithId,e.onShowCloudInfo,e.vm),t=Se(e,Fe);return a.a.createElement(A,ve({canUseCloud:this.canUseCloud(this.props),vm:i},t))}}]),t}();e.propTypes={canModifyCloudData:o.a.bool.isRequired,cloudHost:o.a.string,hasCloudPermission:o.a.bool,isShowingWithId:o.a.bool.isRequired,onShowCloudInfo:o.a.func,projectId:o.a.oneOfType([o.a.string,o.a.number]),username:o.a.string,vm:o.a.instanceOf(u.a).isRequired},e.defaultProps={cloudHost:null,hasCloudPermission:!1,onShowCloudInfo:function(){},username:null};return Object(s.b)(function(A,e){var i=A.scratchGui.projectState.loadingState;return{isShowingWithId:Object(E.t)(i),projectId:A.scratchGui.projectState.projectId,canModifyCloudData:!A.scratchGui.mode.hasEverEnteredEditor||e.canSave}},function(A){return{onShowCloudInfo:function(){return Object(TA.f)(A,"cloudInfo")}}},function(A,e,i){return Object.assign({},A,e,i)})(e)},He=i(4),Le=i.n(He),Pe=i(157),xe=i.n(Pe);function _e(A){return A.type&&"Tab"===A.type.tabsRole}function je(A){return A.type&&"TabPanel"===A.type.tabsRole}function Je(A){return A.type&&"TabList"===A.type.tabsRole}function ze(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Ke(A,e){return n.Children.map(A,function(A){return null===A?null:function(A){return _e(A)||Je(A)||je(A)}(A)?e(A):A.props&&A.props.children&&"object"==typeof A.props.children?Object(n.cloneElement)(A,function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{},t=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(i).filter(function(A){return Object.getOwnPropertyDescriptor(i,A).enumerable}))),t.forEach(function(e){ze(A,e,i[e])})}return A}({},A.props,{children:Ke(A.props.children,e)})):A})}function We(A,e){return n.Children.forEach(A,function(A){null!==A&&(_e(A)||je(A)?e(A):A.props&&A.props.children&&"object"==typeof A.props.children&&(Je(A)&&e(A),We(A.props.children,e)))})}function Ve(A,e,i){var t,o=0,n=0,a=!1,r=[];return We(A[e],function(A){Je(A)&&(A.props&&A.props.children&&"object"==typeof A.props.children&&We(A.props.children,function(A){return r.push(A)}),a&&(t=new Error("Found multiple 'TabList' components inside 'Tabs'. Only one is allowed.")),a=!0),_e(A)?(a&&-1!==r.indexOf(A)||(t=new Error("Found a 'Tab' component outside of the 'TabList' component. 'Tab' components have to be inside the 'TabList' component.")),o++):je(A)&&n++}),t||o===n||(t=new Error("There should be an equal number of 'Tab' and 'TabPanel' in `"+i+"`. Received "+o+" 'Tab' and "+n+" 'TabPanel'.")),t}var Xe,Ze=0;function qe(){return"react-tabs-"+Ze++}function $e(A){var e=0;return We(A,function(A){_e(A)&&e++}),e}function Ai(){return(Ai=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function ei(A){return"getAttribute"in A&&"tab"===A.getAttribute("role")}function ii(A){return"true"===A.getAttribute("aria-disabled")}try{Xe=!("undefined"==typeof window||!window.document||!window.document.activeElement)}catch(A){Xe=!1}var ti=function(A){function e(){for(var e,i=arguments.length,t=new Array(i),o=0;o<i;o++)t[o]=arguments[o];return(e=A.call.apply(A,[this].concat(t))||this).tabNodes=[],e.handleKeyDown=function(A){if(e.isTabFromContainer(A.target)){var i=e.props.selectedIndex,t=!1,o=!1;32!==A.keyCode&&13!==A.keyCode||(t=!0,o=!1,e.handleClick(A)),37===A.keyCode||38===A.keyCode?(i=e.getPrevTab(i),t=!0,o=!0):39===A.keyCode||40===A.keyCode?(i=e.getNextTab(i),t=!0,o=!0):35===A.keyCode?(i=e.getLastTab(),t=!0,o=!0):36===A.keyCode&&(i=e.getFirstTab(),t=!0,o=!0),t&&A.preventDefault(),o&&e.setSelected(i,A)}},e.handleClick=function(A){var i=A.target;do{if(e.isTabFromContainer(i)){if(ii(i))return;var t=[].slice.call(i.parentNode.children).filter(ei).indexOf(i);return void e.setSelected(t,A)}}while(null!==(i=i.parentNode))},e}!function(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,A.__proto__=e}(e,A);var i=e.prototype;return i.setSelected=function(A,e){if(!(A<0||A>=this.getTabsCount())){var i=this.props;(0,i.onSelect)(A,i.selectedIndex,e)}},i.getNextTab=function(A){for(var e=this.getTabsCount(),i=A+1;i<e;i++)if(!ii(this.getTab(i)))return i;for(var t=0;t<A;t++)if(!ii(this.getTab(t)))return t;return A},i.getPrevTab=function(A){for(var e=A;e--;)if(!ii(this.getTab(e)))return e;for(e=this.getTabsCount();e-- >A;)if(!ii(this.getTab(e)))return e;return A},i.getFirstTab=function(){for(var A=this.getTabsCount(),e=0;e<A;e++)if(!ii(this.getTab(e)))return e;return null},i.getLastTab=function(){for(var A=this.getTabsCount();A--;)if(!ii(this.getTab(A)))return A;return null},i.getTabsCount=function(){return $e(this.props.children)},i.getPanelsCount=function(){return function(A){var e=0;return We(A,function(A){je(A)&&e++}),e}(this.props.children)},i.getTab=function(A){return this.tabNodes["tabs-"+A]},i.getChildren=function(){var A=this,e=0,i=this.props,t=i.children,o=i.disabledTabClassName,r=i.focus,s=i.forceRenderTabPanel,g=i.selectedIndex,l=i.selectedTabClassName,c=i.selectedTabPanelClassName;this.tabIds=this.tabIds||[],this.panelIds=this.panelIds||[];for(var u=this.tabIds.length-this.getTabsCount();u++<0;)this.tabIds.push(qe()),this.panelIds.push(qe());return Ke(t,function(i){var t=i;if(Je(i)){var u=0,B=!1;Xe&&(B=a.a.Children.toArray(i.props.children).filter(_e).some(function(e,i){return document.activeElement===A.getTab(i)})),t=Object(n.cloneElement)(i,{children:Ke(i.props.children,function(e){var i="tabs-"+u,t=g===u,a={tabRef:function(e){A.tabNodes[i]=e},id:A.tabIds[u],panelId:A.panelIds[u],selected:t,focus:t&&(r||B)};return l&&(a.selectedClassName=l),o&&(a.disabledClassName=o),u++,Object(n.cloneElement)(e,a)})})}else if(je(i)){var d={id:A.panelIds[e],tabId:A.tabIds[e],selected:g===e};s&&(d.forceRender=s),c&&(d.selectedClassName=c),e++,t=Object(n.cloneElement)(i,d)}return t})},i.isTabFromContainer=function(A){if(!ei(A))return!1;var e=A.parentElement;do{if(e===this.node)return!0;if(e.getAttribute("data-tabs"))break;e=e.parentElement}while(e);return!1},i.render=function(){var A=this,e=this.props,i=(e.children,e.className),t=(e.disabledTabClassName,e.domRef),o=(e.focus,e.forceRenderTabPanel,e.onSelect,e.selectedIndex,e.selectedTabClassName,e.selectedTabPanelClassName,function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(e,["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName"]));return a.a.createElement("div",Ai({},o,{className:Le()(i),onClick:this.handleClick,onKeyDown:this.handleKeyDown,ref:function(e){A.node=e,t&&t(e)},"data-tabs":!0}),this.getChildren())},e}(n.Component);ti.defaultProps={className:"react-tabs",focus:!1},ti.propTypes={children:Ve,className:o.a.oneOfType([o.a.string,o.a.array,o.a.object]),disabledTabClassName:o.a.string,domRef:o.a.func,focus:o.a.bool,forceRenderTabPanel:o.a.bool,onSelect:o.a.func.isRequired,selectedIndex:o.a.number.isRequired,selectedTabClassName:o.a.string,selectedTabPanelClassName:o.a.string};var oi=function(A){function e(i){var t;return(t=A.call(this,i)||this).handleSelected=function(A,i,o){var n=t.props.onSelect;if("function"!=typeof n||!1!==n(A,i,o)){var a={focus:"keydown"===o.type};e.inUncontrolledMode(t.props)&&(a.selectedIndex=A),t.setState(a)}},t.state=e.copyPropsToState(t.props,{},i.defaultFocus),t}!function(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,A.__proto__=e}(e,A);var i=e.prototype;return i.componentWillReceiveProps=function(A){if(e.inUncontrolledMode(A)!==e.inUncontrolledMode(this.props))throw new Error("Switching between controlled mode (by using `selectedIndex`) and uncontrolled mode is not supported in `Tabs`.\nFor more information about controlled and uncontrolled mode of react-tabs see the README.");this.setState(function(i){return e.copyPropsToState(A,i)})},e.inUncontrolledMode=function(A){return null===A.selectedIndex},e.copyPropsToState=function(A,i,t){void 0===t&&(t=!1);var o={focus:t};if(e.inUncontrolledMode(A)){var n=$e(A.children)-1,a=null;a=null!=i.selectedIndex?Math.min(i.selectedIndex,n):A.defaultIndex||0,o.selectedIndex=a}return o},i.render=function(){var A=this.props,e=A.children,i=(A.defaultIndex,A.defaultFocus,function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,["children","defaultIndex","defaultFocus"])),t=this.state,o=t.focus,n=t.selectedIndex;return i.focus=o,i.onSelect=this.handleSelected,null!=n&&(i.selectedIndex=n),a.a.createElement(ti,i,e)},e}(n.Component);function ni(){return(ni=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}oi.defaultProps={defaultFocus:!1,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null},oi.propTypes={children:Ve,className:o.a.oneOfType([o.a.string,o.a.array,o.a.object]),defaultFocus:o.a.bool,defaultIndex:o.a.number,disabledTabClassName:o.a.string,domRef:o.a.func,forceRenderTabPanel:o.a.bool,onSelect:function(A,e,i,t,o){var n=A[e],a=o||e,r=null;return n&&"function"!=typeof n?r=new Error("Invalid "+t+" `"+a+"` of type `"+typeof n+"` supplied to `"+i+"`, expected `function`."):null!=A.selectedIndex&&null==n&&(r=new Error("The "+t+" `"+a+"` is marked as required in `"+i+"`, but its value is `undefined` or `null`.\n`onSelect` is required when `selectedIndex` is also set. Not doing so will make the tabs not do anything, as `selectedIndex` indicates that you want to handle the selected tab yourself.\nIf you only want to set the inital tab replace `selectedIndex` with `defaultIndex`.")),r},selectedIndex:function(A,e,i,t,o){var n=A[e],a=o||e,r=null;if(null!=n&&"number"!=typeof n)r=new Error("Invalid "+t+" `"+a+"` of type `"+typeof n+"` supplied to `"+i+"`, expected `number`.");else if(null!=A.defaultIndex&&null!=n)return new Error("The "+t+" `"+a+"` cannot be used together with `defaultIndex` in `"+i+"`.\nEither remove `"+a+"` to let `"+i+"` handle the selected tab internally or remove `defaultIndex` to handle it yourself.");return r},selectedTabClassName:o.a.string,selectedTabPanelClassName:o.a.string},oi.tabsRole="Tabs";var ai=function(A){function e(){return A.apply(this,arguments)||this}return function(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,A.__proto__=e}(e,A),e.prototype.render=function(){var A=this.props,e=A.children,i=A.className,t=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,["children","className"]);return a.a.createElement("ul",ni({},t,{className:Le()(i),role:"tablist"}),e)},e}(n.Component);function ri(){return(ri=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}ai.defaultProps={className:"react-tabs__tab-list"},ai.propTypes={children:o.a.oneOfType([o.a.object,o.a.array]),className:o.a.oneOfType([o.a.string,o.a.array,o.a.object])},ai.tabsRole="TabList";var si=function(A){function e(){return A.apply(this,arguments)||this}!function(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,A.__proto__=e}(e,A);var i=e.prototype;return i.componentDidMount=function(){this.checkFocus()},i.componentDidUpdate=function(){this.checkFocus()},i.checkFocus=function(){var A=this.props,e=A.selected,i=A.focus;e&&i&&this.node.focus()},i.render=function(){var A,e=this,i=this.props,t=i.children,o=i.className,n=i.disabled,r=i.disabledClassName,s=(i.focus,i.id),g=i.panelId,l=i.selected,c=i.selectedClassName,u=i.tabIndex,B=i.tabRef,d=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(i,["children","className","disabled","disabledClassName","focus","id","panelId","selected","selectedClassName","tabIndex","tabRef"]);return a.a.createElement("li",ri({},d,{className:Le()(o,(A={},A[c]=l,A[r]=n,A)),ref:function(A){e.node=A,B&&B(A)},role:"tab",id:s,"aria-selected":l?"true":"false","aria-disabled":n?"true":"false","aria-controls":g,tabIndex:u||(l?"0":null)}),t)},e}(n.Component);function gi(){return(gi=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}si.defaultProps={className:"react-tabs__tab",disabledClassName:"react-tabs__tab--disabled",focus:!1,id:null,panelId:null,selected:!1,selectedClassName:"react-tabs__tab--selected"},si.propTypes={children:o.a.oneOfType([o.a.array,o.a.object,o.a.string]),className:o.a.oneOfType([o.a.string,o.a.array,o.a.object]),disabled:o.a.bool,tabIndex:o.a.string,disabledClassName:o.a.string,focus:o.a.bool,id:o.a.string,panelId:o.a.string,selected:o.a.bool,selectedClassName:o.a.string,tabRef:o.a.func},si.tabsRole="Tab";var li=function(A){function e(){return A.apply(this,arguments)||this}return function(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,A.__proto__=e}(e,A),e.prototype.render=function(){var A,e=this.props,i=e.children,t=e.className,o=e.forceRender,n=e.id,r=e.selected,s=e.selectedClassName,g=e.tabId,l=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(e,["children","className","forceRender","id","selected","selectedClassName","tabId"]);return a.a.createElement("div",gi({},l,{className:Le()(t,(A={},A[s]=r,A)),role:"tabpanel",id:n,"aria-labelledby":g}),o||r?i:null)},e}(n.Component);li.defaultProps={className:"react-tabs__tab-panel",forceRender:!1,selectedClassName:"react-tabs__tab-panel--selected"},li.propTypes={children:o.a.node,className:o.a.oneOfType([o.a.string,o.a.array,o.a.object]),forceRender:o.a.bool,id:o.a.string,selected:o.a.bool,selectedClassName:o.a.string,tabId:o.a.string},li.tabsRole="TabPanel";var ci=i(182),ui=i.n(ci),Bi=i(275),di=i.n(Bi),Ei=i(292),hi=i(7),Ci=i(112),wi=i(204),mi=i(115),pi=function(){var A,e;return function(i){if(A===i.assetId)return e;if(A=i.assetId,i.assetType===eA.a.AssetType.ImageVector){var t=i.decodeText();if(t.match('font-family(?!="none")')){var o=Object(mi.inlineSvgFonts)(t);e="data:image/svg+xml;utf8,".concat(encodeURIComponent(o))}else e=i.encodeDataURI()}else e=i.encodeDataURI();return e}}(),Ii=function(A){return A.touches&&A.touches[0]?{x:A.touches[0].clientX,y:A.touches[0].clientY}:A.changedTouches&&A.changedTouches[0]?{x:A.changedTouches[0].clientX,y:A.changedTouches[0].clientY}:{x:A.clientX,y:A.clientY}};function fi(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var Qi=function(){function A(e){var i=e.onDrag,t=void 0===i?function(){}:i,o=e.onDragEnd,n=void 0===o?function(){}:o,a=e.touchDragAngle,r=void 0===a?70:a,s=e.distanceThreshold,g=void 0===s?3:s;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this._onDrag=t,this._onDragEnd=n,this._touchDragAngle=r,this._distanceThreshold=g,this._initialOffset=null,this._gestureState=A.STATE_UNIDENTIFIED,H()(this,["start","gestureInProgress","reset","_handleMove","_handleEnd"])}return function(A,e,i){e&&fi(A.prototype,e),i&&fi(A,i)}(A,[{key:"start",value:function(A){this._initialOffset=Ii(A),this._bindListeners()}},{key:"gestureInProgress",value:function(){return this._gestureState!==A.STATE_UNIDENTIFIED}},{key:"reset",value:function(){this._unbindListeners(),this._initialOffset=null,this._gestureState=A.STATE_UNIDENTIFIED}},{key:"_bindListeners",value:function(){window.addEventListener("mouseup",this._handleEnd),window.addEventListener("mousemove",this._handleMove),window.addEventListener("touchend",this._handleEnd),window.addEventListener("touchmove",this._handleMove,{passive:!1})}},{key:"_unbindListeners",value:function(){window.removeEventListener("mouseup",this._handleEnd),window.removeEventListener("mousemove",this._handleMove),window.removeEventListener("touchend",this._handleEnd),window.removeEventListener("touchmove",this._handleMove,{passive:!1})}},{key:"_handleMove",value:function(e){if(!this._isScroll()){var i=Ii(e);if(!this.gestureInProgress()){var t=i.x-this._initialOffset.x,o=i.y-this._initialOffset.y;if(Math.sqrt(t*t+o*o)<this._distanceThreshold)return;if("touchmove"===e.type){var n=Math.atan2(o,t)/Math.PI*180;(n=Math.abs(n))>90&&(n=180-n),n>this._touchDragAngle?this._gestureState=A.STATE_SCROLL:this._gestureState=A.STATE_DRAG}else this._gestureState=A.STATE_DRAG}this._isDrag()&&(this._onDrag(i,this._initialOffset),e.preventDefault())}}},{key:"_handleEnd",value:function(){this.reset(),this._onDragEnd()}},{key:"_isDrag",value:function(){return this._gestureState===A.STATE_DRAG}},{key:"_isScroll",value:function(){return this._gestureState===A.STATE_SCROLL}}],[{key:"STATE_UNIDENTIFIED",get:function(){return"unidentified"}},{key:"STATE_SCROLL",get:function(){return"scroll"}},{key:"STATE_DRAG",get:function(){return"drag"}}]),A}(),Di=i(302),Mi=i.n(Di),bi=i(761),yi=i.n(bi),Ti=function(A){return a.a.createElement("div",{"aria-label":"Delete",className:Le()(Mi.a.deleteButton,A.className),role:"button",tabIndex:A.tabIndex,onClick:A.onClick},a.a.createElement("div",{className:Mi.a.deleteButtonVisible},a.a.createElement("img",{className:Mi.a.deleteIcon,src:yi.a})))};Ti.propTypes={className:o.a.string,onClick:o.a.func.isRequired,tabIndex:o.a.number},Ti.defaultProps={tabIndex:0};var ki=Ti,Fi=i(96),vi=i.n(Fi),Si=i(54),Ni=i.n(Si);function Ri(A){for(var e=arguments.length,i=Array(e>1?e-1:0),t=1;t<e;t++)i[t-1]=arguments[t];return"function"==typeof A&&A.apply(void 0,i)}function Oi(A,e){return Object.prototype.hasOwnProperty.call(A,e)}var Yi="react-contextmenu",Ui="react-contextmenu--visible",Gi="react-contextmenu-wrapper",Hi="react-contextmenu-item",Li="react-contextmenu-item--active",Pi="react-contextmenu-item--disabled",xi="react-contextmenu-item--divider",_i="react-contextmenu-item--selected",ji="react-contextmenu-submenu",Ji={},zi=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),Ki="REACT_CONTEXTMENU_SHOW",Wi="REACT_CONTEXTMENU_HIDE";function Vi(A,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,t=void 0;"function"==typeof window.CustomEvent?t=new window.CustomEvent(A,{detail:e}):(t=document.createEvent("CustomEvent")).initCustomEvent(A,!1,!0,e),i&&(i.dispatchEvent(t),Ni()(Ji,e))}function Xi(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];Vi(Ki,Ni()({},A,{type:Ki}),e)}function Zi(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];Vi(Wi,Ni()({},A,{type:Wi}),e)}var qi=new function A(){var e=this;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.handleShowEvent=function(A){for(var i in e.callbacks)Oi(e.callbacks,i)&&e.callbacks[i].show(A)},this.handleHideEvent=function(A){for(var i in e.callbacks)Oi(e.callbacks,i)&&e.callbacks[i].hide(A)},this.register=function(A,i){var t=Math.random().toString(36).substring(7);return e.callbacks[t]={show:A,hide:i},t},this.unregister=function(A){A&&e.callbacks[A]&&delete e.callbacks[A]},this.callbacks={},zi&&(window.addEventListener(Ki,this.handleShowEvent),window.addEventListener(Wi,this.handleHideEvent))},$i=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A},At=function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}return function(e,i,t){return i&&A(e.prototype,i),t&&A(e,t),e}}();function et(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function it(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}var tt=function(A){function e(){var A,i,t;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var o=arguments.length,n=Array(o),a=0;a<o;a++)n[a]=arguments[a];return i=t=it(this,(A=e.__proto__||Object.getPrototypeOf(e)).call.apply(A,[this].concat(n))),t.handleClick=function(A){A.preventDefault(),t.props.disabled||t.props.divider||(Ri(t.props.onClick,A,Ni()({},t.props.data,Ji.data),Ji.target),t.props.preventClose||Zi())},it(t,i)}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,n["Component"]),At(e,[{key:"render",value:function(){var A,e=this,i=this.props,t=i.disabled,o=i.divider,n=i.children,r=i.attributes,s=i.selected,g=Le()(Hi,r.className,(et(A={},Le()(Pi,r.disabledClassName),t),et(A,Le()(xi,r.dividerClassName),o),et(A,Le()(_i,r.selectedClassName),s),A));return a.a.createElement("div",$i({},r,{className:g,role:"menuitem",tabIndex:"-1","aria-disabled":t?"true":"false","aria-orientation":o?"horizontal":null,ref:function(A){e.ref=A},onMouseMove:this.props.onMouseMove,onMouseLeave:this.props.onMouseLeave,onTouchEnd:this.handleClick,onClick:this.handleClick}),o?null:n)}}]),e}();tt.propTypes={children:o.a.node,attributes:o.a.object,data:o.a.object,disabled:o.a.bool,divider:o.a.bool,preventClose:o.a.bool,onClick:o.a.func,selected:o.a.bool,onMouseMove:o.a.func,onMouseLeave:o.a.func},tt.defaultProps={disabled:!1,data:{},divider:!1,attributes:{},preventClose:!1,onClick:function(){return null},children:null,selected:!1,onMouseMove:function(){return null},onMouseLeave:function(){return null}};var ot=tt;var nt=function(A){function e(A){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,A));return at.call(i),i.seletedItemRef=null,i.state={selectedItem:null,forceSubMenuOpen:!1},i}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,n["Component"]),e}();nt.propTypes={children:o.a.node.isRequired};var at=function(){var A=this;this.handleKeyNavigation=function(e){if(!1!==A.state.isVisible)switch(e.keyCode){case 37:case 27:e.preventDefault(),A.hideMenu(e);break;case 38:e.preventDefault(),A.selectChildren(!0);break;case 40:e.preventDefault(),A.selectChildren(!1);break;case 39:A.tryToOpenSubMenu(e);break;case 13:e.preventDefault(),A.tryToOpenSubMenu(e);var i=A.seletedItemRef&&A.seletedItemRef.props&&A.seletedItemRef.props.disabled;A.seletedItemRef&&A.seletedItemRef.ref instanceof HTMLElement&&!i?A.seletedItemRef.ref.click():A.hideMenu(e)}},this.handleForceClose=function(){A.setState({forceSubMenuOpen:!1})},this.tryToOpenSubMenu=function(e){A.state.selectedItem&&A.state.selectedItem.type===A.getSubMenuType()&&(e.preventDefault(),A.setState({forceSubMenuOpen:!0}))},this.selectChildren=function(e){var i=A.state.selectedItem,t=[];a.a.Children.forEach(A.props.children,function e(i){i&&([ot,A.getSubMenuType()].indexOf(i.type)<0?a.a.Children.forEach(i.props.children,e):i.props.divider||t.push(i))});var o=t.indexOf(i);o<0?A.setState({selectedItem:e?t[t.length-1]:t[0],forceSubMenuOpen:!1}):e?A.setState({selectedItem:t[o-1<0?t.length-1:o-1],forceSubMenuOpen:!1}):A.setState({selectedItem:t[o+1<t.length?o+1:0],forceSubMenuOpen:!1})},this.onChildMouseMove=function(e){A.state.selectedItem!==e&&A.setState({selectedItem:e,forceSubMenuOpen:!1})},this.onChildMouseLeave=function(){A.setState({selectedItem:null,forceSubMenuOpen:!1})},this.renderChildren=function(e){return a.a.Children.map(e,function(e){var i={};return a.a.isValidElement(e)?[ot,A.getSubMenuType()].indexOf(e.type)<0?(i.children=A.renderChildren(e.props.children),a.a.cloneElement(e,i)):(i.onMouseLeave=A.onChildMouseLeave.bind(A),e.type===A.getSubMenuType()&&(i.forceOpen=A.state.forceSubMenuOpen&&A.state.selectedItem===e,i.forceClose=A.handleForceClose,i.parentKeyNavigationHandler=A.handleKeyNavigation),e.props.divider||A.state.selectedItem!==e?(i.onMouseMove=function(){return A.onChildMouseMove(e)},a.a.cloneElement(e,i)):(i.selected=!0,i.ref=function(e){A.seletedItemRef=e},a.a.cloneElement(e,i))):e})}},rt=nt,st=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A},gt=function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}return function(e,i,t){return i&&A(e.prototype,i),t&&A(e,t),e}}();function lt(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var ct=function(A){function e(A){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,A));return i.getMenuPosition=function(){var A=window,e=A.innerWidth,t=A.innerHeight,o=i.subMenu.getBoundingClientRect(),n={};return o.bottom>t?n.bottom=0:n.top=0,o.right<e?n.left="100%":n.right="100%",n},i.getRTLMenuPosition=function(){var A=window.innerHeight,e=i.subMenu.getBoundingClientRect(),t={};return e.bottom>A?t.bottom=0:t.top=0,e.left<0?t.left="100%":t.right="100%",t},i.hideMenu=function(A){A.detail&&A.detail.id&&i.menu&&A.detail.id!==i.menu.id||(i.props.forceOpen&&i.props.forceClose(),i.setState({visible:!1,selectedItem:null}),i.unregisterHandlers())},i.handleClick=function(A){A.preventDefault(),i.props.disabled||Ri(i.props.onClick,A,Ni()({},i.props.data,Ji.data),Ji.target)},i.handleMouseEnter=function(){i.closetimer&&clearTimeout(i.closetimer),i.props.disabled||i.state.visible||(i.opentimer=setTimeout(function(){return i.setState({visible:!0,selectedItem:null})},i.props.hoverDelay))},i.handleMouseLeave=function(){i.opentimer&&clearTimeout(i.opentimer),i.state.visible&&(i.closetimer=setTimeout(function(){return i.setState({visible:!1,selectedItem:null})},i.props.hoverDelay))},i.menuRef=function(A){i.menu=A},i.subMenuRef=function(A){i.subMenu=A},i.registerHandlers=function(){document.removeEventListener("keydown",i.props.parentKeyNavigationHandler),document.addEventListener("keydown",i.handleKeyNavigation)},i.unregisterHandlers=function(A){document.removeEventListener("keydown",i.handleKeyNavigation),A||document.addEventListener("keydown",i.props.parentKeyNavigationHandler)},i.state=Ni()({},i.state,{visible:!1}),i}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,rt),gt(e,[{key:"componentDidMount",value:function(){this.listenId=qi.register(function(){},this.hideMenu)}},{key:"getSubMenuType",value:function(){return e}},{key:"shouldComponentUpdate",value:function(A,e){return this.isVisibilityChange=!(this.state.visible===e.visible&&this.props.forceOpen===A.forceOpen||this.state.visible&&A.forceOpen||this.props.forceOpen&&e.visible),!0}},{key:"componentDidUpdate",value:function(){var A=this;if(this.isVisibilityChange)if(this.props.forceOpen||this.state.visible){(window.requestAnimationFrame||setTimeout)(function(){var e=A.props.rtl?A.getRTLMenuPosition():A.getMenuPosition();A.subMenu.style.removeProperty("top"),A.subMenu.style.removeProperty("bottom"),A.subMenu.style.removeProperty("left"),A.subMenu.style.removeProperty("right"),Oi(e,"top")&&(A.subMenu.style.top=e.top),Oi(e,"left")&&(A.subMenu.style.left=e.left),Oi(e,"bottom")&&(A.subMenu.style.bottom=e.bottom),Oi(e,"right")&&(A.subMenu.style.right=e.right),A.subMenu.classList.add(Ui),A.registerHandlers(),A.setState({selectedItem:null})})}else{this.subMenu.addEventListener("transitionend",function e(){A.subMenu.removeEventListener("transitionend",e),A.subMenu.style.removeProperty("bottom"),A.subMenu.style.removeProperty("right"),A.subMenu.style.top=0,A.subMenu.style.left="100%",A.unregisterHandlers()}),this.subMenu.classList.remove(Ui)}}},{key:"componentWillUnmount",value:function(){this.listenId&&qi.unregister(this.listenId),this.opentimer&&clearTimeout(this.opentimer),this.closetimer&&clearTimeout(this.closetimer),this.unregisterHandlers(!0)}},{key:"render",value:function(){var A,e=this.props,i=e.children,t=e.attributes,o=e.disabled,n=e.title,r=e.selected,s=this.state.visible,g={ref:this.menuRef,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,className:Le()(Hi,ji,t.listClassName),style:{position:"relative"}},l={className:Le()(Hi,t.className,(A={},lt(A,Le()(Pi,t.disabledClassName),o),lt(A,Le()(Li,t.visibleClassName),s),lt(A,Le()(_i,t.selectedClassName),r),A)),onMouseMove:this.props.onMouseMove,onMouseOut:this.props.onMouseOut,onClick:this.handleClick},c={ref:this.subMenuRef,style:{position:"absolute",transition:"opacity 1ms",top:0,left:"100%"},className:Le()(Yi,this.props.className)};return a.a.createElement("nav",st({},g,{role:"menuitem",tabIndex:"-1","aria-haspopup":"true"}),a.a.createElement("div",st({},t,l),n),a.a.createElement("nav",st({},c,{role:"menu",tabIndex:"-1"}),this.renderChildren(i)))}}]),e}();ct.propTypes={children:o.a.node.isRequired,attributes:o.a.object,title:o.a.node.isRequired,className:o.a.string,disabled:o.a.bool,hoverDelay:o.a.number,rtl:o.a.bool,selected:o.a.bool,onMouseMove:o.a.func,onMouseOut:o.a.func,forceOpen:o.a.bool,forceClose:o.a.func,parentKeyNavigationHandler:o.a.func},ct.defaultProps={disabled:!1,hoverDelay:500,attributes:{},className:"",rtl:!1,selected:!1,onMouseMove:function(){return null},onMouseOut:function(){return null},forceOpen:!1,forceClose:function(){return null},parentKeyNavigationHandler:function(){return null}};var ut=ct,Bt=function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}return function(e,i,t){return i&&A(e.prototype,i),t&&A(e,t),e}}();var dt=function(A){function e(A){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,A));return i.registerHandlers=function(){document.addEventListener("mousedown",i.handleOutsideClick),document.addEventListener("touchstart",i.handleOutsideClick),document.addEventListener("scroll",i.handleHide),document.addEventListener("contextmenu",i.handleHide),document.addEventListener("keydown",i.handleKeyNavigation),window.addEventListener("resize",i.handleHide)},i.unregisterHandlers=function(){document.removeEventListener("mousedown",i.handleOutsideClick),document.removeEventListener("touchstart",i.handleOutsideClick),document.removeEventListener("scroll",i.handleHide),document.removeEventListener("contextmenu",i.handleHide),document.removeEventListener("keydown",i.handleKeyNavigation),window.removeEventListener("resize",i.handleHide)},i.handleShow=function(A){if(A.detail.id===i.props.id&&!i.state.isVisible){var e=A.detail.position,t=e.x,o=e.y;i.setState({isVisible:!0,x:t,y:o}),i.registerHandlers(),Ri(i.props.onShow,A)}},i.handleHide=function(A){!i.state.isVisible||A.detail&&A.detail.id&&A.detail.id!==i.props.id||(i.unregisterHandlers(),i.setState({isVisible:!1,selectedItem:null,forceSubMenuOpen:!1}),Ri(i.props.onHide,A))},i.handleOutsideClick=function(A){i.menu.contains(A.target)||Zi()},i.handleMouseLeave=function(A){A.preventDefault(),Ri(i.props.onMouseLeave,A,Ni()({},i.props.data,Ji.data),Ji.target),i.props.hideOnLeave&&Zi()},i.handleContextMenu=function(A){i.handleHide(A)},i.hideMenu=function(A){27!==A.keyCode&&13!==A.keyCode||Zi()},i.getMenuPosition=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t={top:e,left:A};if(!i.menu)return t;var o=window,n=o.innerWidth,a=o.innerHeight,r=i.menu.getBoundingClientRect();return e+r.height>a&&(t.top-=r.height),A+r.width>n&&(t.left-=r.width),t.top<0&&(t.top=r.height<a?(a-r.height)/2:0),t.left<0&&(t.left=r.width<n?(n-r.width)/2:0),t},i.menuRef=function(A){i.menu=A},i.state=Ni()({},i.state,{x:0,y:0,isVisible:!1}),i}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,rt),Bt(e,[{key:"getSubMenuType",value:function(){return ut}},{key:"componentDidMount",value:function(){this.listenId=qi.register(this.handleShow,this.handleHide)}},{key:"componentDidUpdate",value:function(){var A=this;if(this.state.isVisible){var e=window.requestAnimationFrame||setTimeout;e(function(){var i=A.state,t=i.x,o=i.y,n=A.getMenuPosition(t,o),a=n.top,r=n.left;e(function(){A.menu&&(A.menu.style.top=a+"px",A.menu.style.left=r+"px",A.menu.style.opacity=1,A.menu.style.pointerEvents="auto")})})}else{if(!this.menu)return;this.menu.style.opacity=0,this.menu.style.pointerEvents="none"}}},{key:"componentWillUnmount",value:function(){this.listenId&&qi.unregister(this.listenId),this.unregisterHandlers()}},{key:"render",value:function(){var A=this.props,e=A.children,i=A.className,t=A.style,o=this.state.isVisible,n=Ni()({},t,{position:"fixed",opacity:0,pointerEvents:"none"}),r=Le()(Yi,i,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},Ui,o));return a.a.createElement("nav",{role:"menu",tabIndex:"-1",ref:this.menuRef,style:n,className:r,onContextMenu:this.handleContextMenu,onMouseLeave:this.handleMouseLeave},this.renderChildren(e))}}]),e}();dt.propTypes={id:o.a.string.isRequired,children:o.a.node.isRequired,data:o.a.object,className:o.a.string,hideOnLeave:o.a.bool,onHide:o.a.func,onMouseLeave:o.a.func,onShow:o.a.func,style:o.a.object},dt.defaultProps={className:"",data:{},hideOnLeave:!1,onHide:function(){return null},onMouseLeave:function(){return null},onShow:function(){return null},style:{}};var Et=dt,ht=function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}return function(e,i,t){return i&&A(e.prototype,i),t&&A(e,t),e}}();function Ct(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}var wt=function(A){function e(){var A,i,t;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var o=arguments.length,n=Array(o),a=0;a<o;a++)n[a]=arguments[a];return i=t=Ct(this,(A=e.__proto__||Object.getPrototypeOf(e)).call.apply(A,[this].concat(n))),t.touchHandled=!1,t.handleMouseDown=function(A){t.props.holdToDisplay>=0&&0===A.button&&(A.persist(),A.stopPropagation(),t.mouseDownTimeoutId=setTimeout(function(){return t.handleContextClick(A)},t.props.holdToDisplay)),Ri(t.props.attributes.onMouseDown,A)},t.handleMouseUp=function(A){0===A.button&&clearTimeout(t.mouseDownTimeoutId),Ri(t.props.attributes.onMouseUp,A)},t.handleMouseOut=function(A){0===A.button&&clearTimeout(t.mouseDownTimeoutId),Ri(t.props.attributes.onMouseOut,A)},t.handleTouchstart=function(A){t.touchHandled=!1,t.props.holdToDisplay>=0&&(A.persist(),A.stopPropagation(),t.touchstartTimeoutId=setTimeout(function(){t.handleContextClick(A),t.touchHandled=!0},t.props.holdToDisplay)),Ri(t.props.attributes.onTouchStart,A)},t.handleTouchEnd=function(A){t.touchHandled&&A.preventDefault(),clearTimeout(t.touchstartTimeoutId),Ri(t.props.attributes.onTouchEnd,A)},t.handleContextMenu=function(A){t.handleContextClick(A),Ri(t.props.attributes.onContextMenu,A)},t.handleContextClick=function(A){if(!t.props.disable){A.preventDefault(),A.stopPropagation();var e=A.clientX||A.touches&&A.touches[0].pageX,i=A.clientY||A.touches&&A.touches[0].pageY;t.props.posX&&(e-=t.props.posX),t.props.posY&&(i-=t.props.posY),Zi();var o=Ri(t.props.collect,t.props),n={position:{x:e,y:i},target:t.elem,id:t.props.id,data:o};o&&"function"==typeof o.then?o.then(function(A){n.data=A,Xi(n)}):Xi(n)}},t.elemRef=function(A){t.elem=A},Ct(t,i)}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,n["Component"]),ht(e,[{key:"render",value:function(){var A=this.props,e=A.renderTag,i=A.attributes,t=A.children,o=Ni()({},i,{className:Le()(Gi,i.className),onContextMenu:this.handleContextMenu,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onTouchStart:this.handleTouchstart,onTouchEnd:this.handleTouchEnd,onMouseOut:this.handleMouseOut,ref:this.elemRef});return a.a.createElement(e,o,t)}}]),e}();wt.propTypes={id:o.a.string.isRequired,children:o.a.node.isRequired,attributes:o.a.object,collect:o.a.func,disable:o.a.bool,holdToDisplay:o.a.number,posX:o.a.number,posY:o.a.number,renderTag:o.a.oneOfType([o.a.node,o.a.func])},wt.defaultProps={attributes:{},collect:function(){return null},disable:!1,holdToDisplay:1e3,renderTag:"div",posX:0,posY:0};var mt=wt;Object.assign,function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}}();[].concat(function(A){if(Array.isArray(A)){for(var e=0,i=Array(A.length);e<A.length;e++)i[e]=A[e];return i}return Array.from(A)}(Object.keys(mt.propTypes)),["children"]);var pt=i(146),It=i.n(pt);function ft(){return(ft=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}var Qt=function(A){return a.a.createElement(Et,ft({},A,{className:It.a.contextMenu}))},Dt=function(A){return a.a.createElement(ot,ft({},A,{attributes:{className:It.a.menuItem}}))},Mt=function(A){return a.a.createElement(ot,ft({},A,{attributes:{className:Le()(It.a.menuItem,It.a.menuItemBordered)}}))},bt=function(A){return a.a.createElement(ot,ft({},A,{attributes:{className:Le()(It.a.menuItem,It.a.menuItemBordered,It.a.menuItemDanger)}}))};var yt=0,Tt=function(A){return a.a.createElement(mt,{attributes:{className:Le()(A.className,vi.a.spriteSelectorItem,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},vi.a.isSelected,A.selected)),onClick:A.onClick,onMouseEnter:A.onMouseEnter,onMouseLeave:A.onMouseLeave,onMouseDown:A.onMouseDown,onTouchStart:A.onMouseDown},disable:A.preventContextMenu,id:"".concat(A.name,"-").concat(yt),ref:A.componentRef},void 0===A.number?null:a.a.createElement("div",{className:vi.a.number},A.number),A.costumeURL?a.a.createElement("div",{className:vi.a.spriteImageOuter},a.a.createElement("div",{className:vi.a.spriteImageInner},a.a.createElement("img",{className:vi.a.spriteImage,draggable:!1,src:A.costumeURL}))):null,a.a.createElement("div",{className:vi.a.spriteInfo},a.a.createElement("div",{className:vi.a.spriteName},A.name),A.details?a.a.createElement("div",{className:vi.a.spriteDetails},A.details):null),A.selected&&A.onDeleteButtonClick?a.a.createElement(ki,{className:vi.a.deleteButton,onClick:A.onDeleteButtonClick}):null,A.onDuplicateButtonClick||A.onDeleteButtonClick||A.onExportButtonClick?a.a.createElement(Qt,{id:"".concat(A.name,"-").concat(yt++)},A.onDuplicateButtonClick?a.a.createElement(Dt,{onClick:A.onDuplicateButtonClick},a.a.createElement(B.a,{defaultMessage:"duplicate",id:"gui.spriteSelectorItem.contextMenuDuplicate"})):null,A.onExportButtonClick?a.a.createElement(Dt,{onClick:A.onExportButtonClick},a.a.createElement(B.a,{defaultMessage:"export",id:"gui.spriteSelectorItem.contextMenuExport"})):null,A.onDeleteButtonClick?a.a.createElement(bt,{onClick:A.onDeleteButtonClick},a.a.createElement(B.a,{defaultMessage:"delete",id:"gui.spriteSelectorItem.contextMenuDelete"})):null):null)};Tt.propTypes={className:o.a.string,componentRef:o.a.func,costumeURL:o.a.string,details:o.a.string,name:o.a.string.isRequired,number:o.a.number,onClick:o.a.func,onDeleteButtonClick:o.a.func,onDuplicateButtonClick:o.a.func,onExportButtonClick:o.a.func,onMouseDown:o.a.func,onMouseEnter:o.a.func,onMouseLeave:o.a.func,preventContextMenu:o.a.bool,selected:o.a.bool.isRequired};var kt=Tt;function Ft(A){"@babel/helpers - typeof";return(Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var vt=["asset","id","index","onClick","onDeleteButtonClick","onDuplicateButtonClick","onExportButtonClick","dragPayload","receivedBlocks","costumeURL","vm"];function St(){return(St=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Nt(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Rt(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Ot(A,e){return(Ot=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Yt(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Gt(A);if(e){var o=Gt(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ft(e)||"function"==typeof e))return e;return Ut(A)}(this,i)}}function Ut(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Gt(A){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ht=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Ot(A,e)}(i,a.a.PureComponent);var e=Yt(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Ut(t),["getCostumeData","setRef","handleClick","handleDelete","handleDuplicate","handleExport","handleMouseEnter","handleMouseLeave","handleMouseDown","handleDragEnd","handleDrag","handleTouchEnd"]),t.dragRecognizer=new Qi({onDrag:t.handleDrag,onDragEnd:t.handleDragEnd}),t}return function(A,e,i){e&&Rt(A.prototype,e),i&&Rt(A,i)}(i,[{key:"componentDidMount",value:function(){document.addEventListener("touchend",this.handleTouchEnd)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("touchend",this.handleTouchEnd),this.dragRecognizer.reset()}},{key:"getCostumeData",value:function(){return this.props.costumeURL?this.props.costumeURL:this.props.asset?pi(this.props.asset):null}},{key:"handleDragEnd",value:function(){var A=this;this.props.dragging&&this.props.onDrag({img:null,currentOffset:null,dragging:!1,dragType:null,index:null}),setTimeout(function(){A.noClick=!1})}},{key:"handleDrag",value:function(A){this.props.onDrag({img:this.getCostumeData(),currentOffset:A,dragging:!0,dragType:this.props.dragType,index:this.props.index,payload:this.props.dragPayload}),this.noClick=!0}},{key:"handleTouchEnd",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=this.ref.getBoundingClientRect(),n=o.top,a=o.left,r=o.bottom,s=o.right;i>=a&&i<=s&&t>=n&&t<=r&&this.handleMouseEnter()}},{key:"handleMouseDown",value:function(A){this.dragRecognizer.start(A)}},{key:"handleClick",value:function(A){A.preventDefault(),this.noClick||this.props.onClick(this.props.id)}},{key:"handleDelete",value:function(A){A.stopPropagation(),this.props.onDeleteButtonClick(this.props.id)}},{key:"handleDuplicate",value:function(A){A.stopPropagation(),this.props.onDuplicateButtonClick(this.props.id)}},{key:"handleExport",value:function(A){A.stopPropagation(),this.props.onExportButtonClick(this.props.id)}},{key:"handleMouseLeave",value:function(){this.props.dispatchSetHoveredSprite(null)}},{key:"handleMouseEnter",value:function(){this.props.dispatchSetHoveredSprite(this.props.id)}},{key:"setRef",value:function(A){this.ref=A&&A.elem}},{key:"render",value:function(){var A=this.props,e=(A.asset,A.id,A.index,A.onClick,A.onDeleteButtonClick),i=A.onDuplicateButtonClick,t=A.onExportButtonClick,o=(A.dragPayload,A.receivedBlocks,A.costumeURL,A.vm,Nt(A,vt));return a.a.createElement(kt,St({componentRef:this.setRef,costumeURL:this.getCostumeData(),preventContextMenu:this.dragRecognizer.gestureInProgress(),onClick:this.handleClick,onDeleteButtonClick:e?this.handleDelete:null,onDuplicateButtonClick:i?this.handleDuplicate:null,onExportButtonClick:t?this.handleExport:null,onMouseDown:this.handleMouseDown,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},o))}}]),i}();Ht.propTypes={asset:o.a.instanceOf(eA.a.Asset),costumeURL:o.a.string,dispatchSetHoveredSprite:o.a.func.isRequired,dragPayload:o.a.oneOfType([o.a.string,o.a.number]),dragType:o.a.string,dragging:o.a.bool,id:o.a.oneOfType([o.a.string,o.a.number]),index:o.a.number,name:o.a.string,onClick:o.a.func,onDeleteButtonClick:o.a.func,onDrag:o.a.func.isRequired,onDuplicateButtonClick:o.a.func,onExportButtonClick:o.a.func,receivedBlocks:o.a.bool.isRequired,selected:o.a.bool,vm:o.a.instanceOf(u.a).isRequired};var Lt=Object(s.b)(function(A,e){var i=e.id;return{dragging:A.scratchGui.assetDrag.dragging,receivedBlocks:A.scratchGui.hoveredTarget.receivedBlocks&&A.scratchGui.hoveredTarget.sprite===i,vm:A.scratchGui.vm}},function(A){return{dispatchSetHoveredSprite:function(e){A(Object(Ci.c)(e))},onDrag:function(e){return A(Object(wi.c)(e))}}})(Ht),Pt=i(223),xt=i.n(Pt),_t=i(62),jt=i.n(_t);function Jt(A){"@babel/helpers - typeof";return(Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function zt(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Kt(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Wt(A,e){return(Wt=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Vt(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Zt(A);if(e){var o=Zt(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Jt(e)||"function"==typeof e))return e;return Xt(A)}(this,i)}}function Xt(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Zt(A){return(Zt=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var qt=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Wt(A,e)}(i,a.a.Component);var e=Vt(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Xt(t),["clickDelayer","handleClosePopover","handleToggleOpenState","handleTouchStart","handleTouchOutside","setButtonRef","setContainerRef"]),t.state={isOpen:!1,forceHide:!1},t.mainTooltipId="tooltip-".concat(Math.random()),t}return function(A,e,i){e&&Kt(A.prototype,e),i&&Kt(A,i)}(i,[{key:"componentDidMount",value:function(){this.buttonRef.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("touchstart",this.handleTouchOutside)}},{key:"shouldComponentUpdate",value:function(A,e){return e.isOpen!==this.state.isOpen||e.forceHide!==this.state.forceHide||A.title!==this.props.title}},{key:"componentWillUnmount",value:function(){this.buttonRef.removeEventListener("touchstart",this.handleTouchStart),document.removeEventListener("touchstart",this.handleTouchOutside)}},{key:"handleClosePopover",value:function(){var A=this;this.closeTimeoutId=setTimeout(function(){A.setState({isOpen:!1}),A.closeTimeoutId=null},300)}},{key:"handleToggleOpenState",value:function(){this.closeTimeoutId?(clearTimeout(this.closeTimeoutId),this.closeTimeoutId=null):this.state.isOpen||this.setState({isOpen:!0,forceHide:!1})}},{key:"handleTouchOutside",value:function(A){this.state.isOpen&&!this.containerRef.contains(A.target)&&(this.setState({isOpen:!1}),xt.a.hide())}},{key:"clickDelayer",value:function(A){var e=this;return function(i){xt.a.hide(),A&&A(i),e.buttonRef.blur(),e.setState({forceHide:!0,isOpen:!1},function(){setTimeout(function(){return e.setState({forceHide:!1})})})}}},{key:"handleTouchStart",value:function(A){this.state.isOpen||(A.preventDefault(),this.handleToggleOpenState())}},{key:"setButtonRef",value:function(A){this.buttonRef=A}},{key:"setContainerRef",value:function(A){this.containerRef=A}},{key:"render",value:function(){var A,e=this,i=this.props,t=i.className,o=i.img,n=i.title,r=i.moreButtons,s=i.tooltipPlace,g=i.onClick;return a.a.createElement("div",{className:Le()(jt.a.menuContainer,t,(A={},zt(A,jt.a.expanded,this.state.isOpen),zt(A,jt.a.forceHidden,this.state.forceHide),A)),ref:this.setContainerRef,onMouseEnter:this.handleToggleOpenState,onMouseLeave:this.handleClosePopover},a.a.createElement("button",{"aria-label":n,className:Le()(jt.a.button,jt.a.mainButton),"data-for":this.mainTooltipId,"data-tip":n,ref:this.setButtonRef,onClick:this.clickDelayer(g)},a.a.createElement("img",{className:jt.a.mainIcon,draggable:!1,src:o})),a.a.createElement(xt.a,{className:jt.a.tooltip,effect:"solid",id:this.mainTooltipId,place:s||"left"}),a.a.createElement("div",{className:jt.a.moreButtonsOuter},a.a.createElement("div",{className:jt.a.moreButtons},(r||[]).map(function(A,i){var t=A.img,o=A.title,n=A.onClick,r=A.fileAccept,g=A.fileChange,l=A.fileInput,c=A.fileMultiple,u=!n,B=l,d="".concat(e.mainTooltipId,"-").concat(o);return a.a.createElement("div",{key:"".concat(d,"-").concat(i)},a.a.createElement("button",{"aria-label":o,className:Le()(jt.a.button,jt.a.moreButton,zt({},jt.a.comingSoon,u)),"data-for":d,"data-tip":o,onClick:B?n:e.clickDelayer(n)},a.a.createElement("img",{className:jt.a.moreIcon,draggable:!1,src:t}),B?a.a.createElement("input",{accept:r,className:jt.a.fileInput,multiple:c,ref:l,type:"file",onChange:g}):null),a.a.createElement(xt.a,{className:Le()(jt.a.tooltip,zt({},jt.a.comingSoonTooltip,u)),effect:"solid",id:d,place:s||"left"}))}))))}}]),i}();qt.propTypes={className:o.a.string,img:o.a.string,moreButtons:o.a.arrayOf(o.a.shape({img:o.a.string,title:o.a.node.isRequired,onClick:o.a.func,fileAccept:o.a.string,fileChange:o.a.func,fileInput:o.a.func,fileMultiple:o.a.bool})),onClick:o.a.func.isRequired,title:o.a.node.isRequired,tooltipPlace:o.a.string};var $t=qt;function Ao(A){"@babel/helpers - typeof";return(Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function eo(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function io(A,e){return(io=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function to(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=no(A);if(e){var o=no(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ao(e)||"function"==typeof e))return e;return oo(A)}(this,i)}}function oo(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function no(A){return(no=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ao=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&io(A,e)}(i,a.a.Component);var e=to(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(oo(t),["setRef"]),t}return function(A,e,i){e&&eo(A.prototype,e),i&&eo(A,i)}(i,[{key:"componentDidMount",value:function(){this.props.onAddSortable(this.ref)}},{key:"componentWillUnmount",value:function(){this.props.onRemoveSortable(this.ref)}},{key:"setRef",value:function(A){this.ref=A}},{key:"render",value:function(){return a.a.createElement("div",{className:this.props.className,ref:this.setRef,style:{order:this.props.index}},this.props.children)}}]),i}();ao.propTypes={children:o.a.node.isRequired,className:o.a.string,index:o.a.number.isRequired,onAddSortable:o.a.func.isRequired,onRemoveSortable:o.a.func.isRequired};var ro=ao;function so(A){"@babel/helpers - typeof";return(so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function go(){return(go=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function lo(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function co(A,e){return(co=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function uo(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Eo(A);if(e){var o=Eo(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===so(e)||"function"==typeof e))return e;return Bo(A)}(this,i)}}function Bo(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Eo(A){return(Eo=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ho=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&co(A,e)}(t,a.a.Component);var i=uo(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(Bo(e),["setRef","handleAddSortable","handleRemoveSortable"]),e.sortableRefs=[],e.boxes=null,e.ref=null,e.containerBox=null,e}return function(A,e,i){e&&lo(A.prototype,e),i&&lo(A,i)}(t,[{key:"componentWillReceiveProps",value:function(A){var e=this;if(A.dragInfo.dragging&&!this.props.dragInfo.dragging){if(this.boxes=this.sortableRefs.map(function(A){return A&&A.getBoundingClientRect()}),this.boxes.sort(function(A,i){return A.top===i.top?(A.left-i.left)*(e.props.isRtl?-1:1):A.top-i.top}),!this.ref)throw new Error("The containerRef must be assigned to the sortable area");this.containerBox=this.ref.getBoundingClientRect()}else if(!A.dragInfo.dragging&&this.props.dragInfo.dragging){var i=this.getMouseOverIndex();null!==i&&this.props.onDrop(Object.assign({},this.props.dragInfo,{newIndex:i}))}}},{key:"handleAddSortable",value:function(A){this.sortableRefs.push(A)}},{key:"handleRemoveSortable",value:function(A){var e=this.sortableRefs.indexOf(A);this.sortableRefs=this.sortableRefs.slice(0,e).concat(this.sortableRefs.slice(e+1))}},{key:"getOrdering",value:function(A,e,i){var t=Array(this.props.items.length).fill(0).map(function(A,e){return e}),o=function(A){return"number"==typeof A&&!isNaN(A)};return o(e)&&o(i)&&(t=t.slice(0,e).concat(t.slice(e+1))).splice(i,0,e),t}},{key:"getMouseOverIndex",value:function(){var A=null;if(this.props.dragInfo.currentOffset){var e=this.props.dragInfo.currentOffset,i=e.x,t=e.y,o=this.containerBox,n=o.top,a=o.left,r=o.bottom,s=o.right;i>=a&&i<=s&&t>=n&&t<=r&&(A=0===this.boxes.length?0:function(A,e,i){var t=A.x,o=A.y;if(0===e.length)return null;for(var n=null,a=Math.min.apply(null,e.map(function(A){return A.left})),r=Math.max.apply(null,e.map(function(A){return A.right})),s=Math.min.apply(null,e.map(function(A){return A.top})),g=Math.max.apply(null,e.map(function(A){return A.bottom})),l=0;l<e.length;l++){var c=e[l],u=c.left===a?-1/0:c.left,B=c.right===r?1/0:c.right,d=c.top===s?-1/0:c.top,E=c.bottom===g?1/0:c.bottom;if(l===e.length-1&&(i?u=-1/0:B=1/0),t>=u&&t<=B&&o>=d&&o<=E){n=l;break}}return n}(this.props.dragInfo.currentOffset,this.boxes,this.props.isRtl))}return A}},{key:"setRef",value:function(A){this.ref=A}},{key:"render",value:function(){var e=this.props,i=e.dragInfo,t=i.index,o=i.dragType,n=e.items,r=this.getMouseOverIndex(),s=this.getOrdering(n,t,r);return a.a.createElement(A,go({containerRef:this.setRef,draggingIndex:t,draggingType:o,mouseOverIndex:r,ordering:s,onAddSortable:this.handleAddSortable,onRemoveSortable:this.handleRemoveSortable},this.props))}}]),t}();e.propTypes={dragInfo:o.a.shape({currentOffset:o.a.shape({x:o.a.number,y:o.a.number}),dragType:o.a.string,dragging:o.a.bool,index:o.a.number}),items:o.a.arrayOf(o.a.shape({url:o.a.string,name:o.a.string.isRequired})),onClose:o.a.func,onDrop:o.a.func,isRtl:o.a.bool};return Object(s.b)(function(A){return{dragInfo:A.scratchGui.assetDrag,isRtl:A.locales.isRtl}},function(){return{}})(e)},Co=i(21),wo=i(183),mo=i.n(wo);var po=function(A){var e=A.buttons,i=A.containerRef,t=A.dragType,o=A.isRtl,n=A.items,r=A.selectedItemIndex,s=A.draggingIndex,g=A.draggingType,l=A.ordering,c=A.onAddSortable,u=A.onRemoveSortable,B=A.onDeleteClick,d=A.onDuplicateClick,E=A.onExportClick,h=A.onItemClick,C=g===t,w=null;if(e.length>0){var m=e[0],p=m.img,I=m.title,f=m.onClick,Q=e.slice(1);w=a.a.createElement(hi.a,{className:mo.a.newButtons},a.a.createElement($t,{img:p,moreButtons:Q,title:I,tooltipPlace:o?"left":"right",onClick:f}))}return a.a.createElement(hi.a,{className:mo.a.wrapper,componentRef:i},a.a.createElement(hi.a,{className:mo.a.listArea},n.map(function(A,e){return a.a.createElement(ro,{id:A.name,index:C?l.indexOf(e):e,key:A.name,onAddSortable:c,onRemoveSortable:u},a.a.createElement(Lt,{asset:A.asset,className:Le()(mo.a.listItem,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},mo.a.placeholder,C&&e===s)),costumeURL:A.url,details:A.details,dragPayload:A.dragPayload,dragType:t,id:e,index:e,name:A.name,number:e+1,selected:e===r,onClick:h,onDeleteButtonClick:B,onDuplicateButtonClick:d,onExportButtonClick:E}))})),w)};po.propTypes={buttons:o.a.arrayOf(o.a.shape({title:o.a.string.isRequired,img:o.a.string.isRequired,onClick:o.a.func})),containerRef:o.a.func,dragType:o.a.oneOf(Object.keys(Co.a)),draggingIndex:o.a.number,draggingType:o.a.oneOf(Object.keys(Co.a)),isRtl:o.a.bool,items:o.a.arrayOf(o.a.shape({url:o.a.string,name:o.a.string.isRequired})),onAddSortable:o.a.func,onDeleteClick:o.a.func,onDuplicateClick:o.a.func,onExportClick:o.a.func,onItemClick:o.a.func.isRequired,onRemoveSortable:o.a.func,ordering:o.a.arrayOf(o.a.number),selectedItemIndex:o.a.number.isRequired};var Io=ho(po),fo=i(303),Qo=i.n(fo);function Do(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function Mo(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function bo(){return(bo=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}var yo=function(A){return a.a.createElement(hi.a,{className:Qo.a.wrapper},a.a.createElement(Io,bo({className:Qo.a.selector},A)),a.a.createElement(hi.a,{className:Qo.a.detailArea},A.children))};yo.propTypes=function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Do(Object(i),!0).forEach(function(e){Mo(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):Do(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({},Io.propTypes);var To=yo,ko=i(203);function Fo(A){"@babel/helpers - typeof";return(Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var vo=["selectedCostumeIndex","vm"];function So(){return(So=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function No(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Ro(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Oo(A,e){return(Oo=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Yo(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Go(A);if(e){var o=Go(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Fo(e)||"function"==typeof e))return e;return Uo(A)}(this,i)}}function Uo(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Go(A){return(Go=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ho=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Oo(A,e)}(i,a.a.Component);var e=Yo(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Uo(t),["handleUpdateImage","handleUpdateName"]),t}return function(A,e,i){e&&Ro(A.prototype,e),i&&Ro(A,i)}(i,[{key:"shouldComponentUpdate",value:function(A){return this.props.imageId!==A.imageId||this.props.rtl!==A.rtl||this.props.name!==A.name}},{key:"handleUpdateName",value:function(A){this.props.vm.renameCostume(this.props.selectedCostumeIndex,A)}},{key:"handleUpdateImage",value:function(A,e,i,t){A?this.props.vm.updateSvg(this.props.selectedCostumeIndex,e,i,t):this.props.vm.updateBitmap(this.props.selectedCostumeIndex,e,i,t,2)}},{key:"render",value:function(){if(!this.props.imageId)return null;var A=this.props,e=A.selectedCostumeIndex,i=A.vm,t=No(A,vo);return a.a.createElement(ko.default,So({},t,{image:i.getCostume(e),onUpdateImage:this.handleUpdateImage,onUpdateName:this.handleUpdateName,fontInlineFn:mi.inlineSvgFonts}))}}]),i}();Ho.propTypes={imageFormat:o.a.string.isRequired,imageId:o.a.string.isRequired,name:o.a.string,rotationCenterX:o.a.number,rotationCenterY:o.a.number,rtl:o.a.bool,selectedCostumeIndex:o.a.number.isRequired,vm:o.a.instanceOf(u.a)};var Lo=Object(s.b)(function(A,e){var i=e.selectedCostumeIndex,t=A.scratchGui.vm.editingTarget.id,o=A.scratchGui.vm.editingTarget.sprite,n=i<o.costumes.length?i:o.costumes.length-1,a=A.scratchGui.vm.editingTarget.sprite.costumes[n];return{name:a&&a.name,rotationCenterX:a&&a.rotationCenterX,rotationCenterY:a&&a.rotationCenterY,imageFormat:a&&a.dataFormat,imageId:t&&"".concat(t).concat(a.skinId),rtl:A.locales.isRtl,selectedCostumeIndex:n,vm:A.scratchGui.vm,zoomLevelId:t}})(Ho),Po=function(A){A.x=Math.floor(200*Math.random()-100),A.y=Math.floor(100*Math.random()-50)},xo=i(762),_o=function(A,e,i){!function t(o,n){if(o!==n.length){var a=n[o],r=new FileReader;r.onload=function(){var A=a.type,i=function(A){return A.split(".",1)[0]}(a.name);e(r.result,A,i,o,n.length),t(o+1,n)},r.onerror=i,r.readAsArrayBuffer(a)}else A.value=null}(0,A.files)},jo=function(A,e,i,t){var o=A.createAsset(e,i,t,null,!0);return{name:null,dataFormat:i,asset:o,md5:"".concat(o.assetId,".").concat(i),assetId:o.assetId}},Jo=function A(e,i,t,o){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},a=null,r=null;switch(i){case"image/svg+xml":e=mi.sanitizeSvg.sanitizeByteStream(e),a=t.DataFormat.SVG,r=t.AssetType.ImageVector;break;case"image/jpeg":a=t.DataFormat.JPG,r=t.AssetType.ImageBitmap;break;case"image/bmp":return void function(A){return new Promise(function(e){var i=A instanceof String?A:window.URL.createObjectURL(new Blob([A],{type:"image/bmp"})),t=document.createElement("canvas"),o=t.getContext("2d"),n=document.createElement("img");n.addEventListener("load",function(){t.width=n.naturalWidth,t.height=n.naturalHeight,o.drawImage(n,0,0);var A=t.toDataURL("image/png");window.URL.revokeObjectURL(i),e(A)}),n.setAttribute("src",i)})}(e).then(function(e){A(e,"image/png",t,o)});case"image/png":a=t.DataFormat.PNG,r=t.AssetType.ImageBitmap;break;case"image/gif":var s=[];return void function(A,e){var i=document.createElement("canvas"),t=i.getContext("2d"),o=new xo.GifReader(new Uint8Array(A)),n=o.numFrames();i.width=o.width,i.height=o.height;var a=t.createImageData(i.width,i.height),r=t.createImageData(i.width,i.height);!function A(s){var g=[];o.decodeAndBlitFrameRGBA(s,g);for(var l=o.frameInfo(s),c=l.x,u=l.y,B=l.width,d=l.height,E=l.disposal,h=0;h<d;h++)for(var C=0;C<B;C++){var w=4*(c+u*i.width)+4*(C+h*i.width);g[w+3]&&(a.data[w+0]=g[w+0],a.data[w+1]=g[w+1],a.data[w+2]=g[w+2],a.data[w+3]=g[w+3])}t.clearRect(0,0,i.width,i.height),t.putImageData(a,0,0);var m=i.toDataURL();switch(E){case 2:t.clearRect(c,u,B,d),a=t.getImageData(0,0,i.width,i.height);break;case 3:(a=t.createImageData(i.width,i.height)).data.set(r.data);break;default:r=t.getImageData(0,0,i.width,i.height)}e(s,m,n),s<n-1&&setTimeout(function(){A(s+1)})}(0)}(e,function(e,i,a){A(i,"image/png",t,function(A){s=s.concat(A),e===a-1&&o(s)},n)});default:return void n("Encountered unexpected file type: ".concat(i))}var g=new mi.BitmapAdapter,l=function(A){var e=jo(t,r,a,A);o([e])};a===t.DataFormat.SVG?l(new Uint8Array(e)):g.importBitmap(e,i).then(l).catch(n)},zo=function(A){return{name:A,md5:"cd21514d0531fdffb22204e0ec5ed84a.svg",rotationCenterX:0,rotationCenterY:0,bitmapResolution:1,skinId:null}},Ko=function(A,e){var i=document.createElement("a");if(document.body.appendChild(i),navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(e,A);else if("download"in HTMLAnchorElement.prototype){var t=window.URL.createObjectURL(e);i.href=t,i.download=A,i.type=e.type,i.click(),window.setTimeout(function(){document.body.removeChild(i),window.URL.revokeObjectURL(t)},1e3)}else{var o=window.open("","_blank"),n=new FileReader;n.onloadend=function(){o.location.href=n.result,o=null},n.readAsDataURL(e)}},Wo=i(114),Vo=i(763),Xo=i.n(Vo),Zo=i(764),qo=i.n(Zo),$o=i(135),An=i.n($o),en=i(174),tn=i.n(en),on=i(136),nn=i.n(on),an=i(137),rn=i.n(an),sn=i(216),gn=i(142);function ln(A){"@babel/helpers - typeof";return(ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function cn(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function un(A,e){return(un=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Bn(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=En(A);if(e){var o=En(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ln(e)||"function"==typeof e))return e;return dn(A)}(this,i)}}function dn(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function En(A){return(En=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}function hn(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function Cn(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?hn(Object(i),!0).forEach(function(e){wn(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):hn(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function wn(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var mn=Object(B.d)({addLibraryBackdropMsg:{id:"gui.costumeTab.addBackdropFromLibrary",defaultMessage:"Choose a Backdrop"},addLibraryCostumeMsg:{id:"gui.costumeTab.addCostumeFromLibrary",defaultMessage:"Choose a Costume"},addBlankCostumeMsg:{id:"gui.costumeTab.addBlankCostume",defaultMessage:"Paint"},addSurpriseCostumeMsg:{id:"gui.costumeTab.addSurpriseCostume",defaultMessage:"Surprise"},addFileBackdropMsg:{id:"gui.costumeTab.addFileBackdrop",defaultMessage:"Upload Backdrop"},addFileCostumeMsg:{id:"gui.costumeTab.addFileCostume",defaultMessage:"Upload Costume"}});mn=Cn(Cn({},mn),P.a);var pn=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&un(A,e)}(i,a.a.Component);var e=Bn(i);function i(A){var t;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(dn(t),["handleSelectCostume","handleDeleteCostume","handleDuplicateCostume","handleExportCostume","handleNewCostume","handleNewBlankCostume","handleSurpriseCostume","handleSurpriseBackdrop","handleFileUploadClick","handleCostumeUpload","handleDrop","setFileInput"]);var o=A.editingTarget,n=A.sprites,a=A.stage,r=o&&n[o]?n[o]:a;return r&&r.currentCostume?t.state={selectedCostumeIndex:r.currentCostume}:t.state={selectedCostumeIndex:0},t}return function(A,e,i){e&&cn(A.prototype,e),i&&cn(A,i)}(i,[{key:"componentWillReceiveProps",value:function(A){var e=A.editingTarget,i=A.sprites,t=A.stage,o=e&&i[e]?i[e]:t;o&&o.costumes&&(this.props.editingTarget===e?(this.props.sprites[e]?this.props.sprites[e]:this.props.stage).costumeCount!==o.costumeCount&&this.setState({selectedCostumeIndex:o.currentCostume}):this.setState({selectedCostumeIndex:o.currentCostume}))}},{key:"handleSelectCostume",value:function(A){this.props.vm.editingTarget.setCostume(A),this.setState({selectedCostumeIndex:A})}},{key:"handleDeleteCostume",value:function(A){var e=this.props.vm.deleteCostume(A);this.props.dispatchUpdateRestore({restoreFun:e,deletedItem:"Costume"})}},{key:"handleDuplicateCostume",value:function(A){this.props.vm.duplicateCostume(A)}},{key:"handleExportCostume",value:function(A){var e=this.props.vm.editingTarget.sprite.costumes[A],i=new Blob([e.asset.data],{type:e.asset.assetType.contentType});Ko("".concat(e.name,".").concat(e.asset.dataFormat),i)}},{key:"handleNewCostume",value:function(A,e,i){var t=this,o=Array.isArray(A)?A:[A];return Promise.all(o.map(function(A){return e?t.props.vm.addCostumeFromLibrary(A.md5,A):t.props.vm.addCostume(A.md5,A,i)}))}},{key:"handleNewBlankCostume",value:function(){var A=this.props.vm.editingTarget.isStage?this.props.intl.formatMessage(mn.backdrop,{index:1}):this.props.intl.formatMessage(mn.costume,{index:1});this.handleNewCostume(zo(A))}},{key:"handleSurpriseCostume",value:function(){var A=sn[Math.floor(Math.random()*sn.length)],e={name:A.name,md5:A.md5ext,rotationCenterX:A.rotationCenterX,rotationCenterY:A.rotationCenterY,bitmapResolution:A.bitmapResolution,skinId:null};this.handleNewCostume(e,!0)}},{key:"handleSurpriseBackdrop",value:function(){var A=gn[Math.floor(Math.random()*gn.length)],e={name:A.name,md5:A.md5ext,rotationCenterX:A.rotationCenterX,rotationCenterY:A.rotationCenterY,bitmapResolution:A.bitmapResolution,skinId:null};this.handleNewCostume(e)}},{key:"handleCostumeUpload",value:function(A){var e=this,i=this.props.vm.runtime.storage,t=this.props.vm.editingTarget.id;this.props.onShowImporting(),_o(A.target,function(A,o,n,a,r){Jo(A,o,i,function(A){A.forEach(function(A,e){A.name="".concat(n).concat(e?e+1:"")}),e.handleNewCostume(A,!1,t).then(function(){a===r-1&&e.props.onCloseImporting()})},e.props.onCloseImporting)},this.props.onCloseImporting)}},{key:"handleFileUploadClick",value:function(){this.fileInput.click()}},{key:"handleDrop",value:function(A){if(A.dragType===Co.a.COSTUME){var e=this.props.vm.editingTarget.sprite,i=e.costumes[this.state.selectedCostumeIndex];this.props.vm.reorderCostume(this.props.vm.editingTarget.id,A.index,A.newIndex),this.setState({selectedCostumeIndex:e.costumes.indexOf(i)})}else A.dragType===Co.a.BACKPACK_COSTUME?this.props.vm.addCostume(A.payload.body,{name:A.payload.name}):A.dragType===Co.a.BACKPACK_SOUND&&(this.props.onActivateSoundsTab(),this.props.vm.addSound({md5:A.payload.body,name:A.payload.name}))}},{key:"setFileInput",value:function(A){this.fileInput=A}},{key:"formatCostumeDetails",value:function(A,e){var i=e||1;return"".concat(Math.ceil(A[0]/i)," x ").concat(Math.ceil(A[1]/i))}},{key:"render",value:function(){var A=this,e=this.props,i=(e.dispatchUpdateRestore,e.intl),t=e.isRtl,o=e.onNewLibraryBackdropClick,n=e.onNewLibraryCostumeClick,r=e.vm;if(!r.editingTarget)return null;var s=r.editingTarget.isStage,g=r.editingTarget.sprite,l=s?mn.addLibraryBackdropMsg:mn.addLibraryCostumeMsg,c=s?mn.addFileBackdropMsg:mn.addFileCostumeMsg,u=s?this.handleSurpriseBackdrop:this.handleSurpriseCostume,B=s?o:n,d=s?Xo.a:qo.a,E=g.costumes?g.costumes.map(function(e){return{name:e.name,asset:e.asset,details:e.size?A.formatCostumeDetails(e.size,e.bitmapResolution):null,dragPayload:e}}):[];return a.a.createElement(To,{buttons:[{title:i.formatMessage(l),img:d,onClick:B},{title:i.formatMessage(c),img:An.a,onClick:this.handleFileUploadClick,fileAccept:".svg, .png, .bmp, .jpg, .jpeg, .gif",fileChange:this.handleCostumeUpload,fileInput:this.setFileInput,fileMultiple:!0},{title:i.formatMessage(mn.addSurpriseCostumeMsg),img:nn.a,onClick:u},{title:i.formatMessage(mn.addBlankCostumeMsg),img:tn.a,onClick:this.handleNewBlankCostume},{title:i.formatMessage(l),img:rn.a,onClick:B}],dragType:Co.a.COSTUME,isRtl:t,items:E,selectedItemIndex:this.state.selectedCostumeIndex,onDeleteClick:g&&g.costumes&&g.costumes.length>1?this.handleDeleteCostume:null,onDrop:this.handleDrop,onDuplicateClick:this.handleDuplicateCostume,onExportClick:this.handleExportCostume,onItemClick:this.handleSelectCostume},g.costumes?a.a.createElement(Lo,{selectedCostumeIndex:this.state.selectedCostumeIndex}):null)}}]),i}();pn.propTypes={dispatchUpdateRestore:o.a.func,editingTarget:o.a.string,intl:B.f,isRtl:o.a.bool,onActivateSoundsTab:o.a.func.isRequired,onCloseImporting:o.a.func.isRequired,onNewLibraryBackdropClick:o.a.func.isRequired,onNewLibraryCostumeClick:o.a.func.isRequired,onShowImporting:o.a.func.isRequired,sprites:o.a.shape({id:o.a.shape({costumes:o.a.arrayOf(o.a.shape({url:o.a.string,name:o.a.string.isRequired,skinId:o.a.number}))})}),stage:o.a.shape({sounds:o.a.arrayOf(o.a.shape({name:o.a.string.isRequired}))}),vm:o.a.instanceOf(u.a)};var In=Object(d.a)("Costume Tab")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,isRtl:A.locales.isRtl,sprites:A.scratchGui.targets.sprites,stage:A.scratchGui.targets.stage,dragging:A.scratchGui.assetDrag.dragging}},function(A){return{onActivateSoundsTab:function(){return A(Object(h.e)(h.d))},onNewLibraryBackdropClick:function(e){e.preventDefault(),A(Object(C.m)())},onNewLibraryCostumeClick:function(e){e.preventDefault(),A(Object(C.o)())},dispatchUpdateRestore:function(e){A(Object(Wo.c)(e))},onCloseImporting:function(){return A(Object(TA.c)("importingAsset"))},onShowImporting:function(){return A(Object(TA.h)("importingAsset"))}}})(pn))),fn=i(281),Qn=Object(B.d)({all:{id:"gui.libraryTags.all",defaultMessage:"All"},animals:{id:"gui.libraryTags.animals",defaultMessage:"Animals"},dance:{id:"gui.libraryTags.dance",defaultMessage:"Dance"},effects:{id:"gui.libraryTags.effects",defaultMessage:"Effects"},fantasy:{id:"gui.libraryTags.fantasy",defaultMessage:"Fantasy"},fashion:{id:"gui.libraryTags.fashion",defaultMessage:"Fashion"},food:{id:"gui.libraryTags.food",defaultMessage:"Food"},indoors:{id:"gui.libraryTags.indoors",defaultMessage:"Indoors"},loops:{id:"gui.libraryTags.loops",defaultMessage:"Loops"},music:{id:"gui.libraryTags.music",defaultMessage:"Music"},notes:{id:"gui.libraryTags.notes",defaultMessage:"Notes"},outdoors:{id:"gui.libraryTags.outdoors",defaultMessage:"Outdoors"},patterns:{id:"gui.libraryTags.patterns",defaultMessage:"Patterns"},people:{id:"gui.libraryTags.people",defaultMessage:"People"},percussion:{id:"gui.libraryTags.percussion",defaultMessage:"Percussion"},space:{id:"gui.libraryTags.space",defaultMessage:"Space"},sports:{id:"gui.libraryTags.sports",defaultMessage:"Sports"},underwater:{id:"gui.libraryTags.underwater",defaultMessage:"Underwater"},voice:{id:"gui.libraryTags.voice",defaultMessage:"Voice"},wacky:{id:"gui.libraryTags.wacky",defaultMessage:"Wacky"},animation:{id:"gui.libraryTags.animation",defaultMessage:"Animation"},art:{id:"gui.libraryTags.art",defaultMessage:"Art"},games:{id:"gui.libraryTags.games",defaultMessage:"Games"},stories:{id:"gui.libraryTags.stories",defaultMessage:"Stories"},letters:{id:"gui.libraryTags.letters",defaultMessage:"Letters"}}),Dn=[{tag:"animals",intlLabel:Qn.animals},{tag:"people",intlLabel:Qn.people},{tag:"fantasy",intlLabel:Qn.fantasy},{tag:"dance",intlLabel:Qn.dance},{tag:"music",intlLabel:Qn.music},{tag:"sports",intlLabel:Qn.sports},{tag:"food",intlLabel:Qn.food},{tag:"fashion",intlLabel:Qn.fashion},{tag:"letters",intlLabel:Qn.letters}],Mn=i(84);function bn(A){"@babel/helpers - typeof";return(bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function yn(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Tn(A,e){return(Tn=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function kn(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=vn(A);if(e){var o=vn(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===bn(e)||"function"==typeof e))return e;return Fn(A)}(this,i)}}function Fn(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function vn(A){return(vn=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Sn=Object(B.d)({libraryTitle:{id:"gui.spriteLibrary.chooseASprite",defaultMessage:"Choose a Sprite"}}),Nn=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Tn(A,e)}(i,a.a.PureComponent);var e=kn(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Fn(t),["handleItemSelect"]),t}return function(A,e,i){e&&yn(A.prototype,e),i&&yn(A,i)}(i,[{key:"handleItemSelect",value:function(A){var e=this;Po(A),this.props.vm.addSprite(JSON.stringify(A)).then(function(){e.props.onActivateBlocksTab()})}},{key:"render",value:function(){return a.a.createElement(Mn.a,{data:fn,id:"spriteLibrary",tags:Dn,title:this.props.intl.formatMessage(Sn.libraryTitle),onItemSelected:this.handleItemSelect,onRequestClose:this.props.onRequestClose})}}]),i}();Nn.propTypes={intl:B.f.isRequired,onActivateBlocksTab:o.a.func.isRequired,onRequestClose:o.a.func,vm:o.a.instanceOf(u.a).isRequired};var Rn=Object(B.e)(Nn),On=i(224),Yn=i.n(On),Un=function(A){return a.a.createElement("label",{className:A.above?Yn.a.inputGroupColumn:Yn.a.inputGroup},a.a.createElement("span",{className:A.secondary?Yn.a.inputLabelSecondary:Yn.a.inputLabel},A.text),A.children)};Un.propTypes={above:o.a.bool,children:o.a.node,secondary:o.a.bool,text:o.a.oneOfType([o.a.string,o.a.node]).isRequired},Un.defaultProps={above:!1,secondary:!1};var Gn=Un,Hn=i(372),Ln=i.n(Hn),Pn=["small"];function xn(){return(xn=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function _n(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var jn=function(A){var e=A.small,i=_n(A,Pn);return a.a.createElement("input",xn({},i,{className:Le()(Ln.a.inputForm,A.className,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},Ln.a.inputSmall,e))}))};jn.propTypes={className:o.a.string,small:o.a.bool},jn.defaultProps={small:!1};var Jn=jn;function zn(A){"@babel/helpers - typeof";return(zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Kn(){return(Kn=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Wn(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Vn(A,e){return(Vn=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Xn(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=qn(A);if(e){var o=qn(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===zn(e)||"function"==typeof e))return e;return Zn(A)}(this,i)}}function Zn(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function qn(A){return(qn=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var $n=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Vn(A,e)}(t,a.a.Component);var i=Xn(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(Zn(e),["handleChange","handleKeyPress","handleFlush"]),e.state={value:null},e}return function(A,e,i){e&&Wn(A.prototype,e),i&&Wn(A,i)}(t,[{key:"handleKeyPress",value:function(A){"Enter"===A.key&&(this.handleFlush(),A.target.blur())}},{key:"handleFlush",value:function(){var A="number"==typeof this.props.value,e=!A||!isNaN(this.state.value);null!==this.state.value&&e&&this.props.onSubmit(A?Number(this.state.value):this.state.value),this.setState({value:null})}},{key:"handleChange",value:function(A){this.setState({value:A.target.value})}},{key:"render",value:function(){var e=null===this.state.value?this.props.value:this.state.value;return a.a.createElement(A,Kn({},this.props,{value:e,onBlur:this.handleFlush,onChange:this.handleChange,onKeyPress:this.handleKeyPress}))}}]),t}();return e.propTypes={onSubmit:o.a.func.isRequired,value:o.a.oneOfType([o.a.string,o.a.number])},e},Aa=i(173),ea=i.n(Aa),ia=i(163),ta=i.n(ia),oa=i(765),na=i.n(oa),aa=i(766),ra=i.n(aa);function sa(A){"@babel/helpers - typeof";return(sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function ga(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function la(A,e){return(la=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ca(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Ba(A);if(e){var o=Ba(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===sa(e)||"function"==typeof e))return e;return ua(A)}(this,i)}}function ua(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Ba(A){return(Ba=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var da=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&la(A,e)}(i,a.a.Component);var e=ca(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(ua(t),["handleMouseDown","handleMouseMove","containerRef","handleRef","unbindMouseEvents"]),t}return function(A,e,i){e&&ga(A.prototype,e),i&&ga(A,i)}(i,[{key:"componentDidMount",value:function(){this.handleElement.addEventListener("mousedown",this.handleMouseDown),this.handleElement.addEventListener("touchstart",this.handleMouseDown)}},{key:"componentWillUnmount",value:function(){this.unbindMouseEvents(),this.handleElement.removeEventListener("mousedown",this.handleMouseDown),this.handleElement.removeEventListener("touchstart",this.handleMouseDown)}},{key:"directionToMouseEvent",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=this.containerElement.getBoundingClientRect(),n=o.top+o.height/2,a=o.left+o.width/2;return Math.atan2(t-n,i-a)*(180/Math.PI)+90}},{key:"gaugePath",value:function(A,e){var i=e*(Math.PI/180),t=[];return t.push("M ".concat(A," 0")),t.push("L ".concat(A," ").concat(A)),t.push("L ".concat(A+A*Math.sin(i)," ").concat(A-A*Math.cos(i))),t.push("A ".concat(A," ").concat(A," 0 0 ").concat(e<0?1:0," ").concat(A," 0")),t.push("Z"),t.join(" ")}},{key:"handleMouseMove",value:function(A){this.props.onChange(this.directionToMouseEvent(A)+this.directionOffset),A.preventDefault()}},{key:"unbindMouseEvents",value:function(){window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.unbindMouseEvents),window.removeEventListener("touchmove",this.handleMouseMove),window.removeEventListener("touchend",this.unbindMouseEvents)}},{key:"handleMouseDown",value:function(A){this.directionOffset=this.props.direction-this.directionToMouseEvent(A),window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.unbindMouseEvents),window.addEventListener("touchmove",this.handleMouseMove),window.addEventListener("touchend",this.unbindMouseEvents),A.preventDefault()}},{key:"containerRef",value:function(A){this.containerElement=A}},{key:"handleRef",value:function(A){this.handleElement=A}},{key:"render",value:function(){var A=this.props,e=A.direction,i=A.radius;return a.a.createElement("div",{className:ta.a.container},a.a.createElement("div",{className:ta.a.dialContainer,ref:this.containerRef,style:{width:"".concat(2*i,"px"),height:"".concat(2*i,"px")}},a.a.createElement("img",{className:ta.a.dialFace,draggable:!1,src:na.a}),a.a.createElement("svg",{className:ta.a.gauge,height:2*i,width:2*i},a.a.createElement("path",{className:ta.a.gaugePath,d:this.gaugePath(i,e)})),a.a.createElement("img",{className:ta.a.dialHandle,draggable:!1,ref:this.handleRef,src:ra.a,style:{top:"".concat(i-i*Math.cos(e*(Math.PI/180)),"px"),left:"".concat(i+i*Math.sin(e*(Math.PI/180)),"px"),transform:"rotate(".concat(e,"deg)")}})))}}]),i}();da.propTypes={direction:o.a.number,onChange:o.a.func.isRequired,radius:o.a.number},da.defaultProps={direction:90,radius:56};var Ea=da,ha=i(147),Ca=i.n(ha),wa=i(767),ma=i.n(wa),pa=i(768),Ia=i.n(pa),fa=i(769),Qa=i.n(fa);function Da(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var Ma=$n(Jn),ba=a.a.createElement(B.a,{defaultMessage:"Direction",id:"gui.SpriteInfo.direction"}),ya="all around",Ta="left-right",ka="don't rotate",Fa=Object(B.d)({allAround:{id:"gui.directionPicker.rotationStyles.allAround",defaultMessage:"All Around"},leftRight:{id:"gui.directionPicker.rotationStyles.leftRight",defaultMessage:"Left/Right"},dontRotate:{id:"gui.directionPicker.rotationStyles.dontRotate",defaultMessage:"Do not rotate"}}),va=function(A){return a.a.createElement(Gn,{secondary:!0,above:A.labelAbove,text:ba},a.a.createElement(ea.a,{body:a.a.createElement("div",null,a.a.createElement(Ea,{direction:A.direction,onChange:A.onChangeDirection}),a.a.createElement("div",{className:Ca.a.buttonRow},a.a.createElement("button",{className:Le()(Ca.a.iconButton,Da({},Ca.a.active,A.rotationStyle===ya)),title:A.intl.formatMessage(Fa.allAround),onClick:A.onClickAllAround},a.a.createElement("img",{draggable:!1,src:ma.a})),a.a.createElement("button",{className:Le()(Ca.a.iconButton,Da({},Ca.a.active,A.rotationStyle===Ta)),title:A.intl.formatMessage(Fa.leftRight),onClick:A.onClickLeftRight},a.a.createElement("img",{draggable:!1,src:Ia.a})),a.a.createElement("button",{className:Le()(Ca.a.iconButton,Da({},Ca.a.active,A.rotationStyle===ka)),title:A.intl.formatMessage(Fa.dontRotate),onClick:A.onClickDontRotate},a.a.createElement("img",{draggable:!1,src:Qa.a})))),isOpen:A.popoverOpen,preferPlace:"above",onOuterAction:A.onClosePopover},a.a.createElement(Ma,{small:!0,disabled:A.disabled,label:ba,tabIndex:"0",type:"text",value:A.disabled?"":A.direction,onFocus:A.onOpenPopover,onSubmit:A.onChangeDirection})))};va.propTypes={direction:o.a.number,disabled:o.a.bool.isRequired,intl:B.f,labelAbove:o.a.bool,onChangeDirection:o.a.func.isRequired,onClickAllAround:o.a.func.isRequired,onClickDontRotate:o.a.func.isRequired,onClickLeftRight:o.a.func.isRequired,onClosePopover:o.a.func.isRequired,onOpenPopover:o.a.func.isRequired,popoverOpen:o.a.bool.isRequired,rotationStyle:o.a.string},va.defaultProps={labelAbove:!1};var Sa=Object(B.e)(va);function Na(A){"@babel/helpers - typeof";return(Na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Ra(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Oa(A,e){return(Oa=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Ya(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Ga(A);if(e){var o=Ga(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Na(e)||"function"==typeof e))return e;return Ua(A)}(this,i)}}function Ua(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Ga(A){return(Ga=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ha=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Oa(A,e)}(i,a.a.Component);var e=Ya(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Ua(t),["handleOpenPopover","handleClosePopover","handleClickLeftRight","handleClickDontRotate","handleClickAllAround"]),t.state={popoverOpen:!1},t}return function(A,e,i){e&&Ra(A.prototype,e),i&&Ra(A,i)}(i,[{key:"handleOpenPopover",value:function(){this.setState({popoverOpen:!0})}},{key:"handleClosePopover",value:function(){this.setState({popoverOpen:!1})}},{key:"handleClickAllAround",value:function(){this.props.onChangeRotationStyle(ya)}},{key:"handleClickLeftRight",value:function(){this.props.onChangeRotationStyle(Ta)}},{key:"handleClickDontRotate",value:function(){this.props.onChangeRotationStyle(ka)}},{key:"render",value:function(){return a.a.createElement(Sa,{direction:this.props.direction,disabled:this.props.disabled,labelAbove:this.props.labelAbove,popoverOpen:this.state.popoverOpen&&!this.props.disabled,rotationStyle:this.props.rotationStyle,onChangeDirection:this.props.onChangeDirection,onClickAllAround:this.handleClickAllAround,onClickDontRotate:this.handleClickDontRotate,onClickLeftRight:this.handleClickLeftRight,onClosePopover:this.handleClosePopover,onOpenPopover:this.handleOpenPopover})}}]),i}();Ha.propTypes={direction:o.a.number,disabled:o.a.bool,labelAbove:o.a.bool,onChangeDirection:o.a.func,onChangeRotationStyle:o.a.func,rotationStyle:o.a.string};var La=Ha,Pa=i(16),xa=["ab","ca","de","el","it","ja","ja-Hira","ko","hu","ru","vi"],_a=i(23),ja=i.n(_a),Ja=i(770),za=i.n(Ja),Ka=i(771),Wa=i.n(Ka),Va=i(772),Xa=i.n(Va),Za=i(773),qa=i.n(Za);function $a(A){"@babel/helpers - typeof";return($a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Ar(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function er(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function ir(A,e){return(ir=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function tr(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=or(A);if(e){var o=or(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===$a(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function or(A){return(or=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var nr=$n(Jn),ar=Object(B.d)({spritePlaceholder:{id:"gui.SpriteInfo.spritePlaceholder",defaultMessage:"Name"}}),rr=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&ir(A,e)}(i,a.a.Component);var e=tr(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&er(A.prototype,e),i&&er(A,i)}(i,[{key:"shouldComponentUpdate",value:function(A){return this.props.rotationStyle!==A.rotationStyle||this.props.disabled!==A.disabled||this.props.name!==A.name||this.props.stageSize!==A.stageSize||this.props.visible!==A.visible||Math.round(this.props.direction)!==Math.round(A.direction)||Math.round(this.props.size)!==Math.round(A.size)||Math.round(this.props.x)!==Math.round(A.x)||Math.round(this.props.y)!==Math.round(A.y)}},{key:"render",value:function(){var A,e,i=this.props.stageSize,t=a.a.createElement(B.a,{defaultMessage:"Sprite",id:"gui.SpriteInfo.sprite"}),o=a.a.createElement(B.a,{defaultMessage:"Show",id:"gui.SpriteInfo.show"}),n=a.a.createElement(B.a,{defaultMessage:"Size",id:"gui.SpriteInfo.size"}),r=function(A){return-1!==xa.indexOf(A)}(this.props.intl.locale),s=a.a.createElement(nr,{className:Le()(ja.a.spriteInput,Ar({},ja.a.columnInput,r)),disabled:this.props.disabled,placeholder:this.props.intl.formatMessage(ar.spritePlaceholder),tabIndex:"0",type:"text",value:this.props.disabled?"":this.props.name,onSubmit:this.props.onChangeName}),g=a.a.createElement("div",{className:ja.a.group},i===Pa.c.large?a.a.createElement("div",{className:ja.a.iconWrapper},a.a.createElement("img",{"aria-hidden":"true",className:Le()(ja.a.xIcon,ja.a.icon),src:za.a})):null,a.a.createElement(Gn,{text:"x"},a.a.createElement(nr,{small:!0,disabled:this.props.disabled,placeholder:"x",tabIndex:"0",type:"text",value:this.props.disabled?"":Math.round(this.props.x),onSubmit:this.props.onChangeX}))),l=a.a.createElement("div",{className:ja.a.group},i===Pa.c.large?a.a.createElement("div",{className:ja.a.iconWrapper},a.a.createElement("img",{"aria-hidden":"true",className:Le()(ja.a.yIcon,ja.a.icon),src:Wa.a})):null,a.a.createElement(Gn,{text:"y"},a.a.createElement(nr,{small:!0,disabled:this.props.disabled,placeholder:"y",tabIndex:"0",type:"text",value:this.props.disabled?"":Math.round(this.props.y),onSubmit:this.props.onChangeY})));return i===Pa.c.small?a.a.createElement(hi.a,{className:ja.a.spriteInfo},a.a.createElement("div",{className:Le()(ja.a.row,ja.a.rowPrimary)},a.a.createElement("div",{className:ja.a.group},s)),a.a.createElement("div",{className:Le()(ja.a.row,ja.a.rowSecondary)},g,l)):a.a.createElement(hi.a,{className:ja.a.spriteInfo},a.a.createElement("div",{className:Le()(ja.a.row,ja.a.rowPrimary)},a.a.createElement("div",{className:ja.a.group},a.a.createElement(Gn,{above:r,text:t},s)),g,l),a.a.createElement("div",{className:Le()(ja.a.row,ja.a.rowSecondary)},a.a.createElement("div",{className:r?ja.a.column:ja.a.group},i===Pa.c.large?a.a.createElement(Gn,{secondary:!0,text:o}):null,a.a.createElement("div",{className:ja.a.radioWrapper},a.a.createElement("div",{className:Le()(ja.a.radio,ja.a.radioFirst,ja.a.iconWrapper,(A={},Ar(A,ja.a.isActive,this.props.visible&&!this.props.disabled),Ar(A,ja.a.isDisabled,this.props.disabled),A)),tabIndex:"0",onClick:this.props.onClickVisible,onKeyPress:this.props.onPressVisible},a.a.createElement("img",{className:ja.a.icon,src:Xa.a})),a.a.createElement("div",{className:Le()(ja.a.radio,ja.a.radioLast,ja.a.iconWrapper,(e={},Ar(e,ja.a.isActive,!this.props.visible&&!this.props.disabled),Ar(e,ja.a.isDisabled,this.props.disabled),e)),tabIndex:"0",onClick:this.props.onClickNotVisible,onKeyPress:this.props.onPressNotVisible},a.a.createElement("img",{className:ja.a.icon,src:qa.a})))),a.a.createElement("div",{className:Le()(ja.a.group,ja.a.largerInput)},a.a.createElement(Gn,{secondary:!0,above:r,text:n},a.a.createElement(nr,{small:!0,disabled:this.props.disabled,label:n,tabIndex:"0",type:"text",value:this.props.disabled?"":Math.round(this.props.size),onSubmit:this.props.onChangeSize}))),a.a.createElement("div",{className:Le()(ja.a.group,ja.a.largerInput)},a.a.createElement(La,{direction:Math.round(this.props.direction),disabled:this.props.disabled,labelAbove:r,rotationStyle:this.props.rotationStyle,onChangeDirection:this.props.onChangeDirection,onChangeRotationStyle:this.props.onChangeRotationStyle}))))}}]),i}();rr.propTypes={direction:o.a.oneOfType([o.a.string,o.a.number]),disabled:o.a.bool,intl:B.f,name:o.a.string,onChangeDirection:o.a.func,onChangeName:o.a.func,onChangeRotationStyle:o.a.func,onChangeSize:o.a.func,onChangeX:o.a.func,onChangeY:o.a.func,onClickNotVisible:o.a.func,onClickVisible:o.a.func,onPressNotVisible:o.a.func,onPressVisible:o.a.func,rotationStyle:o.a.string,size:o.a.oneOfType([o.a.string,o.a.number]),stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,visible:o.a.bool,x:o.a.oneOfType([o.a.string,o.a.number]),y:o.a.oneOfType([o.a.string,o.a.number])};var sr=Object(B.e)(rr);function gr(A){"@babel/helpers - typeof";return(gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function lr(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function cr(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?lr(Object(i),!0).forEach(function(e){ur(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):lr(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function ur(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Br(){return(Br=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function dr(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Er(A,e){return(Er=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function hr(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=wr(A);if(e){var o=wr(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===gr(e)||"function"==typeof e))return e;return Cr(A)}(this,i)}}function Cr(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function wr(A){return(wr=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var mr=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Er(A,e)}(i,a.a.Component);var e=hr(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Cr(t),["handleClickVisible","handleClickNotVisible","handlePressVisible","handlePressNotVisible"]),t}return function(A,e,i){e&&dr(A.prototype,e),i&&dr(A,i)}(i,[{key:"handleClickVisible",value:function(A){A.preventDefault(),this.props.onChangeVisibility(!0)}},{key:"handleClickNotVisible",value:function(A){A.preventDefault(),this.props.onChangeVisibility(!1)}},{key:"handlePressVisible",value:function(A){" "!==A.key&&"Enter"!==A.key||(A.preventDefault(),this.props.onChangeVisibility(!0))}},{key:"handlePressNotVisible",value:function(A){" "!==A.key&&"Enter"!==A.key||(A.preventDefault(),this.props.onChangeVisibility(!1))}},{key:"render",value:function(){return a.a.createElement(sr,Br({},this.props,{onClickNotVisible:this.handleClickNotVisible,onClickVisible:this.handleClickVisible,onPressNotVisible:this.handlePressNotVisible,onPressVisible:this.handlePressVisible}))}}]),i}();mr.propTypes=cr(cr({},sr.propTypes),{},{onChangeDirection:o.a.func,onChangeName:o.a.func,onChangeSize:o.a.func,onChangeVisibility:o.a.func,onChangeX:o.a.func,onChangeY:o.a.func,x:o.a.number,y:o.a.number});var pr=mr;function Ir(A){"@babel/helpers - typeof";return(Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function fr(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Qr(A,e){return(Qr=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Dr(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Mr(A);if(e){var o=Mr(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ir(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function Mr(A){return(Mr=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var br=function(A,e){return function(i){return function(t){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Qr(A,e)}(n,a.a.Component);var o=Dr(n);function n(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),o.apply(this,arguments)}return function(A,e,i){e&&fr(A.prototype,e),i&&fr(A,i)}(n,[{key:"shouldComponentUpdate",value:function(i){for(var t in i)if(t!==A&&this.props[t]!==i[t])return!0;return i[A]!==this._lastRenderedValue&&Date.now()-this._lastRenderTime>e}},{key:"render",value:function(){return this._lastRenderTime=Date.now(),this._lastRenderedValue=this.props[A],a.a.createElement(i,this.props)}}]),n}()}},yr=i(88),Tr=i.n(yr);function kr(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var Fr=br("asset",500)(Lt),vr=function(A){var e=A.containerRef,i=A.editingTarget,t=A.draggingIndex,o=A.draggingType,n=A.hoveredTarget,r=A.onDeleteSprite,s=A.onDuplicateSprite,g=A.onExportSprite,l=A.onSelectSprite,c=A.onAddSortable,u=A.onRemoveSortable,B=A.ordering,d=A.raised,E=A.selectedId,h=A.items,C=o===Co.a.SPRITE;return a.a.createElement(hi.a,{className:Le()(Tr.a.scrollWrapper,kr({},Tr.a.scrollWrapperDragging,o===Co.a.BACKPACK_SPRITE)),componentRef:e},a.a.createElement(hi.a,{className:Tr.a.itemsWrapper},h.map(function(A,e){var h,w=n.sprite===A.id&&A.id!==i&&n.receivedBlocks,m=!w&&d&&A.id!==i;return m=m||[Co.a.COSTUME,Co.a.SOUND,Co.a.BACKPACK_COSTUME,Co.a.BACKPACK_SOUND,Co.a.BACKPACK_CODE].includes(o),a.a.createElement(ro,{className:Le()(Tr.a.spriteWrapper,kr({},Tr.a.placeholder,C&&e===t)),index:C?B.indexOf(e):e,key:A.name,onAddSortable:c,onRemoveSortable:u},a.a.createElement(Fr,{asset:A.costume&&A.costume.asset,className:Le()(Tr.a.sprite,(h={},kr(h,Tr.a.raised,m),kr(h,Tr.a.receivedBlocks,w),h)),dragPayload:A.id,dragType:Co.a.SPRITE,id:A.id,index:e,key:A.id,name:A.name,selected:A.id===E,onClick:l,onDeleteButtonClick:r,onDuplicateButtonClick:s,onExportButtonClick:g}))})))};vr.propTypes={containerRef:o.a.func,draggingIndex:o.a.number,draggingType:o.a.oneOf(Object.keys(Co.a)),editingTarget:o.a.string,hoveredTarget:o.a.shape({hoveredSprite:o.a.string,receivedBlocks:o.a.bool,sprite:o.a.string}),items:o.a.arrayOf(o.a.shape({costume:o.a.shape({url:o.a.string,name:o.a.string.isRequired,bitmapResolution:o.a.number.isRequired,rotationCenterX:o.a.number.isRequired,rotationCenterY:o.a.number.isRequired}),name:o.a.string.isRequired,order:o.a.number.isRequired})),onAddSortable:o.a.func,onDeleteSprite:o.a.func,onDuplicateSprite:o.a.func,onExportSprite:o.a.func,onRemoveSortable:o.a.func,onSelectSprite:o.a.func,ordering:o.a.arrayOf(o.a.number),raised:o.a.bool,selectedId:o.a.string};var Sr=ho(vr),Nr=i(72),Rr=i(279),Or=i.n(Rr),Yr=["editingTarget","hoveredTarget","intl","onChangeSpriteDirection","onChangeSpriteName","onChangeSpriteRotationStyle","onChangeSpriteSize","onChangeSpriteVisibility","onChangeSpriteX","onChangeSpriteY","onDrop","onDeleteSprite","onDuplicateSprite","onExportSprite","onFileUploadClick","onNewSpriteClick","onPaintSpriteClick","onSelectSprite","onSpriteUpload","onSurpriseSpriteClick","raised","selectedId","spriteFileInput","sprites","stageSize"];function Ur(){return(Ur=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Gr(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var Hr=Object(B.d)({addSpriteFromLibrary:{id:"gui.spriteSelector.addSpriteFromLibrary",defaultMessage:"Choose a Sprite"},addSpriteFromPaint:{id:"gui.spriteSelector.addSpriteFromPaint",defaultMessage:"Paint"},addSpriteFromSurprise:{id:"gui.spriteSelector.addSpriteFromSurprise",defaultMessage:"Surprise"},addSpriteFromFile:{id:"gui.spriteSelector.addSpriteFromFile",defaultMessage:"Upload Sprite"}}),Lr=function(A){var e=A.editingTarget,i=A.hoveredTarget,t=A.intl,o=A.onChangeSpriteDirection,n=A.onChangeSpriteName,r=A.onChangeSpriteRotationStyle,s=A.onChangeSpriteSize,g=A.onChangeSpriteVisibility,l=A.onChangeSpriteX,c=A.onChangeSpriteY,u=A.onDrop,B=A.onDeleteSprite,d=A.onDuplicateSprite,E=A.onExportSprite,h=A.onFileUploadClick,C=A.onNewSpriteClick,w=A.onPaintSpriteClick,m=A.onSelectSprite,p=A.onSpriteUpload,I=A.onSurpriseSpriteClick,f=A.raised,Q=A.selectedId,D=A.spriteFileInput,M=A.sprites,b=A.stageSize,y=Gr(A,Yr),T=M[Q],k=!1;return void 0===T&&(T={},k=!0),a.a.createElement(hi.a,Ur({className:Tr.a.spriteSelector},y),a.a.createElement(pr,{direction:T.direction,disabled:k,name:T.name,rotationStyle:T.rotationStyle,size:T.size,stageSize:b,visible:T.visible,x:T.x,y:T.y,onChangeDirection:o,onChangeName:n,onChangeRotationStyle:r,onChangeSize:s,onChangeVisibility:g,onChangeX:l,onChangeY:c}),a.a.createElement(Sr,{editingTarget:e,hoveredTarget:i,items:Object.keys(M).map(function(A){return M[A]}),raised:f,selectedId:Q,onDeleteSprite:B,onDrop:u,onDuplicateSprite:d,onExportSprite:E,onSelectSprite:m}),a.a.createElement($t,{className:Tr.a.addButton,img:Or.a,moreButtons:[{title:t.formatMessage(Hr.addSpriteFromFile),img:An.a,onClick:h,fileAccept:".svg, .png, .bmp, .jpg, .jpeg, .sprite2, .sprite3, .gif",fileChange:p,fileInput:D,fileMultiple:!0},{title:t.formatMessage(Hr.addSpriteFromSurprise),img:nn.a,onClick:I},{title:t.formatMessage(Hr.addSpriteFromPaint),img:tn.a,onClick:w},{title:t.formatMessage(Hr.addSpriteFromLibrary),img:rn.a,onClick:C}],title:t.formatMessage(Hr.addSpriteFromLibrary),tooltipPlace:Object(Nr.b)(t.locale)?"right":"left",onClick:C}))};Lr.propTypes={editingTarget:o.a.string,hoveredTarget:o.a.shape({hoveredSprite:o.a.string,receivedBlocks:o.a.bool}),intl:B.f.isRequired,onChangeSpriteDirection:o.a.func,onChangeSpriteName:o.a.func,onChangeSpriteRotationStyle:o.a.func,onChangeSpriteSize:o.a.func,onChangeSpriteVisibility:o.a.func,onChangeSpriteX:o.a.func,onChangeSpriteY:o.a.func,onDeleteSprite:o.a.func,onDrop:o.a.func,onDuplicateSprite:o.a.func,onExportSprite:o.a.func,onFileUploadClick:o.a.func,onNewSpriteClick:o.a.func,onPaintSpriteClick:o.a.func,onSelectSprite:o.a.func,onSpriteUpload:o.a.func,onSurpriseSpriteClick:o.a.func,raised:o.a.bool,selectedId:o.a.string,spriteFileInput:o.a.func,sprites:o.a.shape({id:o.a.shape({costume:o.a.shape({url:o.a.string,name:o.a.string.isRequired,bitmapResolution:o.a.number.isRequired,rotationCenterX:o.a.number.isRequired,rotationCenterY:o.a.number.isRequired}),name:o.a.string.isRequired,order:o.a.number.isRequired})}),stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired};var Pr=Object(B.e)(Lr),xr=i(280),_r=(i(774),i(775),i(12),i(776),function(A,e){return new Promise(function(i,t){bA()({uri:e,responseType:A},function(A,e){return A||200!==e.statusCode?t(new Error(e.status)):i(e.body)})})}),jr=_r.bind(null,"json"),Jr=_r.bind(null,"arraybuffer"),zr=i(97),Kr=i.n(zr),Wr=i(777),Vr=i.n(Wr),Xr=["backdropCount","containerRef","dragOver","fileInputRef","intl","selected","raised","receivedBlocks","url","onBackdropFileUploadClick","onBackdropFileUpload","onClick","onMouseEnter","onMouseLeave","onNewBackdropClick","onSurpriseBackdropClick","onEmptyBackdropClick"];function Zr(){return(Zr=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function qr(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function $r(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var As=Object(B.d)({addBackdropFromLibrary:{id:"gui.spriteSelector.addBackdropFromLibrary",defaultMessage:"Choose a Backdrop"},addBackdropFromPaint:{id:"gui.stageSelector.addBackdropFromPaint",defaultMessage:"Paint"},addBackdropFromSurprise:{id:"gui.stageSelector.addBackdropFromSurprise",defaultMessage:"Surprise"},addBackdropFromFile:{id:"gui.stageSelector.addBackdropFromFile",defaultMessage:"Upload Backdrop"}}),es=function(A){var e,i=A.backdropCount,t=A.containerRef,o=A.dragOver,n=A.fileInputRef,r=A.intl,s=A.selected,g=A.raised,l=A.receivedBlocks,c=A.url,u=A.onBackdropFileUploadClick,d=A.onBackdropFileUpload,E=A.onClick,h=A.onMouseEnter,C=A.onMouseLeave,w=A.onNewBackdropClick,m=A.onSurpriseBackdropClick,p=A.onEmptyBackdropClick,I=$r(A,Xr);return a.a.createElement(hi.a,Zr({className:Le()(Kr.a.stageSelector,(e={},qr(e,Kr.a.isSelected,s),qr(e,Kr.a.raised,g||o),qr(e,Kr.a.receivedBlocks,l),e)),componentRef:t,onClick:E,onMouseEnter:h,onMouseLeave:C},I),a.a.createElement("div",{className:Kr.a.header},a.a.createElement("div",{className:Kr.a.headerTitle},a.a.createElement(B.a,{defaultMessage:"Stage",id:"gui.stageSelector.stage"}))),c?a.a.createElement("img",{className:Kr.a.costumeCanvas,src:c}):null,a.a.createElement("div",{className:Kr.a.label},a.a.createElement(B.a,{defaultMessage:"Backdrops",id:"gui.stageSelector.backdrops"})),a.a.createElement("div",{className:Kr.a.count},i),a.a.createElement($t,{className:Kr.a.addButton,img:Vr.a,moreButtons:[{title:r.formatMessage(As.addBackdropFromFile),img:An.a,onClick:u,fileAccept:".svg, .png, .bmp, .jpg, .jpeg, .gif",fileChange:d,fileInput:n,fileMultiple:!0},{title:r.formatMessage(As.addBackdropFromSurprise),img:nn.a,onClick:m},{title:r.formatMessage(As.addBackdropFromPaint),img:tn.a,onClick:p},{title:r.formatMessage(As.addBackdropFromLibrary),img:rn.a,onClick:w}],title:r.formatMessage(As.addBackdropFromLibrary),tooltipPlace:Object(Nr.b)(r.locale)?"right":"left",onClick:w}))};es.propTypes={backdropCount:o.a.number.isRequired,containerRef:o.a.func,dragOver:o.a.bool,fileInputRef:o.a.func,intl:B.f.isRequired,onBackdropFileUpload:o.a.func,onBackdropFileUploadClick:o.a.func,onClick:o.a.func,onEmptyBackdropClick:o.a.func,onMouseEnter:o.a.func,onMouseLeave:o.a.func,onNewBackdropClick:o.a.func,onSurpriseBackdropClick:o.a.func,raised:o.a.bool.isRequired,receivedBlocks:o.a.bool.isRequired,selected:o.a.bool.isRequired,url:o.a.string};var is=Object(B.e)(es);function ts(A){"@babel/helpers - typeof";return(ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function os(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function ns(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?os(Object(i),!0).forEach(function(e){as(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):os(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function as(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function rs(){return(rs=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function ss(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function gs(A,e){return(gs=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ls(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=us(A);if(e){var o=us(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ts(e)||"function"==typeof e))return e;return cs(A)}(this,i)}}function cs(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function us(A){return(us=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Bs=[Co.a.COSTUME,Co.a.SOUND,Co.a.BACKPACK_COSTUME,Co.a.BACKPACK_SOUND,Co.a.BACKPACK_CODE],ds=Object(xr.a)(Bs)(br("url",500)(is)),Es=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&gs(A,e)}(i,a.a.Component);var e=ls(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(cs(t),["handleClick","handleNewBackdrop","handleSurpriseBackdrop","handleEmptyBackdrop","addBackdropFromLibraryItem","handleFileUploadClick","handleBackdropUpload","handleMouseEnter","handleMouseLeave","handleTouchEnd","handleDrop","setFileInput","setRef"]),t}return function(A,e,i){e&&ss(A.prototype,e),i&&ss(A,i)}(i,[{key:"componentDidMount",value:function(){document.addEventListener("touchend",this.handleTouchEnd)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("touchend",this.handleTouchEnd)}},{key:"handleTouchEnd",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=this.ref.getBoundingClientRect(),n=o.top,a=o.left,r=o.bottom,s=o.right;i>=a&&i<=s&&t>=n&&t<=r&&this.handleMouseEnter()}},{key:"addBackdropFromLibraryItem",value:function(A){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i={name:A.name,md5:A.md5ext,rotationCenterX:A.rotationCenterX,rotationCenterY:A.rotationCenterY,bitmapResolution:A.bitmapResolution,skinId:null};this.handleNewBackdrop(i,e)}},{key:"handleClick",value:function(){this.props.onSelect(this.props.id)}},{key:"handleNewBackdrop",value:function(A){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=Array.isArray(A)?A:[A];return Promise.all(t.map(function(A){return e.props.vm.addBackdrop(A.md5,A)})).then(function(){if(i)return e.props.onActivateTab(h.b)})}},{key:"handleSurpriseBackdrop",value:function(A){A.stopPropagation();var e=gn[Math.floor(Math.random()*gn.length)];this.addBackdropFromLibraryItem(e,!1)}},{key:"handleEmptyBackdrop",value:function(A){A.stopPropagation(),this.props.vm.setEditingTarget(this.props.id),this.handleNewBackdrop(zo(this.props.intl.formatMessage(P.a.backdrop,{index:1})))}},{key:"handleBackdropUpload",value:function(A){var e=this,i=this.props.vm.runtime.storage;this.props.onShowImporting(),_o(A.target,function(A,t,o,n,a){Jo(A,t,i,function(A){e.props.vm.setEditingTarget(e.props.id),A.forEach(function(A,e){A.name="".concat(o).concat(e?e+1:"")}),e.handleNewBackdrop(A).then(function(){n===a-1&&e.props.onCloseImporting()})},e.props.onCloseImporting)},this.props.onCloseImporting)}},{key:"handleFileUploadClick",value:function(A){A.stopPropagation(),this.fileInput.click()}},{key:"handleMouseEnter",value:function(){this.props.dispatchSetHoveredSprite(this.props.id)}},{key:"handleMouseLeave",value:function(){this.props.dispatchSetHoveredSprite(null)}},{key:"handleDrop",value:function(A){var e=this;A.dragType===Co.a.COSTUME?this.props.vm.shareCostumeToTarget(A.index,this.props.id):A.dragType===Co.a.SOUND?this.props.vm.shareSoundToTarget(A.index,this.props.id):A.dragType===Co.a.BACKPACK_COSTUME?this.props.vm.addCostume(A.payload.body,{name:A.payload.name},this.props.id):A.dragType===Co.a.BACKPACK_SOUND?this.props.vm.addSound({md5:A.payload.body,name:A.payload.name},this.props.id):A.dragType===Co.a.BACKPACK_CODE&&jr(A.payload.bodyUrl).then(function(A){e.props.vm.shareBlocksToTarget(A,e.props.id),e.props.vm.refreshWorkspace()})}},{key:"setFileInput",value:function(A){this.fileInput=A}},{key:"setRef",value:function(A){this.ref=A}},{key:"render",value:function(){var A=m()(this.props,["asset","dispatchSetHoveredSprite","id","intl","onActivateTab","onSelect","onShowImporting","onCloseImporting"]);return a.a.createElement(ds,rs({componentRef:this.setRef,fileInputRef:this.setFileInput,onBackdropFileUpload:this.handleBackdropUpload,onBackdropFileUploadClick:this.handleFileUploadClick,onClick:this.handleClick,onDrop:this.handleDrop,onEmptyBackdropClick:this.handleEmptyBackdrop,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onSurpriseBackdropClick:this.handleSurpriseBackdrop},A))}}]),i}();Es.propTypes=ns(ns({},is.propTypes),{},{id:o.a.string,intl:B.f.isRequired,onCloseImporting:o.a.func,onSelect:o.a.func,onShowImporting:o.a.func});var hs=Object(B.e)(Object(s.b)(function(A,e){var i=e.asset,t=e.id;return{url:i&&i.encodeDataURI(),vm:A.scratchGui.vm,receivedBlocks:A.scratchGui.hoveredTarget.receivedBlocks&&A.scratchGui.hoveredTarget.sprite===t,raised:A.scratchGui.blockDrag}},function(A){return{onNewBackdropClick:function(e){e.stopPropagation(),A(Object(C.m)())},onActivateTab:function(e){A(Object(h.e)(e))},dispatchSetHoveredSprite:function(e){A(Object(Ci.c)(e))},onCloseImporting:function(){return A(Object(TA.c)("importingAsset"))},onShowImporting:function(){return A(Object(TA.h)("importingAsset"))}}})(Es)),Cs=i(373),ws=i.n(Cs),ms=["editingTarget","fileInputRef","hoveredTarget","spriteLibraryVisible","onActivateBlocksTab","onChangeSpriteDirection","onChangeSpriteName","onChangeSpriteRotationStyle","onChangeSpriteSize","onChangeSpriteVisibility","onChangeSpriteX","onChangeSpriteY","onDeleteSprite","onDrop","onDuplicateSprite","onExportSprite","onFileUploadClick","onNewSpriteClick","onPaintSpriteClick","onRequestCloseSpriteLibrary","onSelectSprite","onSpriteUpload","onSurpriseSpriteClick","raiseSprites","stage","stageSize","sprites","vm"];function ps(){return(ps=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Is(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var fs=function(A){var e=A.editingTarget,i=A.fileInputRef,t=A.hoveredTarget,o=A.spriteLibraryVisible,n=A.onActivateBlocksTab,r=A.onChangeSpriteDirection,s=A.onChangeSpriteName,g=A.onChangeSpriteRotationStyle,l=A.onChangeSpriteSize,c=A.onChangeSpriteVisibility,u=A.onChangeSpriteX,B=A.onChangeSpriteY,d=A.onDeleteSprite,E=A.onDrop,h=A.onDuplicateSprite,C=A.onExportSprite,w=A.onFileUploadClick,m=A.onNewSpriteClick,p=A.onPaintSpriteClick,I=A.onRequestCloseSpriteLibrary,f=A.onSelectSprite,Q=A.onSpriteUpload,D=A.onSurpriseSpriteClick,M=A.raiseSprites,b=A.stage,y=A.stageSize,T=A.sprites,k=A.vm,F=Is(A,ms);return a.a.createElement("div",ps({className:ws.a.targetPane},F),a.a.createElement(Pr,{editingTarget:e,hoveredTarget:t,raised:M,selectedId:e,spriteFileInput:i,sprites:T,stageSize:y,onChangeSpriteDirection:r,onChangeSpriteName:s,onChangeSpriteRotationStyle:g,onChangeSpriteSize:l,onChangeSpriteVisibility:c,onChangeSpriteX:u,onChangeSpriteY:B,onDeleteSprite:d,onDrop:E,onDuplicateSprite:h,onExportSprite:C,onFileUploadClick:w,onNewSpriteClick:m,onPaintSpriteClick:p,onSelectSprite:f,onSpriteUpload:Q,onSurpriseSpriteClick:D}),a.a.createElement("div",{className:ws.a.stageSelectorWrapper},b.id&&a.a.createElement(hs,{asset:b.costume&&b.costume.asset,backdropCount:b.costumeCount,id:b.id,selected:b.id===e,onSelect:f}),a.a.createElement("div",null,o?a.a.createElement(Rn,{vm:k,onActivateBlocksTab:n,onRequestClose:I}):null)))},Qs=o.a.shape({costume:o.a.shape({asset:o.a.object,url:o.a.string,name:o.a.string.isRequired,bitmapResolution:o.a.number,rotationCenterX:o.a.number,rotationCenterY:o.a.number}),costumeCount:o.a.number,direction:o.a.number,id:o.a.string,name:o.a.string,order:o.a.number,size:o.a.number,visibility:o.a.bool,x:o.a.number,y:o.a.number});fs.propTypes={editingTarget:o.a.string,extensionLibraryVisible:o.a.bool,fileInputRef:o.a.func,hoveredTarget:o.a.shape({hoveredSprite:o.a.string,receivedBlocks:o.a.bool}),onActivateBlocksTab:o.a.func.isRequired,onChangeSpriteDirection:o.a.func,onChangeSpriteName:o.a.func,onChangeSpriteRotationStyle:o.a.func,onChangeSpriteSize:o.a.func,onChangeSpriteVisibility:o.a.func,onChangeSpriteX:o.a.func,onChangeSpriteY:o.a.func,onDeleteSprite:o.a.func,onDrop:o.a.func,onDuplicateSprite:o.a.func,onExportSprite:o.a.func,onFileUploadClick:o.a.func,onNewSpriteClick:o.a.func,onPaintSpriteClick:o.a.func,onRequestCloseExtensionLibrary:o.a.func,onRequestCloseSpriteLibrary:o.a.func,onSelectSprite:o.a.func,onSpriteUpload:o.a.func,onSurpriseSpriteClick:o.a.func,raiseSprites:o.a.bool,spriteLibraryVisible:o.a.bool,sprites:o.a.objectOf(Qs),stage:Qs,stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,vm:o.a.instanceOf(u.a)};var Ds=fs;function Ms(A){"@babel/helpers - typeof";return(Ms="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var bs=["dispatchUpdateRestore","isRtl","onActivateTab","onCloseImporting","onHighlightTarget","onReceivedBlocks","onShowImporting","workspaceMetrics"];function ys(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function Ts(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function ks(){return(ks=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Fs(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function vs(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Ss(A,e){return(Ss=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Ns(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Os(A);if(e){var o=Os(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ms(e)||"function"==typeof e))return e;return Rs(A)}(this,i)}}function Rs(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Os(A){return(Os=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ys=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Ss(A,e)}(i,a.a.Component);var e=Ns(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Rs(t),["handleActivateBlocksTab","handleBlockDragEnd","handleChangeSpriteRotationStyle","handleChangeSpriteDirection","handleChangeSpriteName","handleChangeSpriteSize","handleChangeSpriteVisibility","handleChangeSpriteX","handleChangeSpriteY","handleDeleteSprite","handleDrop","handleDuplicateSprite","handleExportSprite","handleNewSprite","handleSelectSprite","handleSurpriseSpriteClick","handlePaintSpriteClick","handleFileUploadClick","handleSpriteUpload","setFileInput"]),t}return function(A,e,i){e&&vs(A.prototype,e),i&&vs(A,i)}(i,[{key:"componentDidMount",value:function(){this.props.vm.addListener("BLOCK_DRAG_END",this.handleBlockDragEnd)}},{key:"componentWillUnmount",value:function(){this.props.vm.removeListener("BLOCK_DRAG_END",this.handleBlockDragEnd)}},{key:"handleChangeSpriteDirection",value:function(A){this.props.vm.postSpriteInfo({direction:A})}},{key:"handleChangeSpriteRotationStyle",value:function(A){this.props.vm.postSpriteInfo({rotationStyle:A})}},{key:"handleChangeSpriteName",value:function(A){this.props.vm.renameSprite(this.props.editingTarget,A)}},{key:"handleChangeSpriteSize",value:function(A){this.props.vm.postSpriteInfo({size:A})}},{key:"handleChangeSpriteVisibility",value:function(A){this.props.vm.postSpriteInfo({visible:A})}},{key:"handleChangeSpriteX",value:function(A){this.props.vm.postSpriteInfo({x:A})}},{key:"handleChangeSpriteY",value:function(A){this.props.vm.postSpriteInfo({y:A})}},{key:"handleDeleteSprite",value:function(A){var e=this,i=this.props.vm.deleteSprite(A);this.props.dispatchUpdateRestore({restoreFun:function(){return i().then(e.handleActivateBlocksTab)},deletedItem:"Sprite"})}},{key:"handleDuplicateSprite",value:function(A){this.props.vm.duplicateSprite(A)}},{key:"handleExportSprite",value:function(A){var e=this.props.vm.runtime.getTargetById(A).getName(),i=document.createElement("a");document.body.appendChild(i),this.props.vm.exportSprite(A).then(function(A){Ko("".concat(e,".sprite3"),A)})}},{key:"handleSelectSprite",value:function(A){this.props.vm.setEditingTarget(A),this.props.stage&&A!==this.props.stage.id&&this.props.onHighlightTarget(A)}},{key:"handleSurpriseSpriteClick",value:function(){var A=fn.filter(function(A){return-1===A.tags.indexOf("letters")&&-1===A.tags.indexOf("numbers")}),e=A[Math.floor(Math.random()*A.length)];Po(e),this.props.vm.addSprite(JSON.stringify(e)).then(this.handleActivateBlocksTab)}},{key:"handlePaintSpriteClick",value:function(){var A=this,e=this.props.intl.formatMessage,i=function(A,e,i){return{objName:A,sounds:[{soundName:e,soundID:-1,md5:"83a9787d4cb6f3b7632b4ddfebf74367.wav",sampleCount:258,rate:11025,format:""}],costumes:[{costumeName:i,baseLayerID:-1,baseLayerMD5:"cd21514d0531fdffb22204e0ec5ed84a.svg",bitmapResolution:1,rotationCenterX:0,rotationCenterY:0}],currentCostumeIndex:0,scratchX:36,scratchY:28,scale:1,direction:90,rotationStyle:"normal",isDraggable:!1,visible:!0,spriteInfo:{}}}(e(P.a.sprite,{index:1}),e(P.a.pop),e(P.a.costume,{index:1}));this.props.vm.addSprite(JSON.stringify(i)).then(function(){setTimeout(function(){A.props.onActivateTab(h.b)})})}},{key:"handleActivateBlocksTab",value:function(){this.props.onActivateTab(h.a)}},{key:"handleNewSprite",value:function(A){return this.props.vm.addSprite(A).then(this.handleActivateBlocksTab)}},{key:"handleFileUploadClick",value:function(){this.fileInput.click()}},{key:"handleSpriteUpload",value:function(A){var e=this,i=this.props.vm.runtime.storage;this.props.onShowImporting(),_o(A.target,function(A,t,o,n,a){!function(A,e,i,t,o){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(){};switch(e){case"":case"application/zip":return void o(new Uint8Array(A));case"image/svg+xml":case"image/png":case"image/bmp":case"image/jpeg":case"image/gif":return void Jo(A,e,t,function(A){A.forEach(function(A,e){A.name="".concat(i).concat(e?e+1:"")});var e={name:i,isStage:!1,x:0,y:0,visible:!0,size:100,rotationStyle:"all around",direction:90,draggable:!1,currentCostume:0,blocks:{},variables:{},costumes:A,sounds:[]};Po(e),o(JSON.stringify(e))},n);default:n("Encountered unexpected file type: ".concat(e))}}(A,t,o,i,function(A){e.handleNewSprite(A).then(function(){n===a-1&&e.props.onCloseImporting()}).catch(e.props.onCloseImporting)},e.props.onCloseImporting)},this.props.onCloseImporting)}},{key:"setFileInput",value:function(A){this.fileInput=A}},{key:"handleBlockDragEnd",value:function(A){this.props.hoveredTarget.sprite&&this.props.hoveredTarget.sprite!==this.props.editingTarget&&(this.shareBlocks(A,this.props.hoveredTarget.sprite,this.props.editingTarget),this.props.onReceivedBlocks(!0))}},{key:"shareBlocks",value:function(A,e,i){var t=A.find(function(A){return A.topLevel});if(t){var o,n=this.props.workspaceMetrics.targets[e]?this.props.workspaceMetrics.targets[e]:{scrollX:0,scrollY:0,scale:Pa.a},a=n.scrollX,r=n.scrollY,s=n.scale,g=30-r;o=this.props.isRtl?a+30:30-a,t.x=o/s,t.y=g/s}return this.props.vm.shareBlocksToTarget(A,e,i)}},{key:"handleDrop",value:function(A){var e=this,i=this.props.hoveredTarget.sprite;A.dragType===Co.a.SPRITE?this.props.vm.reorderTarget(A.index+1,A.newIndex+1):A.dragType===Co.a.BACKPACK_SPRITE?Jr(A.payload.bodyUrl).then(function(A){return e.props.vm.addSprite(A)}):i&&(A.dragType===Co.a.COSTUME?this.props.vm.shareCostumeToTarget(A.index,i):i&&A.dragType===Co.a.SOUND?this.props.vm.shareSoundToTarget(A.index,i):A.dragType===Co.a.BACKPACK_COSTUME?this.props.vm.addCostume(A.payload.body,{name:A.payload.name},i):A.dragType===Co.a.BACKPACK_SOUND?this.props.vm.addSound({md5:A.payload.body,name:A.payload.name},i):A.dragType===Co.a.BACKPACK_CODE&&jr(A.payload.bodyUrl).then(function(A){return e.shareBlocks(A,i)}).then(function(){return e.props.vm.refreshWorkspace()}))}},{key:"render",value:function(){var A=this.props,e=(A.dispatchUpdateRestore,A.isRtl,A.onActivateTab,A.onCloseImporting,A.onHighlightTarget,A.onReceivedBlocks,A.onShowImporting,A.workspaceMetrics,Fs(A,bs));return a.a.createElement(Ds,ks({},e,{fileInputRef:this.setFileInput,onActivateBlocksTab:this.handleActivateBlocksTab,onChangeSpriteDirection:this.handleChangeSpriteDirection,onChangeSpriteName:this.handleChangeSpriteName,onChangeSpriteRotationStyle:this.handleChangeSpriteRotationStyle,onChangeSpriteSize:this.handleChangeSpriteSize,onChangeSpriteVisibility:this.handleChangeSpriteVisibility,onChangeSpriteX:this.handleChangeSpriteX,onChangeSpriteY:this.handleChangeSpriteY,onDeleteSprite:this.handleDeleteSprite,onDrop:this.handleDrop,onDuplicateSprite:this.handleDuplicateSprite,onExportSprite:this.handleExportSprite,onFileUploadClick:this.handleFileUploadClick,onPaintSpriteClick:this.handlePaintSpriteClick,onSelectSprite:this.handleSelectSprite,onSpriteUpload:this.handleSpriteUpload,onSurpriseSpriteClick:this.handleSurpriseSpriteClick}))}}]),i}(),Us=Ds.propTypes,Gs=(Us.onSelectSprite,Us.onActivateBlocksTab,Fs(Us,["onSelectSprite","onActivateBlocksTab"]));Ys.propTypes=function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ys(Object(i),!0).forEach(function(e){Ts(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):ys(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({intl:B.f.isRequired,onCloseImporting:o.a.func,onShowImporting:o.a.func},Gs);var Hs=Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,hoveredTarget:A.scratchGui.hoveredTarget,isRtl:A.locales.isRtl,spriteLibraryVisible:A.scratchGui.modals.spriteLibrary,sprites:A.scratchGui.targets.sprites,stage:A.scratchGui.targets.stage,raiseSprites:A.scratchGui.blockDrag,workspaceMetrics:A.scratchGui.workspaceMetrics}},function(A){return{onNewSpriteClick:function(e){e.preventDefault(),A(Object(C.t)())},onRequestCloseSpriteLibrary:function(){A(Object(C.h)())},onActivateTab:function(e){A(Object(h.e)(e))},onReceivedBlocks:function(e){A(Object(Ci.d)(e))},dispatchUpdateRestore:function(e){A(Object(Wo.c)(e))},onHighlightTarget:function(e){A(Object(qA.b)(e))},onCloseImporting:function(){return A(Object(TA.c)("importingAsset"))},onShowImporting:function(){return A(Object(TA.h)("importingAsset"))}}})(Ys)),Ls=i(778),Ps=i.n(Ls),xs=i(779),_s=i.n(xs),js=i(780),Js=i.n(js),zs=i(781),Ks=i.n(zs),Ws=i(282),Vs=i.n(Ws),Xs=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.55;if(0===A.length)return 0;for(var i=0,t=0;t<A.length;t++){var o=A[t];i+=Math.pow(o,2)}var n=Math.sqrt(i/A.length)/e;return Math.sqrt(n)},Zs=function(A){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,i=A.length,t=[],o=0;o<i;o+=e){var n=Math.min(i,o+e);t.push(Xs(A.slice(o,n)))}return t},qs=function(A,e,i,t,o){Vs.a.encode({sampleRate:i,channelData:[e]}).then(function(n){var a={format:"",dataFormat:"wav",rate:i,sampleCount:e.length},r=A.runtime.storage;a.asset=r.createAsset(r.AssetType.Sound,r.DataFormat.WAV,new Uint8Array(n),null,!0),a.assetId=a.asset.assetId,a.md5="".concat(a.assetId,".").concat(a.dataFormat),a.name=t,A.addSound(a).then(function(){o&&o()})})},$s=i(164),Ag=i.n($s),eg=function(A){var e=A.level,i=A.width,t=A.height,o=(t-50)/19,n=((19-Math.floor(19*e))*(o+2.5)+1.25)/t;return a.a.createElement("div",{className:Ag.a.maskContainer,style:{height:"".concat(t,"px")}},a.a.createElement("svg",{className:Ag.a.container,height:t,width:i},Array(19).fill(0).map(function(A,e){return a.a.createElement("rect",{className:e<11?Ag.a.green:e<16?Ag.a.yellow:Ag.a.red,height:o,key:e,rx:3,ry:3,width:i-2,x:1,y:t-(2.5+o)*(e+1)})})),a.a.createElement("div",{className:Ag.a.mask,style:{transform:"scaleY(".concat(n,")")}}))};eg.propTypes={height:o.a.number,level:o.a.number,width:o.a.number};var ig=eg,tg=i(374),og=i.n(tg);function ng(A){"@babel/helpers - typeof";return(ng="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function ag(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var i=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null==i)return;var t,o,n=[],a=!0,r=!1;try{for(i=i.call(A);!(a=(t=i.next()).done)&&(n.push(t.value),!e||n.length!==e);a=!0);}catch(A){r=!0,o=A}finally{try{a||null==i.return||i.return()}finally{if(r)throw o}}return n}(A,e)||sg(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rg(A){return function(A){if(Array.isArray(A))return gg(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||sg(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sg(A,e){if(A){if("string"==typeof A)return gg(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);return"Object"===i&&A.constructor&&(i=A.constructor.name),"Map"===i||"Set"===i?Array.from(A):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?gg(A,e):void 0}}function gg(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function lg(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function cg(A,e){return(cg=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ug(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Bg(A);if(e){var o=Bg(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ng(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function Bg(A){return(Bg=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var dg=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&cg(A,e)}(i,a.a.PureComponent);var e=ug(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&lg(A.prototype,e),i&&lg(A,i)}(i,[{key:"render",value:function(){var A=this.props,e=A.width,i=A.height,t=A.data,o=Math.ceil(t.length/e),n=1===o?t.slice(0):t.filter(function(A,e){return e%o==0});1===n.length&&n.push(n[0]);var r=n.length-1,s=[].concat(rg(n.map(function(A,t){return[e*(t/r),i*A/2]})),rg(n.reverse().map(function(A,t){return[e*(1-t/r),-i*A/2]}))),g=s.map(function(A,e){var i=ag(A,2),t=i[0],o=i[1],n=ag(s[e<s.length-1?e+1:0],2),a=n[0],r=n[1];return"Q".concat(t," ").concat(o," ").concat((t+a)/2," ").concat((o+r)/2)});return a.a.createElement("svg",{className:og.a.container,viewBox:"0 0 ".concat(e," ").concat(i)},a.a.createElement("g",{transform:"scale(1, -1) translate(0, -".concat(i/2,")")},a.a.createElement("path",{className:og.a.waveformPath,d:"M0 0".concat(g.join(" "),"Z"),strokeLinejoin:"round",strokeWidth:1})))}}]),i}();dg.propTypes={data:o.a.arrayOf(o.a.number),height:o.a.number,width:o.a.number};var Eg=dg,hg=i(38),Cg=i.n(hg),wg=i(782),mg=i.n(wg),pg=Object(B.d)({beginRecord:{id:"gui.recordingStep.beginRecord",defaultMessage:"Begin recording by clicking the button below"},permission:{id:"gui.recordingStep.permission",defaultMessage:"{arrow}We need your permission to use your microphone"},stop:{id:"gui.recordingStep.stop",defaultMessage:"Stop recording"},record:{id:"gui.recordingStep.record",defaultMessage:"Record"}}),Ig=function(A){return a.a.createElement(hi.a,null,a.a.createElement(hi.a,{className:Cg.a.visualizationContainer},a.a.createElement(hi.a,{className:Cg.a.meterContainer},a.a.createElement(ig,{height:172,level:A.level,width:20})),a.a.createElement(hi.a,{className:Cg.a.waveformContainer},A.levels?a.a.createElement(Eg,{data:A.levels,height:150,level:0,width:440}):a.a.createElement("span",{className:Cg.a.helpText},A.listening?A.intl.formatMessage(pg.beginRecord):A.intl.formatMessage(pg.permission,{arrow:A.isRtl?"↗️ ":"↖️ "})))),a.a.createElement(hi.a,{className:Cg.a.mainButtonRow},a.a.createElement("button",{className:Cg.a.mainButton,disabled:!A.listening,onClick:A.recording?A.onStopRecording:A.onRecord},A.recording?a.a.createElement("img",{draggable:!1,src:mg.a}):a.a.createElement("svg",{className:Cg.a.recordButton,height:"52",width:"52"},a.a.createElement("circle",{className:Cg.a.recordButtonCircle,cx:"26",cy:"26",r:"25"}),a.a.createElement("circle",{className:Cg.a.recordButtonCircleOutline,cx:"26",cy:"26",r:27+5*A.level})),a.a.createElement("div",{className:Cg.a.helpText},a.a.createElement("span",{className:Cg.a.recordingText},A.recording?A.intl.formatMessage(pg.stop):A.intl.formatMessage(pg.record))))))};Ig.propTypes={intl:B.f.isRequired,isRtl:o.a.bool,level:o.a.number,levels:o.a.arrayOf(o.a.number),listening:o.a.bool,onRecord:o.a.func.isRequired,onStopRecording:o.a.func.isRequired,recording:o.a.bool};var fg,Qg=Object(B.e)(Ig),Dg=(i(1527),i(283)),Mg=i.n(Dg),bg=i(363),yg=i.n(bg),Tg=i(215);if(!i.n(Tg).a.msie){var kg=void 0===document.ontouchstart?"mousedown":"touchstart";document.addEventListener(kg,function A(){document.removeEventListener(kg,A),fg=new(window.AudioContext||window.webkitAudioContext),yg()(fg)})}var Fg=function(){return fg};function vg(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var Sg=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=new Fg,this.bufferLength=8192,this.userMediaStream=null,this.mediaStreamSource=null,this.sourceNode=null,this.scriptProcessorNode=null,this.recordedSamples=0,this.recording=!1,this.started=!1,this.buffers=[],this.disposed=!1}return function(A,e,i){e&&vg(A.prototype,e),i&&vg(A,i)}(A,[{key:"startListening",value:function(A,e,i){var t=this;try{Mg()({audio:!0}).then(function(i){t.disposed||(t.started=!0,A(),t.attachUserMediaStream(i,e))}).catch(function(A){t.disposed||i(A)})}catch(A){this.disposed||i(A)}}},{key:"startRecording",value:function(){this.recording=!0}},{key:"attachUserMediaStream",value:function(A,e){var i=this;this.userMediaStream=A,this.mediaStreamSource=this.audioContext.createMediaStreamSource(A),this.sourceNode=this.audioContext.createGain(),this.scriptProcessorNode=this.audioContext.createScriptProcessor(this.bufferLength,1,1),this.scriptProcessorNode.onaudioprocess=function(A){i.recording&&!i.disposed&&i.buffers.push(new Float32Array(A.inputBuffer.getChannelData(0)))},this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=2048;var t=this.analyserNode.frequencyBinCount,o=new Float32Array(t);requestAnimationFrame(function A(){i.disposed||(i.analyserNode.getFloatTimeDomainData(o),e(Xs(o)),requestAnimationFrame(A))}),this.mediaStreamSource.connect(this.sourceNode),this.sourceNode.connect(this.analyserNode),this.analyserNode.connect(this.scriptProcessorNode),this.scriptProcessorNode.connect(this.audioContext.destination)}},{key:"stop",value:function(){for(var A=new Float32Array(this.buffers.length*this.bufferLength),e=0,i=0;i<this.buffers.length;i++){var t=this.buffers[i];A.set(t,e),e+=t.length}for(var o=Zs(A),n=Math.max.apply(null,o)/8,a=null,r=null,s=0;s<o.length;s++)o[s]>n&&(null===a&&(a=s+1),r=s+1);var g=Math.max(2,a-2)/this.buffers.length,l=Math.min(this.buffers.length-2,r+2)/this.buffers.length;return g>=l&&(g=0,l=1),{levels:o,samples:A,sampleRate:this.audioContext.sampleRate,trimStart:g,trimEnd:l}}},{key:"dispose",value:function(){this.started&&(this.scriptProcessorNode.onaudioprocess=null,this.scriptProcessorNode.disconnect(),this.analyserNode.disconnect(),this.sourceNode.disconnect(),this.mediaStreamSource.disconnect(),this.userMediaStream.getAudioTracks()[0].stop()),this.disposed=!0}}]),A}();function Ng(A){"@babel/helpers - typeof";return(Ng="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var Rg=["onRecord","onStopRecording"];function Og(){return(Og=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Yg(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Ug(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Gg(A,e){return(Gg=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Hg(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Pg(A);if(e){var o=Pg(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ng(e)||"function"==typeof e))return e;return Lg(A)}(this,i)}}function Lg(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Pg(A){return(Pg=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var xg=Object(B.d)({alertMsg:{id:"gui.recordingStep.alertMsg",defaultMessage:"Could not start recording"}}),_g=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Gg(A,e)}(i,a.a.Component);var e=Hg(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Lg(t),["handleRecord","handleStopRecording","handleStarted","handleLevelUpdate","handleRecordingError"]),t.state={listening:!1,level:0,levels:null},t}return function(A,e,i){e&&Ug(A.prototype,e),i&&Ug(A,i)}(i,[{key:"componentDidMount",value:function(){this.audioRecorder=new Sg,this.audioRecorder.startListening(this.handleStarted,this.handleLevelUpdate,this.handleRecordingError)}},{key:"componentWillUnmount",value:function(){this.audioRecorder.dispose()}},{key:"handleStarted",value:function(){this.setState({listening:!0})}},{key:"handleRecordingError",value:function(){alert(this.props.intl.formatMessage(xg.alertMsg))}},{key:"handleLevelUpdate",value:function(A){this.setState({level:A,levels:this.props.recording?(this.state.levels||[]).concat([A]):this.state.levels})}},{key:"handleRecord",value:function(){this.audioRecorder.startRecording(),this.props.onRecord()}},{key:"handleStopRecording",value:function(){var A=this.audioRecorder.stop(),e=A.samples,i=A.sampleRate,t=A.levels,o=A.trimStart,n=A.trimEnd;this.props.onStopRecording(e,i,t,o,n)}},{key:"render",value:function(){var A=this.props,e=(A.onRecord,A.onStopRecording,Yg(A,Rg));return a.a.createElement(Qg,Og({level:this.state.level,levels:this.state.levels,listening:this.state.listening,onRecord:this.handleRecord,onStopRecording:this.handleStopRecording},e))}}]),i}();_g.propTypes={intl:B.f.isRequired,onRecord:o.a.func.isRequired,onStopRecording:o.a.func.isRequired,recording:o.a.bool};var jg=Object(B.e)(_g),Jg=i(32),zg=i.n(Jg),Kg=i(375),Wg=i.n(Kg),Vg=function(A){return a.a.createElement(hi.a,{className:Le()(zg.a.trimLine,A.handleStyle),onMouseDown:A.onMouseDown,onTouchStart:A.onMouseDown},a.a.createElement(hi.a,{className:Le()(zg.a.trimHandle,zg.a.topTrimHandle)},a.a.createElement("img",{src:Wg.a,draggable:!1})),a.a.createElement(hi.a,{className:Le()(zg.a.trimHandle,zg.a.bottomTrimHandle)},a.a.createElement("img",{src:Wg.a,draggable:!1})))};Vg.propTypes={handleStyle:o.a.string,onMouseDown:o.a.func};var Xg=Vg,Zg=function(A){return a.a.createElement("div",{className:zg.a.playheadContainer},a.a.createElement("div",{className:Le()(zg.a.playhead),style:{transform:"translateX(".concat(100*A.playbackPosition,"%)")}}))};Zg.propTypes={playbackPosition:o.a.number};var qg=Zg,$g=function(A){return a.a.createElement("div",{className:Le()(zg.a.absolute,zg.a.trimmer),ref:A.containerRef},null===A.trimStart?null:a.a.createElement(hi.a,{className:Le()(zg.a.absolute,zg.a.trimBackground,zg.a.startTrimBackground),style:{width:"".concat(100*A.trimStart,"%")},onMouseDown:A.onTrimStartMouseDown,onTouchStart:A.onTrimStartMouseDown},a.a.createElement(hi.a,{className:Le()(zg.a.absolute,zg.a.trimBackgroundMask)}),a.a.createElement(Xg,{handleStyle:zg.a.leftHandle})),A.playhead?a.a.createElement(qg,{playbackPosition:A.playhead}):null,null===A.trimEnd?null:a.a.createElement(hi.a,{className:Le()(zg.a.absolute,zg.a.trimBackground,zg.a.endTrimBackground),style:{left:"".concat(100*A.trimEnd,"%"),width:"".concat(100-100*A.trimEnd,"%")},onMouseDown:A.onTrimEndMouseDown,onTouchStart:A.onTrimEndMouseDown},a.a.createElement(hi.a,{className:Le()(zg.a.absolute,zg.a.trimBackgroundMask)}),a.a.createElement(Xg,{handleStyle:zg.a.rightHandle})))};$g.propTypes={containerRef:o.a.func,onTrimEndMouseDown:o.a.func.isRequired,onTrimStartMouseDown:o.a.func.isRequired,playhead:o.a.number,trimEnd:o.a.number,trimStart:o.a.number};var Al=$g;function el(A){"@babel/helpers - typeof";return(el="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function il(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function tl(A,e){return(tl=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ol(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=al(A);if(e){var o=al(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===el(e)||"function"==typeof e))return e;return nl(A)}(this,i)}}function nl(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function al(A){return(al=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var rl=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&tl(A,e)}(i,a.a.Component);var e=ol(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(nl(t),["handleTrimStartMouseDown","handleTrimEndMouseDown","handleTrimStartMouseMove","handleTrimEndMouseMove","storeRef"]),t.trimStartDragRecognizer=new Qi({onDrag:t.handleTrimStartMouseMove,touchDragAngle:90,distanceThreshold:0}),t.trimEndDragRecognizer=new Qi({onDrag:t.handleTrimEndMouseMove,touchDragAngle:90,distanceThreshold:0}),t}return function(A,e,i){e&&il(A.prototype,e),i&&il(A,i)}(i,[{key:"handleTrimStartMouseMove",value:function(A,e){var i=(A.x-e.x)/this.containerSize,t=Math.max(0,Math.min(this.props.trimEnd-.01,this.initialTrim+i));this.props.onSetTrimStart(t)}},{key:"handleTrimEndMouseMove",value:function(A,e){var i=(A.x-e.x)/this.containerSize,t=Math.min(1,Math.max(this.props.trimStart+.01,this.initialTrim+i));this.props.onSetTrimEnd(t)}},{key:"handleTrimStartMouseDown",value:function(A){this.containerSize=this.containerElement.getBoundingClientRect().width,this.trimStartDragRecognizer.start(A),this.initialTrim=this.props.trimStart}},{key:"handleTrimEndMouseDown",value:function(A){this.containerSize=this.containerElement.getBoundingClientRect().width,this.trimEndDragRecognizer.start(A),this.initialTrim=this.props.trimEnd}},{key:"storeRef",value:function(A){this.containerElement=A}},{key:"render",value:function(){return a.a.createElement(Al,{containerRef:this.storeRef,playhead:this.props.playhead,trimEnd:this.props.trimEnd,trimStart:this.props.trimStart,onTrimEndMouseDown:this.handleTrimEndMouseDown,onTrimStartMouseDown:this.handleTrimStartMouseDown})}}]),i}();rl.propTypes={onSetTrimEnd:o.a.func,onSetTrimStart:o.a.func,playhead:o.a.number,trimEnd:o.a.number,trimStart:o.a.number};var sl=rl,gl=i(783),ll=i.n(gl),cl=i(784),ul=i.n(cl),Bl=i(785),dl=i.n(Bl),El=Object(B.d)({stopMsg:{id:"gui.playbackStep.stopMsg",defaultMessage:"Stop"},playMsg:{id:"gui.playbackStep.playMsg",defaultMessage:"Play"},loadingMsg:{id:"gui.playbackStep.loadingMsg",defaultMessage:"Loading..."},saveMsg:{id:"gui.playbackStep.saveMsg",defaultMessage:"Save"},reRecordMsg:{id:"gui.playbackStep.reRecordMsg",defaultMessage:"Re-record"}}),hl=function(A){return a.a.createElement(hi.a,null,a.a.createElement(hi.a,{className:Cg.a.visualizationContainer},a.a.createElement(hi.a,{className:Cg.a.meterContainer},a.a.createElement(ig,{height:172,level:0,width:20})),a.a.createElement(hi.a,{className:Cg.a.waveformContainer},a.a.createElement(Eg,{data:A.levels,height:150,level:0,width:480}),a.a.createElement(sl,{playhead:A.playhead,trimEnd:A.trimEnd,trimStart:A.trimStart,onSetTrimEnd:A.onSetTrimEnd,onSetTrimStart:A.onSetTrimStart}))),a.a.createElement(hi.a,{className:Cg.a.mainButtonRow},a.a.createElement("button",{className:Cg.a.mainButton,onClick:A.playing?A.onStopPlaying:A.onPlay},a.a.createElement("img",{draggable:!1,src:A.playing?ul.a:dl.a}),a.a.createElement("div",{className:Cg.a.helpText},a.a.createElement("span",{className:Cg.a.playingText},A.playing?A.intl.formatMessage(El.stopMsg):A.intl.formatMessage(El.playMsg))))),a.a.createElement(hi.a,{className:Cg.a.buttonRow},a.a.createElement("button",{className:Cg.a.rerecordButton,onClick:A.onBack},a.a.createElement("img",{draggable:!1,src:ll.a}),A.intl.formatMessage(El.reRecordMsg)),a.a.createElement("button",{className:Cg.a.okButton,disabled:A.encoding,onClick:A.onSubmit},A.encoding?A.intl.formatMessage(El.loadingMsg):A.intl.formatMessage(El.saveMsg))))};hl.propTypes={encoding:o.a.bool.isRequired,intl:B.f.isRequired,levels:o.a.arrayOf(o.a.number).isRequired,onBack:o.a.func.isRequired,onPlay:o.a.func.isRequired,onSetTrimEnd:o.a.func.isRequired,onSetTrimStart:o.a.func.isRequired,onStopPlaying:o.a.func.isRequired,onSubmit:o.a.func.isRequired,playhead:o.a.number,playing:o.a.bool.isRequired,trimEnd:o.a.number.isRequired,trimStart:o.a.number.isRequired};var Cl=Object(B.e)(hl);function wl(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var ml=function(){function A(e,i){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=new Fg,this.buffer=this.audioContext.createBuffer(1,e.length,i),this.buffer.getChannelData(0).set(e),this.source=null,this.startTime=null,this.updateCallback=null,this.trimStart=null,this.trimEnd=null}return function(A,e,i){e&&wl(A.prototype,e),i&&wl(A,i)}(A,[{key:"play",value:function(A,e,i,t){this.updateCallback=i,this.trimStart=A,this.trimEnd=e,this.startTime=Date.now();var o=this.buffer.duration*A,n=this.buffer.duration*e-o;this.source=this.audioContext.createBufferSource(),this.source.onended=t,this.source.buffer=this.buffer,this.source.connect(this.audioContext.destination),this.source.start(0,o,n),this.update()}},{key:"update",value:function(){var A=(Date.now()-this.startTime)/1e3/this.buffer.duration;A+this.trimStart<this.trimEnd&&this.source.onended?(requestAnimationFrame(this.update.bind(this)),this.updateCallback(A+this.trimStart)):this.updateCallback=null}},{key:"stop",value:function(){if(this.source){this.source.onended=null;try{this.source.stop()}catch(A){console.log("Caught error while stopping buffer source node.")}}}}]),A}();function pl(A){"@babel/helpers - typeof";return(pl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var Il=["sampleRate","onPlay","onStopPlaying","onSetPlayhead"];function fl(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function Ql(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Dl(){return(Dl=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Ml(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function bl(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function yl(A,e){return(yl=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Tl(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Fl(A);if(e){var o=Fl(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===pl(e)||"function"==typeof e))return e;return kl(A)}(this,i)}}function kl(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Fl(A){return(Fl=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var vl=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&yl(A,e)}(i,a.a.Component);var e=Tl(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(kl(t),["handlePlay","handleStopPlaying"]),t}return function(A,e,i){e&&bl(A.prototype,e),i&&bl(A,i)}(i,[{key:"componentDidMount",value:function(){this.audioBufferPlayer=new ml(this.props.samples,this.props.sampleRate)}},{key:"componentWillUnmount",value:function(){this.audioBufferPlayer.stop()}},{key:"handlePlay",value:function(){this.audioBufferPlayer.play(this.props.trimStart,this.props.trimEnd,this.props.onSetPlayhead,this.props.onStopPlaying),this.props.onPlay()}},{key:"handleStopPlaying",value:function(){this.audioBufferPlayer.stop(),this.props.onStopPlaying()}},{key:"render",value:function(){var A=this.props,e=(A.sampleRate,A.onPlay,A.onStopPlaying,A.onSetPlayhead,Ml(A,Il));return a.a.createElement(Cl,Dl({onPlay:this.handlePlay,onStopPlaying:this.handleStopPlaying},e))}}]),i}();vl.propTypes=function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?fl(Object(i),!0).forEach(function(e){Ql(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):fl(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({sampleRate:o.a.number.isRequired,samples:o.a.instanceOf(Float32Array).isRequired},Cl.propTypes);var Sl=vl,Nl=i(85),Rl=Object(B.d)({title:{id:"gui.recordModal.title",defaultMessage:"Record Sound"}}),Ol=function(A){return a.a.createElement(Nl.a,{className:Cg.a.modalContent,contentLabel:A.intl.formatMessage(Rl.title),onRequestClose:A.onCancel},a.a.createElement(hi.a,{className:Cg.a.body},A.samples?a.a.createElement(Sl,{encoding:A.encoding,levels:A.levels,playhead:A.playhead,playing:A.playing,sampleRate:A.sampleRate,samples:A.samples,trimEnd:A.trimEnd,trimStart:A.trimStart,onBack:A.onBack,onPlay:A.onPlay,onSetPlayhead:A.onSetPlayhead,onSetTrimEnd:A.onSetTrimEnd,onSetTrimStart:A.onSetTrimStart,onStopPlaying:A.onStopPlaying,onSubmit:A.onSubmit}):a.a.createElement(jg,{recording:A.recording,onRecord:A.onRecord,onStopRecording:A.onStopRecording})))};Ol.propTypes={encoding:o.a.bool.isRequired,intl:B.f.isRequired,levels:o.a.arrayOf(o.a.number),onBack:o.a.func.isRequired,onCancel:o.a.func.isRequired,onPlay:o.a.func.isRequired,onRecord:o.a.func.isRequired,onSetPlayhead:o.a.func.isRequired,onSetTrimEnd:o.a.func.isRequired,onSetTrimStart:o.a.func.isRequired,onStopPlaying:o.a.func.isRequired,onStopRecording:o.a.func.isRequired,onSubmit:o.a.func.isRequired,playhead:o.a.number,playing:o.a.bool,recording:o.a.bool,sampleRate:o.a.number,samples:o.a.instanceOf(Float32Array),trimEnd:o.a.number.isRequired,trimStart:o.a.number.isRequired};var Yl=Object(B.e)(Ol);function Ul(A){"@babel/helpers - typeof";return(Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Gl(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Hl(A,e){return(Hl=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Ll(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=xl(A);if(e){var o=xl(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ul(e)||"function"==typeof e))return e;return Pl(A)}(this,i)}}function Pl(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function xl(A){return(xl=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var _l=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Hl(A,e)}(i,a.a.Component);var e=Ll(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Pl(t),["handleRecord","handleStopRecording","handlePlay","handleStopPlaying","handleBack","handleSubmit","handleCancel","handleSetPlayhead","handleSetTrimStart","handleSetTrimEnd"]),t.state={samples:null,encoding:!1,levels:null,playhead:null,playing:!1,recording:!1,sampleRate:null,trimStart:0,trimEnd:1},t}return function(A,e,i){e&&Gl(A.prototype,e),i&&Gl(A,i)}(i,[{key:"handleRecord",value:function(){this.setState({recording:!0})}},{key:"handleStopRecording",value:function(A,e,i,t,o){A.length>0&&this.setState({samples:A,sampleRate:e,levels:i,trimStart:t,trimEnd:o,recording:!1})}},{key:"handlePlay",value:function(){this.setState({playing:!0})}},{key:"handleStopPlaying",value:function(){this.setState({playing:!1,playhead:null})}},{key:"handleBack",value:function(){this.setState({playing:!1,samples:null})}},{key:"handleSetTrimEnd",value:function(A){this.setState({trimEnd:A})}},{key:"handleSetTrimStart",value:function(A){this.setState({trimStart:A})}},{key:"handleSetPlayhead",value:function(A){this.setState({playhead:A})}},{key:"handleSubmit",value:function(){var A=this;this.setState({encoding:!0},function(){var e=A.state.samples.length,i=Math.floor(A.state.trimStart*e),t=Math.floor(A.state.trimEnd*e),o=A.state.samples.slice(i,t);qs(A.props.vm,o,A.state.sampleRate,"recording1",function(){A.props.onClose(),A.props.onNewSound()})})}},{key:"handleCancel",value:function(){this.props.onClose()}},{key:"render",value:function(){return a.a.createElement(Yl,{encoding:this.state.encoding,levels:this.state.levels,playhead:this.state.playhead,playing:this.state.playing,recording:this.state.recording,sampleRate:this.state.sampleRate,samples:this.state.samples,trimEnd:this.state.trimEnd,trimStart:this.state.trimStart,onBack:this.handleBack,onCancel:this.handleCancel,onPlay:this.handlePlay,onRecord:this.handleRecord,onSetPlayhead:this.handleSetPlayhead,onSetTrimEnd:this.handleSetTrimEnd,onSetTrimStart:this.handleSetTrimStart,onStopPlaying:this.handleStopPlaying,onStopRecording:this.handleStopRecording,onSubmit:this.handleSubmit})}}]),i}();_l.propTypes={onClose:o.a.func,onNewSound:o.a.func,vm:o.a.instanceOf(u.a)};var jl=Object(s.b)(function(A){return{vm:A.scratchGui.vm}},function(A){return{onClose:function(){A(Object(C.g)())}}})(_l);function Jl(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var zl=function(){function A(e,i,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=e,this.input=this.audioContext.createGain(),this.output=this.audioContext.createGain(),this.effectInput=this.audioContext.createGain(),this.effectInput.gain.value=0,this.effectInput.gain.setValueAtTime(.75,i),this.effectInput.gain.setValueAtTime(0,t),this.delay=this.audioContext.createDelay(1),this.delay.delayTime.value=A.DELAY_TIME,this.decay=this.audioContext.createGain(),this.decay.gain.value=.3,this.compressor=this.audioContext.createDynamicsCompressor(),this.compressor.threshold.value=-5,this.compressor.knee.value=15,this.compressor.ratio.value=12,this.compressor.attack.value=0,this.compressor.release.value=.25,this.input.connect(this.effectInput),this.effectInput.connect(this.delay),this.delay.connect(this.compressor),this.input.connect(this.compressor),this.delay.connect(this.decay),this.decay.connect(this.delay),this.compressor.connect(this.output)}return function(A,e,i){e&&Jl(A.prototype,e),i&&Jl(A,i)}(A,null,[{key:"DELAY_TIME",get:function(){return.25}},{key:"TAIL_SECONDS",get:function(){return.75}}]),A}();var Kl=function A(e,i,t){var o=this;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=e,this.input=this.audioContext.createGain(),this.output=this.audioContext.createGain(),this.passthrough=this.audioContext.createGain(),this.effectInput=this.audioContext.createGain(),this.passthrough.gain.value=1,this.effectInput.gain.value=0,this.passthrough.gain.setValueAtTime(0,i),this.passthrough.gain.setValueAtTime(1,t),this.effectInput.gain.setValueAtTime(1,i),this.effectInput.gain.setValueAtTime(0,t);var n=function(){for(var A=o.audioContext.createWaveShaper(),e=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.4,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.65;return A<=e?0:A<=i?t*(Math.pow(A-e,2)/(2*i-2*e)):t*A-t*i+t*(Math.pow(A-e,2)/(2*i-2*e))},i=new Float32Array(1024),t=0;t<1024;t++){var n=t/1024*2-1;i[t]=e(n)}return A.curve=i,A},a=this.audioContext.createOscillator();a.frequency.value=50,a.start(0);var r=this.audioContext.createGain();r.gain.value=.5;var s=this.audioContext.createGain();s.gain.value=-1;var g=this.audioContext.createGain();g.gain.value=-1;var l=n(this.audioContext),c=n(this.audioContext),u=this.audioContext.createGain();u.gain.value=-1;var B=this.audioContext.createGain();B.gain.value=-1;var d=n(this.audioContext),E=n(this.audioContext),h=this.audioContext.createDynamicsCompressor();h.threshold.value=-5,h.knee.value=15,h.ratio.value=12,h.attack.value=0,h.release.value=.25;var C=this.audioContext.createBiquadFilter();C.type="highpass",C.frequency.value=1e3,C.gain.value=1.25,this.input.connect(this.effectInput),this.input.connect(this.passthrough),this.passthrough.connect(this.output),this.effectInput.connect(B),this.effectInput.connect(E),B.connect(d),a.connect(r),r.connect(s),r.connect(B),r.connect(E),s.connect(g),s.connect(c),g.connect(l),l.connect(u),c.connect(u),u.connect(h),d.connect(h),E.connect(h),this.effectInput.connect(C),C.connect(h),h.connect(this.output)};var Wl=function A(e,i,t,o){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=e,this.input=this.audioContext.createGain(),this.output=this.audioContext.createGain(),this.gain=this.audioContext.createGain(),this.rampLength=.01,this.gain.gain.setValueAtTime(1,Math.max(0,t-this.rampLength)),this.gain.gain.exponentialRampToValueAtTime(i,t),this.gain.gain.setValueAtTime(i,o),this.gain.gain.exponentialRampToValueAtTime(1,o+this.rampLength),this.input.connect(this.gain),this.gain.connect(this.output)};var Vl=function A(e,i,t,o){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=e,this.input=this.audioContext.createGain(),this.output=this.audioContext.createGain(),this.gain=this.audioContext.createGain(),this.gain.gain.setValueAtTime(1,0),i?(this.gain.gain.setValueAtTime(0,t),this.gain.gain.linearRampToValueAtTime(1,o)):(this.gain.gain.setValueAtTime(1,t),this.gain.gain.linearRampToValueAtTime(0,o)),this.gain.gain.setValueAtTime(1,o),this.input.connect(this.gain),this.gain.connect(this.output)};var Xl=function A(e,i,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=e,this.input=this.audioContext.createGain(),this.output=this.audioContext.createGain(),this.gain=this.audioContext.createGain(),this.rampLength=.001,this.gain.gain.setValueAtTime(1,Math.max(0,i-this.rampLength)),this.gain.gain.linearRampToValueAtTime(0,i),this.gain.gain.setValueAtTime(0,t),this.gain.gain.linearRampToValueAtTime(1,t+this.rampLength),this.input.connect(this.gain),this.gain.connect(this.output)};function Zl(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var ql={ROBOT:"robot",REVERSE:"reverse",LOUDER:"higher",SOFTER:"lower",FASTER:"faster",SLOWER:"slower",ECHO:"echo",FADEIN:"fade in",FADEOUT:"fade out",MUTE:"mute"},$l=function(){function A(e,i,t,o){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.trimStartSeconds=t*e.length/e.sampleRate,this.trimEndSeconds=o*e.length/e.sampleRate,this.adjustedTrimStartSeconds=this.trimStartSeconds,this.adjustedTrimEndSeconds=this.trimEndSeconds;var n=Math.pow(2,4/12),a=e.length,r=Math.floor((this.trimEndSeconds-this.trimStartSeconds)*e.sampleRate),s=r,g=a-r;switch(this.playbackRate=1,i){case ql.ECHO:a=Math.max(a,Math.floor((this.trimEndSeconds+zl.TAIL_SECONDS)*e.sampleRate));break;case ql.FASTER:this.playbackRate=n,a=g+(s=Math.floor(r/this.playbackRate));break;case ql.SLOWER:this.playbackRate=1/n,a=g+(s=Math.floor(r/this.playbackRate))}var l=a/e.sampleRate;if(this.adjustedTrimEndSeconds=this.trimStartSeconds+s/e.sampleRate,this.adjustedTrimStart=this.adjustedTrimStartSeconds/l,this.adjustedTrimEnd=this.adjustedTrimEndSeconds/l,window.OfflineAudioContext)this.audioContext=new window.OfflineAudioContext(1,a,e.sampleRate);else{var c=44100/e.sampleRate;this.audioContext=new window.webkitOfflineAudioContext(1,c*a,44100)}if(i===ql.REVERSE){for(var u=e.getChannelData(0),B=this.audioContext.createBuffer(1,e.length,e.sampleRate),d=B.getChannelData(0),E=e.length,h=Math.floor(this.trimStartSeconds*e.sampleRate),C=Math.floor(this.trimEndSeconds*e.sampleRate),w=0,m=0;m<E;m++)m>=h&&m<C?(d[m]=u[C-w-1],w++):d[m]=u[m];this.buffer=B}else this.buffer=e;this.source=this.audioContext.createBufferSource(),this.source.buffer=this.buffer,this.name=i}return function(A,e,i){e&&Zl(A.prototype,e),i&&Zl(A,i)}(A,[{key:"process",value:function(A){var e,i,t=this;switch(this.name){case ql.FASTER:case ql.SLOWER:this.source.playbackRate.setValueAtTime(this.playbackRate,this.adjustedTrimStartSeconds),this.source.playbackRate.setValueAtTime(1,this.adjustedTrimEndSeconds);break;case ql.LOUDER:var o=new Wl(this.audioContext,1.25,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=o.input,i=o.output;break;case ql.SOFTER:var n=new Wl(this.audioContext,.75,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=n.input,i=n.output;break;case ql.ECHO:var a=new zl(this.audioContext,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=a.input,i=a.output;break;case ql.ROBOT:var r=new Kl(this.audioContext,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=r.input,i=r.output;break;case ql.FADEIN:var s=new Vl(this.audioContext,!0,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=s.input,i=s.output;break;case ql.FADEOUT:var g=new Vl(this.audioContext,!1,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=g.input,i=g.output;break;case ql.MUTE:var l=new Xl(this.audioContext,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=l.input,i=l.output}e&&i?(this.source.connect(e),i.connect(this.audioContext.destination)):this.source.connect(this.audioContext.destination),this.source.start(),this.audioContext.startRendering(),this.audioContext.oncomplete=function(e){var i=e.renderedBuffer;A(i,t.adjustedTrimStart,t.adjustedTrimEnd)}}}],[{key:"effectTypes",get:function(){return ql}}]),A}(),Ac=function(A){return a.a.createElement("div",{className:Le()(zg.a.absolute,zg.a.selector),ref:A.containerRef,onMouseDown:A.onNewSelectionMouseDown,onTouchStart:A.onNewSelectionMouseDown},null===A.trimStart?null:a.a.createElement(hi.a,{className:Le()(zg.a.absolute),style:{left:"".concat(100*A.trimStart,"%"),width:"".concat(100*(A.trimEnd-A.trimStart),"%")}},a.a.createElement(hi.a,{className:Le()(zg.a.absolute,zg.a.selectionBackground)}),a.a.createElement(Xg,{handleStyle:zg.a.leftHandle,onMouseDown:A.onTrimStartMouseDown}),a.a.createElement(Xg,{handleStyle:zg.a.rightHandle,onMouseDown:A.onTrimEndMouseDown})),A.playhead?a.a.createElement(qg,{playbackPosition:A.playhead}):null)};Ac.propTypes={containerRef:o.a.func,onNewSelectionMouseDown:o.a.func.isRequired,onTrimEndMouseDown:o.a.func.isRequired,onTrimStartMouseDown:o.a.func.isRequired,playhead:o.a.number,trimEnd:o.a.number,trimStart:o.a.number};var ec=Ac;function ic(A){"@babel/helpers - typeof";return(ic="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function tc(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function oc(A,e){return(oc=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function nc(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=rc(A);if(e){var o=rc(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ic(e)||"function"==typeof e))return e;return ac(A)}(this,i)}}function ac(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function rc(A){return(rc=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var sc=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&oc(A,e)}(i,a.a.Component);var e=nc(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(ac(t),["handleNewSelectionMouseDown","handleTrimStartMouseDown","handleTrimEndMouseDown","handleTrimStartMouseMove","handleTrimEndMouseMove","handleTrimStartMouseUp","handleTrimEndMouseUp","storeRef"]),t.state={trimStart:A.trimStart,trimEnd:A.trimEnd},t.clickStartTime=0,t.trimStartDragRecognizer=new Qi({onDrag:t.handleTrimStartMouseMove,onDragEnd:t.handleTrimStartMouseUp,touchDragAngle:90,distanceThreshold:0}),t.trimEndDragRecognizer=new Qi({onDrag:t.handleTrimEndMouseMove,onDragEnd:t.handleTrimEndMouseUp,touchDragAngle:90,distanceThreshold:0}),t}return function(A,e,i){e&&tc(A.prototype,e),i&&tc(A,i)}(i,[{key:"componentWillReceiveProps",value:function(A){var e=this.props,i=e.trimStart,t=e.trimEnd;A.trimStart===i&&A.trimEnd===t||this.setState({trimStart:A.trimStart,trimEnd:A.trimEnd})}},{key:"clearSelection",value:function(){this.props.onSetTrim(null,null)}},{key:"handleNewSelectionMouseDown",value:function(A){var e=this.containerElement.getBoundingClientRect(),i=e.width,t=e.left;this.initialTrimEnd=(Ii(A).x-t)/i,this.initialTrimStart=this.initialTrimEnd,this.props.onSetTrim(this.initialTrimStart,this.initialTrimEnd),this.clickStartTime=Date.now(),this.containerSize=i,this.trimEndDragRecognizer.start(A),A.preventDefault()}},{key:"handleTrimStartMouseMove",value:function(A,e){var i=(A.x-e.x)/this.containerSize,t=Math.max(0,Math.min(1,this.initialTrimStart+i));t>this.initialTrimEnd?this.setState({trimStart:this.initialTrimEnd,trimEnd:t}):this.setState({trimStart:t,trimEnd:this.initialTrimEnd})}},{key:"handleTrimEndMouseMove",value:function(A,e){var i=(A.x-e.x)/this.containerSize,t=Math.min(1,Math.max(0,this.initialTrimEnd+i));t<this.initialTrimStart?this.setState({trimStart:t,trimEnd:this.initialTrimStart}):this.setState({trimStart:this.initialTrimStart,trimEnd:t})}},{key:"handleTrimStartMouseUp",value:function(){this.props.onSetTrim(this.state.trimStart,this.state.trimEnd)}},{key:"handleTrimEndMouseUp",value:function(){var A=Date.now()-this.clickStartTime<500,e=this.state.trimEnd-this.state.trimStart<.01;A&&e?this.clearSelection():this.props.onSetTrim(this.state.trimStart,this.state.trimEnd)}},{key:"handleTrimStartMouseDown",value:function(A){this.containerSize=this.containerElement.getBoundingClientRect().width,this.trimStartDragRecognizer.start(A),this.initialTrimStart=this.props.trimStart,this.initialTrimEnd=this.props.trimEnd,A.stopPropagation(),A.preventDefault()}},{key:"handleTrimEndMouseDown",value:function(A){this.containerSize=this.containerElement.getBoundingClientRect().width,this.trimEndDragRecognizer.start(A),this.initialTrimEnd=this.props.trimEnd,this.initialTrimStart=this.props.trimStart,A.stopPropagation(),A.preventDefault()}},{key:"storeRef",value:function(A){this.containerElement=A}},{key:"render",value:function(){return a.a.createElement(ec,{containerRef:this.storeRef,playhead:this.props.playhead,trimEnd:this.state.trimEnd,trimStart:this.state.trimStart,onNewSelectionMouseDown:this.handleNewSelectionMouseDown,onTrimEndMouseDown:this.handleTrimEndMouseDown,onTrimStartMouseDown:this.handleTrimStartMouseDown})}}]),i}();sc.propTypes={onSetTrim:o.a.func,playhead:o.a.number,trimEnd:o.a.number,trimStart:o.a.number};var gc=sc,lc=i(225),cc=i.n(lc),uc=function(A){var e=A.img,i=A.disabled,t=A.className,o=A.title,n=A.onClick;return a.a.createElement("div",{className:Le()(cc.a.container,t,i?cc.a.disabled:null),role:"button",onClick:i?null:n},a.a.createElement("img",{className:cc.a.icon,draggable:!1,src:e}),a.a.createElement("div",{className:cc.a.title},o))};uc.propTypes={className:o.a.string,disabled:o.a.bool,img:o.a.string,onClick:o.a.func.isRequired,title:o.a.node.isRequired};var Bc=uc,dc=i(30),Ec=i.n(dc),hc=i(786),Cc=i.n(hc),wc=i(787),mc=i.n(wc),pc=i(788),Ic=i.n(pc),fc=i(789),Qc=i.n(fc),Dc=i(790),Mc=i.n(Dc),bc=i(791),yc=i.n(bc),Tc=i(792),kc=i.n(Tc),Fc=i(793),vc=i.n(Fc),Sc=i(794),Nc=i.n(Sc),Rc=i(795),Oc=i.n(Rc),Yc=i(796),Uc=i.n(Yc),Gc=i(797),Hc=i.n(Gc),Lc=i(798),Pc=i.n(Lc),xc=i(799),_c=i.n(xc),jc=i(800),Jc=i.n(jc),zc=i(801),Kc=i.n(zc),Wc=i(802),Vc=i.n(Wc),Xc=$n(Jn),Zc=Object(B.d)({sound:{id:"gui.soundEditor.sound",defaultMessage:"Sound"},play:{id:"gui.soundEditor.play",defaultMessage:"Play"},stop:{id:"gui.soundEditor.stop",defaultMessage:"Stop"},copy:{id:"gui.soundEditor.copy",defaultMessage:"Copy"},paste:{id:"gui.soundEditor.paste",defaultMessage:"Paste"},copyToNew:{id:"gui.soundEditor.copyToNew",defaultMessage:"Copy to New"},delete:{id:"gui.soundEditor.delete",defaultMessage:"Delete"},save:{id:"gui.soundEditor.save",defaultMessage:"Save"},undo:{id:"gui.soundEditor.undo",defaultMessage:"Undo"},redo:{id:"gui.soundEditor.redo",defaultMessage:"Redo"},faster:{id:"gui.soundEditor.faster",defaultMessage:"Faster"},slower:{id:"gui.soundEditor.slower",defaultMessage:"Slower"},echo:{id:"gui.soundEditor.echo",defaultMessage:"Echo"},robot:{id:"gui.soundEditor.robot",defaultMessage:"Robot"},louder:{id:"gui.soundEditor.louder",defaultMessage:"Louder"},softer:{id:"gui.soundEditor.softer",defaultMessage:"Softer"},reverse:{id:"gui.soundEditor.reverse",defaultMessage:"Reverse"},fadeOut:{id:"gui.soundEditor.fadeOut",defaultMessage:"Fade out"},fadeIn:{id:"gui.soundEditor.fadeIn",defaultMessage:"Fade in"},mute:{id:"gui.soundEditor.mute",defaultMessage:"Mute"}}),qc=function(A){return a.a.createElement("div",{className:Ec.a.editorContainer,ref:A.setRef,onMouseDown:A.onContainerClick},a.a.createElement("div",{className:Ec.a.row},a.a.createElement("div",{className:Ec.a.inputGroup},a.a.createElement(Gn,{text:A.intl.formatMessage(Zc.sound)},a.a.createElement(Xc,{tabIndex:"1",type:"text",value:A.name,onSubmit:A.onChangeName})),a.a.createElement("div",{className:Ec.a.buttonGroup},a.a.createElement("button",{className:Ec.a.button,disabled:!A.canUndo,title:A.intl.formatMessage(Zc.undo),onClick:A.onUndo},a.a.createElement("img",{className:Ec.a.undoIcon,draggable:!1,src:Qc.a})),a.a.createElement("button",{className:Ec.a.button,disabled:!A.canRedo,title:A.intl.formatMessage(Zc.redo),onClick:A.onRedo},a.a.createElement("img",{className:Ec.a.redoIcon,draggable:!1,src:Ic.a})))),a.a.createElement("div",{className:Ec.a.inputGroup},a.a.createElement(Bc,{className:Ec.a.toolButton,img:Jc.a,title:A.intl.formatMessage(Zc.copy),onClick:A.onCopy}),a.a.createElement(Bc,{className:Ec.a.toolButton,disabled:!1===A.canPaste,img:Kc.a,title:A.intl.formatMessage(Zc.paste),onClick:A.onPaste}),a.a.createElement(Bc,{className:Le()(Ec.a.toolButton,Ec.a.flipInRtl),img:Vc.a,title:A.intl.formatMessage(Zc.copyToNew),onClick:A.onCopyToNew})),a.a.createElement(Bc,{className:Ec.a.toolButton,disabled:null===A.trimStart,img:_c.a,title:A.intl.formatMessage(Zc.delete),onClick:A.onDelete})),a.a.createElement("div",{className:Ec.a.row},a.a.createElement("div",{className:Ec.a.waveformContainer},a.a.createElement(Eg,{data:A.chunkLevels,height:160,width:600}),a.a.createElement(gc,{playhead:A.playhead,trimEnd:A.trimEnd,trimStart:A.trimStart,onPlay:A.onPlay,onSetTrim:A.onSetTrim,onStop:A.onStop}))),a.a.createElement("div",{className:Le()(Ec.a.row,Ec.a.rowReverse)},a.a.createElement("div",{className:Ec.a.inputGroup},A.playhead?a.a.createElement("button",{className:Le()(Ec.a.roundButton,Ec.a.stopButtonn),title:A.intl.formatMessage(Zc.stop),onClick:A.onStop},a.a.createElement("img",{draggable:!1,src:mc.a})):a.a.createElement("button",{className:Le()(Ec.a.roundButton,Ec.a.playButton),title:A.intl.formatMessage(Zc.play),onClick:A.onPlay},a.a.createElement("img",{draggable:!1,src:Cc.a}))),a.a.createElement(Bc,{className:Ec.a.effectButton,img:Mc.a,title:a.a.createElement(B.a,Zc.faster),onClick:A.onFaster}),a.a.createElement(Bc,{className:Ec.a.effectButton,img:yc.a,title:a.a.createElement(B.a,Zc.slower),onClick:A.onSlower}),a.a.createElement(Bc,{disabled:A.tooLoud,className:Le()(Ec.a.effectButton,Ec.a.flipInRtl),img:kc.a,title:a.a.createElement(B.a,Zc.louder),onClick:A.onLouder}),a.a.createElement(Bc,{className:Le()(Ec.a.effectButton,Ec.a.flipInRtl),img:vc.a,title:a.a.createElement(B.a,Zc.softer),onClick:A.onSofter}),a.a.createElement(Bc,{className:Le()(Ec.a.effectButton,Ec.a.flipInRtl),img:Pc.a,title:a.a.createElement(B.a,Zc.mute),onClick:A.onMute}),a.a.createElement(Bc,{className:Ec.a.effectButton,img:Hc.a,title:a.a.createElement(B.a,Zc.fadeIn),onClick:A.onFadeIn}),a.a.createElement(Bc,{className:Ec.a.effectButton,img:Uc.a,title:a.a.createElement(B.a,Zc.fadeOut),onClick:A.onFadeOut}),a.a.createElement(Bc,{className:Ec.a.effectButton,img:Oc.a,title:a.a.createElement(B.a,Zc.reverse),onClick:A.onReverse}),a.a.createElement(Bc,{className:Ec.a.effectButton,img:Nc.a,title:a.a.createElement(B.a,Zc.robot),onClick:A.onRobot})))};qc.propTypes={canPaste:o.a.bool.isRequired,canRedo:o.a.bool.isRequired,canUndo:o.a.bool.isRequired,chunkLevels:o.a.arrayOf(o.a.number).isRequired,intl:B.f,name:o.a.string.isRequired,onChangeName:o.a.func.isRequired,onContainerClick:o.a.func.isRequired,onCopy:o.a.func.isRequired,onCopyToNew:o.a.func.isRequired,onDelete:o.a.func,onEcho:o.a.func.isRequired,onFadeIn:o.a.func.isRequired,onFadeOut:o.a.func.isRequired,onFaster:o.a.func.isRequired,onLouder:o.a.func.isRequired,onMute:o.a.func.isRequired,onPaste:o.a.func.isRequired,onPlay:o.a.func.isRequired,onRedo:o.a.func.isRequired,onReverse:o.a.func.isRequired,onRobot:o.a.func.isRequired,onSetTrim:o.a.func,onSlower:o.a.func.isRequired,onSofter:o.a.func.isRequired,onStop:o.a.func.isRequired,onUndo:o.a.func.isRequired,playhead:o.a.number,setRef:o.a.func,tooLoud:o.a.bool.isRequired,trimEnd:o.a.number,trimStart:o.a.number};var $c=Object(B.e)(qc);function Au(A){"@babel/helpers - typeof";return(Au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function eu(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function iu(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?eu(Object(i),!0).forEach(function(e){tu(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):eu(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function tu(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function ou(A){return function(A){if(Array.isArray(A))return nu(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||function(A,e){if(!A)return;if("string"==typeof A)return nu(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return nu(A,e)}(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nu(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function au(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function ru(A,e){return(ru=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function su(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=lu(A);if(e){var o=lu(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Au(e)||"function"==typeof e))return e;return gu(A)}(this,i)}}function gu(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function lu(A){return(lu=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var cu=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&ru(A,e)}(i,a.a.Component);var e=su(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(gu(t),["copy","copyCurrentBuffer","handleCopyToNew","handleStoppedPlaying","handleChangeName","handlePlay","handleStopPlaying","handleUpdatePlayhead","handleDelete","handleUpdateTrim","handleEffect","handleUndo","handleRedo","submitNewSamples","handleCopy","handlePaste","paste","handleKeyPress","handleContainerClick","setRef","resampleBufferToRate"]),t.state={copyBuffer:null,chunkLevels:Zs(t.props.samples),playhead:null,trimStart:null,trimEnd:null},t.redoStack=[],t.undoStack=[],t.ref=null,t}return function(A,e,i){e&&au(A.prototype,e),i&&au(A,i)}(i,[{key:"componentDidMount",value:function(){this.audioBufferPlayer=new ml(this.props.samples,this.props.sampleRate),document.addEventListener("keydown",this.handleKeyPress)}},{key:"componentWillReceiveProps",value:function(A){A.soundId!==this.props.soundId&&(this.redoStack=[],this.undoStack=[],this.resetState(A.samples,A.sampleRate),this.setState({trimStart:null,trimEnd:null}))}},{key:"componentWillUnmount",value:function(){this.audioBufferPlayer.stop(),document.removeEventListener("keydown",this.handleKeyPress)}},{key:"handleKeyPress",value:function(A){A.target instanceof HTMLInputElement||this.props.isFullScreen||(" "===A.key&&(A.preventDefault(),this.state.playhead?this.handleStopPlaying():this.handlePlay()),"Delete"!==A.key&&"Backspace"!==A.key||(A.preventDefault(),A.shiftKey?this.handleDeleteInverse():this.handleDelete()),"Escape"===A.key&&(A.preventDefault(),this.handleUpdateTrim(null,null)),(A.metaKey||A.ctrlKey)&&(A.shiftKey&&"z"===A.key.toLowerCase()?(A.preventDefault(),this.redoStack.length>0&&this.handleRedo()):"z"===A.key?this.undoStack.length>0&&(A.preventDefault(),this.handleUndo()):"c"===A.key?(A.preventDefault(),this.handleCopy()):"v"===A.key?(A.preventDefault(),this.handlePaste()):"a"===A.key&&(A.preventDefault(),this.handleUpdateTrim(0,1))))}},{key:"resetState",value:function(A,e){this.audioBufferPlayer.stop(),this.audioBufferPlayer=new ml(A,e),this.setState({chunkLevels:Zs(A),playhead:null})}},{key:"submitNewSamples",value:function(A,e,i){var t=this;return function(A,e){var i=A.samples,t=A.sampleRate,o=i.length/t;return 2*i.length<1e7?Promise.resolve({samples:i,sampleRate:t}):22050*o*2<1e7?e({samples:i,sampleRate:t},22050):Promise.reject(new Error("Sound too large to save, refusing to edit"))}({samples:A,sampleRate:e},this.resampleBufferToRate).then(function(A){var e=A.samples,o=A.sampleRate;return Vs.a.encode({sampleRate:o,channelData:[e]}).then(function(A){return i||(t.redoStack=[],t.undoStack.length>=99&&t.undoStack.shift(),t.undoStack.push(t.getUndoItem())),t.resetState(e,o),t.props.vm.updateSoundBuffer(t.props.soundIndex,t.audioBufferPlayer.buffer,new Uint8Array(A)),!0})}).catch(function(A){return L.a.error("Encountered error while trying to encode sound update: ".concat(A.message)),!1})}},{key:"handlePlay",value:function(){this.audioBufferPlayer.stop(),this.audioBufferPlayer.play(this.state.trimStart||0,this.state.trimEnd||1,this.handleUpdatePlayhead,this.handleStoppedPlaying)}},{key:"handleStopPlaying",value:function(){this.audioBufferPlayer.stop(),this.handleStoppedPlaying()}},{key:"handleStoppedPlaying",value:function(){this.setState({playhead:null})}},{key:"handleUpdatePlayhead",value:function(A){this.setState({playhead:A})}},{key:"handleChangeName",value:function(A){this.props.vm.renameSound(this.props.soundIndex,A)}},{key:"handleDelete",value:function(){var A,e=this,i=this.copyCurrentBuffer(),t=i.samples,o=i.sampleRate,n=t.length,a=Math.floor(this.state.trimStart*n),r=Math.floor(this.state.trimEnd*n),s=t.slice(0,a),g=t.slice(r,n),l=s.length+g.length;0===l?A=new Float32Array(1):((A=new Float32Array(l)).set(s,0),A.set(g,s.length)),this.submitNewSamples(A,o).then(function(){e.setState({trimStart:null,trimEnd:null})})}},{key:"handleDeleteInverse",value:function(){var A=this,e=this.copyCurrentBuffer(),i=e.samples,t=e.sampleRate,o=i.length,n=Math.floor(this.state.trimStart*o),a=Math.floor(this.state.trimEnd*o),r=i.slice(n,a);0===r.length&&(r=new Float32Array(1)),this.submitNewSamples(r,t).then(function(e){e&&A.setState({trimStart:null,trimEnd:null})})}},{key:"handleUpdateTrim",value:function(A,e){this.setState({trimStart:A,trimEnd:e}),this.handleStopPlaying()}},{key:"effectFactory",value:function(A){var e=this;return function(){return e.handleEffect(A)}}},{key:"copyCurrentBuffer",value:function(){return{samples:this.audioBufferPlayer.buffer.getChannelData(0),sampleRate:this.audioBufferPlayer.buffer.sampleRate}}},{key:"handleEffect",value:function(A){var e=this,i=null===this.state.trimStart?0:this.state.trimStart,t=null===this.state.trimEnd?1:this.state.trimEnd;this.audioBufferPlayer.buffer.length<2||new $l(this.audioBufferPlayer.buffer,A,i,t).process(function(A,i,t){var o=A.getChannelData(0),n=A.sampleRate;e.submitNewSamples(o,n).then(function(A){A&&(null===e.state.trimStart?e.handlePlay():e.setState({trimStart:i,trimEnd:t},e.handlePlay))})})}},{key:"tooLoud",value:function(){var A=this.state.chunkLevels.length,e=null===this.state.trimStart?0:Math.floor(this.state.trimStart*A),i=null===this.state.trimEnd?A-1:Math.ceil(this.state.trimEnd*A),t=this.state.chunkLevels.slice(e,i);return Math.max.apply(Math,ou(t))>1.2}},{key:"getUndoItem",value:function(){return iu(iu({},this.copyCurrentBuffer()),{},{trimStart:this.state.trimStart,trimEnd:this.state.trimEnd})}},{key:"handleUndo",value:function(){var A=this;this.redoStack.push(this.getUndoItem());var e=this.undoStack.pop(),i=e.samples,t=e.sampleRate,o=e.trimStart,n=e.trimEnd;if(i)return this.submitNewSamples(i,t,!0).then(function(e){e&&A.setState({trimStart:o,trimEnd:n},A.handlePlay)})}},{key:"handleRedo",value:function(){var A=this,e=this.redoStack.pop(),i=e.samples,t=e.sampleRate,o=e.trimStart,n=e.trimEnd;if(i)return this.undoStack.push(this.getUndoItem()),this.submitNewSamples(i,t,!0).then(function(e){e&&A.setState({trimStart:o,trimEnd:n},A.handlePlay)})}},{key:"handleCopy",value:function(){this.copy()}},{key:"copy",value:function(A){var e=null===this.state.trimStart?0:this.state.trimStart,i=null===this.state.trimEnd?1:this.state.trimEnd,t=this.copyCurrentBuffer(),o=e*t.samples.length,n=i*t.samples.length;t.samples=t.samples.slice(o,n),this.setState({copyBuffer:t},A)}},{key:"handleCopyToNew",value:function(){var A=this;this.copy(function(){qs(A.props.vm,A.state.copyBuffer.samples,A.state.copyBuffer.sampleRate,A.props.name)})}},{key:"resampleBufferToRate",value:function(A,e){return new Promise(function(i,t){var o,n=e/A.sampleRate*A.samples.length;try{window.OfflineAudioContext?o=new window.OfflineAudioContext(1,n,e):window.webkitOfflineAudioContext&&(o=new window.webkitOfflineAudioContext(1,n,e))}catch(o){return e===A.sampleRate/2?i(function(A){for(var e=Math.floor(A.samples.length/2),i=new Float32Array(e),t=0;t<e;t++)i[t]=A.samples[2*t];return{samples:i,sampleRate:A.sampleRate/2}}(A)):t(new Error("Could not resample"))}var a=o.createBufferSource(),r=o.createBuffer(1,A.samples.length,A.sampleRate);r.getChannelData(0).set(A.samples),a.buffer=r,a.connect(o.destination),a.start(),o.startRendering(),o.oncomplete=function(A){var t=A.renderedBuffer;i({samples:t.getChannelData(0),sampleRate:e})}})}},{key:"paste",value:function(){var A=this,e=this.copyCurrentBuffer().samples;if(null===this.state.trimStart){var i=e.length+this.state.copyBuffer.samples.length,t=new Float32Array(i);t.set(e,0),t.set(this.state.copyBuffer.samples,e.length),this.submitNewSamples(t,this.props.sampleRate,!1).then(function(e){e&&A.handlePlay()})}else{var o=this.state.trimStart*e.length,n=this.state.trimEnd*e.length,a=e.slice(0,o),r=e.slice(n),s=a.length+this.state.copyBuffer.samples.length+r.length,g=new Float32Array(s);g.set(a,0),g.set(this.state.copyBuffer.samples,a.length),g.set(r,a.length+this.state.copyBuffer.samples.length);var l=o/this.props.sampleRate,c=l+this.state.copyBuffer.samples.length/this.state.copyBuffer.sampleRate,u=g.length/this.state.copyBuffer.sampleRate,B=l/u,d=c/u;this.submitNewSamples(g,this.props.sampleRate,!1).then(function(e){e&&A.setState({trimStart:B,trimEnd:d},A.handlePlay)})}}},{key:"handlePaste",value:function(){var A=this;this.state.copyBuffer&&(this.state.copyBuffer.sampleRate===this.props.sampleRate?this.paste():this.resampleBufferToRate(this.state.copyBuffer,this.props.sampleRate).then(function(e){A.setState({copyBuffer:e},A.paste)}))}},{key:"setRef",value:function(A){this.ref=A}},{key:"handleContainerClick",value:function(A){A.target===this.ref&&null!==this.state.trimStart&&this.handleUpdateTrim(null,null)}},{key:"render",value:function(){var A=$l.effectTypes;return a.a.createElement($c,{canPaste:null!==this.state.copyBuffer,canRedo:this.redoStack.length>0,canUndo:this.undoStack.length>0,chunkLevels:this.state.chunkLevels,name:this.props.name,playhead:this.state.playhead,setRef:this.setRef,tooLoud:this.tooLoud(),trimEnd:this.state.trimEnd,trimStart:this.state.trimStart,onChangeName:this.handleChangeName,onContainerClick:this.handleContainerClick,onCopy:this.handleCopy,onCopyToNew:this.handleCopyToNew,onDelete:this.handleDelete,onEcho:this.effectFactory(A.ECHO),onFadeIn:this.effectFactory(A.FADEIN),onFadeOut:this.effectFactory(A.FADEOUT),onFaster:this.effectFactory(A.FASTER),onLouder:this.effectFactory(A.LOUDER),onMute:this.effectFactory(A.MUTE),onPaste:this.handlePaste,onPlay:this.handlePlay,onRedo:this.handleRedo,onReverse:this.effectFactory(A.REVERSE),onRobot:this.effectFactory(A.ROBOT),onSetTrim:this.handleUpdateTrim,onSlower:this.effectFactory(A.SLOWER),onSofter:this.effectFactory(A.SOFTER),onStop:this.handleStopPlaying,onUndo:this.handleUndo})}}]),i}();cu.propTypes={isFullScreen:o.a.bool,name:o.a.string.isRequired,sampleRate:o.a.number,samples:o.a.instanceOf(Float32Array),soundId:o.a.string,soundIndex:o.a.number,vm:o.a.instanceOf(u.a).isRequired};var uu=Object(s.b)(function(A,e){var i=e.soundIndex,t=A.scratchGui.vm.editingTarget.sprite,o=i<t.sounds.length?i:t.sounds.length-1,n=A.scratchGui.vm.editingTarget.sprite.sounds[o],a=A.scratchGui.vm.getSoundBuffer(o);return{soundId:n.soundId,sampleRate:a.sampleRate,samples:a.getChannelData(0),isFullScreen:A.scratchGui.mode.isFullScreen,name:n.name,vm:A.scratchGui.vm}})(cu),Bu=i(803),du=i.n(Bu),Eu=i(804),hu=i.n(Eu),Cu=i(217),wu=[{tag:"animals",intlLabel:Qn.animals},{tag:"effects",intlLabel:Qn.effects},{tag:"loops",intlLabel:Qn.loops},{tag:"notes",intlLabel:Qn.notes},{tag:"percussion",intlLabel:Qn.percussion},{tag:"space",intlLabel:Qn.space},{tag:"sports",intlLabel:Qn.sports},{tag:"voice",intlLabel:Qn.voice},{tag:"wacky",intlLabel:Qn.wacky}];function mu(A){"@babel/helpers - typeof";return(mu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var pu=["md5ext"];function Iu(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function fu(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Qu(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Du(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Mu(A,e){return(Mu=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function bu(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Tu(A);if(e){var o=Tu(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===mu(e)||"function"==typeof e))return e;return yu(A)}(this,i)}}function yu(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Tu(A){return(Tu=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ku=Object(B.d)({libraryTitle:{id:"gui.soundLibrary.chooseASound",defaultMessage:"Choose a Sound"}}),Fu=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Mu(A,e)}(i,a.a.PureComponent);var e=bu(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(yu(t),["handleItemSelected","handleItemMouseEnter","handleItemMouseLeave","onStop","setStopHandler"]),t.audioEngine=null,t.playingSoundPromise=null,t.handleStop=null,t}return function(A,e,i){e&&Du(A.prototype,e),i&&Du(A,i)}(i,[{key:"componentDidMount",value:function(){this.audioEngine=new de.a,this.playingSoundPromise=null}},{key:"componentWillUnmount",value:function(){this.stopPlayingSound()}},{key:"onStop",value:function(){var A=this;null!==this.playingSoundPromise&&(this.playingSoundPromise.then(function(e){return e&&e.removeListener("stop",A.onStop)}),this.handleStop&&this.handleStop())}},{key:"setStopHandler",value:function(A){this.handleStop=A}},{key:"stopPlayingSound",value:function(){var A=this;null!==this.playingSoundPromise&&(this.playingSoundPromise.then(function(e){return e&&e.removeListener("stop",A.onStop)}),this.playingSoundPromise.isPlaying?this.playingSoundPromise.then(function(A){A.stop()}):this.playingSoundPromise.then(function(A){A&&A.stopImmediately()}),this.playingSoundPromise=null)}},{key:"handleItemMouseEnter",value:function(A){var e=this,i=A._md5,t=i.split(".")[0],o=this.props.vm;this.stopPlayingSound(),this.playingSoundPromise=o.runtime.storage.load(o.runtime.storage.AssetType.Sound,t).then(function(t){if(t){var o={md5:i,name:A.name,format:A.format,data:t.data};return e.audioEngine.decodeSoundPlayer(o).then(function(A){if(A.buffer.duration<.001)throw new Error("Sound is not fetched properly -- there might be a problem with the internet connection.");return A.connect(e.audioEngine),A.play(),A.addListener("stop",e.onStop),null!==e.playingSoundPromise&&(e.playingSoundPromise.isPlaying=!0),A}).catch(function(A){console.warn(A),mv2Interface.send_REST("notification/warn-message/This sound requires internet. Please select a pre-loaded sound.")})}}).catch(function(A){mv2Interface.send_REST("notification/warn-message/This sound requires internet. Please select a pre-loaded sound.")})}},{key:"handleItemMouseLeave",value:function(){this.stopPlayingSound()}},{key:"handleItemSelected",value:function(A){var e=this,i={format:A.format,md5:A._md5,rate:A.rate,sampleCount:A.sampleCount,name:A.name};this.props.vm.addSound(i).then(function(){e.props.onNewSound()})}},{key:"render",value:function(){var A=this,e=Cu.map(function(e){var i=e.md5ext,t=Qu(e,pu);return function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Iu(Object(i),!0).forEach(function(e){fu(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):Iu(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({_md5:i,rawURL:A.props.isRtl?hu.a:du.a},t)});return a.a.createElement(Mn.a,{showPlayButton:!0,data:e,id:"soundLibrary",setStopHandler:this.setStopHandler,tags:wu,title:this.props.intl.formatMessage(ku.libraryTitle),onItemMouseEnter:this.handleItemMouseEnter,onItemMouseLeave:this.handleItemMouseLeave,onItemSelected:this.handleItemSelected,onRequestClose:this.props.onRequestClose})}}]),i}();Fu.propTypes={intl:B.f.isRequired,isRtl:o.a.bool,onNewSound:o.a.func.isRequired,onRequestClose:o.a.func,vm:o.a.instanceOf(u.a).isRequired};var vu=Object(B.e)(Object(s.b)(function(A){return{isRtl:A.locales.isRtl}},function(){return{}})(Fu));function Su(A){"@babel/helpers - typeof";return(Su="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Nu(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Ru(A,e){return(Ru=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Ou(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Uu(A);if(e){var o=Uu(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Su(e)||"function"==typeof e))return e;return Yu(A)}(this,i)}}function Yu(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Uu(A){return(Uu=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Gu=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Ru(A,e)}(i,a.a.Component);var e=Ou(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Yu(t),["handleSelectSound","handleDeleteSound","handleDuplicateSound","handleExportSound","handleNewSound","handleSurpriseSound","handleFileUploadClick","handleSoundUpload","handleDrop","setFileInput"]),t.state={selectedSoundIndex:0},t}return function(A,e,i){e&&Nu(A.prototype,e),i&&Nu(A,i)}(i,[{key:"componentWillReceiveProps",value:function(A){var e=A.editingTarget,i=A.sprites,t=A.stage,o=e&&i[e]?i[e]:t;o&&o.sounds&&(this.props.editingTarget!==e?this.setState({selectedSoundIndex:0}):this.state.selectedSoundIndex>o.sounds.length-1&&this.setState({selectedSoundIndex:Math.max(o.sounds.length-1,0)}))}},{key:"handleSelectSound",value:function(A){this.setState({selectedSoundIndex:A})}},{key:"handleDeleteSound",value:function(A){var e=this.props.vm.deleteSound(A);A>=this.state.selectedSoundIndex&&this.setState({selectedSoundIndex:Math.max(0,A-1)}),this.props.dispatchUpdateRestore({restoreFun:e,deletedItem:"Sound"})}},{key:"handleExportSound",value:function(A){var e=this.props.vm.editingTarget.sprite.sounds[A],i=new Blob([e.asset.data],{type:e.asset.assetType.contentType});Ko("".concat(e.name,".").concat(e.asset.dataFormat),i)}},{key:"handleDuplicateSound",value:function(A){var e=this;this.props.vm.duplicateSound(A).then(function(){e.setState({selectedSoundIndex:A+1})})}},{key:"handleNewSound",value:function(){if(!this.props.vm.editingTarget)return null;var A=this.props.vm.editingTarget.sprite,e=A.sounds?A.sounds:[];this.setState({selectedSoundIndex:Math.max(e.length-1,0)})}},{key:"handleSurpriseSound",value:function(){var A=this,e=Cu[Math.floor(Math.random()*Cu.length)],i={format:e.dataFormat,md5:e.md5ext,rate:e.rate,sampleCount:e.sampleCount,name:e.name};this.props.vm.addSound(i).then(function(){A.handleNewSound()})}},{key:"handleFileUploadClick",value:function(){this.fileInput.click()}},{key:"handleSoundUpload",value:function(A){var e=this,i=this.props.vm.runtime.storage,t=this.props.vm.editingTarget.id;this.props.onShowImporting(),_o(A.target,function(A,o,n,a,r){!function(A,e,i,t,o){var n;switch(e){case"audio/mp3":case"audio/mpeg":n=i.DataFormat.MP3;break;case"audio/wav":case"audio/wave":case"audio/x-wav":case"audio/x-pn-wav":n=i.DataFormat.WAV;break;default:return void o("Encountered unexpected file type: ".concat(e))}t(jo(i,i.AssetType.Sound,n,new Uint8Array(A)))}(A,o,i,function(A){A.name=n,e.props.vm.addSound(A,t).then(function(){e.handleNewSound(),a===r-1&&e.props.onCloseImporting()})},e.props.onCloseImporting)},this.props.onCloseImporting)}},{key:"handleDrop",value:function(A){if(A.dragType===Co.a.SOUND){var e=this.props.vm.editingTarget.sprite,i=e.sounds[this.state.selectedSoundIndex];this.props.vm.reorderSound(this.props.vm.editingTarget.id,A.index,A.newIndex),this.setState({selectedSoundIndex:e.sounds.indexOf(i)})}else A.dragType===Co.a.BACKPACK_COSTUME?(this.props.onActivateCostumesTab(),this.props.vm.addCostume(A.payload.body,{name:A.payload.name})):A.dragType===Co.a.BACKPACK_SOUND&&this.props.vm.addSound({md5:A.payload.body,name:A.payload.name}).then(this.handleNewSound)}},{key:"setFileInput",value:function(A){this.fileInput=A}},{key:"render",value:function(){var A=this.props,e=(A.dispatchUpdateRestore,A.intl),i=A.isRtl,t=A.vm,o=A.onNewSoundFromLibraryClick,n=A.onNewSoundFromRecordingClick;if(!t.editingTarget)return null;var r=t.editingTarget.sprite,s=r.sounds?r.sounds.map(function(A){return{url:i?_s.a:Ps.a,name:A.name,details:(A.sampleCount/A.rate).toFixed(2),dragPayload:A}}):[],g=Object(B.d)({fileUploadSound:{id:"gui.soundTab.fileUploadSound",defaultMessage:"Upload Sound"},surpriseSound:{id:"gui.soundTab.surpriseSound",defaultMessage:"Surprise"},recordSound:{id:"gui.soundTab.recordSound",defaultMessage:"Record"},addSound:{id:"gui.soundTab.addSoundFromLibrary",defaultMessage:"Choose a Sound"}});return a.a.createElement(To,{buttons:[{title:e.formatMessage(g.addSound),img:Js.a,onClick:o},{title:e.formatMessage(g.fileUploadSound),img:An.a,onClick:this.handleFileUploadClick,fileAccept:".wav, .mp3",fileChange:this.handleSoundUpload,fileInput:this.setFileInput,fileMultiple:!0},{title:e.formatMessage(g.surpriseSound),img:nn.a,onClick:this.handleSurpriseSound},{title:e.formatMessage(g.recordSound),img:Ks.a,onClick:n},{title:e.formatMessage(g.addSound),img:rn.a,onClick:o}],dragType:Co.a.SOUND,isRtl:i,items:s,selectedItemIndex:this.state.selectedSoundIndex,onDeleteClick:this.handleDeleteSound,onDrop:this.handleDrop,onDuplicateClick:this.handleDuplicateSound,onExportClick:this.handleExportSound,onItemClick:this.handleSelectSound},r.sounds&&r.sounds[this.state.selectedSoundIndex]?a.a.createElement(uu,{soundIndex:this.state.selectedSoundIndex}):null,this.props.soundRecorderVisible?a.a.createElement(jl,{onNewSound:this.handleNewSound}):null,this.props.soundLibraryVisible?a.a.createElement(vu,{vm:this.props.vm,onNewSound:this.handleNewSound,onRequestClose:this.props.onRequestCloseSoundLibrary}):null)}}]),i}();Gu.propTypes={dispatchUpdateRestore:o.a.func,editingTarget:o.a.string,intl:B.f,isRtl:o.a.bool,onActivateCostumesTab:o.a.func.isRequired,onCloseImporting:o.a.func.isRequired,onNewSoundFromLibraryClick:o.a.func.isRequired,onNewSoundFromRecordingClick:o.a.func.isRequired,onRequestCloseSoundLibrary:o.a.func.isRequired,onShowImporting:o.a.func.isRequired,soundLibraryVisible:o.a.bool,soundRecorderVisible:o.a.bool,sprites:o.a.shape({id:o.a.shape({sounds:o.a.arrayOf(o.a.shape({name:o.a.string.isRequired}))})}),stage:o.a.shape({sounds:o.a.arrayOf(o.a.shape({name:o.a.string.isRequired}))}),vm:o.a.instanceOf(u.a).isRequired};var Hu=Object(d.a)("Sound Tab")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,isRtl:A.locales.isRtl,sprites:A.scratchGui.targets.sprites,stage:A.scratchGui.targets.stage,soundLibraryVisible:A.scratchGui.modals.soundLibrary,soundRecorderVisible:A.scratchGui.modals.soundRecorder}},function(A){return{onActivateCostumesTab:function(){return A(Object(h.e)(h.b))},onNewSoundFromLibraryClick:function(e){e.preventDefault(),A(Object(C.r)())},onNewSoundFromRecordingClick:function(){A(Object(C.s)())},onRequestCloseSoundLibrary:function(){A(Object(C.f)())},dispatchUpdateRestore:function(e){A(Object(Wo.c)(e))},onCloseImporting:function(){return A(Object(TA.c)("importingAsset"))},onShowImporting:function(){return A(Object(TA.h)("importingAsset"))}}})(Gu))),Lu=i(55),Pu=i.n(Lu),xu=i(47),_u=i(69),ju=i.n(_u);function Ju(A){"@babel/helpers - typeof";return(Ju="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function zu(A){return function(A){if(Array.isArray(A))return Ku(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||function(A,e){if(!A)return;if("string"==typeof A)return Ku(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ku(A,e)}(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ku(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function Wu(A,e,i,t,o,n,a){try{var r=A[n](a),s=r.value}catch(A){return void i(A)}r.done?e(s):Promise.resolve(s).then(t,o)}function Vu(A){return function(){var e=this,i=arguments;return new Promise(function(t,o){var n=A.apply(e,i);function a(A){Wu(n,t,o,a,r,"next",A)}function r(A){Wu(n,t,o,a,r,"throw",A)}a(void 0)})}}function Xu(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Zu(A,e){return(Zu=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function qu(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=AB(A);if(e){var o=AB(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ju(e)||"function"==typeof e))return e;return $u(A)}(this,i)}}function $u(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function AB(A){return(AB=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var eB=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Zu(A,e)}(i,a.a.Component);var e=qu(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={saveFileName:"",fileNames:[],isValidFileName:!1},t.setSaveFileName=t.setSaveFileName.bind($u(t)),t.saveFile=t.saveFile.bind($u(t)),t.loadFile=t.loadFile.bind($u(t)),t.deleteFile=t.deleteFile.bind($u(t)),t.getCurrentFiles(),t}return function(A,e,i){e&&Xu(A.prototype,e),i&&Xu(A,i)}(i,[{key:"getCurrentFiles",value:function(){var A=Vu(function*(){var A=(yield mv2Interface.listSavedScratchFiles()).fileNames.map(function(A){return decodeURIComponent(A)}).filter(function(A){return"__autosave"!==A});this.setState({fileNames:A})});return function(){return A.apply(this,arguments)}}()},{key:"setSaveFileName",value:function(A){var e=A.length>0&&A.length<30;this.setState({saveFileName:A,isValidFileName:e})}},{key:"saveFile",value:function(){var A=Vu(function*(A){var e=this.state.fileNames,i=encodeURIComponent(A);if(!e.includes(i)||window.confirm('Are you sure you want to overwrite "'.concat(A,'"?'))){var t=yield this.props.saveProjectSb3(),o=yield te(t);try{if(yield mv2Interface.saveScratchFile(i,o),alert("Project Saved."),this.props.onProjectTelemetryEvent){var n=fA(this.props.vm,this.props.projectTitle,this.props.locale);this.props.onProjectTelemetryEvent("projectDidSave",n)}var a=[A].concat(zu(e.filter(function(e){return e!==A})));this.setState({fileNames:a})}catch(A){alert("Failed to save project: ".concat(A.message))}}});return function(e){return A.apply(this,arguments)}}()},{key:"loadFile",value:function(){var A=Vu(function*(A){var e=this,i=this.props.vm;if(!i.editingTarget)return null;try{var t=yield mv2Interface.loadScratchFile(encodeURIComponent(A)),o=yield(yield fetch(t.contents)).arrayBuffer();i.loadProject(o),alert("Loaded Project"),window.setTimeout(function(){return e.props.onActivateBlocksTab()})}catch(A){alert("Failed to load project: ".concat(A.message))}});return function(e){return A.apply(this,arguments)}}()},{key:"deleteFile",value:function(){var A=Vu(function*(A){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.state.fileNames;if(!e||window.confirm('Are you sure you want to delete "'.concat(A,'"?')))try{yield mv2Interface.deleteScratchFile(encodeURIComponent(A));var t=i.filter(function(e){return e!==A});this.setState({fileNames:t})}catch(A){alert("Failed to delete project: ".concat(A.message))}});return function(e){return A.apply(this,arguments)}}()},{key:"render",value:function(){var A=this,e=this.state,i=e.saveFileName,t=e.isValidFileName,o=e.fileNames;return a.a.createElement("div",{className:ju.a.mainContent},a.a.createElement("div",{className:ju.a.block},a.a.createElement("div",{className:ju.a.saveHeaderContainer},a.a.createElement("div",{className:ju.a.newSaveTitleContainer},"Create a new save file:"),a.a.createElement(Jn,{placeholder:"Type what you would like to name your new save file here...",style:{flex:1,marginLeft:10},type:"text",value:i,onChange:function(e){return A.setSaveFileName(e.currentTarget.value)}}),a.a.createElement(xu.a,{style:{marginLeft:10,marginRight:5,opacity:t?1:.2},className:ju.a.button,disabled:!t,onClick:function(){return A.saveFile(i)}},"Save"))),o.length>0&&a.a.createElement("div",{className:[ju.a.block,ju.a["block-100"]].join(" ")},a.a.createElement("div",{className:ju.a.savedFilesContainer},a.a.createElement("div",{className:ju.a.savedFilesTitle},"Your Saved Files:"),a.a.createElement("div",{className:ju.a.saveList},o.sort().map(function(e,i){return a.a.createElement("div",{key:e,className:ju.a.row},a.a.createElement("div",{style:{flex:2}},e),a.a.createElement("div",{style:{display:"flex",flexDirection:"row"}},a.a.createElement(xu.a,{className:ju.a.button,style:{marginLeft:10},onClick:function(){return A.deleteFile(e)}},"Delete"),a.a.createElement(xu.a,{className:ju.a.button,style:{marginLeft:10},onClick:function(){return A.loadFile(e)}},"Load"),a.a.createElement(xu.a,{className:ju.a.button,style:{marginLeft:10},onClick:function(){return A.saveFile(e)}},"Save")))})))))}}]),i}();eB.propTypes={onActivateBlocksTab:o.a.func,saveProjectSb3:o.a.func,editingTarget:o.a.string,locale:o.a.string.isRequired,onProjectTelemetryEvent:o.a.func,projectTitle:o.a.string,vm:o.a.instanceOf(u.a).isRequired,onConfirmNewProject:o.a.func};var iB=Object(d.a)("Save / Load")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,locale:A.locales.locale,saveProjectSb3:A.scratchGui.vm.saveProjectSb3.bind(A.scratchGui.vm)}},function(A){return{onActivateBlocksTab:function(){return A(Object(h.e)(h.a))},onConfirmNewProject:function(){return A(Object(E.C)(!1))}}})(eB))),tB=i(66),oB=i.n(tB),nB=i(805),aB=i.n(nB);function rB(A){"@babel/helpers - typeof";return(rB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function sB(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function gB(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?sB(Object(i),!0).forEach(function(e){lB(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):sB(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function lB(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function cB(A,e,i,t,o,n,a){try{var r=A[n](a),s=r.value}catch(A){return void i(A)}r.done?e(s):Promise.resolve(s).then(t,o)}function uB(A){return function(){var e=this,i=arguments;return new Promise(function(t,o){var n=A.apply(e,i);function a(A){cB(n,t,o,a,r,"next",A)}function r(A){cB(n,t,o,a,r,"throw",A)}a(void 0)})}}function BB(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function dB(A,e){return(dB=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function EB(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=CB(A);if(e){var o=CB(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===rB(e)||"function"==typeof e))return e;return hB(A)}(this,i)}}function hB(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function CB(A){return(CB=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var wB=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&dB(A,e)}(i,a.a.Component);var e=EB(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={loadFileName:"",isValidFileName:!1,isLoading:!1,savedProjectId:"",copyToCPText:"Copy to Clipboard"},t.setloadFileName=t.setloadFileName.bind(hB(t)),t.saveFile=t.saveFile.bind(hB(t)),t.loadFile=t.loadFile.bind(hB(t)),t.copyTextToClipboard=t.copyTextToClipboard.bind(hB(t)),t.fallbackCopyTextToClipboard=t.fallbackCopyTextToClipboard.bind(hB(t)),t}return function(A,e,i){e&&BB(A.prototype,e),i&&BB(A,i)}(i,[{key:"setloadFileName",value:function(A){var e=A.length>0&&A.length<130;this.setState({loadFileName:A,isValidFileName:e})}},{key:"saveFile",value:function(){var A=uB(function*(){this.setState(function(A){return gB(gB({},A),{},{isLoading:!0})});var A=yield this.props.saveProjectSb3(),e=yield te(A);try{var i=yield mv2Interface.saveCloudScratchFile(e);this.setState({savedProjectId:i}),alert("Successfully saved project!")}catch(A){alert("Failed to save project: ".concat(A.message))}this.setState(function(A){return gB(gB({},A),{},{isLoading:!1})})});return function(){return A.apply(this,arguments)}}()},{key:"loadFile",value:function(){var A=uB(function*(A){var e=this,i=this.props.vm;if(!i.editingTarget)return null;var t=A;this.validURL(A)&&(A.includes("http")||(A="https://"+A),t=new URL(A).searchParams.get("p")||"");this.setState(function(A){return gB(gB({},A),{},{isLoading:!0})});try{var o=yield mv2Interface.loadCloudScratchFile(t);if(!o)throw new Error("Couldn't find project with id: "+t);var n=yield(yield fetch(o)).arrayBuffer();i.loadProject(n),alert("Loaded Project"),window.setTimeout(function(){return e.props.onActivateBlocksTab()})}catch(A){alert("Failed to load project: ".concat(A.message))}this.setState(function(A){return gB(gB({},A),{},{isLoading:!1})})});return function(e){return A.apply(this,arguments)}}()},{key:"fallbackCopyTextToClipboard",value:function(A){var e=this,i=document.createElement("textarea");i.value=A,i.style.top="0",i.style.left="0",i.style.position="fixed",document.body.appendChild(i),i.focus(),i.select();try{var t=document.execCommand("copy")?"successful":"unsuccessful";setTimeout(function(){e.setState({copyToCPText:"Copy to Clipboard"})},3e3),this.setState({copyToCPText:"Copied!"}),console.log("Fallback: Copying text command was "+t)}catch(A){console.error("Fallback: Oops, unable to copy",A)}document.body.removeChild(i)}},{key:"copyTextToClipboard",value:function(A){var e=this;navigator.clipboard?navigator.clipboard.writeText(A).then(function(){setTimeout(function(){e.setState({copyToCPText:"Copy to Clipboard"})},3e3),e.setState({copyToCPText:"Copied!"}),console.log("Async: Copying to clipboard was successful!")},function(A){console.error("Async: Could not copy text: ",A)}):this.fallbackCopyTextToClipboard(A)}},{key:"validURL",value:function(A){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(A)}},{key:"render",value:function(){var A=this,e=this.state,i=e.loadFileName,t=e.isValidFileName;return a.a.createElement("div",{className:oB.a.mainContent},a.a.createElement("div",{className:oB.a.block},a.a.createElement("div",{className:oB.a.loadProjectContainer},a.a.createElement("div",{className:oB.a.loadProjectTitle},"Load a Cloud save:"),a.a.createElement(Jn,{style:{flex:1,marginLeft:10},type:"text",placeholder:"Type the name of the cloud save file you would like to load here...",value:i,onChange:function(e){return A.setloadFileName(e.currentTarget.value)}}),a.a.createElement(xu.a,{style:{marginLeft:10,marginRight:5,opacity:t?1:.2},className:oB.a.button,disabled:!t,onClick:function(){return A.loadFile(i)}},"Load")),a.a.createElement("div",{className:oB.a.loadProjectContainer,style:{marginTop:"1rem"}},a.a.createElement("div",{className:oB.a.loadProjectTitle},"Create a new Cloud Save file:"),a.a.createElement(xu.a,{style:{marginLeft:10,marginRight:5,opacity:this.state.isLoading?.2:1},disabled:this.state.isLoading,className:oB.a.button,onClick:function(){return A.saveFile()}},"Save"),a.a.createElement(Jn,{style:{flex:1,marginLeft:10},type:"text",placeholder:"Your autogenerated Save File Code is:",value:this.state.savedProjectId,editable:"false"}),a.a.createElement(xu.a,{iconSrc:aB.a,style:{marginLeft:10,marginRight:5,opacity:this.state.savedProjectId?1:.2},className:oB.a.button,disabled:!this.state.savedProjectId,onClick:function(){return A.copyTextToClipboard(A.state.savedProjectId)}},this.state.copyToCPText))),this.state.isLoading&&a.a.createElement("div",{className:oB.a.ldsSpinner},a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null)),a.a.createElement("div",{className:[oB.a.block,oB.a["block-100"]].join(" "),style:{marginTop:"2rem"}},a.a.createElement("div",{className:oB.a.tipsContainer},a.a.createElement("div",{className:oB.a.tipsTitle},"Tips for Cloud Saving:"),a.a.createElement("ul",{className:oB.a.tipsList},a.a.createElement("li",null,"Make sure to write down or record the auto-generated code that is provided each time you save a new file. You will need this to load it in the future."),a.a.createElement("li",null,"Although the Marty the Robot app will continue to auto-save files to the local space storage, there is no auto-save function for cloud save files. Please manually re-save your file each time, if you wish them to be available for download over cloud storage."),a.a.createElement("li",null,"Each time you re-save a file to cloud storage, you will be provided with a NEW SAVE FILE CODE. Please take a note of this.")))))}}]),i}();wB.propTypes={onActivateBlocksTab:o.a.func,saveProjectSb3:o.a.func,editingTarget:o.a.string,locale:o.a.string.isRequired,onProjectTelemetryEvent:o.a.func,projectTitle:o.a.string,vm:o.a.instanceOf(u.a).isRequired,onConfirmNewProject:o.a.func};var mB=Object(d.a)("Save / Load")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,locale:A.locales.locale,saveProjectSb3:A.scratchGui.vm.saveProjectSb3.bind(A.scratchGui.vm)}},function(A){return{onActivateBlocksTab:function(){return A(Object(h.e)(h.a))},onConfirmNewProject:function(){return A(Object(E.C)(!1))}}})(wB))),pB=i(98),IB=i.n(pB);function fB(A){"@babel/helpers - typeof";return(fB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function QB(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function DB(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?QB(Object(i),!0).forEach(function(e){MB(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):QB(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function MB(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function bB(A,e,i,t,o,n,a){try{var r=A[n](a),s=r.value}catch(A){return void i(A)}r.done?e(s):Promise.resolve(s).then(t,o)}function yB(A){return function(){var e=this,i=arguments;return new Promise(function(t,o){var n=A.apply(e,i);function a(A){bB(n,t,o,a,r,"next",A)}function r(A){bB(n,t,o,a,r,"throw",A)}a(void 0)})}}function TB(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function kB(A,e){return(kB=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function FB(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=SB(A);if(e){var o=SB(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===fB(e)||"function"==typeof e))return e;return vB(A)}(this,i)}}function vB(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function SB(A){return(SB=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var NB=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&kB(A,e)}(i,a.a.Component);var e=FB(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={isLoading:!1},t.saveFile=t.saveFile.bind(vB(t)),t.loadFile=t.loadFile.bind(vB(t)),t}return function(A,e,i){e&&TB(A.prototype,e),i&&TB(A,i)}(i,[{key:"saveFile",value:function(){var A=yB(function*(){this.setState(function(A){return DB(DB({},A),{},{isLoading:!0})});var A=yield this.props.saveProjectSb3(),e=yield te(A);try{var i="sb-".concat(function(){for(var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=i.length,o=0;o<A;o++)e+=i.charAt(Math.floor(Math.random()*t));return e}(5),".sb3");yield mv2Interface.saveScratchFileOnDevice(i,e),mv2Interface.send_REST("notification/info-message/File ".concat(i," Saved!"))}catch(A){mv2Interface.send_REST("notification/error-message/Couldn't save file."),console.log("Couldn't save file",A)}this.setState(function(A){return DB(DB({},A),{},{isLoading:!1})})});return function(){return A.apply(this,arguments)}}()},{key:"loadFile",value:function(){var A=yB(function*(A){var e=this,i=this.props.vm;if(!i.editingTarget)return null;this.setState(function(A){return DB(DB({},A),{},{isLoading:!0})});try{var t,o=A.target.value,n=A.target.files[0];if(!o)throw new Error("Couldn't find project with id: "+o);if(!!window.ReactNativeWebView){var a=yield n.text();t=yield(yield fetch(a)).arrayBuffer()}else t=yield n.arrayBuffer();i.loadProject(t),mv2Interface.send_REST("notification/info-message/Project loaded!"),window.setTimeout(function(){return e.props.onActivateBlocksTab()})}catch(A){mv2Interface.send_REST("notification/error-message/Failed to load project: ".concat(A.message))}this.setState(function(A){return DB(DB({},A),{},{isLoading:!1})})});return function(e){return A.apply(this,arguments)}}()},{key:"render",value:function(){var A=this;return a.a.createElement("div",{className:IB.a.mainContent},a.a.createElement("div",{className:IB.a.block},a.a.createElement("div",{className:IB.a.saveProjectContainer},a.a.createElement("div",{className:IB.a.button,onClick:function(){return A.saveFile()}},a.a.createElement("p",{className:IB.a.buttonTitle},"Save to file"))),a.a.createElement("div",{className:IB.a.loadProjectContainer},a.a.createElement("div",{className:IB.a.button},a.a.createElement("input",{type:"file",id:"file-upload",name:"file-upload",className:IB.a.loadInput,onChange:this.loadFile}),a.a.createElement("label",{htmlFor:"file-upload",className:IB.a.buttonTitle},"Load from file")))),this.state.isLoading&&a.a.createElement("div",{className:IB.a.ldsSpinner},a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null)))}}]),i}();NB.propTypes={onActivateBlocksTab:o.a.func,saveProjectSb3:o.a.func,editingTarget:o.a.string,locale:o.a.string.isRequired,onProjectTelemetryEvent:o.a.func,projectTitle:o.a.string,vm:o.a.instanceOf(u.a).isRequired,onConfirmNewProject:o.a.func};var RB=Object(d.a)("Save / Load")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,locale:A.locales.locale,saveProjectSb3:A.scratchGui.vm.saveProjectSb3.bind(A.scratchGui.vm)}},function(A){return{onActivateBlocksTab:function(){return A(Object(h.e)(h.a))},onConfirmNewProject:function(){return A(Object(E.C)(!1))}}})(NB)));function OB(A){"@babel/helpers - typeof";return(OB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function YB(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function UB(A,e){return(UB=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function GB(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=HB(A);if(e){var o=HB(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===OB(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function HB(A){return(HB=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var LB=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&UB(A,e)}(i,a.a.Component);var e=GB(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={currentTab:"local-storage"},t}return function(A,e,i){e&&YB(A.prototype,e),i&&YB(A,i)}(i,[{key:"render",value:function(){var A,e=this,i=this.state.currentTab;return"local-storage"===i?A=a.a.createElement(iB,this.props):"cloud-storage"===i?A=a.a.createElement(mB,this.props):"portable-file-storage"===i&&(A=a.a.createElement(RB,this.props)),a.a.createElement("div",{className:Pu.a.mainContainer},a.a.createElement("div",{className:Pu.a.header},a.a.createElement("div",{className:"local-storage"===this.state.currentTab?[Pu.a.button,Pu.a.buttonSelected].join(" "):Pu.a.button,onClick:function(){return e.setState({currentTab:"local-storage"})}},a.a.createElement("p",{className:Pu.a.buttonTitle},"In the App"),a.a.createElement("p",{className:Pu.a.buttonSubtitle},"Local Storage")),a.a.createElement("div",{className:"cloud-storage"===this.state.currentTab?[Pu.a.button,Pu.a.buttonSelected].join(" "):Pu.a.button,onClick:function(){return e.setState({currentTab:"cloud-storage"})}},a.a.createElement("p",{className:Pu.a.buttonTitle},"In the Cloud"),a.a.createElement("p",{className:Pu.a.buttonSubtitle},"Cloud Storage")),a.a.createElement("div",{className:"portable-file-storage"===this.state.currentTab?[Pu.a.button,Pu.a.buttonSelected].join(" "):Pu.a.button,onClick:function(){return e.setState({currentTab:"portable-file-storage"})}},a.a.createElement("p",{className:Pu.a.buttonTitle},"Portable"),a.a.createElement("p",{className:Pu.a.buttonSubtitle},"File Storage"))),a.a.createElement("div",{className:Pu.a.content},A))}}]),i}();LB.propTypes={onActivateBlocksTab:o.a.func,saveProjectSb3:o.a.func,editingTarget:o.a.string,locale:o.a.string.isRequired,onProjectTelemetryEvent:o.a.func,projectTitle:o.a.string,vm:o.a.instanceOf(u.a).isRequired,onConfirmNewProject:o.a.func};var PB=Object(d.a)("Save / Load")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,locale:A.locales.locale,saveProjectSb3:A.scratchGui.vm.saveProjectSb3.bind(A.scratchGui.vm)}},function(A){return{onActivateBlocksTab:function(){return A(Object(h.e)(h.a))},onConfirmNewProject:function(){return A(Object(E.C)(!1))}}})(LB))),xB=function(A){return a.a.createElement(PB,A)},_B=i(117),jB=i(60),JB=i(139),zB=12,KB=44,WB=function(A,e){var i={heightDefault:Pa.e.standardStageHeight,widthDefault:Pa.e.standardStageWidth,height:0,width:0,scale:0};return e?(i.height=window.innerHeight-KB-zB,i.width=i.height+i.height/3,i.width>window.innerWidth&&(i.width=window.innerWidth,i.height=.75*i.width),i.scale=i.width/i.widthDefault):(i.scale=Pa.b[A],i.height=i.scale*i.heightDefault,i.width=i.scale*i.widthDefault),i.height=Math.round(i.height),i.width=Math.round(i.width),i},VB=function(A){var e=A.width,i=A.height,t=e/A.widthDefault,o=i/A.heightDefault;if(1!==t||1!==o)return{transform:"scale(".concat(t,",").concat(o,")")}},XB=i(809),ZB=i.n(XB),qB=i(810),$B=i.n(qB),Ad=i(285),ed=i.n(Ad),id=i(89),td=i.n(id),od=Object(B.d)({largeStageSizeMessage:{id:"gui.stageHeader.stageSizeLarge",defaultMessage:"Switch to large stage"},smallStageSizeMessage:{id:"gui.stageHeader.stageSizeSmall",defaultMessage:"Switch to small stage"},fullStageSizeMessage:{id:"gui.stageHeader.stageSizeFull",defaultMessage:"Enter full screen mode"},unFullStageSizeMessage:{id:"gui.stageHeader.stageSizeUnFull",defaultMessage:"Exit full screen mode"},fullscreenControl:{id:"gui.stageHeader.fullscreenControl",defaultMessage:"Full Screen Control"}}),nd=function(A){var e=A.isFullScreen,i=A.isPlayerOnly,t=A.onKeyPress,o=A.onSetStageFull,n=A.onSetStageUnFull,r=A.showBranding,s=A.vm,g=null;if(e){var l=WB(null,!0),c=r?a.a.createElement("div",{className:td.a.embedScratchLogo},a.a.createElement("a",{href:"https://scratch.mit.edu",rel:"noopener noreferrer",target:"_blank"},a.a.createElement("img",{alt:"Scratch",src:ed.a}))):a.a.createElement(xu.a,{className:td.a.stageButton,onClick:n,onKeyPress:t},a.a.createElement("img",{alt:A.intl.formatMessage(od.unFullStageSizeMessage),className:td.a.stageButtonIcon,draggable:!1,src:$B.a,title:A.intl.formatMessage(od.fullscreenControl)}));g=a.a.createElement(hi.a,{className:td.a.stageHeaderWrapperOverlay},a.a.createElement(hi.a,{className:td.a.stageMenuWrapper,style:{width:l.width}},a.a.createElement(JB.a,{vm:s}),c))}else{var u=i?[]:a.a.createElement("div",{className:td.a.stageSizeToggleGroup});g=a.a.createElement(hi.a,{className:td.a.stageHeaderWrapper},a.a.createElement(hi.a,{className:td.a.stageMenuWrapper},a.a.createElement("div",{className:td.a.stageSizeRow},u,a.a.createElement("div",null,a.a.createElement(xu.a,{className:td.a.stageButton,onClick:o},a.a.createElement("img",{alt:A.intl.formatMessage(od.fullStageSizeMessage),className:td.a.stageButtonIcon,draggable:!1,src:ZB.a,title:A.intl.formatMessage(od.fullscreenControl)}))))))}return g};nd.propTypes={intl:B.f,isFullScreen:o.a.bool.isRequired,isPlayerOnly:o.a.bool.isRequired,onKeyPress:o.a.func.isRequired,onSetStageFull:o.a.func.isRequired,onSetStageLarge:o.a.func.isRequired,onSetStageSmall:o.a.func.isRequired,onSetStageUnFull:o.a.func.isRequired,showBranding:o.a.bool.isRequired,stageSizeMode:o.a.oneOf(Object.keys(Pa.d)),vm:o.a.instanceOf(u.a).isRequired},nd.defaultProps={stageSizeMode:Pa.d.large};var ad=Object(B.e)(Object(s.b)(function(A){return{stageSizeMode:A.scratchGui.stageSize.stageSize}})(nd));function rd(A){"@babel/helpers - typeof";return(rd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function sd(){return(sd=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function gd(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function ld(A,e){return(ld=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function cd(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Bd(A);if(e){var o=Bd(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===rd(e)||"function"==typeof e))return e;return ud(A)}(this,i)}}function ud(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Bd(A){return(Bd=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var dd=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&ld(A,e)}(i,a.a.Component);var e=cd(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(ud(t),["handleKeyPress"]),t}return function(A,e,i){e&&gd(A.prototype,e),i&&gd(A,i)}(i,[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyPress)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyPress)}},{key:"handleKeyPress",value:function(A){"Escape"===A.key&&this.props.isFullScreen&&this.props.onSetStageUnFull(!1)}},{key:"render",value:function(){var A=sd({},this.props);return a.a.createElement(ad,sd({},A,{onKeyPress:this.handleKeyPress}))}}]),i}();dd.propTypes={isFullScreen:o.a.bool,isPlayerOnly:o.a.bool,onSetStageUnFull:o.a.func.isRequired,showBranding:o.a.bool,stageSizeMode:o.a.oneOf(Object.keys(Pa.d)),vm:o.a.instanceOf(u.a).isRequired};var Ed=Object(s.b)(function(A){return{stageSizeMode:A.scratchGui.stageSize.stageSize,showBranding:A.scratchGui.mode.showBranding,isFullScreen:A.scratchGui.mode.isFullScreen,isPlayerOnly:A.scratchGui.mode.isPlayerOnly}},function(A){return{onSetStageLarge:function(){return A(Object(_B.b)(Pa.d.large))},onSetStageSmall:function(){return A(Object(_B.b)(Pa.d.small))},onSetStageFull:function(){return A(Object(jB.c)(!0))},onSetStageUnFull:function(){return A(Object(jB.c)(!1))}}})(dd),hd=[];function Cd(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var i=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null==i)return;var t,o,n=[],a=!0,r=!1;try{for(i=i.call(A);!(a=(t=i.next()).done)&&(n.push(t.value),!e||n.length!==e);a=!0);}catch(A){r=!0,o=A}finally{try{a||null==i.return||i.return()}finally{if(r)throw o}}return n}(A,e)||function(A,e){if(!A)return;if("string"==typeof A)return wd(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return wd(A,e)}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wd(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function md(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var pd=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.mirror=!0,this._frameCacheTimeout=16,this._video=null,this._track=null,this._workspace=[]}return function(A,e,i){e&&md(A.prototype,e),i&&md(A,i)}(A,[{key:"video",get:function(){return this._video}},{key:"enableVideo",value:function(){return this.enabled=!0,this._setupVideo()}},{key:"disableVideo",value:function(){var A=this;this.enabled=!1,this._singleSetup&&this._singleSetup.then(this._teardown.bind(this)).catch(function(e){return A.onError(e)})}},{key:"_teardown",value:function(){if(!1===this.enabled){var A=(hd.pop(),!(hd.length>0));this._singleSetup=null,this._video=null,this._track&&A&&this._track.stop(),this._track=null}}},{key:"getFrame",value:function(e){var i=e.dimensions,t=void 0===i?A.DIMENSIONS:i,o=e.mirror,n=void 0===o?this.mirror:o,a=e.format,r=void 0===a?A.FORMAT_IMAGE_DATA:a,s=e.cacheTimeout,g=void 0===s?this._frameCacheTimeout:s;if(!this.videoReady)return null;var l=Cd(t,2),c=l[0],u=l[1],B=this._getWorkspace({dimensions:t,mirror:Boolean(n)}),d=this._video,E=d.videoWidth,h=d.videoHeight,C=B.canvas,w=B.context,m=B.lastUpdate,p=B.cacheData,I=Date.now();m+g<I&&(n&&(w.scale(-1,1),w.translate(-1*c,0)),w.drawImage(this._video,0,0,E,h,0,0,c,u),w.setTransform(1,0,0,1,0,0),B.lastUpdate=I),p[r]||(p[r]={lastUpdate:0});var f=p[r];return f.lastUpdate+g<I&&(r===A.FORMAT_IMAGE_DATA?f.lastData=w.getImageData(0,0,c,u):r===A.FORMAT_CANVAS?(f.lastUpdate=1/0,f.lastData=C):(L.a.error("video io error - unimplemented format ".concat(r)),f.lastUpdate=1/0,f.lastData=null),f.lastUpdate=Math.max(B.lastUpdate,f.lastUpdate)),f.lastData}},{key:"onError",value:function(A){L.a.error("Unhandled video io device error",A)}},{key:"_setupVideo",value:function(){var A=this;return this._singleSetup?this._singleSetup:(this._singleSetup=function(A){var e;return 0===hd.length?(e=Mg()({audio:!1,video:A}),hd.push(e)):hd.length>0&&(e=hd[0],hd.push(!0)),e}({width:{min:480,ideal:640},height:{min:360,ideal:480}}).then(function(e){A._video=document.createElement("video");try{A._video.srcObject=e}catch(i){A._video.src=window.URL.createObjectURL(e)}return A._video.play(),A._track=e.getTracks()[0],A}).catch(function(e){A._singleSetup=null,A.onError(e)}),this._singleSetup)}},{key:"videoReady",get:function(){if(!this.enabled)return!1;if(!this._video)return!1;if(!this._track)return!1;var A=this._video,e=A.videoWidth,i=A.videoHeight;return"number"==typeof e&&"number"==typeof i&&(0!==e&&0!==i)}},{key:"_getWorkspace",value:function(A){var e=A.dimensions,i=A.mirror,t=this._workspace.find(function(A){return A.dimensions.join("-")===e.join("-")&&A.mirror===i});return t||((t={dimensions:e,mirror:i,canvas:document.createElement("canvas"),lastUpdate:0,cacheData:{}}).canvas.width=e[0],t.canvas.height=e[1],t.context=t.canvas.getContext("2d"),this._workspace.push(t)),t}}],[{key:"FORMAT_IMAGE_DATA",get:function(){return"image-data"}},{key:"FORMAT_CANVAS",get:function(){return"canvas"}},{key:"DIMENSIONS",get:function(){return[480,360]}},{key:"ORDER",get:function(){return 1}}]),A}(),Id=i(811),fd=i.n(Id),Qd=i(172),Dd=i.n(Qd);function Md(A){"@babel/helpers - typeof";return(Md="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function bd(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function yd(A,e){return(yd=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Td(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Fd(A);if(e){var o=Fd(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Md(e)||"function"==typeof e))return e;return kd(A)}(this,i)}}function kd(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Fd(A){return(Fd=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var vd=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&yd(A,e)}(i,a.a.Component);var e=Td(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).setContainer=t.setContainer.bind(kd(t)),t}return function(A,e,i){e&&bd(A.prototype,e),i&&bd(A,i)}(i,[{key:"componentDidMount",value:function(){this.container.appendChild(this.props.domElement)}},{key:"componentWillUnmount",value:function(){this.container.removeChild(this.props.domElement)}},{key:"setContainer",value:function(A){this.container=A}},{key:"render",value:function(){return Object.assign(this.props.domElement,m()(this.props,["domElement","children","style"])),this.props.style&&(this.props.domElement.style.cssText=fd.a.string(this.props.style)),a.a.createElement("div",{ref:this.setContainer})}}]),i}();vd.propTypes={domElement:o.a.instanceOf(Element).isRequired,style:Dd.a};var Sd=vd,Nd=i(812),Rd=i.n(Nd);function Od(A){"@babel/helpers - typeof";return(Od="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var Yd=["colorInfo"];function Ud(){return(Ud=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Gd(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Hd(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Ld(A,e){return(Ld=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Pd(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=_d(A);if(e){var o=_d(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Od(e)||"function"==typeof e))return e;return xd(A)}(this,i)}}function xd(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function _d(A){return(_d=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var jd=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Ld(A,e)}(i,a.a.Component);var e=Pd(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(xd(t),["setCanvas"]),t}return function(A,e,i){e&&Hd(A.prototype,e),i&&Hd(A,i)}(i,[{key:"componentDidUpdate",value:function(){this.draw()}},{key:"draw",value:function(){var A=this.canvas.getContext("2d"),e=this.props.colorInfo,i=e.color,t=e.data,o=e.width,n=e.height;this.canvas.width=3*o,this.canvas.height=3*n;var a=document.createElement("canvas");a.width=o,a.height=n;var r=a.getContext("2d"),s=r.createImageData(o,n);s.data.set(t),r.putImageData(s,0,0),A.save(),A.scale(3,3),A.drawImage(a,0,0,o,n),A.lineWidth=1/3,A.strokeStyle="black",A.fillStyle="rgba(".concat(i.r,", ").concat(i.g,", ").concat(i.b,", ").concat(i.a,")"),A.beginPath(),A.rect(o/2-1,n/2-1,2,2),A.fill(),A.stroke(),A.strokeStyle="rgba(".concat(i.r,", ").concat(i.g,", ").concat(i.b,", ").concat(i.a,")"),A.lineWidth=5,A.beginPath(),A.moveTo(o,n/2),A.arc(o/2,n/2,o/2,0,2*Math.PI),A.stroke(),A.restore()}},{key:"setCanvas",value:function(A){this.canvas=A}},{key:"render",value:function(){var A=this.props,e=A.colorInfo,i=Gd(A,Yd);return a.a.createElement(hi.a,Ud({},i,{className:Rd.a.colorPicker,componentRef:this.setCanvas,element:"canvas",height:e.height,style:{top:e.y-3*e.height/2,left:e.x-3*e.width/2,width:3*e.width,height:3*e.height},width:e.width}))}}]),i}();jd.propTypes={colorInfo:o.a.shape({color:o.a.shape({r:o.a.number,g:o.a.number,b:o.a.number,a:o.a.number}),data:o.a.instanceOf(Uint8Array),width:o.a.number,height:o.a.number,x:o.a.number,y:o.a.number})};var Jd=jd;function zd(A){"@babel/helpers - typeof";return(zd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Kd(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var i=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null==i)return;var t,o,n=[],a=!0,r=!1;try{for(i=i.call(A);!(a=(t=i.next()).done)&&(n.push(t.value),!e||n.length!==e);a=!0);}catch(A){r=!0,o=A}finally{try{a||null==i.return||i.return()}finally{if(r)throw o}}return n}(A,e)||function(A,e){if(!A)return;if("string"==typeof A)return Wd(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Wd(A,e)}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wd(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function Vd(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Xd(A,e){return(Xd=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Zd(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=$d(A);if(e){var o=$d(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===zd(e)||"function"==typeof e))return e;return qd(A)}(this,i)}}function qd(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function $d(A){return($d=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var AE=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Xd(A,e)}(i,a.a.Component);var e=Zd(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(qd(t),["getPageCoords"]),t}return function(A,e,i){e&&Vd(A.prototype,e),i&&Vd(A,i)}(i,[{key:"getPageCoords",value:function(A,e){var i=this.props,t=i.stageWidth,o=i.stageHeight,n=i.vm.renderer.getNativeSize();return[t/n[0]*A+t/2,-o/n[1]*e+o/2]}},{key:"render",value:function(){var A=this.props,e=A.className,i=A.highlightedTargetId,t=A.highlightedTargetTime,o=A.vm;if(!(i&&o&&o.renderer&&o.runtime.getTargetById(i)))return null;var n=o.runtime.getTargetById(i),r=o.renderer.getBounds(n.drawableID),s=Kd(this.getPageCoords(r.left,r.top),2),g=s[0],l=s[1],c=Kd(this.getPageCoords(r.right,r.bottom),2),u=c[0],B=c[1];return a.a.createElement("div",{className:e,key:t,style:{position:"absolute",top:"".concat(l-2,"px"),left:"".concat(g-2,"px"),width:"".concat(u-g+4,"px"),height:"".concat(B-l+4,"px")}})}}]),i}();AE.propTypes={className:o.a.string,highlightedTargetId:o.a.string,highlightedTargetTime:o.a.number,stageHeight:o.a.number,stageWidth:o.a.number,vm:o.a.instanceOf(u.a)};var eE=Object(s.b)(function(A){return{highlightedTargetTime:A.scratchGui.targets.highlightedTargetTime,highlightedTargetId:A.scratchGui.targets.highlightedTargetId,vm:A.scratchGui.vm}},function(){return{}})(AE),iE=i(284),tE=i.n(iE);function oE(A){"@babel/helpers - typeof";return(oE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function nE(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function aE(A,e){return(aE=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function rE(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=gE(A);if(e){var o=gE(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===oE(e)||"function"==typeof e))return e;return sE(A)}(this,i)}}function sE(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function gE(A){return(gE=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var lE=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&aE(A,e)}(i,a.a.Component);var e=rE(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(sE(t),["handleClick"]),t}return function(A,e,i){e&&nE(A.prototype,e),i&&nE(A,i)}(i,[{key:"handleClick",value:function(){this.props.vm.start(),this.props.vm.greenFlag()}},{key:"render",value:function(){return a.a.createElement(hi.a,{className:this.props.wrapperClass,onClick:this.handleClick},a.a.createElement("div",{className:this.props.className},a.a.createElement("img",{draggable:!1,src:tE.a})))}}]),i}();lE.propTypes={className:o.a.string,vm:o.a.instanceOf(u.a),wrapperClass:o.a.string};var cE=Object(s.b)(function(A){return{vm:A.scratchGui.vm}},function(){return{}})(lE),uE=i(184),BE=i.n(uE),dE=i(813),EE=i.n(dE),hE=function(A){var e=A.answer,i=A.className,t=A.question,o=A.onChange,n=A.onClick,r=A.onKeyPress;return a.a.createElement("div",{className:i},a.a.createElement("div",{className:BE.a.questionContainer},t?a.a.createElement("div",{className:BE.a.questionLabel},t):null,a.a.createElement("div",{className:BE.a.questionInput},a.a.createElement(Jn,{autoFocus:!0,value:e,onChange:o,onKeyPress:r}),a.a.createElement("button",{className:BE.a.questionSubmitButton,onClick:n},a.a.createElement("img",{className:BE.a.questionSubmitButtonIcon,draggable:!1,src:EE.a})))))};hE.propTypes={answer:o.a.string,className:o.a.string,onChange:o.a.func.isRequired,onClick:o.a.func.isRequired,onKeyPress:o.a.func.isRequired,question:o.a.string};var CE=hE;function wE(A){"@babel/helpers - typeof";return(wE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function mE(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function pE(A,e){return(pE=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function IE(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=QE(A);if(e){var o=QE(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===wE(e)||"function"==typeof e))return e;return fE(A)}(this,i)}}function fE(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function QE(A){return(QE=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var DE=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&pE(A,e)}(i,a.a.Component);var e=IE(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(fE(t),["handleChange","handleKeyPress","handleSubmit"]),t.state={answer:""},t}return function(A,e,i){e&&mE(A.prototype,e),i&&mE(A,i)}(i,[{key:"handleChange",value:function(A){this.setState({answer:A.target.value})}},{key:"handleKeyPress",value:function(A){"Enter"===A.key&&this.handleSubmit()}},{key:"handleSubmit",value:function(){this.props.onQuestionAnswered(this.state.answer)}},{key:"render",value:function(){return a.a.createElement(CE,{answer:this.state.answer,question:this.props.question,onChange:this.handleChange,onClick:this.handleSubmit,onKeyPress:this.handleKeyPress})}}]),i}();DE.propTypes={onQuestionAnswered:o.a.func.isRequired,question:o.a.string};var ME=DE,bE=i(814),yE=i.n(bE),TE=i(815),kE=i.n(TE),FE=function(A){return a.a.createElement("div",{className:A.className,style:VB(A.stageSize)},a.a.createElement("img",{className:yE.a.micImg,src:kE.a}))};FE.propTypes={className:o.a.string,stageSize:o.a.shape({width:o.a.number,height:o.a.number,widthDefault:o.a.number,heightDefault:o.a.number}).isRequired};var vE=FE,SE=i(67),NE=i.n(SE),RE=["canvas","dragRef","isColorPicking","isFullScreen","isStarted","colorInfo","micIndicator","question","stageSize","onDeactivateColorPicker","onDoubleClick","onQuestionAnswered"];function OE(){return(OE=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function YE(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function UE(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var GE=function(A){var e,i=A.canvas,t=A.dragRef,o=A.isColorPicking,n=A.isFullScreen,r=A.isStarted,s=A.colorInfo,g=A.micIndicator,l=A.question,c=A.stageSize,u=A.onDeactivateColorPicker,B=A.onDoubleClick,d=A.onQuestionAnswered,E=UE(A,RE),h=WB(c,n);return a.a.createElement("div",null,a.a.createElement(hi.a,{className:Le()((e={},YE(e,NE.a.stageWrapper,!n),YE(e,NE.a.stageWrapperOverlay,n),YE(e,NE.a.withColorPicker,!n&&o),e)),style:{minHeight:h.height,minWidth:h.width},onDoubleClick:B},a.a.createElement(hi.a,{className:Le()(NE.a.stage,YE({},NE.a.stageOverlayContent,n)),style:{height:h.height,width:h.width}},a.a.createElement(Sd,OE({domElement:i,style:{height:h.height,width:h.width}},E))),a.a.createElement(hi.a,{className:NE.a.frameWrapper},a.a.createElement(eE,{className:NE.a.frame,stageHeight:h.height,stageWidth:h.width})),r?null:a.a.createElement(cE,{className:NE.a.greenFlagOverlay,wrapperClass:NE.a.greenFlagOverlayWrapper}),o&&s?a.a.createElement(hi.a,{className:NE.a.colorPickerWrapper},a.a.createElement(Jd,{colorInfo:s})):null,a.a.createElement("div",{className:NE.a.stageBottomWrapper,style:{width:h.width,height:h.height,left:"50%",marginLeft:-.5*h.width}},g?a.a.createElement(vE,{className:NE.a.micIndicator,stageSize:h}):null,null===l?null:a.a.createElement("div",{className:NE.a.questionWrapper,style:{width:h.width}},a.a.createElement(ME,{question:l,onQuestionAnswered:d}))),a.a.createElement("canvas",{className:NE.a.draggingSprite,height:0,ref:t,width:0})),o?a.a.createElement(hi.a,{className:NE.a.colorPickerBackground,onClick:u}):null)};GE.propTypes={canvas:o.a.instanceOf(Element).isRequired,colorInfo:Jd.propTypes.colorInfo,dragRef:o.a.func,isColorPicking:o.a.bool,isFullScreen:o.a.bool.isRequired,isStarted:o.a.bool,micIndicator:o.a.bool,onDeactivateColorPicker:o.a.func,onDoubleClick:o.a.func,onQuestionAnswered:o.a.func,question:o.a.string,stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,useEditorDragStyle:o.a.bool},GE.defaultProps={dragRef:function(){}};var HE=GE,LE=i(140);function PE(A){"@babel/helpers - typeof";return(PE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var xE=["vm","onActivateColorPicker"];function _E(){return(_E=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function jE(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function JE(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var i=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null==i)return;var t,o,n=[],a=!0,r=!1;try{for(i=i.call(A);!(a=(t=i.next()).done)&&(n.push(t.value),!e||n.length!==e);a=!0);}catch(A){r=!0,o=A}finally{try{a||null==i.return||i.return()}finally{if(r)throw o}}return n}(A,e)||KE(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zE(A){return function(A){if(Array.isArray(A))return WE(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||KE(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function KE(A,e){if(A){if("string"==typeof A)return WE(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);return"Object"===i&&A.constructor&&(i=A.constructor.name),"Map"===i||"Set"===i?Array.from(A):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?WE(A,e):void 0}}function WE(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function VE(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function XE(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function ZE(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function qE(A,e){return(qE=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function $E(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=eh(A);if(e){var o=eh(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===PE(e)||"function"==typeof e))return e;return Ah(A)}(this,i)}}function Ah(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function eh(A){return(eh=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ih=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&qE(A,e)}(i,a.a.Component);var e=$E(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Ah(t),["attachMouseEvents","cancelMouseDownTimeout","detachMouseEvents","handleDoubleClick","handleQuestionAnswered","onMouseUp","onMouseMove","onMouseDown","onStartDrag","onStopDrag","onWheel","updateRect","questionListener","setDragCanvas","clearDragCanvas","drawDragCanvas","positionDragCanvas"]),t.state={mouseDownTimeoutId:null,mouseDownPosition:null,isDragging:!1,dragOffset:null,dragId:null,colorInfo:null,question:null},t.props.vm.renderer?(t.renderer=t.props.vm.renderer,t.canvas=t.renderer.canvas):(t.canvas=document.createElement("canvas"),t.renderer=new di.a(t.canvas),t.props.vm.attachRenderer(t.renderer),t.props.vm.setVideoProvider(new pd),t.props.vm.renderer.draw()),t.props.vm.attachV2BitmapAdapter(new mi.BitmapAdapter),t}return function(A,e,i){e&&ZE(A.prototype,e),i&&ZE(A,i)}(i,[{key:"componentDidMount",value:function(){this.attachRectEvents(),this.attachMouseEvents(this.canvas),this.updateRect(),this.props.vm.runtime.addListener("QUESTION",this.questionListener)}},{key:"shouldComponentUpdate",value:function(A,e){return this.props.stageSize!==A.stageSize||this.props.isColorPicking!==A.isColorPicking||this.state.colorInfo!==e.colorInfo||this.props.isFullScreen!==A.isFullScreen||this.state.question!==e.question||this.props.micIndicator!==A.micIndicator||this.props.isStarted!==A.isStarted}},{key:"componentDidUpdate",value:function(A){this.props.isColorPicking&&!A.isColorPicking?this.startColorPickingLoop():!this.props.isColorPicking&&A.isColorPicking&&this.stopColorPickingLoop(),this.updateRect(),this.renderer.resize(this.rect.width,this.rect.height)}},{key:"componentWillUnmount",value:function(){this.detachMouseEvents(this.canvas),this.detachRectEvents(),this.stopColorPickingLoop(),this.props.vm.runtime.removeListener("QUESTION",this.questionListener)}},{key:"questionListener",value:function(A){this.setState({question:A})}},{key:"handleQuestionAnswered",value:function(A){var e=this;this.setState({question:null},function(){e.props.vm.runtime.emit("ANSWER",A)})}},{key:"startColorPickingLoop",value:function(){var A=this;this.intervalId=setInterval(function(){"number"==typeof A.pickX&&A.setState({colorInfo:A.getColorInfo(A.pickX,A.pickY)})},30)}},{key:"stopColorPickingLoop",value:function(){clearInterval(this.intervalId)}},{key:"attachMouseEvents",value:function(A){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("touchmove",this.onMouseMove),document.addEventListener("touchend",this.onMouseUp),A.addEventListener("mousedown",this.onMouseDown),A.addEventListener("touchstart",this.onMouseDown),A.addEventListener("wheel",this.onWheel)}},{key:"detachMouseEvents",value:function(A){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("touchmove",this.onMouseMove),document.removeEventListener("touchend",this.onMouseUp),A.removeEventListener("mousedown",this.onMouseDown),A.removeEventListener("touchstart",this.onMouseDown),A.removeEventListener("wheel",this.onWheel)}},{key:"attachRectEvents",value:function(){window.addEventListener("resize",this.updateRect),window.addEventListener("scroll",this.updateRect)}},{key:"detachRectEvents",value:function(){window.removeEventListener("resize",this.updateRect),window.removeEventListener("scroll",this.updateRect)}},{key:"updateRect",value:function(){this.rect=this.canvas.getBoundingClientRect()}},{key:"getScratchCoords",value:function(A,e){var i=this.renderer.getNativeSize();return[i[0]/this.rect.width*(A-this.rect.width/2),i[1]/this.rect.height*(e-this.rect.height/2)]}},{key:"getColorInfo",value:function(A,e){return function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?VE(Object(i),!0).forEach(function(e){XE(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):VE(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({x:A,y:e},this.renderer.extractColor(A,e,20))}},{key:"handleDoubleClick",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=[i-this.rect.left,t-this.rect.top],n=this.renderer.pick(o[0],o[1]);if(null!==n){var a=this.props.vm.getTargetIdForDrawableId(n);null!==a&&this.props.vm.setEditingTarget(a)}}},{key:"onMouseMove",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=[i-this.rect.left,t-this.rect.top];(this.props.isColorPicking&&(this.pickX=o[0],this.pickY=o[1]),this.state.mouseDown&&!this.state.isDragging)&&(Math.sqrt(Math.pow(o[0]-this.state.mouseDownPosition[0],2)+Math.pow(o[1]-this.state.mouseDownPosition[1],2))>3&&(this.cancelMouseDownTimeout(),this.onStartDrag.apply(this,zE(this.state.mouseDownPosition))));if(this.state.mouseDown&&this.state.isDragging)if(this.props.useEditorDragStyle)this.positionDragCanvas(o[0],o[1]);else{var n=this.getScratchCoords(o[0],o[1]);this.props.vm.postSpriteInfo({x:n[0]+this.state.dragOffset[0],y:-(n[1]+this.state.dragOffset[1]),force:!0})}var a={x:o[0],y:o[1],canvasWidth:this.rect.width,canvasHeight:this.rect.height};this.props.vm.postIOData("mouse",a)}},{key:"onMouseUp",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=[i-this.rect.left,t-this.rect.top];this.cancelMouseDownTimeout(),this.setState({mouseDown:!1,mouseDownPosition:null});var n={isDown:!1,x:i-this.rect.left,y:t-this.rect.top,canvasWidth:this.rect.width,canvasHeight:this.rect.height,wasDragged:this.state.isDragging};if(this.state.isDragging&&this.onStopDrag(o[0],o[1]),this.props.vm.postIOData("mouse",n),this.props.isColorPicking&&o[0]>0&&o[0]<this.rect.width&&o[1]>0&&o[1]<this.rect.height){var a=this.state.colorInfo.color,r=a.r,s=a.g,g=a.b,l=function(A){var e=A.toString(16);return 1===e.length?"0".concat(e):e},c="#".concat(l(r)).concat(l(s)).concat(l(g));this.props.onDeactivateColorPicker(c),this.setState({colorInfo:null}),this.pickX=null,this.pickY=null}}},{key:"onMouseDown",value:function(A){this.updateRect();var e=Ii(A),i=e.x,t=e.y,o=[i-this.rect.left,t-this.rect.top];if(this.props.isColorPicking)this.pickX=o[0],this.pickY=o[1],this.setState({colorInfo:this.getColorInfo(this.pickX,this.pickY)});else{(0===A.button||window.TouchEvent&&A instanceof TouchEvent)&&this.setState({mouseDown:!0,mouseDownPosition:o,mouseDownTimeoutId:setTimeout(this.onStartDrag.bind(this,o[0],o[1]),400)});var n={isDown:!0,x:o[0],y:o[1],canvasWidth:this.rect.width,canvasHeight:this.rect.height};this.props.vm.postIOData("mouse",n),A.preventDefault&&(A.preventDefault(),document.activeElement&&document.activeElement.blur&&document.activeElement.blur())}}},{key:"onWheel",value:function(A){var e={deltaX:A.deltaX,deltaY:A.deltaY};this.props.vm.postIOData("mouseWheel",e)}},{key:"cancelMouseDownTimeout",value:function(){null!==this.state.mouseDownTimeoutId&&clearTimeout(this.state.mouseDownTimeoutId),this.setState({mouseDownTimeoutId:null})}},{key:"drawDragCanvas",value:function(A,e,i){var t=A.imageData,o=A.x,n=A.y,a=A.width,r=A.height;this.dragCanvas.width=t.width,this.dragCanvas.height=t.height,this.dragCanvas.style.width="".concat(a,"px"),this.dragCanvas.style.height="".concat(r,"px"),this.dragCanvas.getContext("2d").putImageData(t,0,0),this.dragCanvas.style.left="".concat(o-e,"px"),this.dragCanvas.style.top="".concat(n-i,"px"),this.dragCanvas.style.display="block"}},{key:"clearDragCanvas",value:function(){this.dragCanvas.width=this.dragCanvas.height=0,this.dragCanvas.style.display="none"}},{key:"positionDragCanvas",value:function(A,e){this.dragCanvas.style.transform="translate(".concat(A,"px, ").concat(e,"px)")}},{key:"onStartDrag",value:function(A,e){if(!this.state.dragId){var i=this.renderer.pick(A,e);if(null!==i){var t=this.props.vm.getTargetIdForDrawableId(i);if(null!==t){var o=this.props.vm.runtime.getTargetById(t);if(this.props.useEditorDragStyle||o.draggable){o.goToFront();var n=JE(this.getScratchCoords(A,e),2),a=n[0],r=n[1],s=o.x-a,g=-(o.y+r);if(this.props.vm.startDrag(t),this.setState({isDragging:!0,dragId:t,dragOffset:[s,g]}),this.props.useEditorDragStyle){var l=this.renderer.extractDrawableScreenSpace(i);this.drawDragCanvas(l,A,e),this.positionDragCanvas(A,e),this.props.vm.postSpriteInfo({visible:!1}),this.props.vm.renderer.draw()}}}}}}},{key:"onStopDrag",value:function(A,e){var i=this,t=this.state.dragId,o=function(){i.props.vm.stopDrag(t),i.setState({isDragging:!1,dragOffset:null,dragId:null})};if(this.props.useEditorDragStyle){var n={visible:!0};if(A>0&&A<this.rect.width&&e>0&&e<this.rect.height){var a=this.getScratchCoords(A,e);n.x=a[0]+this.state.dragOffset[0],n.y=-(a[1]+this.state.dragOffset[1]),n.force=!0}this.props.vm.postSpriteInfo(n),this.clearDragCanvas(),o(),this.props.vm.renderer.draw()}else o()}},{key:"setDragCanvas",value:function(A){this.dragCanvas=A}},{key:"render",value:function(){var A=this.props,e=(A.vm,A.onActivateColorPicker,jE(A,xE));return a.a.createElement(HE,_E({canvas:this.canvas,colorInfo:this.state.colorInfo,dragRef:this.setDragCanvas,question:this.state.question,onDoubleClick:this.handleDoubleClick,onQuestionAnswered:this.handleQuestionAnswered},e))}}]),i}();ih.propTypes={isColorPicking:o.a.bool,isFullScreen:o.a.bool.isRequired,isStarted:o.a.bool,micIndicator:o.a.bool,onActivateColorPicker:o.a.func,onDeactivateColorPicker:o.a.func,stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,useEditorDragStyle:o.a.bool,vm:o.a.instanceOf(u.a).isRequired},ih.defaultProps={useEditorDragStyle:!0};var th=Object(s.b)(function(A){return{isColorPicking:A.scratchGui.colorPicker.active,isFullScreen:A.scratchGui.mode.isFullScreen,isStarted:A.scratchGui.vmStatus.started,micIndicator:A.scratchGui.micIndicator,useEditorDragStyle:!(A.scratchGui.mode.isFullScreen||A.scratchGui.mode.isPlayerOnly)}},function(A){return{onActivateColorPicker:function(){return A(Object(LE.a)())},onDeactivateColorPicker:function(e){return A(Object(LE.c)(e))}}})(ih),oh=i(90),nh=i.n(oh),ah=i(816),rh=i.n(ah),sh=i(817),gh=i.n(sh),lh=i(818),ch=i.n(lh);function uh(A){"@babel/helpers - typeof";return(uh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Bh(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function dh(A,e){return(dh=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Eh(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=hh(A);if(e){var o=hh(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===uh(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function hh(A){return(hh=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ch=[{message:a.a.createElement(B.a,{defaultMessage:"Creating blocks …",id:"gui.loader.message1"}),weight:50},{message:a.a.createElement(B.a,{defaultMessage:"Loading sprites …",id:"gui.loader.message2"}),weight:50},{message:a.a.createElement(B.a,{defaultMessage:"Loading sounds …",id:"gui.loader.message3"}),weight:50},{message:a.a.createElement(B.a,{defaultMessage:"Loading extensions …",id:"gui.loader.message4"}),weight:50},{message:a.a.createElement(B.a,{defaultMessage:"Creating blocks …",id:"gui.loader.message1"}),weight:20},{message:a.a.createElement(B.a,{defaultMessage:"Herding cats …",id:"gui.loader.message5"}),weight:1},{message:a.a.createElement(B.a,{defaultMessage:"Transmitting nanos …",id:"gui.loader.message6"}),weight:1},{message:a.a.createElement(B.a,{defaultMessage:"Inflating gobos …",id:"gui.loader.message7"}),weight:1},{message:a.a.createElement(B.a,{defaultMessage:"Preparing emojis …",id:"gui.loader.message8"}),weight:1}],wh={"gui.loader.headline":a.a.createElement(B.a,{defaultMessage:"Loading Project",id:"gui.loader.headline"}),"gui.loader.creating":a.a.createElement(B.a,{defaultMessage:"Creating Project",id:"gui.loader.creating"})},mh=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&dh(A,e)}(i,a.a.Component);var e=Eh(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={messageNumber:t.chooseRandomMessage()},t}return function(A,e,i){e&&Bh(A.prototype,e),i&&Bh(A,i)}(i,[{key:"componentDidMount",value:function(){var A=this;this.intervalId=setInterval(function(){A.setState({messageNumber:A.chooseRandomMessage()})},5e3)}},{key:"componentWillUnmount",value:function(){clearInterval(this.intervalId)}},{key:"chooseRandomMessage",value:function(){for(var A,e=Ch.reduce(function(A,e){return A+e.weight},0)*Math.random(),i=0;i<Ch.length;i++)if((e-=Ch[i].weight)<=0){A=i;break}return A}},{key:"render",value:function(){return a.a.createElement("div",{className:Le()(nh.a.background,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},nh.a.fullscreen,this.props.isFullScreen))},a.a.createElement("div",{className:nh.a.container},a.a.createElement("div",{className:nh.a.blockAnimation},a.a.createElement("img",{className:nh.a.topBlock,src:rh.a}),a.a.createElement("img",{className:nh.a.middleBlock,src:gh.a}),a.a.createElement("img",{className:nh.a.bottomBlock,src:ch.a})),a.a.createElement("div",{className:nh.a.title},wh[this.props.messageId]),a.a.createElement("div",{className:nh.a.messageContainerOuter},a.a.createElement("div",{className:nh.a.messageContainerInner,style:{transform:"translate(0, -".concat(25*this.state.messageNumber,"px)")}},Ch.map(function(A,e){return a.a.createElement("div",{className:nh.a.message,key:e},A.message)})))))}}]),i}();mh.propTypes={isFullScreen:o.a.bool,messageId:o.a.string},mh.defaultProps={isFullScreen:!1,messageId:"gui.loader.headline"};var ph=mh,Ih=i(226),fh=i.n(Ih);var Qh=function(A){var e=A.isFullScreen,i=A.isRtl,t=A.isRendererSupported,o=A.loading,n=A.stageSize,r=A.vm;return a.a.createElement(hi.a,{className:Le()(fh.a.stageWrapper,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},fh.a.fullScreen,e)),dir:i?"rtl":"ltr"},a.a.createElement(hi.a,{className:fh.a.stageMenuWrapper},a.a.createElement(Ed,{stageSize:n,vm:r})),a.a.createElement(hi.a,{className:fh.a.stageCanvasWrapper},t?a.a.createElement(th,{stageSize:n,vm:r}):null),o?a.a.createElement(ph,{isFullScreen:e}):null)};Qh.propTypes={isFullScreen:o.a.bool,isRendererSupported:o.a.bool.isRequired,isRtl:o.a.bool.isRequired,loading:o.a.bool,stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,vm:o.a.instanceOf(u.a).isRequired};var Dh=Qh,Mh=function(A){return a.a.createElement(Dh,A)};Mh.propTypes={isRendererSupported:o.a.bool.isRequired,stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,vm:o.a.instanceOf(u.a).isRequired};var bh=Mh;function yh(A){"@babel/helpers - typeof";return(yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Th(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function kh(A,e){return(kh=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Fh(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Sh(A);if(e){var o=Sh(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===yh(e)||"function"==typeof e))return e;return vh(A)}(this,i)}}function vh(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Sh(A){return(Sh=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Nh=Object(B.d)({libraryTitle:{id:"gui.costumeLibrary.chooseACostume",defaultMessage:"Choose a Costume"}}),Rh=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&kh(A,e)}(i,a.a.PureComponent);var e=Fh(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(vh(t),["handleItemSelected"]),t}return function(A,e,i){e&&Th(A.prototype,e),i&&Th(A,i)}(i,[{key:"handleItemSelected",value:function(A){var e={name:A.name,rotationCenterX:A.rotationCenterX,rotationCenterY:A.rotationCenterY,bitmapResolution:A.bitmapResolution,skinId:null};this.props.vm.addCostumeFromLibrary(A.md5ext,e)}},{key:"render",value:function(){return a.a.createElement(Mn.a,{data:sn,id:"costumeLibrary",tags:Dn,title:this.props.intl.formatMessage(Nh.libraryTitle),onItemSelected:this.handleItemSelected,onRequestClose:this.props.onRequestClose})}}]),i}();Rh.propTypes={intl:B.f.isRequired,onRequestClose:o.a.func,vm:o.a.instanceOf(u.a).isRequired};var Oh=Object(B.e)(Rh),Yh=[{tag:"fantasy",intlLabel:Qn.fantasy},{tag:"music",intlLabel:Qn.music},{tag:"sports",intlLabel:Qn.sports},{tag:"outdoors",intlLabel:Qn.outdoors},{tag:"indoors",intlLabel:Qn.indoors},{tag:"space",intlLabel:Qn.space},{tag:"underwater",intlLabel:Qn.underwater},{tag:"patterns",intlLabel:Qn.patterns}];function Uh(A){"@babel/helpers - typeof";return(Uh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Gh(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Hh(A,e){return(Hh=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Lh(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=xh(A);if(e){var o=xh(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Uh(e)||"function"==typeof e))return e;return Ph(A)}(this,i)}}function Ph(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function xh(A){return(xh=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var _h=Object(B.d)({libraryTitle:{id:"gui.costumeLibrary.chooseABackdrop",defaultMessage:"Choose a Backdrop"}}),jh=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Hh(A,e)}(i,a.a.Component);var e=Lh(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Ph(t),["handleItemSelect"]),t}return function(A,e,i){e&&Gh(A.prototype,e),i&&Gh(A,i)}(i,[{key:"handleItemSelect",value:function(A){var e={name:A.name,rotationCenterX:A.rotationCenterX,rotationCenterY:A.rotationCenterY,bitmapResolution:A.bitmapResolution,skinId:null};this.props.vm.addBackdrop(A.md5ext,e)}},{key:"render",value:function(){return a.a.createElement(Mn.a,{data:gn,id:"backdropLibrary",tags:Yh,title:this.props.intl.formatMessage(_h.libraryTitle),onItemSelected:this.handleItemSelect,onRequestClose:this.props.onRequestClose})}}]),i}();jh.propTypes={intl:B.f.isRequired,onRequestClose:o.a.func,vm:o.a.instanceOf(u.a).isRequired};var Jh=Object(B.e)(jh),zh=i(819),Kh=i.n(zh),Wh=function(A){return a.a.createElement("img",{className:Kh.a.spriteImage,src:A.costumeURL})};Wh.propTypes={costumeURL:o.a.string};var Vh=Wh;function Xh(A){"@babel/helpers - typeof";return(Xh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Zh(){return(Zh=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function qh(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function $h(A,e){return($h=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function AC(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=iC(A);if(e){var o=iC(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Xh(e)||"function"==typeof e))return e;return eC(A)}(this,i)}}function eC(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function iC(A){return(iC=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var tC=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&$h(A,e)}(i,a.a.Component);var e=AC(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(eC(t),["getCostumeData"]),t}return function(A,e,i){e&&qh(A.prototype,e),i&&qh(A,i)}(i,[{key:"getCostumeData",value:function(){return this.props.asset?pi(this.props.asset):null}},{key:"render",value:function(){var A=m()(this.props,["asset","vm"]);return a.a.createElement(Vh,Zh({costumeURL:this.getCostumeData()},A))}}]),i}();tC.propTypes={asset:o.a.instanceOf(eA.a.Asset),vm:o.a.instanceOf(u.a).isRequired};var oC=Object(s.b)(function(A){var e,i=A.scratchGui.targets,t=i.editingTarget;t&&(i.stage.id===t?e=i.stage.costume.asset:i.sprites.hasOwnProperty(t)&&(e=i.sprites[t].costume.asset));return{vm:A.scratchGui.vm,asset:e}})(br("asset",500)(tC)),nC=i(94),aC=i(820),rC=i.n(aC),sC=["el","en","bg","ja","zh-cn","zh-tw","de","nl","cs","ru","es","fr"],gC=Object.keys(Nr.a).filter(function(A){return!sC.includes(A)}),lC=function(A){var e=A.currentLocale,i=A.label,t=A.onChange;return a.a.createElement("select",{"aria-label":i,className:rC.a.languageSelect,value:e,onChange:t},Object.keys(Nr.a).filter(function(A){return!gC.includes(A)}).map(function(A){return a.a.createElement("option",{key:A,value:A},Nr.a[A].name)}))};lC.propTypes={currentLocale:o.a.string,label:o.a.string,onChange:o.a.func};var cC=lC;function uC(A){"@babel/helpers - typeof";return(uC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var BC=["onChangeLanguage","messagesByLocale","children"];function dC(){return(dC=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function EC(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function hC(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function CC(A,e){return(CC=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function wC(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=pC(A);if(e){var o=pC(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===uC(e)||"function"==typeof e))return e;return mC(A)}(this,i)}}function mC(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function pC(A){return(pC=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var IC=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&CC(A,e)}(i,a.a.Component);var e=wC(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(mC(t),["handleChange"]),document.documentElement.lang=A.currentLocale,t}return function(A,e,i){e&&hC(A.prototype,e),i&&hC(A,i)}(i,[{key:"handleChange",value:function(A){var e=A.target.value;this.props.messagesByLocale[e]&&(this.props.onChangeLanguage(e),document.documentElement.lang=e)}},{key:"render",value:function(){var A=this.props,e=(A.onChangeLanguage,A.messagesByLocale,A.children),i=EC(A,BC);return a.a.createElement(cC,dC({onChange:this.handleChange},i),e)}}]),i}();IC.propTypes={children:o.a.node,currentLocale:o.a.string.isRequired,messagesByLocale:o.a.object,onChangeLanguage:o.a.func.isRequired};var fC=Object(s.b)(function(A){return{currentLocale:A.locales.locale,messagesByLocale:A.locales.messagesByLocale}},function(A){return{onChangeLanguage:function(e){A(Object(nC.d)(e)),A(Object(_.e)())}}})(IC),QC=i(821),DC=i.n(QC),MC=i(121),bC=i.n(MC),yC=i(822),TC=i.n(yC),kC=(i(83),i(133));Object(B.d)({mode:{id:"gui.menuBar.modeMenu",defaultMessage:"Mode"},normal:{id:"gui.menuBar.normalMode",defaultMessage:"Normal mode"},cat:{id:"gui.menuBar.caturdayMode",defaultMessage:"Caturday mode"},"90s":{id:"gui.menuBar.1990sMode",defaultMessage:"90s mode"},old:{id:"gui.menuBar.oldTimeyMode",defaultMessage:"Old timey mode"},prehistoric:{id:"gui.menuBar.prehistoricMode",defaultMessage:"Prehistoric mode"}}),nC.a,kC.default,ko.ScratchPaintReducer;function FC(A){"@babel/helpers - typeof";return(FC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var vC=["projectChanged"];function SC(){return(SC=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function NC(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function RC(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function OC(A,e){return(OC=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function YC(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=GC(A);if(e){var o=GC(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===FC(e)||"function"==typeof e))return e;return UC(A)}(this,i)}}function UC(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function GC(A){return(GC=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var HC=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&OC(A,e)}(t,a.a.PureComponent);var i=YC(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(UC(e),["confirmReadyToReplaceProject","shouldSaveBeforeTransition"]),e}return function(A,e,i){e&&RC(A.prototype,e),i&&RC(A,i)}(t,[{key:"confirmReadyToReplaceProject",value:function(A){var e=!0;return this.props.projectChanged&&!this.props.canCreateNew&&(e=this.props.confirmWithMessage(A)),e}},{key:"shouldSaveBeforeTransition",value:function(){return this.props.canSave&&this.props.projectChanged}},{key:"render",value:function(){var e=this.props,i=(e.projectChanged,NC(e,vC));return a.a.createElement(A,SC({confirmReadyToReplaceProject:this.confirmReadyToReplaceProject,shouldSaveBeforeTransition:this.shouldSaveBeforeTransition},i))}}]),t}();e.propTypes={canCreateNew:o.a.bool,canSave:o.a.bool,confirmWithMessage:o.a.func,projectChanged:o.a.bool},e.defaultProps={confirmWithMessage:function(A){return confirm(A)}};return Object(s.b)(function(A){return{projectChanged:A.scratchGui.projectChanged}},function(){return{}},function(A,e,i){return Object.assign({},A,e,i)})(e)};function LC(A){"@babel/helpers - typeof";return(LC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function PC(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function xC(A,e){return(xC=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function _C(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=JC(A);if(e){var o=JC(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===LC(e)||"function"==typeof e))return e;return jC(A)}(this,i)}}function jC(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function JC(A){return(JC=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var zC=Object(B.d)({language:{id:"gui.menuBar.LanguageSelector",defaultMessage:"language selector"}}),KC=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&xC(A,e)}(i,a.a.Component);var e=_C(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(jC(t),["handleLanguageMouseUp"]),t}return function(A,e,i){e&&PC(A.prototype,e),i&&PC(A,i)}(i,[{key:"handleLanguageMouseUp",value:function(A){this.props.languageMenuOpen||this.props.onClickLanguage(A)}},{key:"render",value:function(){return a.a.createElement(hi.a,{className:Le()(this.props.className,bC.a.menuBar)},a.a.createElement("div",{className:bC.a.mainMenu},a.a.createElement("div",{className:bC.a.fileGroup},this.props.canChangeLanguage&&a.a.createElement("div",{className:Le()(bC.a.menuBarItem,bC.a.hoverable,bC.a.languageMenu)},a.a.createElement("div",null,a.a.createElement("img",{className:bC.a.languageIcon,src:DC.a}),a.a.createElement("img",{className:bC.a.languageCaret,src:TC.a})),a.a.createElement(fC,{label:this.props.intl.formatMessage(zC.language)})))))}}]),i}();fC.propTypes={accountMenuOpen:o.a.bool,authorId:o.a.oneOfType([o.a.string,o.a.bool]),authorThumbnailUrl:o.a.string,authorUsername:o.a.oneOfType([o.a.string,o.a.bool]),autoUpdateProject:o.a.func,canChangeLanguage:o.a.bool,canCreateCopy:o.a.bool,canCreateNew:o.a.bool,canEditTitle:o.a.bool,canManageFiles:o.a.bool,canRemix:o.a.bool,canSave:o.a.bool,canShare:o.a.bool,className:o.a.string,confirmReadyToReplaceProject:o.a.func,editMenuOpen:o.a.bool,enableCommunity:o.a.bool,fileMenuOpen:o.a.bool,intl:B.f,isRtl:o.a.bool,isShared:o.a.bool,isShowingProject:o.a.bool,isUpdating:o.a.bool,languageMenuOpen:o.a.bool,loginMenuOpen:o.a.bool,logo:o.a.string,onClickAccount:o.a.func,onClickEdit:o.a.func,onClickFile:o.a.func,onClickLanguage:o.a.func,onClickLogin:o.a.func,onClickLogo:o.a.func,onClickNew:o.a.func,onClickRemix:o.a.func,onClickSave:o.a.func,onClickSaveAsCopy:o.a.func,onLogOut:o.a.func,onOpenRegistration:o.a.func,onOpenTipLibrary:o.a.func,onProjectTelemetryEvent:o.a.func,onRequestCloseAccount:o.a.func,onRequestCloseEdit:o.a.func,onRequestCloseFile:o.a.func,onRequestCloseLanguage:o.a.func,onRequestCloseLogin:o.a.func,onSeeCommunity:o.a.func,onShare:o.a.func,onToggleLoginOpen:o.a.func,projectTitle:o.a.string,renderLogin:o.a.func,sessionExists:o.a.bool,shouldSaveBeforeTransition:o.a.func,showComingSoon:o.a.bool,userOwnsProject:o.a.bool,username:o.a.string};var WC=Object(r.d)(B.e,HC,Object(s.b)(function(A,e){var i=A.scratchGui.projectState.loadingState,t=A.session&&A.session.session&&A.session.session.user;return{accountMenuOpen:Object(_.a)(A),fileMenuOpen:Object(_.i)(A),editMenuOpen:Object(_.h)(A),isRtl:A.locales.isRtl,isUpdating:Object(E.v)(i),isShowingProject:Object(E.s)(i),languageMenuOpen:Object(_.j)(A),locale:A.locales.locale,loginMenuOpen:Object(_.k)(A),projectTitle:A.scratchGui.projectTitle,sessionExists:A.session&&void 0!==A.session.session,username:t?t.username:null,userOwnsProject:e.authorUsername&&t&&e.authorUsername===t.username,vm:A.scratchGui.vm}},function(A){return{autoUpdateProject:function(){return A(Object(E.b)())},onOpenTipLibrary:function(){return A(Object(C.u)())},onClickAccount:function(){return A(Object(_.m)())},onRequestCloseAccount:function(){return A(Object(_.b)())},onClickFile:function(){return A(Object(_.o)())},onRequestCloseFile:function(){return A(Object(_.d)())},onClickEdit:function(){return A(Object(_.n)())},onRequestCloseEdit:function(){return A(Object(_.c)())},onClickLanguage:function(){return A(Object(_.p)())},onRequestCloseLanguage:function(){return A(Object(_.e)())},onClickLogin:function(){return A(Object(_.q)())},onRequestCloseLogin:function(){return A(Object(_.f)())},onClickNew:function(e){return A(Object(E.C)(e))},onClickRemix:function(){return A(Object(E.B)())},onClickSave:function(){return A(Object(E.w)())},onClickSaveAsCopy:function(){return A(Object(E.E)())},onSeeCommunity:function(){return A(Object(jB.d)(!0))}}}))(KC),VC=i(107),XC=i.n(VC),ZC=["intl"];function qC(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function $C(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Aw(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var ew=Object(B.d)({label:{id:"gui.webglModal.label",defaultMessage:"Your Browser Does Not Support WebGL"}}),iw=function(A){var e=A.intl,i=Aw(A,ZC);return a.a.createElement(l.a,{isOpen:!0,className:XC.a.modalContent,contentLabel:e.formatMessage(function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?qC(Object(i),!0).forEach(function(e){$C(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):qC(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({},ew.label)),overlayClassName:XC.a.modalOverlay,onRequestClose:i.onBack},a.a.createElement("div",{dir:i.isRtl?"rtl":"ltr"},a.a.createElement(hi.a,{className:XC.a.illustration}),a.a.createElement(hi.a,{className:XC.a.body},a.a.createElement("h2",null,a.a.createElement(B.a,ew.label)),a.a.createElement("p",null,a.a.createElement(B.a,{defaultMessage:"Unfortunately it looks like your browser or computer {webGlLink}. This technology is needed for Scratch 3.0 to run.",id:"gui.webglModal.description",values:{webGlLink:a.a.createElement("a",{className:XC.a.faqLink,href:"https://get.webgl.org/"},a.a.createElement(B.a,{defaultMessage:"does not support WebGL",id:"gui.webglModal.webgllink"}))}})),a.a.createElement(hi.a,{className:XC.a.buttonRow},a.a.createElement("button",{className:XC.a.backButton,onClick:i.onBack},a.a.createElement(B.a,{defaultMessage:"Back",id:"gui.webglModal.back"}))),a.a.createElement("div",{className:XC.a.faqLinkText},a.a.createElement(B.a,{defaultMessage:"To learn more, go to the {previewFaqLink}.",id:"gui.webglModal.previewfaq",values:{previewFaqLink:a.a.createElement("a",{className:XC.a.faqLink,href:"//scratch.mit.edu/3faq"},a.a.createElement(B.a,{defaultMessage:"FAQ",id:"gui.webglModal.previewfaqlinktext"}))}})))))};iw.propTypes={intl:B.f.isRequired,isRtl:o.a.bool,onBack:o.a.func.isRequired};var tw=Object(B.e)(iw);function ow(A){"@babel/helpers - typeof";return(ow="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function nw(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function aw(A,e){return(aw=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function rw(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=sw(A);if(e){var o=sw(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ow(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function sw(A){return(sw=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var gw=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&aw(A,e)}(i,a.a.Component);var e=rw(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&nw(A.prototype,e),i&&nw(A,i)}(i,[{key:"handleCancel",value:function(){window.history.back()}},{key:"render",value:function(){return a.a.createElement(tw,{isRtl:this.props.isRtl,onBack:this.handleCancel})}}]),i}();gw.propTypes={isRtl:o.a.bool};var lw,cw=gw,uw=[{tag:"animation",intlLabel:Qn.animation},{tag:"art",intlLabel:Qn.art},{tag:"music",intlLabel:Qn.music},{tag:"games",intlLabel:Qn.games},{tag:"stories",intlLabel:Qn.stories}],Bw=function(){return lw},dw=function(){return!Bw()};function Ew(A){"@babel/helpers - typeof";return(Ew="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function hw(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Cw(A,e){return(Cw=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ww(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=pw(A);if(e){var o=pw(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ew(e)||"function"==typeof e))return e;return mw(A)}(this,i)}}function mw(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function pw(A){return(pw=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Iw=Object(B.d)({tipsLibraryTitle:{id:"gui.tipsLibrary.tutorials",defaultMessage:"Choose a Tutorial"}}),fw=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Cw(A,e)}(i,a.a.PureComponent);var e=ww(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(mw(t),["handleItemSelect"]),t}return function(A,e,i){e&&hw(A.prototype,e),i&&hw(A,i)}(i,[{key:"handleItemSelect",value:function(A){if(LA.a.event({category:"library",action:"Select How-to",label:A.id}),A.requiredProjectId&&A.requiredProjectId!==this.props.projectId){var e="/projects/".concat(A.requiredProjectId,"/editor?tutorial=").concat(A.urlId);return window.open(window.location.origin+e,"_blank")}this.props.onActivateDeck(A.id)}},{key:"render",value:function(){var A=Object.keys(HA.a).filter(function(A){if(dw())return!0;var e=HA.a[A];return!e.hasOwnProperty("requiredProjectId")&&0!==e.steps.filter(function(A){return A.title}).length}).map(function(A){return{rawURL:HA.a[A].img,id:A,name:HA.a[A].name,featured:!0,tags:HA.a[A].tags,urlId:HA.a[A].urlId,requiredProjectId:HA.a[A].requiredProjectId,hidden:HA.a[A].hidden||!1}});return this.props.visible?a.a.createElement(Mn.a,{filterable:!0,data:A,id:"tipsLibrary",tags:uw,title:this.props.intl.formatMessage(Iw.tipsLibraryTitle),visible:this.props.visible,onItemSelected:this.handleItemSelect,onRequestClose:this.props.onRequestClose}):null}}]),i}();fw.propTypes={intl:B.f.isRequired,onActivateDeck:o.a.func.isRequired,onRequestClose:o.a.func,projectId:o.a.oneOfType([o.a.string,o.a.number]),visible:o.a.bool};var Qw=Object(B.e)(Object(s.b)(function(A){return{visible:A.scratchGui.modals.tipsLibrary,projectId:A.scratchGui.projectState.projectId}},function(A){return{onActivateDeck:function(e){return A(Object(xA.a)(e))},onRequestClose:function(){return A(Object(C.j)())}}})(fw)),Dw=i(286),Mw=i.n(Dw),bw=i(25),yw=i.n(bw),Tw=i(823),kw=i.n(Tw),Fw=i(824),vw=i.n(Fw),Sw=i(378),Nw=i.n(Sw),Rw=i(379),Ow=i.n(Rw),Yw=i(825),Uw=i.n(Yw),Gw=i(826),Hw=i.n(Gw),Lw={"intro-move-sayhello":{en:"rpjvs3v9gj",it:"2im6c1f9kn",pt:"ngdfp8xg4x","pt-br":"ngdfp8xg4x",ja:"v2c2f3y2sc","ja-Hira":"v2c2f3y2sc",es:"htk2m9o65l","es-419":"htk2m9o65l",sw:"fd4bn2nli5",fr:"dt015ouls8",am:"e06wlsebqy",zu:"st2x0emdx7",uk:"1ith4m4f8u",ar:"s53zuo93o7",ca:"4tb26s73x7","zh-cn":"9i01bspmyx","zh-tw":"hr374tlx9t",da:"z9bns5dgiy",nl:"9wleha9s1e",de:"9lljmutx8m",ht:"7pyjz25tvf",he:"5rusa2qb6q",id:"zpzl7nqcyf",km:"zhq0596ewo",ko:"9u7cr4pwsc",ku:"jzwwqih2im",fa:"c15wlv18tt",pl:"ijhn36nicy",ru:"437odiewml",th:"zy7suscqn2",tr:"p3g8ek3cuh",vi:"fetjky76s4"},"intro-getting-started-ASL":{en:"i2g46ikddf"},"animate-a-name":{en:"pyur30ho05",ar:"bz5vgtroxs",fr:"lwb0ro4oly",it:"c8zcrk6w09",pt:"t49tfrukyf","pt-br":"t49tfrukyf",ja:"xrmgno02th","ja-Hira":"xrmgno02th"},"Make-Music":{en:"ir0j8ljsgm",ar:"gqlmfqx1g4",fr:"t4dw6fn2an",it:"8nm1v1m9zx",pt:"9v4zl8504z","pt-br":"9v4zl8504z",ja:"iybhyobckr","ja-Hira":"iybhyobckr"},"Make-A-Game":{en:"5rp47ys13g",ar:"dx5pqpaqsy",fr:"pntfdyyqqk",it:"vrs1e38944",pt:"rjst5ng61s","pt-br":"rjst5ng61s",ja:"h4q2ea3ojw","ja-Hira":"h4q2ea3ojw"},"Chase-Game":{en:"kusyx9thl5",ar:"qapon34gsw",fr:"0nszrbo4dt",it:"899b2jmjlu",pt:"rw6kr9e37n","pt-br":"rw6kr9e37n",ja:"wr6ysk8s6d","ja-Hira":"wr6ysk8s6d"},"add-a-backdrop":{en:"nict6zdzlx",ar:"ompj13t33k",fr:"nwyngs74xw",it:"vrrfpm5grh",pt:"wq7sm038pq","pt-br":"wq7sm038pq",ja:"j382ohngg7","ja-Hira":"j382ohngg7"},"change-size":{en:"p8va85hh61",ar:"acceih3x6k",fr:"rrowyylh2i",it:"1xb1jztsvr",pt:"1ad1ip3ly7","pt-br":"1ad1ip3ly7",ja:"uzkfi9uai0","ja-Hira":"uzkfi9uai0"},"glide-around":{en:"sh9j978rg8",ar:"8c4b4jb2se",fr:"f73cjf5zzf",it:"nvdhpgiebe",ja:"jsat4vhu48","ja-Hira":"jsat4vhu48"},"record-a-sound":{en:"ulzl1fbzny",ar:"vx60cuwzo9",fr:"ep92lqlp7p",it:"ncr9lqk7bt",pt:"aavagpvh5w","pt-br":"aavagpvh5w",ja:"5zmy6u614k","ja-Hira":"5zmy6u614k"},"spin-video":{en:"07fed5hhpv",ar:"5hl1dq3byk",fr:"cqzi6cr872",it:"obmrphhobt",pt:"jxqksu6zcw","pt-br":"jxqksu6zcw",ja:"hjhc0a8r7j","ja-Hira":"hjhc0a8r7j"},"hide-and-show":{en:"g479ahobo9",ar:"r25otzahzi",fr:"o1h6llwd0e",it:"v0vbx3l5uk",pt:"ibtmwb58y8","pt-br":"ibtmwb58y8",ja:"ruynguvag5","ja-Hira":"ruynguvag5"},"switch-costume":{en:"1ocp6a1ejn",ar:"2tz31cmeaq",fr:"2s9sagktio",it:"nty4xjtqcj",pt:"pnlmmv2hs7","pt-br":"pnlmmv2hs7",ja:"g3vluv0ms8","ja-Hira":"g3vluv0ms8"},"move-around-with-arrow-keys":{en:"yetrmk4iuu",ar:"270xh1zb1s",fr:"69tc5nvykx",it:"jse0g0uddw",pt:"erv6eff78p","pt-br":"erv6eff78p",ja:"fk34dcg5oz","ja-Hira":"fk34dcg5oz"},"add-effects":{en:"3jvl8zgjo2",ar:"fp4y3aumie",fr:"nyutlj812e",it:"q3cjjyfju9",pt:"dz6jzpf7hm","pt-br":"dz6jzpf7hm",ja:"q7zq9vu0wb","ja-Hira":"q7zq9vu0wb"},"make-it-fly":{en:"zbtdx2dem9"},"pong-game":{en:"8m48dv0ens"},imagine:{en:"1ndh08yiso"},"code-cartoon":{en:"fpfuky3x6g"},talking:{en:"j0208mq4qi"}},Pw=i(827),xw=i.n(Pw),_w=i(828),jw=i.n(_w),Jw=i(829),zw=i.n(Jw),Kw=i(287),Ww=i.n(Kw),Vw=i(830),Xw=i.n(Vw),Zw=i(831),qw=i.n(Zw),$w=i(832),Am=i.n($w),em=i(228),im=i.n(em),tm=i(383),om=i.n(tm),nm=i(833),am=i.n(nm),rm=i(834),sm=i.n(rm),gm=i(835),lm=i.n(gm),cm=i(836),um=i.n(cm),Bm=i(382),dm=i.n(Bm),Em=i(837),hm=i.n(Em),Cm=i(838),wm=i.n(Cm),mm=i(384),pm=i.n(mm),Im=i(839),fm=i.n(Im),Qm=i(104),Dm=i.n(Qm),Mm=i(840),bm=i.n(Mm),ym=i(841),Tm=i.n(ym),km=i(385),Fm=i.n(km),vm=i(386),Sm=i.n(vm),Nm=i(842),Rm=i.n(Nm),Om=i(387),Ym=i.n(Om),Um=i(843),Gm=i.n(Um),Hm=i(844),Lm=i.n(Hm),Pm=i(845),xm=i.n(Pm),_m=i(388),jm=i.n(_m),Jm=i(846),zm=i.n(Jm),Km=i(847),Wm=i.n(Km),Vm=i(848),Xm=i.n(Vm),Zm=i(849),qm=i.n(Zm),$m=i(389),Ap=i.n($m),ep=i(390),ip=i.n(ep),tp=i(850),op=i.n(tp),np=i(851),ap=i.n(np),rp=i(391),sp=i.n(rp),gp=i(852),lp=i.n(gp),cp=i(853),up=i.n(cp),Bp=i(854),dp=i.n(Bp),Ep=i(392),hp=i.n(Ep),Cp=i(855),wp=i.n(Cp),mp=i(856),pp=i.n(mp),Ip=i(857),fp=i.n(Ip),Qp=i(858),Dp=i.n(Qp),Mp=i(859),bp=i.n(Mp),yp=i(393),Tp=i.n(yp),kp=i(860),Fp=i.n(kp),vp=i(861),Sp=i.n(vp),Np=i(862),Rp=i.n(Np),Op=i(863),Yp=i.n(Op),Up=i(864),Gp=i.n(Up),Hp=i(865),Lp=i.n(Hp),Pp=i(394),xp=i.n(Pp),_p=i(395),jp=i.n(_p),Jp=i(866),zp=i.n(Jp),Kp=i(396),Wp=i.n(Kp),Vp=i(867),Xp=i.n(Vp),Zp=i(868),qp=i.n(Zp),$p=i(397),AI=i.n($p),eI=i(869),iI=i.n(eI),tI=i(870),oI=i.n(tI),nI=i(871),aI=i.n(nI),rI=i(872),sI=i.n(rI),gI=i(873),lI=i.n(gI),cI=i(874),uI=i.n(cI),BI=i(875),dI=i.n(BI),EI=i(398),hI=i.n(EI),CI=i(399),wI=i.n(CI),mI=i(876),pI=i.n(mI),II=i(877),fI=i.n(II),QI=i(400),DI=i.n(QI),MI=i(878),bI=i.n(MI),yI=i(401),TI=i.n(yI),kI=i(879),FI=i.n(kI),vI=i(402),SI=i.n(vI),NI=i(880),RI=i.n(NI),OI=i(881),YI=i.n(OI),UI=i(403),GI=i.n(UI),HI=i(404),LI=i.n(HI),PI=i(882),xI=i.n(PI),_I=i(405),jI=i.n(_I),JI=i(883),zI=i.n(JI),KI=i(406),WI=i.n(KI),VI=i(884),XI=i.n(VI),ZI=i(885),qI=i.n(ZI),$I=i(886),Af=i.n($I),ef=i(887),tf=i.n(ef),of=i(407),nf=i.n(of),af=i(888),rf=i.n(af),sf=i(889),gf=i.n(sf),lf=i(890),cf=i.n(lf),uf=i(408),Bf=i.n(uf),df=i(409),Ef=i.n(df),hf=i(891),Cf=i.n(hf),wf=i(410),mf=i.n(wf),pf=i(892),If=i.n(pf),ff=i(893),Qf=i.n(ff),Df=i(894),Mf=i.n(Df),bf=i(895),yf=i.n(bf),Tf=i(896),kf=i.n(Tf),Ff=i(411),vf=i.n(Ff),Sf=i(897),Nf=i.n(Sf),Rf=i(898),Of=i.n(Rf),Yf=i(899),Uf=i.n(Yf),Gf=i(412),Hf=i.n(Gf),Lf=i(900),Pf=i.n(Lf),xf=i(901),_f=i.n(xf),jf=i(902),Jf=i.n(jf),zf=i(903),Kf=i.n(zf),Wf=i(904),Vf=i.n(Wf),Xf=i(905),Zf=i.n(Xf),qf=i(906),$f=i.n(qf),AQ=i(907),eQ=i.n(AQ),iQ=i(908),tQ=i.n(iQ),oQ=i(909),nQ=i.n(oQ),aQ=i(910),rQ=i.n(aQ),sQ=i(911),gQ=i.n(sQ),lQ=i(912),cQ=i.n(lQ),uQ=i(913),BQ=i.n(uQ),dQ=i(914),EQ=i.n(dQ),hQ=i(915),CQ=i.n(hQ),wQ=i(916),mQ=i.n(wQ),pQ=i(413),IQ=i.n(pQ),fQ=i(917),QQ=i.n(fQ),DQ=i(918),MQ=i.n(DQ),bQ=i(414),yQ=i.n(bQ),TQ=i(919),kQ=i.n(TQ),FQ=i(920),vQ=i.n(FQ),SQ=i(921),NQ=i.n(SQ),RQ=i(922),OQ=i.n(RQ),YQ=i(415),UQ=i.n(YQ),GQ=i(416),HQ=i.n(GQ),LQ=i(923),PQ=i.n(LQ),xQ=i(417),_Q=i.n(xQ),jQ=i(924),JQ=i.n(jQ),zQ=i(418),KQ=i.n(zQ),WQ=i(925),VQ=i.n(WQ),XQ=i(419),ZQ=i.n(XQ),qQ=i(926),$Q=i.n(qQ),AD=i(420),eD=i.n(AD),iD=i(927),tD=i.n(iD),oD=i(928),nD=i.n(oD),aD=i(929),rD=i.n(aD),sD={introMove:xw.a,introSay:jw.a,introGreenFlag:zw.a,speechAddExtension:Ww.a,speechSaySomething:Xw.a,speechSetVoice:qw.a,speechMoveAround:Am.a,speechAddBackdrop:im.a,speechAddSprite:om.a,speechSong:am.a,speechChangeColor:sm.a,speechSpin:lm.a,speechGrowShrink:um.a,cnShowCharacter:dm.a,cnSay:hm.a,cnGlide:wm.a,cnPickSprite:pm.a,cnCollect:fm.a,cnVariable:Dm.a,cnScore:bm.a,cnBackdrop:Tm.a,addSprite:Fm.a,namePickLetter:Sm.a,namePlaySound:Rm.a,namePickLetter2:Ym.a,nameChangeColor:Gm.a,nameSpin:Lm.a,nameGrow:xm.a,musicPickInstrument:jm.a,musicPlaySound:zm.a,musicMakeSong:Wm.a,musicMakeBeat:Xm.a,musicMakeBeatbox:qm.a,chaseGameAddBackdrop:Ap.a,chaseGameAddSprite1:ip.a,chaseGameRightLeft:op.a,chaseGameUpDown:ap.a,chaseGameAddSprite2:sp.a,chaseGameMoveRandomly:lp.a,chaseGamePlaySound:up.a,chaseGameAddVariable:Dm.a,chaseGameChangeScore:dp.a,popGamePickSprite:hp.a,popGamePlaySound:wp.a,popGameAddScore:Dm.a,popGameChangeScore:pp.a,popGameRandomPosition:fp.a,popGameChangeColor:Dp.a,popGameResetScore:bp.a,animateCharPickBackdrop:im.a,animateCharPickSprite:Tp.a,animateCharSaySomething:Fp.a,animateCharAddSound:Sp.a,animateCharTalk:Rp.a,animateCharMove:Yp.a,animateCharJump:Gp.a,animateCharChangeColor:Lp.a,storyPickBackdrop:xp.a,storyPickSprite:jp.a,storySaySomething:zp.a,storyPickSprite2:Wp.a,storyFlip:Xp.a,storyConversation:qp.a,storyPickBackdrop2:AI.a,storySwitchBackdrop:iI.a,storyHideCharacter:oI.a,storyShowCharacter:aI.a,videoAddExtension:sI.a,videoPet:lI.a,videoAnimate:uI.a,videoPop:dI.a,flyChooseBackdrop:hI.a,flyChooseCharacter:wI.a,flySaySomething:pI.a,flyMoveArrows:fI.a,flyChooseObject:DI.a,flyFlyingObject:bI.a,flySelectFlyingSprite:TI.a,flyAddScore:Dm.a,flyKeepScore:FI.a,flyAddScenery:SI.a,flyMoveScenery:RI.a,flySwitchLooks:YI.a,pongAddBackdrop:GI.a,pongAddBallSprite:LI.a,pongBounceAround:xI.a,pongAddPaddle:jI.a,pongMoveThePaddle:zI.a,pongSelectBallSprite:WI.a,pongAddMoreCodeToBall:XI.a,pongAddAScore:Dm.a,pongChooseScoreFromMenu:qI.a,pongInsertChangeScoreBlock:Af.a,pongResetScore:tf.a,pongAddLineSprite:nf.a,pongGameOver:rf.a,imagineTypeWhatYouWant:gf.a,imagineClickGreenFlag:cf.a,imagineChooseBackdrop:Bf.a,imagineChooseSprite:Ef.a,imagineFlyAround:Cf.a,imagineChooseAnotherSprite:mf.a,imagineLeftRight:If.a,imagineUpDown:Qf.a,imagineChangeCostumes:Mf.a,imagineGlideToPoint:yf.a,imagineGrowShrink:kf.a,imagineChooseAnotherBackdrop:vf.a,imagineSwitchBackdrops:Nf.a,imagineRecordASound:Of.a,imagineChooseSound:Uf.a,addBackdrop:Hf.a,addEffects:Pf.a,hideAndShow:_f.a,switchCostumes:Jf.a,changeSize:Kf.a,spinTurn:Vf.a,spinPointInDirection:Zf.a,recordASoundSoundsTab:$f.a,recordASoundClickRecord:eQ.a,recordASoundPressRecordButton:tQ.a,recordASoundChooseSound:nQ.a,recordASoundPlayYourSound:rQ.a,moveArrowKeysLeftRight:gQ.a,moveArrowKeysUpDown:cQ.a,glideAroundBackAndForth:BQ.a,glideAroundPoint:EQ.a,codeCartoonSaySomething:CQ.a,codeCartoonAnimate:mQ.a,codeCartoonSelectDifferentCharacter:IQ.a,codeCartoonUseMinusSign:QQ.a,codeCartoonGrowShrink:MQ.a,codeCartoonSelectDifferentCharacter2:yQ.a,codeCartoonJump:kQ.a,codeCartoonChangeScenes:vQ.a,codeCartoonGlideAround:NQ.a,codeCartoonChangeCostumes:OQ.a,codeCartoonChooseMoreCharacters:UQ.a,talesAddExtension:Ww.a,talesChooseSprite:HQ.a,talesSaySomething:PQ.a,talesAskAnswer:rD.a,talesChooseBackdrop:_Q.a,talesSwitchBackdrop:JQ.a,talesChooseAnotherSprite:KQ.a,talesMoveAround:VQ.a,talesChooseAnotherBackdrop:ZQ.a,talesAnimateTalking:$Q.a,talesChooseThirdBackdrop:eD.a,talesChooseSound:tD.a,talesDanceMoves:nD.a},gD={},lD="",cD=function(){return i.e(5).then(i.bind(null,2944)).then(function(A){return A.esImages})},uD=function(){return i.e(10).then(i.bind(null,2949)).then(function(A){return A.ptBrImages})},BD=function(){return i.e(8).then(i.bind(null,2955)).then(function(A){return A.jaImages})},dD={es:function(){return cD()},"es-419":function(){return cD()},"zh-cn":function(){return i.e(14).then(i.bind(null,2945)).then(function(A){return A.zhCnImages})},"zh-tw":function(){return i.e(15).then(i.bind(null,2946)).then(function(A){return A.zhTwImages})},tr:function(){return i.e(12).then(i.bind(null,2947)).then(function(A){return A.trImages})},fr:function(){return i.e(6).then(i.bind(null,2948)).then(function(A){return A.frImages})},"pt-br":function(){return uD()},pt:function(){return uD()},ar:function(){return i.e(2).then(i.bind(null,2950)).then(function(A){return A.arImages})},am:function(){return i.e(1).then(i.bind(null,2951)).then(function(A){return A.amImages})},sw:function(){return i.e(11).then(i.bind(null,2952)).then(function(A){return A.swImages})},zu:function(){return i.e(16).then(i.bind(null,2953)).then(function(A){return A.zuImages})},uk:function(){return i.e(13).then(i.bind(null,2954)).then(function(A){return A.ukImages})},ja:function(){return BD()},"ja-Hira":function(){return BD()}},ED=function(A){dD.hasOwnProperty(A)&&dD[A]().then(function(e){gD=e,lD=A})};function hD(A){"@babel/helpers - typeof";return(hD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var CD=["activeDeckId","content","dragging","isRtl","locale","onActivateDeckFactory","onCloseCards","onShrinkExpandCards","onDrag","onStartDrag","onEndDrag","onShowAll","onNextStep","onPrevStep","showVideos","step","expanded"];function wD(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function mD(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function pD(A,e){return(pD=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ID(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=fD(A);if(e){var o=fD(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===hD(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function fD(A){return(fD=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var QD=function(A){var e=A.onCloseCards,i=A.onShrinkExpandCards,t=A.onShowAll,o=A.totalSteps,n=A.step,r=A.expanded;return a.a.createElement("div",{className:r?yw.a.headerButtons:Le()(yw.a.headerButtons,yw.a.headerButtonsHidden)},a.a.createElement("div",{className:yw.a.allButton,onClick:t},a.a.createElement("img",{className:yw.a.helpIcon,src:Uw.a}),a.a.createElement(B.a,{defaultMessage:"Tutorials",id:"gui.cards.all-tutorials"})),o>1?a.a.createElement("div",{className:yw.a.stepsList},Array(o).fill(0).map(function(A,e){return a.a.createElement("div",{className:e===n?yw.a.activeStepPip:yw.a.inactiveStepPip,key:"pip-step-".concat(e)})})):null,a.a.createElement("div",{className:yw.a.headerButtonsRight},a.a.createElement("div",{className:yw.a.shrinkExpandButton,onClick:i},a.a.createElement("img",{draggable:!1,src:r?kw.a:vw.a}),r?a.a.createElement(B.a,{defaultMessage:"Shrink",id:"gui.cards.shrink"}):a.a.createElement(B.a,{defaultMessage:"Expand",id:"gui.cards.expand"})),a.a.createElement("div",{className:yw.a.removeButton,onClick:e},a.a.createElement("img",{className:yw.a.closeIcon,src:Hw.a}),a.a.createElement(B.a,{defaultMessage:"Close",id:"gui.cards.close"}))))},DD=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&pD(A,e)}(i,a.a.Component);var e=ID(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&mD(A.prototype,e),i&&mD(A,i)}(i,[{key:"componentDidMount",value:function(){var A=document.createElement("script");A.src="https://fast.wistia.com/embed/medias/".concat(this.props.video,".jsonp"),A.async=!0,A.setAttribute("id","wistia-video-content"),document.body.appendChild(A);var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.async=!0,e.setAttribute("id","wistia-video-api"),document.body.appendChild(e)}},{key:"componentDidUpdate",value:function(A){if(window.Wistia&&window.Wistia.api){var e=window.Wistia.api(A.video);A.video!==this.props.video&&e.replaceWith(this.props.video),this.props.expanded||e.pause()}}},{key:"componentWillUnmount",value:function(){var A=document.getElementById("wistia-video-content");A.parentNode.removeChild(A);var e=document.getElementById("wistia-video-api");e.parentNode.removeChild(e)}},{key:"render",value:function(){return a.a.createElement("div",{className:yw.a.stepVideo},a.a.createElement("div",{className:"wistia_embed wistia_async_".concat(this.props.video),id:"video-div",style:{height:"257px",width:"466px"}}," "))}}]),i}();DD.propTypes={expanded:o.a.bool.isRequired,video:o.a.string.isRequired};var MD=function(A){var e=A.title,i=A.image;return a.a.createElement(n.Fragment,null,a.a.createElement("div",{className:yw.a.stepTitle},e),a.a.createElement("div",{className:yw.a.stepImageContainer},a.a.createElement("img",{className:yw.a.stepImage,draggable:!1,key:i,src:i})))};MD.propTypes={image:o.a.string.isRequired,title:o.a.node.isRequired};var bD=function(A){var e=A.isRtl,i=A.onNextStep,t=A.onPrevStep,o=A.expanded;return a.a.createElement(n.Fragment,null,i?a.a.createElement("div",null,a.a.createElement("div",{className:o?e?yw.a.leftCard:yw.a.rightCard:yw.a.hidden}),a.a.createElement("div",{className:o?e?yw.a.leftButton:yw.a.rightButton:yw.a.hidden,onClick:i},a.a.createElement("img",{draggable:!1,src:e?Ow.a:Nw.a}))):null,t?a.a.createElement("div",null,a.a.createElement("div",{className:o?e?yw.a.rightCard:yw.a.leftCard:yw.a.hidden}),a.a.createElement("div",{className:o?e?yw.a.rightButton:yw.a.leftButton:yw.a.hidden,onClick:t},a.a.createElement("img",{draggable:!1,src:e?Nw.a:Ow.a}))):null)};bD.propTypes={expanded:o.a.bool.isRequired,isRtl:o.a.bool,onNextStep:o.a.func,onPrevStep:o.a.func},QD.propTypes={expanded:o.a.bool.isRequired,onCloseCards:o.a.func.isRequired,onShowAll:o.a.func.isRequired,onShrinkExpandCards:o.a.func.isRequired,step:o.a.number,totalSteps:o.a.number};var yD=function(A){var e=A.deckIds,i=A.content,t=A.onActivateDeckFactory,o=A.onShowAll;return a.a.createElement(n.Fragment,null,a.a.createElement("div",{className:yw.a.stepTitle},a.a.createElement(B.a,{defaultMessage:"More things to try!",id:"gui.cards.more-things-to-try"})),a.a.createElement("div",{className:yw.a.decks},e.slice(0,2).map(function(A){return a.a.createElement("div",{className:yw.a.deck,key:"deck-preview-".concat(A),onClick:t(A)},a.a.createElement("img",{className:yw.a.deckImage,draggable:!1,src:i[A].img}),a.a.createElement("div",{className:yw.a.deckName},i[A].name))})),a.a.createElement("div",{className:yw.a.seeAll},a.a.createElement("div",{className:yw.a.seeAllButton,onClick:o},a.a.createElement(B.a,{defaultMessage:"See more",id:"gui.cards.see-more"}))))};yD.propTypes={content:o.a.shape({id:o.a.shape({name:o.a.node.isRequired,img:o.a.string.isRequired,steps:o.a.arrayOf(o.a.shape({title:o.a.node,image:o.a.string,video:o.a.string,deckIds:o.a.arrayOf(o.a.string)}))})}).isRequired,deckIds:o.a.arrayOf(o.a.string).isRequired,onActivateDeckFactory:o.a.func.isRequired,onShowAll:o.a.func.isRequired};var TD=function(A){var e=A.activeDeckId,i=A.content,t=A.dragging,o=A.isRtl,n=A.locale,r=A.onActivateDeckFactory,s=A.onCloseCards,g=A.onShrinkExpandCards,l=A.onDrag,c=A.onStartDrag,u=A.onEndDrag,B=A.onShowAll,d=A.onNextStep,E=A.onPrevStep,h=A.showVideos,C=A.step,w=A.expanded,m=wD(A,CD),p=m.x,I=m.y;if(null!==e){var f=w?257:0;if(0===p&&0===I){p=o?-1090:292,p+=400;I=window.innerHeight-320-60-48}var Q=i[e].steps;return a.a.createElement("div",{className:yw.a.cardContainerOverlay,style:{width:"".concat(window.innerWidth+800,"px"),height:"".concat(window.innerHeight-48+f,"px"),top:"".concat(48,"px"),left:"".concat(-400,"px")}},a.a.createElement(Mw.a,{bounds:"parent",cancel:"#video-div",position:{x:p,y:I},onDrag:l,onStart:c,onStop:u},a.a.createElement("div",{className:yw.a.cardContainer},a.a.createElement("div",{className:yw.a.card},a.a.createElement(QD,{expanded:w,step:C,totalSteps:Q.length,onCloseCards:s,onShowAll:B,onShrinkExpandCards:g}),a.a.createElement("div",{className:w?yw.a.stepBody:yw.a.hidden},Q[C].deckIds?a.a.createElement(yD,{content:i,deckIds:Q[C].deckIds,onActivateDeckFactory:r,onShowAll:B}):Q[C].video?h?a.a.createElement(DD,{dragging:t,expanded:w,video:function(A,e){return Lw.hasOwnProperty(A)?Lw[A].hasOwnProperty(e)?Lw[A][e]:Lw[A].en:A}(Q[C].video,n)}):a.a.createElement(MD,{image:i[e].img,title:i[e].name}):a.a.createElement(MD,{image:function(A,e){return e===lD&&gD.hasOwnProperty(A)?gD[A]:sD[A]}(Q[C].image,n),title:Q[C].title}),Q[C].trackingPixel&&Q[C].trackingPixel),a.a.createElement(bD,{expanded:w,isRtl:o,onNextStep:C<Q.length-1?d:null,onPrevStep:C>0?E:null})))))}};function kD(A){"@babel/helpers - typeof";return(kD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function FD(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function vD(A,e){return(vD=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function SD(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=ND(A);if(e){var o=ND(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===kD(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function ND(A){return(ND=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}TD.propTypes={activeDeckId:o.a.string.isRequired,content:o.a.shape({id:o.a.shape({name:o.a.node.isRequired,img:o.a.string.isRequired,steps:o.a.arrayOf(o.a.shape({title:o.a.node,image:o.a.string,video:o.a.string,deckIds:o.a.arrayOf(o.a.string)}))})}),dragging:o.a.bool.isRequired,expanded:o.a.bool.isRequired,isRtl:o.a.bool.isRequired,locale:o.a.string.isRequired,onActivateDeckFactory:o.a.func.isRequired,onCloseCards:o.a.func.isRequired,onDrag:o.a.func,onEndDrag:o.a.func,onNextStep:o.a.func.isRequired,onPrevStep:o.a.func.isRequired,onShowAll:o.a.func,onShrinkExpandCards:o.a.func.isRequired,onStartDrag:o.a.func,showVideos:o.a.bool,step:o.a.number.isRequired,x:o.a.number,y:o.a.number},TD.defaultProps={showVideos:!0};var RD=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&vD(A,e)}(i,a.a.Component);var e=SD(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&FD(A.prototype,e),i&&FD(A,i)}(i,[{key:"componentDidMount",value:function(){"en"!==this.props.locale&&ED(this.props.locale)}},{key:"componentDidUpdate",value:function(A){this.props.locale!==A.locale&&ED(this.props.locale)}},{key:"render",value:function(){return a.a.createElement(TD,this.props)}}]),i}();RD.propTypes={locale:o.a.string.isRequired};var OD=Object(s.b)(function(A){return{visible:A.scratchGui.cards.visible,content:A.scratchGui.cards.content,activeDeckId:A.scratchGui.cards.activeDeckId,step:A.scratchGui.cards.step,expanded:A.scratchGui.cards.expanded,x:A.scratchGui.cards.x,y:A.scratchGui.cards.y,isRtl:A.locales.isRtl,locale:A.locales.locale,dragging:A.scratchGui.cards.dragging,showVideos:dw()}},function(A){return{onActivateDeckFactory:function(e){return function(){return A(Object(xA.a)(e))}},onShowAll:function(){A(Object(C.u)()),A(Object(xA.c)())},onCloseCards:function(){return A(Object(xA.c)())},onShrinkExpandCards:function(){return A(Object(xA.i)())},onNextStep:function(){return A(Object(xA.g)())},onPrevStep:function(){return A(Object(xA.h)())},onDrag:function(e,i){return A(Object(xA.e)(i.x,i.y))},onStartDrag:function(){return A(Object(xA.j)())},onEndDrag:function(){return A(Object(xA.f)())}}})(RD);i(1560);function YD(A){"@babel/helpers - typeof";return(YD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function UD(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function GD(A,e){return(GD=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function HD(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=PD(A);if(e){var o=PD(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===YD(e)||"function"==typeof e))return e;return LD(A)}(this,i)}}function LD(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function PD(A){return(PD=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var xD=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&GD(A,e)}(i,a.a.Component);var e=HD(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(LD(t),["downloadProject"]),t}return function(A,e,i){e&&UD(A.prototype,e),i&&UD(A,i)}(i,[{key:"downloadProject",value:function(){var A=this;this.props.saveProjectSb3().then(function(e){A.props.onSaveFinished&&A.props.onSaveFinished(),function(A){return new Promise(function(e){var i=new FileReader;i.readAsDataURL(A),i.onloadend=function(){e(i.result)}})}(e).then(function(A){mv2Interface.savedProjectStates[slot.toString()]=A,mv2Interface.send_REST("save".concat(JSON.stringify(mv2Interface.savedProjectStates)))}),alert("Project Saved.")})}},{key:"render",value:function(){return(0,this.props.children)(this.props.className,this.downloadProject)}}]),i}();xD.propTypes={children:o.a.func,className:o.a.string,onSaveFinished:o.a.func,projectFilename:o.a.string,saveProjectSb3:o.a.func},xD.defaultProps={className:""};var _D,jD=Object(s.b)(function(A){return{saveProjectSb3:A.scratchGui.vm.saveProjectSb3.bind(A.scratchGui.vm),projectFilename:function(A,e){var i=A;return i&&0!==i.length||(i=e),"".concat(i.substring(0,100),".sb3")}(A.scratchGui.projectTitle,x.b)}},function(){return{}})(xD),JD=i(144),zD=i(278),KD=i(73),WD=i(80),VD=i.n(WD);function XD(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var ZD=(XD(_D={},KD.a.SUCCESS,JD.a.COLOR_GREEN),XD(_D,KD.a.WARN,JD.a.COLOR_ORANGE),_D),qD=function(A){var e=A.content,i=A.closeButton,t=A.extensionName,o=A.iconSpinner,n=A.iconURL,r=A.level,s=A.showDownload,g=A.showSaveNow,l=A.onCloseAlert,c=A.onDownload,u=A.onSaveNow,d=A.onReconnect,E=A.showReconnect;return a.a.createElement(hi.a,{className:Le()(VD.a.alert,VD.a[r])},(o||n)&&a.a.createElement("div",{className:VD.a.iconSection},o&&a.a.createElement(zD.a,{className:VD.a.alertSpinner,level:r}),n&&a.a.createElement("img",{className:VD.a.alertIcon,src:n})),a.a.createElement("div",{className:VD.a.alertMessage},t?a.a.createElement(B.a,{defaultMessage:"Scratch lost connection to {extensionName}.",id:"gui.alerts.lostPeripheralConnection",values:{extensionName:"".concat(t)}}):e),a.a.createElement("div",{className:VD.a.alertButtons},g&&a.a.createElement("button",{className:VD.a.alertConnectionButton,onClick:u},a.a.createElement(B.a,{defaultMessage:"Try Again",id:"gui.alerts.tryAgain"})),s&&a.a.createElement("button",{className:VD.a.alertConnectionButton,onClick:c},a.a.createElement(B.a,{defaultMessage:"Download",id:"gui.alerts.download"})),E&&a.a.createElement("button",{className:VD.a.alertConnectionButton,onClick:d},a.a.createElement(B.a,{defaultMessage:"Reconnect",id:"gui.connection.reconnect"})),i&&a.a.createElement(hi.a,{className:VD.a.alertCloseButtonContainer},a.a.createElement(JD.a,{className:Le()(VD.a.alertCloseButton),color:ZD[r],size:JD.a.SIZE_LARGE,onClick:l}))))};qD.propTypes={closeButton:o.a.bool,content:o.a.oneOfType([o.a.element,o.a.string]),extensionName:o.a.string,iconSpinner:o.a.bool,iconURL:o.a.string,level:o.a.string,onCloseAlert:o.a.func.isRequired,onDownload:o.a.func,onReconnect:o.a.func,onSaveNow:o.a.func,showDownload:o.a.func,showReconnect:o.a.bool,showSaveNow:o.a.bool},qD.defaultProps={level:KD.a.WARN};var $D=qD,AM=i(155);function eM(A){"@babel/helpers - typeof";return(eM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function iM(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function tM(A,e){return(tM=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function oM(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=aM(A);if(e){var o=aM(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===eM(e)||"function"==typeof e))return e;return nM(A)}(this,i)}}function nM(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function aM(A){return(aM=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var rM=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&tM(A,e)}(i,a.a.Component);var e=oM(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(nM(t),["handleOnCloseAlert","handleOnReconnect"]),t}return function(A,e,i){e&&iM(A.prototype,e),i&&iM(A,i)}(i,[{key:"handleOnCloseAlert",value:function(){this.props.onCloseAlert(this.props.index)}},{key:"handleOnReconnect",value:function(){this.props.onOpenConnectionModal(this.props.extensionId),this.handleOnCloseAlert()}},{key:"render",value:function(){var A=this,e=this.props,i=e.closeButton,t=e.content,o=e.extensionName,n=(e.index,e.level),r=e.iconSpinner,s=e.iconURL,g=e.message,l=e.onSaveNow,c=e.showDownload,u=e.showReconnect,B=e.showSaveNow;return a.a.createElement(jD,null,function(e,d){return a.a.createElement($D,{closeButton:i,content:t,extensionName:o,iconSpinner:r,iconURL:s,level:n,message:g,showDownload:c,showReconnect:u,showSaveNow:B,onCloseAlert:A.handleOnCloseAlert,onDownload:d,onReconnect:A.handleOnReconnect,onSaveNow:l})})}}]),i}();rM.propTypes={closeButton:o.a.bool,content:o.a.element,extensionId:o.a.string,extensionName:o.a.string,iconSpinner:o.a.bool,iconURL:o.a.string,index:o.a.number,level:o.a.string.isRequired,message:o.a.string,onCloseAlert:o.a.func.isRequired,onOpenConnectionModal:o.a.func,onSaveNow:o.a.func,showDownload:o.a.bool,showReconnect:o.a.bool,showSaveNow:o.a.bool};var sM=Object(s.b)(function(){return{}},function(A){return{onOpenConnectionModal:function(e){A(Object(AM.c)(e)),A(Object(C.n)())},onSaveNow:function(){A(Object(E.w)())}}})(rM),gM=i(930),lM=i.n(gM),cM=function(A){var e=A.alertsList,i=A.className,t=A.onCloseAlert;return a.a.createElement(hi.a,{bounds:"parent",className:i},a.a.createElement(hi.a,{className:lM.a.alertsInnerContainer},e.map(function(A,e){return a.a.createElement(sM,{closeButton:A.closeButton,content:A.content,extensionId:A.extensionId,extensionName:A.extensionName,iconSpinner:A.iconSpinner,iconURL:A.iconURL,index:e,key:e,level:A.level,message:A.message,showDownload:A.showDownload,showReconnect:A.showReconnect,showSaveNow:A.showSaveNow,onCloseAlert:t})})))};cM.propTypes={alertsList:o.a.arrayOf(o.a.object),className:o.a.string,onCloseAlert:o.a.func};var uM=cM,BM=function(A){var e=A.alertsList,i=A.className,t=A.onCloseAlert;return a.a.createElement(uM,{alertsList:Object(TA.e)(e),className:i,onCloseAlert:t})};BM.propTypes={alertsList:o.a.arrayOf(o.a.object),className:o.a.string,onCloseAlert:o.a.func};var dM=Object(s.b)(function(A){return{alertsList:A.scratchGui.alerts.alertsList}},function(A){return{onCloseAlert:function(e){return A(Object(TA.b)(e))}}})(BM),EM=i(305),hM=i.n(EM),CM=function(A){var e=A.dragging,i=A.img,t=A.currentOffset;return e?a.a.createElement("div",{className:hM.a.dragLayer},a.a.createElement("div",{className:hM.a.imageWrapper,style:{transform:"translate(".concat(t.x,"px, ").concat(t.y,"px)")}},a.a.createElement("img",{className:hM.a.image,src:i}))):null};CM.propTypes={currentOffset:o.a.shape({x:o.a.number.isRequired,y:o.a.number.isRequired}),dragging:o.a.bool.isRequired,img:o.a.string};var wM=CM,mM=Object(s.b)(function(A){return{dragging:A.scratchGui.assetDrag.dragging,currentOffset:A.scratchGui.assetDrag.currentOffset,img:A.scratchGui.assetDrag.img}})(wM),pM=i(40),IM=i.n(pM),fM=i(8),QM=i.n(fM);function DM(A){"@babel/helpers - typeof";return(DM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function MM(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function bM(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function yM(A,e){return(yM=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function TM(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=FM(A);if(e){var o=FM(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===DM(e)||"function"==typeof e))return e;return kM(A)}(this,i)}}function kM(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function FM(A){return(FM=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var vM=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&yM(A,e)}(i,a.a.Component);var e=TM(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(kM(t),["handleConnecting"]),t}return function(A,e,i){e&&bM(A.prototype,e),i&&bM(A,i)}(i,[{key:"handleConnecting",value:function(){this.props.onConnecting(this.props.peripheralId)}},{key:"render",value:function(){return a.a.createElement(hi.a,{className:QM.a.peripheralTile},a.a.createElement(hi.a,{className:QM.a.peripheralTileName},a.a.createElement("img",{className:QM.a.peripheralTileImage,src:this.props.connectionSmallIconURL}),a.a.createElement(hi.a,{className:QM.a.peripheralTileNameWrapper},a.a.createElement(hi.a,{className:QM.a.peripheralTileNameLabel},a.a.createElement(B.a,{defaultMessage:"Device name",id:"gui.connection.peripheral-name-label"})),a.a.createElement(hi.a,{className:QM.a.peripheralTileNameText},this.props.name))),a.a.createElement(hi.a,{className:QM.a.peripheralTileWidgets},a.a.createElement(hi.a,{className:QM.a.signalStrengthMeter},a.a.createElement("div",{className:Le()(QM.a.signalBar,MM({},QM.a.greenBar,this.props.rssi>-80))}),a.a.createElement("div",{className:Le()(QM.a.signalBar,MM({},QM.a.greenBar,this.props.rssi>-60))}),a.a.createElement("div",{className:Le()(QM.a.signalBar,MM({},QM.a.greenBar,this.props.rssi>-40))}),a.a.createElement("div",{className:Le()(QM.a.signalBar,MM({},QM.a.greenBar,this.props.rssi>-20))})),a.a.createElement("button",{onClick:this.handleConnecting},a.a.createElement(B.a,{defaultMessage:"Connect",id:"gui.connection.connect"}))))}}]),i}();vM.propTypes={connectionSmallIconURL:o.a.string,name:o.a.string,onConnecting:o.a.func,peripheralId:o.a.string,rssi:o.a.number};var SM=vM;function NM(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var RM=function(A){var e;return a.a.createElement(hi.a,{className:Le()(A.className,QM.a.dotsRow)},a.a.createElement("div",{className:Le()(QM.a.dotsHolder,(e={},NM(e,QM.a.dotsHolderError,A.error),NM(e,QM.a.dotsHolderSuccess,A.success),e))},Array(A.total).fill(0).map(function(e,i){var t="inactive";return A.counter===i&&(t="active"),A.success&&(t="success"),A.error&&(t="error"),a.a.createElement(OM,{key:"dot-".concat(i),type:t})})))};RM.propTypes={className:o.a.string,counter:o.a.number,error:o.a.bool,success:o.a.bool,total:o.a.number};var OM=function(A){var e;return a.a.createElement("div",{className:Le()(QM.a.dot,(e={},NM(e,QM.a.inactiveStepDot,"inactive"===A.type),NM(e,QM.a.activeStepDot,"active"===A.type),NM(e,QM.a.successDot,"success"===A.type),NM(e,QM.a.errorDot,"error"===A.type),e))})};OM.propTypes={type:o.a.string};var YM=RM,UM=i(218),GM=i.n(UM),HM=i(931),LM=i.n(HM),PM=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},A.scanning?0===A.peripheralList.length?a.a.createElement("div",{className:QM.a.activityAreaInfo},a.a.createElement("div",{className:QM.a.centeredRow},a.a.createElement("img",{className:Le()(QM.a.radarSmall,QM.a.radarSpin),src:GM.a}),a.a.createElement(B.a,{defaultMessage:"Looking for devices",id:"gui.connection.scanning.lookingforperipherals"}))):a.a.createElement("div",{className:QM.a.peripheralTilePane},A.peripheralList.map(function(e){return a.a.createElement(SM,{connectionSmallIconURL:A.connectionSmallIconURL,key:e.peripheralId,name:e.name,peripheralId:e.peripheralId,rssi:e.rssi,onConnecting:A.onConnecting})})):a.a.createElement(hi.a,{className:QM.a.instructions},a.a.createElement(B.a,{defaultMessage:"No devices found",id:"gui.connection.scanning.noPeripheralsFound"}))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.instructions)},a.a.createElement(B.a,{defaultMessage:"Select your device in the list above.",id:"gui.connection.scanning.instructions"})),a.a.createElement(YM,{className:QM.a.bottomAreaItem,counter:0,total:3}),a.a.createElement("button",{className:Le()(QM.a.bottomAreaItem,QM.a.connectionButton),onClick:A.onRefresh},a.a.createElement(B.a,{defaultMessage:"Refresh",id:"gui.connection.search"}),a.a.createElement("img",{className:QM.a.buttonIconRight,src:LM.a}))))};PM.propTypes={connectionSmallIconURL:o.a.string,onConnecting:o.a.func,onRefresh:o.a.func,peripheralList:o.a.arrayOf(o.a.shape({name:o.a.string,rssi:o.a.number,peripheralId:o.a.string})),scanning:o.a.bool.isRequired},PM.defaultProps={peripheralList:[],scanning:!0};var xM=PM;function _M(A){"@babel/helpers - typeof";return(_M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function jM(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function JM(A,e){return(JM=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function zM(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=WM(A);if(e){var o=WM(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===_M(e)||"function"==typeof e))return e;return KM(A)}(this,i)}}function KM(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function WM(A){return(WM=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var VM=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&JM(A,e)}(i,a.a.Component);var e=zM(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(KM(t),["handlePeripheralListUpdate","handlePeripheralScanTimeout","handleRefresh"]),t.state={scanning:!0,peripheralList:[]},t}return function(A,e,i){e&&jM(A.prototype,e),i&&jM(A,i)}(i,[{key:"componentDidMount",value:function(){this.props.vm.scanForPeripheral(this.props.extensionId),this.props.vm.on("PERIPHERAL_LIST_UPDATE",this.handlePeripheralListUpdate),this.props.vm.on("PERIPHERAL_SCAN_TIMEOUT",this.handlePeripheralScanTimeout)}},{key:"componentWillUnmount",value:function(){this.props.vm.removeListener("PERIPHERAL_LIST_UPDATE",this.handlePeripheralListUpdate),this.props.vm.removeListener("PERIPHERAL_SCAN_TIMEOUT",this.handlePeripheralScanTimeout)}},{key:"handlePeripheralScanTimeout",value:function(){this.setState({scanning:!1,peripheralList:[]})}},{key:"handlePeripheralListUpdate",value:function(A){var e=Object.keys(A).map(function(e){return A[e]});this.setState({peripheralList:e})}},{key:"handleRefresh",value:function(){this.props.vm.scanForPeripheral(this.props.extensionId),this.setState({scanning:!0,peripheralList:[]})}},{key:"render",value:function(){return a.a.createElement(xM,{connectionSmallIconURL:this.props.connectionSmallIconURL,peripheralList:this.state.peripheralList,phase:this.state.phase,scanning:this.state.scanning,title:this.props.extensionId,onConnected:this.props.onConnected,onConnecting:this.props.onConnecting,onRefresh:this.handleRefresh})}}]),i}();VM.propTypes={connectionSmallIconURL:o.a.string,extensionId:o.a.string.isRequired,onConnected:o.a.func.isRequired,onConnecting:o.a.func.isRequired,vm:o.a.instanceOf(u.a).isRequired};var XM=VM,ZM=i(141),qM=i.n(ZM),$M=i(175),Ab=i.n($M),eb=i(176),ib=i.n(eb),tb=IM()({prescan:null,pressbutton:null,notfound:null}),ob=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},a.a.createElement("div",{className:QM.a.activityAreaInfo},a.a.createElement("div",{className:QM.a.centeredRow},A.phase===tb.prescan&&a.a.createElement(a.a.Fragment,null,a.a.createElement("img",{className:QM.a.radarBig,src:GM.a}),a.a.createElement("img",{className:QM.a.bluetoothCenteredIcon,src:Ab.a})),A.phase===tb.pressbutton&&a.a.createElement(a.a.Fragment,null,a.a.createElement("img",{className:Le()(QM.a.radarBig,QM.a.radarSpin),src:GM.a}),a.a.createElement("img",{className:QM.a.connectionTipIcon,src:A.connectionTipIconURL})),A.phase===tb.notfound&&a.a.createElement(hi.a,{className:QM.a.instructions},a.a.createElement(B.a,{defaultMessage:"No devices found",id:"gui.connection.auto-scanning.noPeripheralsFound"}))))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.instructions)},A.phase===tb.prescan&&a.a.createElement(B.a,{defaultMessage:"Have your device nearby, then begin searching.",id:"gui.connection.auto-scanning.prescan"}),A.phase===tb.pressbutton&&a.a.createElement(B.a,{defaultMessage:"Press the button on your device.",id:"gui.connection.auto-scanning.pressbutton"})),a.a.createElement(YM,{className:QM.a.bottomAreaItem,counter:0,total:3}),a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.buttonRow)},A.phase===tb.prescan&&a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onStartScan},a.a.createElement(B.a,{defaultMessage:"Start Searching",id:"gui.connection.auto-scanning.start-search"})),A.phase===tb.pressbutton&&a.a.createElement("div",{className:QM.a.segmentedButton},a.a.createElement("button",{disabled:!0,className:QM.a.connectionButton},a.a.createElement(B.a,{defaultMessage:"Searching...",id:"gui.connection.connecting-searchbutton"})),a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onRefresh},a.a.createElement("img",{className:QM.a.abortConnectingIcon,src:qM.a}))),A.phase===tb.notfound&&a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onRefresh},a.a.createElement("img",{className:QM.a.buttonIconLeft,src:ib.a}),a.a.createElement(B.a,{defaultMessage:"Try again",id:"gui.connection.auto-scanning.try-again"})))))};function nb(A){"@babel/helpers - typeof";return(nb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function ab(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function rb(A,e){return(rb=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function sb(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=lb(A);if(e){var o=lb(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===nb(e)||"function"==typeof e))return e;return gb(A)}(this,i)}}function gb(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function lb(A){return(lb=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}ob.propTypes={connectionTipIconURL:o.a.string,onRefresh:o.a.func,onStartScan:o.a.func,phase:o.a.oneOf(Object.keys(tb))},ob.defaultProps={phase:tb.prescan};var cb=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&rb(A,e)}(i,a.a.Component);var e=sb(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(gb(t),["handlePeripheralListUpdate","handlePeripheralScanTimeout","handleStartScan","handleRefresh"]),t.state={phase:tb.prescan},t}return function(A,e,i){e&&ab(A.prototype,e),i&&ab(A,i)}(i,[{key:"componentWillUnmount",value:function(){this.unbindPeripheralUpdates()}},{key:"handlePeripheralScanTimeout",value:function(){this.setState({phase:tb.notfound}),this.unbindPeripheralUpdates()}},{key:"handlePeripheralListUpdate",value:function(A){var e=Object.keys(A).map(function(e){return A[e]});e.length>0&&this.props.onConnecting(e[0].peripheralId)}},{key:"bindPeripheralUpdates",value:function(){this.props.vm.on("PERIPHERAL_LIST_UPDATE",this.handlePeripheralListUpdate),this.props.vm.on("PERIPHERAL_SCAN_TIMEOUT",this.handlePeripheralScanTimeout)}},{key:"unbindPeripheralUpdates",value:function(){this.props.vm.removeListener("PERIPHERAL_LIST_UPDATE",this.handlePeripheralListUpdate),this.props.vm.removeListener("PERIPHERAL_SCAN_TIMEOUT",this.handlePeripheralScanTimeout)}},{key:"handleRefresh",value:function(){this.setState({phase:tb.prescan}),this.unbindPeripheralUpdates()}},{key:"handleStartScan",value:function(){this.bindPeripheralUpdates(),this.props.vm.scanForPeripheral(this.props.extensionId),this.setState({phase:tb.pressbutton})}},{key:"render",value:function(){return a.a.createElement(ob,{connectionTipIconURL:this.props.connectionTipIconURL,phase:this.state.phase,title:this.props.extensionId,onRefresh:this.handleRefresh,onStartScan:this.handleStartScan})}}]),i}();cb.propTypes={connectionTipIconURL:o.a.string,extensionId:o.a.string.isRequired,onConnecting:o.a.func.isRequired,vm:o.a.instanceOf(u.a).isRequired};var ub=cb,Bb=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},a.a.createElement(hi.a,{className:QM.a.centeredRow},a.a.createElement("div",{className:QM.a.peripheralActivity},a.a.createElement("img",{className:QM.a.peripheralActivityIcon,src:A.connectionIconURL}),a.a.createElement("img",{className:QM.a.bluetoothConnectingIcon,src:Ab.a})))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.instructions)},A.connectingMessage),a.a.createElement(YM,{className:QM.a.bottomAreaItem,counter:1,total:3}),a.a.createElement("div",{className:Le()(QM.a.bottomAreaItem,QM.a.segmentedButton)},a.a.createElement("button",{disabled:!0,className:QM.a.connectionButton},a.a.createElement(B.a,{defaultMessage:"Connecting...",id:"gui.connection.connecting-cancelbutton"})),a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onDisconnect},a.a.createElement("img",{className:QM.a.abortConnectingIcon,src:qM.a})))))};Bb.propTypes={connectingMessage:o.a.node.isRequired,connectionIconURL:o.a.string.isRequired,onDisconnect:o.a.func};var db=Bb,Eb=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},a.a.createElement(hi.a,{className:QM.a.centeredRow},a.a.createElement("div",{className:QM.a.peripheralActivity},a.a.createElement("img",{className:QM.a.peripheralActivityIcon,src:A.connectionIconURL}),a.a.createElement("img",{className:QM.a.bluetoothConnectedIcon,src:Ab.a})))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.instructions)},a.a.createElement(B.a,{defaultMessage:"Connected",id:"gui.connection.connected"})),a.a.createElement(YM,{success:!0,className:QM.a.bottomAreaItem,total:3}),a.a.createElement("div",{className:Le()(QM.a.bottomAreaItem,QM.a.cornerButtons)},a.a.createElement("button",{className:Le()(QM.a.redButton,QM.a.connectionButton),onClick:A.onDisconnect},a.a.createElement(B.a,{defaultMessage:"Disconnect",id:"gui.connection.disconnect"})),a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onCancel},a.a.createElement(B.a,{defaultMessage:"Go to Editor",id:"gui.connection.go-to-editor"})))))};Eb.propTypes={connectionIconURL:o.a.string.isRequired,onCancel:o.a.func,onDisconnect:o.a.func};var hb=Eb,Cb=i(288),wb=i.n(Cb),mb=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},a.a.createElement(hi.a,{className:QM.a.centeredRow},a.a.createElement("div",{className:QM.a.peripheralActivity},a.a.createElement("img",{className:QM.a.peripheralActivityIcon,src:A.connectionIconURL})))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement("div",{className:Le()(QM.a.bottomAreaItem,QM.a.instructions)},a.a.createElement(B.a,{defaultMessage:"Oops, looks like something went wrong.",id:"gui.connection.error.errorMessage"})),a.a.createElement(YM,{error:!0,className:QM.a.bottomAreaItem,total:3}),a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.buttonRow)},a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onScanning},a.a.createElement("img",{className:Le()(QM.a.buttonIconLeft,QM.a.buttonIconBack),src:ib.a}),a.a.createElement(B.a,{defaultMessage:"Try again",id:"gui.connection.error.tryagainbutton"})),a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onHelp},a.a.createElement("img",{className:QM.a.buttonIconLeft,src:wb.a}),a.a.createElement(B.a,{defaultMessage:"Help",id:"gui.connection.error.helpbutton"})))))};mb.propTypes={connectionIconURL:o.a.string.isRequired,onHelp:o.a.func,onScanning:o.a.func};var pb=mb,Ib=i(932),fb=i.n(Ib),Qb=i(933),Db=i.n(Qb),Mb=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},a.a.createElement("div",{className:QM.a.scratchLinkHelp},a.a.createElement("div",{className:QM.a.scratchLinkHelpStep},a.a.createElement("div",{className:QM.a.helpStepNumber},"1"),a.a.createElement("div",{className:QM.a.helpStepImage},a.a.createElement("img",{className:QM.a.scratchLinkIcon,src:Db.a})),a.a.createElement("div",{className:QM.a.helpStepText},a.a.createElement(B.a,{defaultMessage:"Make sure you have Scratch Link installed and running",id:"gui.connection.unavailable.installscratchlink"}))),a.a.createElement("div",{className:QM.a.scratchLinkHelpStep},a.a.createElement("div",{className:QM.a.helpStepNumber},"2"),a.a.createElement("div",{className:QM.a.helpStepImage},a.a.createElement("img",{className:QM.a.scratchLinkIcon,src:fb.a})),a.a.createElement("div",{className:QM.a.helpStepText},a.a.createElement(B.a,{defaultMessage:"Check that Bluetooth is enabled",id:"gui.connection.unavailable.enablebluetooth"}))))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement(YM,{error:!0,className:QM.a.bottomAreaItem,total:3}),a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.buttonRow)},a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onScanning},a.a.createElement("img",{className:Le()(QM.a.buttonIconLeft,QM.a.buttonIconBack),src:ib.a}),a.a.createElement(B.a,{defaultMessage:"Try again",id:"gui.connection.unavailable.tryagainbutton"})),a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onHelp},a.a.createElement("img",{className:QM.a.buttonIconLeft,src:wb.a}),a.a.createElement(B.a,{defaultMessage:"Help",id:"gui.connection.unavailable.helpbutton"})))))};Mb.propTypes={onHelp:o.a.func,onScanning:o.a.func};var bb=Mb,yb=IM()({scanning:null,connecting:null,connected:null,error:null,unavailable:null}),Tb=function(A){return a.a.createElement(Nl.a,{className:QM.a.modalContent,contentLabel:A.name,headerClassName:QM.a.header,headerImage:A.connectionSmallIconURL,id:"connectionModal",onHelp:A.onHelp,onRequestClose:A.onCancel},a.a.createElement(hi.a,{className:QM.a.body},A.phase===yb.scanning&&!A.useAutoScan&&a.a.createElement(XM,A),A.phase===yb.scanning&&A.useAutoScan&&a.a.createElement(ub,A),A.phase===yb.connecting&&a.a.createElement(db,A),A.phase===yb.connected&&a.a.createElement(hb,A),A.phase===yb.error&&a.a.createElement(pb,A),A.phase===yb.unavailable&&a.a.createElement(bb,A)))};Tb.propTypes={connectingMessage:o.a.node.isRequired,connectionSmallIconURL:o.a.string,connectionTipIconURL:o.a.string,name:o.a.node,onCancel:o.a.func.isRequired,onHelp:o.a.func.isRequired,phase:o.a.oneOf(Object.keys(yb)).isRequired,title:o.a.string.isRequired,useAutoScan:o.a.bool.isRequired},Tb.defaultProps={connectingMessage:"Connecting"};var kb=i(134);function Fb(A){"@babel/helpers - typeof";return(Fb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function vb(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Sb(A,e){return(Sb=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Nb(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Ob(A);if(e){var o=Ob(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Fb(e)||"function"==typeof e))return e;return Rb(A)}(this,i)}}function Rb(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Ob(A){return(Ob=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Yb=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Sb(A,e)}(i,a.a.Component);var e=Nb(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Rb(t),["handleScanning","handleCancel","handleConnected","handleConnecting","handleDisconnect","handleError","handleHelp"]),t.state={extension:kb.a.find(function(e){return e.extensionId===A.extensionId}),phase:A.vm.getPeripheralIsConnected(A.extensionId)?yb.connected:yb.scanning},t}return function(A,e,i){e&&vb(A.prototype,e),i&&vb(A,i)}(i,[{key:"componentDidMount",value:function(){this.props.vm.on("PERIPHERAL_CONNECTED",this.handleConnected),this.props.vm.on("PERIPHERAL_REQUEST_ERROR",this.handleError)}},{key:"componentWillUnmount",value:function(){this.props.vm.removeListener("PERIPHERAL_CONNECTED",this.handleConnected),this.props.vm.removeListener("PERIPHERAL_REQUEST_ERROR",this.handleError)}},{key:"handleScanning",value:function(){this.setState({phase:yb.scanning})}},{key:"handleConnecting",value:function(A){this.props.vm.connectPeripheral(this.props.extensionId,A),this.setState({phase:yb.connecting}),LA.a.event({category:"extensions",action:"connecting",label:this.props.extensionId})}},{key:"handleDisconnect",value:function(){try{this.props.vm.disconnectPeripheral(this.props.extensionId)}finally{this.props.onCancel()}}},{key:"handleCancel",value:function(){try{this.props.vm.getPeripheralIsConnected(this.props.extensionId)||this.props.vm.disconnectPeripheral(this.props.extensionId)}finally{this.props.onCancel()}}},{key:"handleError",value:function(){this.state.phase===yb.scanning||this.state.phase===yb.unavailable?this.setState({phase:yb.unavailable}):(this.setState({phase:yb.error}),LA.a.event({category:"extensions",action:"connecting error",label:this.props.extensionId}))}},{key:"handleConnected",value:function(){this.setState({phase:yb.connected}),LA.a.event({category:"extensions",action:"connected",label:this.props.extensionId})}},{key:"handleHelp",value:function(){window.open(this.state.extension.helpLink,"_blank"),LA.a.event({category:"extensions",action:"help",label:this.props.extensionId})}},{key:"render",value:function(){return a.a.createElement(Tb,{connectingMessage:this.state.extension&&this.state.extension.connectingMessage,connectionIconURL:this.state.extension&&this.state.extension.connectionIconURL,connectionSmallIconURL:this.state.extension&&this.state.extension.connectionSmallIconURL,connectionTipIconURL:this.state.extension&&this.state.extension.connectionTipIconURL,extensionId:this.props.extensionId,name:this.state.extension&&this.state.extension.name,phase:this.state.phase,title:this.props.extensionId,useAutoScan:this.state.extension&&this.state.extension.useAutoScan,vm:this.props.vm,onCancel:this.handleCancel,onConnected:this.handleConnected,onConnecting:this.handleConnecting,onDisconnect:this.handleDisconnect,onHelp:this.handleHelp,onScanning:this.handleScanning})}}]),i}();Yb.propTypes={extensionId:o.a.string.isRequired,onCancel:o.a.func.isRequired,vm:o.a.instanceOf(u.a).isRequired};var Ub=Object(s.b)(function(A){return{extensionId:A.scratchGui.connectionModal.extensionId}},function(A){return{onCancel:function(){A(Object(C.b)())}}})(Yb),Gb=i(91),Hb=i.n(Gb);function Lb(A){"@babel/helpers - typeof";return(Lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Pb(){return(Pb=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function xb(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function _b(A,e){return(_b=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function jb(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=zb(A);if(e){var o=zb(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Lb(e)||"function"==typeof e))return e;return Jb(A)}(this,i)}}function Jb(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function zb(A){return(zb=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Kb=Object(B.d)({label:{id:"gui.telemetryOptIn.label",defaultMessage:"Report statistics to improve Scratch"},bodyText1:{id:"gui.telemetryOptIn.body1",defaultMessage:"The Scratch Team is always looking to better understand how Scratch is used around the world. To help support this effort, you can allow Scratch to automatically send usage information to the Scratch Team."},bodyText2:{id:"gui.telemetryOptIn.body2",defaultMessage:"The information we collect includes language selection, blocks usage, and some events like saving, loading, and uploading a project. We DO NOT collect any personal information. Please see our {privacyPolicyLink} for more information."},privacyPolicyLink:{id:"gui.telemetryOptIn.privacyPolicyLink",defaultMessage:"Privacy Policy"},optInText:{id:"gui.telemetryOptIn.optInText",defaultMessage:"Share my usage data with the Scratch Team"},optInTooltip:{id:"gui.telemetryOptIn.optInTooltip",defaultMessage:"Enable telemetry"},optOutText:{id:"gui.telemetryOptIn.optOutText",defaultMessage:"Do not share my usage data with the Scratch Team"},optOutTooltip:{id:"gui.telemetryOptIn.optOutTooltip",defaultMessage:"Disable telemetry"},settingWasUpdated:{id:"gui.telemetryOptIn.settingWasUpdated",defaultMessage:"Your setting was updated."},closeButton:{id:"gui.telemetryOptIn.buttonClose",defaultMessage:"Close"}}),Wb=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&_b(A,e)}(i,a.a.PureComponent);var e=jb(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Jb(t),["handleCancel","handleOptInOutChanged"]),t.state={settingWasUpdatedTimer:null},t}return function(A,e,i){e&&xb(A.prototype,e),i&&xb(A,i)}(i,[{key:"componentWillUnmount",value:function(){this.state.settingWasUpdatedTimer&&clearTimeout(this.state.settingWasUpdatedTimer)}},{key:"handleCancel",value:function(){this.props.onRequestClose(),this.props.onCancel&&this.props.onCancel()}},{key:"handleOptInOutChanged",value:function(A){"true"===A.target.value?this.props.onOptIn&&(this.props.onOptIn(),this.handleSettingWasUpdated()):"false"===A.target.value&&this.props.onOptOut&&(this.props.onOptOut(),this.handleSettingWasUpdated())}},{key:"handleSettingWasUpdated",value:function(){var A=this;this.state.settingWasUpdatedTimer&&clearTimeout(this.state.settingWasUpdatedTimer);var e=setTimeout(function(){return A.handleSettingWasUpdatedTimeout(e)},3e3);this.setState({settingWasUpdatedTimer:e})}},{key:"handleSettingWasUpdatedTimeout",value:function(A){A===this.state.settingWasUpdatedTimer&&this.setState({settingWasUpdatedTimer:null})}},{key:"render",value:function(){var A="boolean"!=typeof this.props.isTelemetryEnabled,e=!1===this.props.isTelemetryEnabled,i=!0===this.props.isTelemetryEnabled,t=this.state.settingWasUpdatedTimer&&a.a.createElement(B.a,Kb.settingWasUpdated);return a.a.createElement(l.a,{isOpen:!0,className:Hb.a.modalContent,contentLabel:this.props.intl.formatMessage(Kb.label),overlayClassName:Hb.a.modalOverlay,onRequestClose:this.handleCancel},a.a.createElement("div",{dir:this.props.isRtl?"rtl":"ltr"},a.a.createElement(hi.a,{className:Hb.a.illustration}),a.a.createElement(hi.a,{className:Hb.a.body},a.a.createElement("p",null,a.a.createElement(B.a,Kb.bodyText1)),a.a.createElement("p",null,a.a.createElement(B.a,Pb({},Kb.bodyText2,{values:{privacyPolicyLink:a.a.createElement("a",{className:Hb.a.privacyPolicyLink,href:"https://scratch.mit.edu/privacy_policy/",onClick:this.props.onShowPrivacyPolicy,target:"_blank",rel:"noopener noreferrer"},a.a.createElement(B.a,Kb.privacyPolicyLink))}}))),a.a.createElement(hi.a,{className:Hb.a.radioButtons},a.a.createElement("label",{className:i?Hb.a.labelSelected:null},a.a.createElement("input",{name:"optInOut",type:"radio",value:"true",title:this.props.intl.formatMessage(Kb.optInTooltip),checked:!0===this.props.isTelemetryEnabled,onChange:this.handleOptInOutChanged}),a.a.createElement(B.a,Kb.optInText)),a.a.createElement("label",{className:e?Hb.a.labelSelected:null},a.a.createElement("input",{name:"optInOut",type:"radio",value:"false",title:this.props.intl.formatMessage(Kb.optOutTooltip),checked:!1===this.props.isTelemetryEnabled,onChange:this.handleOptInOutChanged}),a.a.createElement(B.a,Kb.optOutText))),a.a.createElement(hi.a,{className:Hb.a.buttonRow},a.a.createElement("span",{className:Hb.a.settingWasUpdated,key:this.state.settingWasUpdatedTimer},t),a.a.createElement("button",{className:Hb.a.optIn,onClick:this.props.onRequestClose,disabled:A},a.a.createElement(B.a,Kb.closeButton))))))}}]),i}();Wb.propTypes={intl:B.f.isRequired,isRtl:o.a.bool,isTelemetryEnabled:o.a.bool,onCancel:o.a.func,onOptIn:o.a.func.isRequired,onOptOut:o.a.func.isRequired,onRequestClose:o.a.func,onShowPrivacyPolicy:o.a.func};var Vb=Object(B.e)(Wb),Xb=i(44),Zb=i.n(Xb),qb=i(934),$b=i.n(qb),Ay=i(935),ey=i.n(Ay),iy=i(936),ty=i.n(iy),oy=i(937),ny=i.n(oy),ay=i(938),ry=i.n(ay),sy=(i(1568),i(939)),gy=i.n(sy),ly=i(940),cy=i.n(ly),uy=i(941),By=i.n(uy),dy=i(59),Ey=i.n(dy),hy=Object(B.d)({largeStageSizeMessage:{id:"gui.stageHeader.stageSizeLarge",defaultMessage:"Switch to large stage"},smallStageSizeMessage:{id:"gui.stageHeader.stageSizeSmall",defaultMessage:"Switch to small stage"},fullStageSizeMessage:{id:"gui.stageHeader.stageSizeFull",defaultMessage:"Enter full screen mode"},unFullStageSizeMessage:{id:"gui.stageHeader.stageSizeUnFull",defaultMessage:"Exit full screen mode"},fullscreenControl:{id:"gui.stageHeader.fullscreenControl",defaultMessage:"Full Screen Control"}}),Cy=function(A){var e=A.isFullScreen,i=A.isPlayerOnly,t=A.onKeyPress,o=A.onSetStageLarge,n=A.onSetStageSmall,r=A.onSetStageUnFull,s=A.showBranding,g=A.stageSizeMode,l=A.vm,c=null;if(e){var u=WB(null,!0),B=s?a.a.createElement("div",{className:Ey.a.embedScratchLogo},a.a.createElement("a",{href:"https://scratch.mit.edu",rel:"noopener noreferrer",target:"_blank"},a.a.createElement("img",{alt:"Scratch",src:ed.a}))):a.a.createElement(xu.a,{className:Ey.a.stageButton,onClick:r,onKeyPress:t},a.a.createElement("img",{alt:A.intl.formatMessage(hy.unFullStageSizeMessage),className:Ey.a.stageButtonIcon,draggable:!1,src:By.a,title:A.intl.formatMessage(hy.fullscreenControl)}));c=a.a.createElement(hi.a,{className:Ey.a.stageHeaderWrapperOverlay},a.a.createElement(hi.a,{className:Ey.a.stageMenuWrapper,style:{width:u.width}},a.a.createElement(JB.a,{vm:l}),B))}else{var d=i?[]:a.a.createElement("div",{className:Ey.a.stageSizeToggleGroup},a.a.createElement("div",null,a.a.createElement(xu.a,{className:Le()(Ey.a.stageButton,Ey.a.stageButtonFirst,g===Pa.d.small?null:Ey.a.stageButtonToggledOff),onClick:n},a.a.createElement("img",{alt:A.intl.formatMessage(hy.smallStageSizeMessage),className:Ey.a.stageButtonIcon,draggable:!1,src:cy.a}))),a.a.createElement("div",null,a.a.createElement(xu.a,{className:Le()(Ey.a.stageButton,Ey.a.stageButtonLast,g===Pa.d.large?null:Ey.a.stageButtonToggledOff),onClick:o},a.a.createElement("img",{alt:A.intl.formatMessage(hy.largeStageSizeMessage),className:Ey.a.stageButtonIcon,draggable:!1,src:gy.a}))));c=a.a.createElement(hi.a,{className:Ey.a.stageHeaderWrapper},a.a.createElement(hi.a,{className:Ey.a.stageMenuWrapper},a.a.createElement("div",{className:Ey.a.stageSizeRow},d)))}return c};Cy.propTypes={intl:B.f,isFullScreen:o.a.bool.isRequired,isPlayerOnly:o.a.bool.isRequired,onKeyPress:o.a.func.isRequired,onSetStageFull:o.a.func.isRequired,onSetStageLarge:o.a.func.isRequired,onSetStageSmall:o.a.func.isRequired,onSetStageUnFull:o.a.func.isRequired,showBranding:o.a.bool.isRequired,stageSizeMode:o.a.oneOf(Object.keys(Pa.d)),vm:o.a.instanceOf(u.a).isRequired},Cy.defaultProps={stageSizeMode:Pa.d.large};var wy=Object(B.e)(Object(s.b)(function(A){return{stageSizeMode:A.scratchGui.stageSize.stageSize}})(Cy));function my(A){"@babel/helpers - typeof";return(my="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function py(){return(py=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Iy(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function fy(A,e){return(fy=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Qy(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=My(A);if(e){var o=My(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===my(e)||"function"==typeof e))return e;return Dy(A)}(this,i)}}function Dy(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function My(A){return(My=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var by=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&fy(A,e)}(i,a.a.Component);var e=Qy(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Dy(t),["handleKeyPress"]),t}return function(A,e,i){e&&Iy(A.prototype,e),i&&Iy(A,i)}(i,[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyPress)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyPress)}},{key:"handleKeyPress",value:function(A){"Escape"===A.key&&this.props.isFullScreen&&this.props.onSetStageUnFull(!1)}},{key:"render",value:function(){var A=py({},this.props);return a.a.createElement(wy,py({},A,{onKeyPress:this.handleKeyPress}))}}]),i}();by.propTypes={isFullScreen:o.a.bool,isPlayerOnly:o.a.bool,onSetStageUnFull:o.a.func.isRequired,showBranding:o.a.bool,stageSizeMode:o.a.oneOf(Object.keys(Pa.d)),vm:o.a.instanceOf(u.a).isRequired};var yy=Object(s.b)(function(A){return{stageSizeMode:A.scratchGui.stageSize.stageSize,showBranding:A.scratchGui.mode.showBranding,isFullScreen:A.scratchGui.mode.isFullScreen,isPlayerOnly:A.scratchGui.mode.isPlayerOnly}},function(A){return{onSetStageLarge:function(){return A(Object(_B.b)(Pa.d.large))},onSetStageSmall:function(){return A(Object(_B.b)(Pa.d.small))},onSetStageFull:function(){return A(Object(jB.c)(!0))},onSetStageUnFull:function(){return A(Object(jB.c)(!1))}}})(by),Ty=i(105);function ky(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var Fy=Object(B.d)({motion_direction:{id:"gui.opcodeLabels.direction",defaultMessage:"direction"},motion_xposition:{id:"gui.opcodeLabels.xposition",defaultMessage:"x position"},motion_yposition:{id:"gui.opcodeLabels.yposition",defaultMessage:"y position"},looks_size:{id:"gui.opcodeLabels.size",defaultMessage:"size"},looks_costumename:{id:"gui.opcodeLabels.costumename",defaultMessage:"costume name"},looks_costumenumber:{id:"gui.opcodeLabels.costumenumber",defaultMessage:"costume number"},looks_backdropname:{id:"gui.opcodeLabels.backdropname",defaultMessage:"backdrop name"},looks_backdropnumber:{id:"gui.opcodeLabels.backdropnumber",defaultMessage:"backdrop number"},sound_volume:{id:"gui.opcodeLabels.volume",defaultMessage:"volume"},sound_tempo:{id:"gui.opcodeLabels.tempo",defaultMessage:"tempo"},sensing_answer:{id:"gui.opcodeLabels.answer",defaultMessage:"answer"},sensing_loudness:{id:"gui.opcodeLabels.loudness",defaultMessage:"loudness"},sensing_username:{id:"gui.opcodeLabels.username",defaultMessage:"username"},sensing_current_year:{id:"gui.opcodeLabels.year",defaultMessage:"year"},sensing_current_month:{id:"gui.opcodeLabels.month",defaultMessage:"month"},sensing_current_date:{id:"gui.opcodeLabels.date",defaultMessage:"date"},sensing_current_dayofweek:{id:"gui.opcodeLabels.dayofweek",defaultMessage:"day of week"},sensing_current_hour:{id:"gui.opcodeLabels.hour",defaultMessage:"hour"},sensing_current_minute:{id:"gui.opcodeLabels.minute",defaultMessage:"minute"},sensing_current_second:{id:"gui.opcodeLabels.second",defaultMessage:"second"},sensing_timer:{id:"gui.opcodeLabels.timer",defaultMessage:"timer"}}),vy=new(function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this._translator=function(A){return A.defaultMessage},this._opcodeMap={motion_direction:{category:"motion"},motion_xposition:{category:"motion"},motion_yposition:{category:"motion"},looks_size:{category:"looks"},looks_costumenumbername:{category:"looks"},looks_backdropnumbername:{category:"looks"},looks_backdropname:{category:"looks"},data_variable:{category:"data"},data_listcontents:{category:"list"},sound_volume:{category:"sound"},sound_tempo:{category:"sound"},sensing_answer:{category:"sensing"},sensing_loudness:{category:"sensing"},sensing_username:{category:"sensing"},sensing_current:{category:"sensing"},sensing_timer:{category:"sensing"}},this._refreshOpcodeMap()}return function(A,e,i){e&&ky(A.prototype,e),i&&ky(A,i)}(A,[{key:"setTranslatorFunction",value:function(A){this._translator=A,this._refreshOpcodeMap()}},{key:"_refreshOpcodeMap",value:function(){var A=this;this._opcodeMap.motion_direction.labelFn=function(){return A._translator(Fy.motion_direction)},this._opcodeMap.motion_xposition.labelFn=function(){return A._translator(Fy.motion_xposition)},this._opcodeMap.motion_yposition.labelFn=function(){return A._translator(Fy.motion_yposition)},this._opcodeMap.looks_size.labelFn=function(){return A._translator(Fy.looks_size)},this._opcodeMap.looks_costumenumbername.labelFn=function(e){return"number"===e.NUMBER_NAME?A._translator(Fy.looks_costumenumber):A._translator(Fy.looks_costumename)},this._opcodeMap.looks_backdropnumbername.labelFn=function(e){return"number"===e.NUMBER_NAME?A._translator(Fy.looks_backdropnumber):A._translator(Fy.looks_backdropname)},this._opcodeMap.looks_backdropname.labelFn=function(){return A._translator(Fy.looks_backdropname)},this._opcodeMap.data_variable.labelFn=function(A){return A.VARIABLE},this._opcodeMap.data_listcontents.labelFn=function(A){return A.LIST},this._opcodeMap.sound_volume.labelFn=function(){return A._translator(Fy.sound_volume)},this._opcodeMap.sound_tempo.labelFn=function(){return A._translator(Fy.sound_tempo)},this._opcodeMap.sensing_answer.labelFn=function(){return A._translator(Fy.sensing_answer)},this._opcodeMap.sensing_loudness.labelFn=function(){return A._translator(Fy.sensing_loudness)},this._opcodeMap.sensing_username.labelFn=function(){return A._translator(Fy.sensing_username)},this._opcodeMap.sensing_current.labelFn=function(e){switch(e.CURRENTMENU.toLowerCase()){case"year":return A._translator(Fy.sensing_current_year);case"month":return A._translator(Fy.sensing_current_month);case"date":return A._translator(Fy.sensing_current_date);case"dayofweek":return A._translator(Fy.sensing_current_dayofweek);case"hour":return A._translator(Fy.sensing_current_hour);case"minute":return A._translator(Fy.sensing_current_minute);case"second":return A._translator(Fy.sensing_current_second)}},this._opcodeMap.sensing_timer.labelFn=function(){return A._translator(Fy.sensing_timer)}}},{key:"getLabel",value:function(A){return A in this._opcodeMap?this._opcodeMap[A]:{category:"extension",label:A}}}]),A}()),Sy=i(46),Ny=i.n(Sy),Ry=i(29),Oy=i.n(Ry),Yy=function(A){var e=A.categoryColor,i=A.label,t=A.value;return a.a.createElement("div",{className:Oy.a.defaultMonitor},a.a.createElement("div",{className:Oy.a.row},a.a.createElement("div",{className:Oy.a.label},i),a.a.createElement("div",{className:Oy.a.value,style:{background:e}},t)))};Yy.propTypes={categoryColor:o.a.string.isRequired,label:o.a.string.isRequired,value:o.a.oneOfType([o.a.string,o.a.number])};var Uy=Yy,Gy=function(A){var e=A.categoryColor,i=A.value;return a.a.createElement("div",{className:Oy.a.largeMonitor},a.a.createElement("div",{className:Oy.a.largeValue,style:{background:e}},i))};Gy.propTypes={categoryColor:o.a.string,value:o.a.oneOfType([o.a.string,o.a.number])};var Hy=Gy,Ly=function(A,e,i){return(e?A.runtime.getTargetById(e):A.runtime.getTargetForStage()).variables[i]},Py=function(A,e,i){var t=Ly(A,e,i);return t.value instanceof Array?t.value.slice():t.value},xy=function(A,e,i,t){Ly(A,e,i).value=t},_y=function(A){var e=A.categoryColor,i=A.isDiscrete,t=A.label,o=A.min,n=A.max,r=A.value,s=A.onSliderUpdate;return a.a.createElement("div",{className:Oy.a.defaultMonitor},a.a.createElement("div",{className:Oy.a.row},a.a.createElement("div",{className:Oy.a.label},t),a.a.createElement("div",{className:Oy.a.value,style:{background:e}},r)),a.a.createElement("div",{className:Oy.a.row},a.a.createElement("input",{className:Le()(Oy.a.slider,"no-drag"),max:n,min:o,step:i?1:.01,type:"range",value:r,onChange:s})))};_y.propTypes={categoryColor:o.a.string.isRequired,isDiscrete:o.a.bool,label:o.a.string.isRequired,max:o.a.number,min:o.a.number,onSliderUpdate:o.a.func.isRequired,value:o.a.oneOfType([o.a.string,o.a.number])},_y.defaultProps={isDiscrete:!0,min:0,max:100};var jy=_y;function Jy(A){"@babel/helpers - typeof";return(Jy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var zy=["vm","value"];function Ky(){return(Ky=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Wy(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Vy(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Xy(A,e){return(Xy=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Zy(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=$y(A);if(e){var o=$y(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Jy(e)||"function"==typeof e))return e;return qy(A)}(this,i)}}function qy(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function $y(A){return($y=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var AT=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Xy(A,e)}(i,a.a.Component);var e=Zy(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(qy(t),["handleSliderUpdate"]),t.state={value:A.value},t}return function(A,e,i){e&&Vy(A.prototype,e),i&&Vy(A,i)}(i,[{key:"componentWillReceiveProps",value:function(A){this.state.value!==A.value&&this.setState({value:A.value})}},{key:"handleSliderUpdate",value:function(A){this.setState({value:Number(A.target.value)});var e=this.props,i=e.vm,t=e.targetId,o=e.id;xy(i,t,o,Number(A.target.value))}},{key:"render",value:function(){var A=this.props,e=(A.vm,A.value,Wy(A,zy));return a.a.createElement(jy,Ky({},e,{value:this.state.value,onSliderUpdate:this.handleSliderUpdate}))}}]),i}();AT.propTypes={id:o.a.string,targetId:o.a.string,value:o.a.oneOfType([o.a.number,o.a.string]),vm:o.a.instanceOf(u.a)};var eT=Object(s.b)(function(A){return{vm:A.scratchGui.vm}})(AT),iT=i(33),tT=i.n(iT),oT=i(20),nT=i.n(oT),aT=i(22),rT=i.n(aT),sT=i(28),gT=i.n(sT),lT=i(34),cT=i.n(lT),uT=i(93),BT=i(289),dT=i.n(BT),ET=i(18),hT=i.n(ET);function CT(A){var e=A.cellCount,i=A.cellSize,t=A.computeMetadataCallback,o=A.computeMetadataCallbackProps,n=A.nextCellsCount,a=A.nextCellSize,r=A.nextScrollToIndex,s=A.scrollToIndex,g=A.updateScrollOffsetForScrollToIndex;e===n&&("number"!=typeof i&&"number"!=typeof a||i===a)||(t(o),s>=0&&s===r&&g())}var wT=i(118),mT=i.n(wT),pT=(o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.bool.isRequired,o.a.bool.isRequired,o.a.string.isRequired,o.a.object.isRequired,o.a.number.isRequired,o.a.object.isRequired,o.a.func),IT=(o.a.objectOf(o.a.node.isRequired),o.a.objectOf(o.a.object.isRequired),o.a.objectOf(o.a.node.isRequired).isRequired,o.a.func.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.object,o.a.number.isRequired,o.a.bool.isRequired,o.a.bool.isRequired,o.a.object.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.objectOf(o.a.object.isRequired).isRequired,o.a.number.isRequired,o.a.object.isRequired,o.a.object.isRequired,o.a.func),fT=(o.a.func,o.a.oneOfType([o.a.func,o.a.number])),QT=o.a.func,DT=(o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.bool.isRequired,o.a.bool.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.oneOf(["horizontal","vertical"]).isRequired,o.a.oneOf([-1,1]).isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.func),MT=o.a.oneOf(["auto","end","start","center"]),bT=(o.a.number,o.a.number,function(){function A(e){var i=e.cellCount,t=e.cellSizeGetter,o=e.estimatedCellSize;nT()(this,A),this._cellSizeAndPositionData={},this._lastMeasuredIndex=-1,this._lastBatchedIndex=-1,this._cellSizeGetter=t,this._cellCount=i,this._estimatedCellSize=o}return rT()(A,[{key:"areOffsetsAdjusted",value:function(){return!1}},{key:"configure",value:function(A){var e=A.cellCount,i=A.estimatedCellSize,t=A.cellSizeGetter;this._cellCount=e,this._estimatedCellSize=i,this._cellSizeGetter=t}},{key:"getCellCount",value:function(){return this._cellCount}},{key:"getEstimatedCellSize",value:function(){return this._estimatedCellSize}},{key:"getLastMeasuredIndex",value:function(){return this._lastMeasuredIndex}},{key:"getOffsetAdjustment",value:function(){return 0}},{key:"getSizeAndPositionOfCell",value:function(A){if(A<0||A>=this._cellCount)throw Error("Requested index "+A+" is outside of range 0.."+this._cellCount);if(A>this._lastMeasuredIndex)for(var e=this.getSizeAndPositionOfLastMeasuredCell(),i=e.offset+e.size,t=this._lastMeasuredIndex+1;t<=A;t++){var o=this._cellSizeGetter({index:t});if(void 0===o||isNaN(o))throw Error("Invalid size returned for cell "+t+" of value "+o);null===o?(this._cellSizeAndPositionData[t]={offset:i,size:0},this._lastBatchedIndex=A):(this._cellSizeAndPositionData[t]={offset:i,size:o},i+=o,this._lastMeasuredIndex=A)}return this._cellSizeAndPositionData[A]}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}}},{key:"getTotalSize",value:function(){var A=this.getSizeAndPositionOfLastMeasuredCell();return A.offset+A.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize}},{key:"getUpdatedOffsetForIndex",value:function(A){var e=A.align,i=void 0===e?"auto":e,t=A.containerSize,o=A.currentOffset,n=A.targetIndex;if(t<=0)return 0;var a=this.getSizeAndPositionOfCell(n),r=a.offset,s=r-t+a.size,g=void 0;switch(i){case"start":g=r;break;case"end":g=s;break;case"center":g=r-(t-a.size)/2;break;default:g=Math.max(s,Math.min(r,o))}var l=this.getTotalSize();return Math.max(0,Math.min(l-t,g))}},{key:"getVisibleCellRange",value:function(A){var e=A.containerSize,i=A.offset;if(0===this.getTotalSize())return{};var t=i+e,o=this._findNearestCell(i),n=this.getSizeAndPositionOfCell(o);i=n.offset+n.size;for(var a=o;i<t&&a<this._cellCount-1;)a++,i+=this.getSizeAndPositionOfCell(a).size;return{start:o,stop:a}}},{key:"resetCell",value:function(A){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,A-1)}},{key:"_binarySearch",value:function(A,e,i){for(;e<=A;){var t=e+Math.floor((A-e)/2),o=this.getSizeAndPositionOfCell(t).offset;if(o===i)return t;o<i?e=t+1:o>i&&(A=t-1)}return e>0?e-1:0}},{key:"_exponentialSearch",value:function(A,e){for(var i=1;A<this._cellCount&&this.getSizeAndPositionOfCell(A).offset<e;)A+=i,i*=2;return this._binarySearch(Math.min(A,this._cellCount-1),Math.floor(A/2),e)}},{key:"_findNearestCell",value:function(A){if(isNaN(A))throw Error("Invalid offset "+A+" specified");A=Math.max(0,A);var e=this.getSizeAndPositionOfLastMeasuredCell(),i=Math.max(0,this._lastMeasuredIndex);return e.offset>=A?this._binarySearch(i,0,A):this._exponentialSearch(i,A)}}]),A}()),yT=function(){return"undefined"!=typeof window&&window.chrome&&window.chrome.webstore?16777100:15e5},TT=function(){function A(e){var i=e.maxScrollSize,t=void 0===i?yT():i,o=mT()(e,["maxScrollSize"]);nT()(this,A),this._cellSizeAndPositionManager=new bT(o),this._maxScrollSize=t}return rT()(A,[{key:"areOffsetsAdjusted",value:function(){return this._cellSizeAndPositionManager.getTotalSize()>this._maxScrollSize}},{key:"configure",value:function(A){this._cellSizeAndPositionManager.configure(A)}},{key:"getCellCount",value:function(){return this._cellSizeAndPositionManager.getCellCount()}},{key:"getEstimatedCellSize",value:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()}},{key:"getLastMeasuredIndex",value:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()}},{key:"getOffsetAdjustment",value:function(A){var e=A.containerSize,i=A.offset,t=this._cellSizeAndPositionManager.getTotalSize(),o=this.getTotalSize(),n=this._getOffsetPercentage({containerSize:e,offset:i,totalSize:o});return Math.round(n*(o-t))}},{key:"getSizeAndPositionOfCell",value:function(A){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(A)}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()}},{key:"getTotalSize",value:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())}},{key:"getUpdatedOffsetForIndex",value:function(A){var e=A.align,i=void 0===e?"auto":e,t=A.containerSize,o=A.currentOffset,n=A.targetIndex;o=this._safeOffsetToOffset({containerSize:t,offset:o});var a=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({align:i,containerSize:t,currentOffset:o,targetIndex:n});return this._offsetToSafeOffset({containerSize:t,offset:a})}},{key:"getVisibleCellRange",value:function(A){var e=A.containerSize,i=A.offset;return i=this._safeOffsetToOffset({containerSize:e,offset:i}),this._cellSizeAndPositionManager.getVisibleCellRange({containerSize:e,offset:i})}},{key:"resetCell",value:function(A){this._cellSizeAndPositionManager.resetCell(A)}},{key:"_getOffsetPercentage",value:function(A){var e=A.containerSize,i=A.offset,t=A.totalSize;return t<=e?0:i/(t-e)}},{key:"_offsetToSafeOffset",value:function(A){var e=A.containerSize,i=A.offset,t=this._cellSizeAndPositionManager.getTotalSize(),o=this.getTotalSize();if(t===o)return i;var n=this._getOffsetPercentage({containerSize:e,offset:i,totalSize:t});return Math.round(n*(o-e))}},{key:"_safeOffsetToOffset",value:function(A){var e=A.containerSize,i=A.offset,t=this._cellSizeAndPositionManager.getTotalSize(),o=this.getTotalSize();if(t===o)return i;var n=this._getOffsetPercentage({containerSize:e,offset:i,totalSize:o});return Math.round(n*(t-e))}}]),A}(),kT=i(159),FT=i.n(kT);function vT(){var A=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e={};return function(i){var t=i.callback,o=i.indices,n=FT()(o),a=!A||n.every(function(A){var e=o[A];return Array.isArray(e)?e.length>0:e>=0}),r=n.length!==FT()(e).length||n.some(function(A){var i=e[A],t=o[A];return Array.isArray(t)?i.join(",")!==t.join(","):i!==t});e=o,a&&r&&t(o)}}var ST=1;function NT(A){var e=A.cellSize,i=A.cellSizeAndPositionManager,t=A.previousCellsCount,o=A.previousCellSize,n=A.previousScrollToAlignment,a=A.previousScrollToIndex,r=A.previousSize,s=A.scrollOffset,g=A.scrollToAlignment,l=A.scrollToIndex,c=A.size,u=A.sizeJustIncreasedFromZero,B=A.updateScrollIndexCallback,d=i.getCellCount(),E=l>=0&&l<d;E&&(c!==r||u||!o||"number"==typeof e&&e!==o||g!==n||l!==a)?B(l):!E&&d>0&&(c<r||d<t)&&s>i.getTotalSize()-c&&B(d-1)}function RT(A,e){e&&(e.type&&e.type.__internalCellMeasurerFlag&&(e=e.props.children),e&&e.props&&void 0===e.props.style&&!0!==A.__warnedAboutMissingStyle&&(A.__warnedAboutMissingStyle=!0,console.warn("Rendered cell should include style property for positioning.")))}var OT=i(219),YT=i.n(OT),UT=i(942),GT=i.n(UT),HT=void 0,LT=(HT="undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).requestAnimationFrame||HT.webkitRequestAnimationFrame||HT.mozRequestAnimationFrame||HT.oRequestAnimationFrame||HT.msRequestAnimationFrame||function(A){return HT.setTimeout(A,1e3/60)},PT=HT.cancelAnimationFrame||HT.webkitCancelAnimationFrame||HT.mozCancelAnimationFrame||HT.oCancelAnimationFrame||HT.msCancelAnimationFrame||function(A){HT.clearTimeout(A)},xT=(o.a.number.isRequired,function(A){return PT(A.id)}),_T=function(A,e){var i=void 0;GT.a.resolve().then(function(){i=Date.now()});var t={id:LT(function o(){Date.now()-i>=e?A.call():t.id=LT(o)})};return t},jT="observed",JT="requested",zT=function(A){function e(A){nT()(this,e);var i=gT()(this,(e.__proto__||tT()(e)).call(this,A));i._onGridRenderedMemoizer=vT(),i._onScrollMemoizer=vT(!1),i._deferredInvalidateColumnIndex=null,i._deferredInvalidateRowIndex=null,i._recomputeScrollLeftFlag=!1,i._recomputeScrollTopFlag=!1,i._horizontalScrollBarSize=0,i._verticalScrollBarSize=0,i._scrollbarPresenceChanged=!1,i._renderedColumnStartIndex=0,i._renderedColumnStopIndex=0,i._renderedRowStartIndex=0,i._renderedRowStopIndex=0,i._styleCache={},i._cellCache={},i._debounceScrollEndedCallback=function(){i._disablePointerEventsTimeoutId=null,i.setState({isScrolling:!1,needToResetStyleCache:!1})},i._invokeOnGridRenderedHelper=function(){var A=i.props.onSectionRendered;i._onGridRenderedMemoizer({callback:A,indices:{columnOverscanStartIndex:i._columnStartIndex,columnOverscanStopIndex:i._columnStopIndex,columnStartIndex:i._renderedColumnStartIndex,columnStopIndex:i._renderedColumnStopIndex,rowOverscanStartIndex:i._rowStartIndex,rowOverscanStopIndex:i._rowStopIndex,rowStartIndex:i._renderedRowStartIndex,rowStopIndex:i._renderedRowStopIndex}})},i._setScrollingContainerRef=function(A){i._scrollingContainer=A},i._onScroll=function(A){A.target===i._scrollingContainer&&i.handleScrollEvent(A.target)};var t=new TT({cellCount:A.columnCount,cellSizeGetter:function(i){return e._wrapSizeGetter(A.columnWidth)(i)},estimatedCellSize:e._getEstimatedColumnSize(A)}),o=new TT({cellCount:A.rowCount,cellSizeGetter:function(i){return e._wrapSizeGetter(A.rowHeight)(i)},estimatedCellSize:e._getEstimatedRowSize(A)});return i.state={instanceProps:{columnSizeAndPositionManager:t,rowSizeAndPositionManager:o,prevColumnWidth:A.columnWidth,prevRowHeight:A.rowHeight,prevColumnCount:A.columnCount,prevRowCount:A.rowCount,prevIsScrolling:!0===A.isScrolling,prevScrollToColumn:A.scrollToColumn,prevScrollToRow:A.scrollToRow,scrollbarSize:0,scrollbarSizeMeasured:!1},isScrolling:!1,scrollDirectionHorizontal:ST,scrollDirectionVertical:ST,scrollLeft:0,scrollTop:0,scrollPositionChangeReason:null,needToResetStyleCache:!1},A.scrollToRow>0&&(i._initialScrollTop=i._getCalculatedScrollTop(A,i.state)),A.scrollToColumn>0&&(i._initialScrollLeft=i._getCalculatedScrollLeft(A,i.state)),i}return cT()(e,A),rT()(e,[{key:"getOffsetForCell",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.alignment,i=void 0===e?this.props.scrollToAlignment:e,t=A.columnIndex,o=void 0===t?this.props.scrollToColumn:t,n=A.rowIndex,a=void 0===n?this.props.scrollToRow:n,r=hT()({},this.props,{scrollToAlignment:i,scrollToColumn:o,scrollToRow:a});return{scrollLeft:this._getCalculatedScrollLeft(r),scrollTop:this._getCalculatedScrollTop(r)}}},{key:"getTotalRowsHeight",value:function(){return this.state.instanceProps.rowSizeAndPositionManager.getTotalSize()}},{key:"getTotalColumnsWidth",value:function(){return this.state.instanceProps.columnSizeAndPositionManager.getTotalSize()}},{key:"handleScrollEvent",value:function(A){var e=A.scrollLeft,i=void 0===e?0:e,t=A.scrollTop,o=void 0===t?0:t;if(!(o<0)){this._debounceScrollEnded();var n=this.props,a=n.autoHeight,r=n.autoWidth,s=n.height,g=n.width,l=this.state.instanceProps,c=l.scrollbarSize,u=l.rowSizeAndPositionManager.getTotalSize(),B=l.columnSizeAndPositionManager.getTotalSize(),d=Math.min(Math.max(0,B-g+c),i),E=Math.min(Math.max(0,u-s+c),o);if(this.state.scrollLeft!==d||this.state.scrollTop!==E){var h={isScrolling:!0,scrollDirectionHorizontal:d!==this.state.scrollLeft?d>this.state.scrollLeft?ST:-1:this.state.scrollDirectionHorizontal,scrollDirectionVertical:E!==this.state.scrollTop?E>this.state.scrollTop?ST:-1:this.state.scrollDirectionVertical,scrollPositionChangeReason:jT};a||(h.scrollTop=E),r||(h.scrollLeft=d),h.needToResetStyleCache=!1,this.setState(h)}this._invokeOnScrollMemoizer({scrollLeft:d,scrollTop:E,totalColumnsWidth:B,totalRowsHeight:u})}}},{key:"invalidateCellSizeAfterRender",value:function(A){var e=A.columnIndex,i=A.rowIndex;this._deferredInvalidateColumnIndex="number"==typeof this._deferredInvalidateColumnIndex?Math.min(this._deferredInvalidateColumnIndex,e):e,this._deferredInvalidateRowIndex="number"==typeof this._deferredInvalidateRowIndex?Math.min(this._deferredInvalidateRowIndex,i):i}},{key:"measureAllCells",value:function(){var A=this.props,e=A.columnCount,i=A.rowCount,t=this.state.instanceProps;t.columnSizeAndPositionManager.getSizeAndPositionOfCell(e-1),t.rowSizeAndPositionManager.getSizeAndPositionOfCell(i-1)}},{key:"recomputeGridSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.columnIndex,i=void 0===e?0:e,t=A.rowIndex,o=void 0===t?0:t,n=this.props,a=n.scrollToColumn,r=n.scrollToRow,s=this.state.instanceProps;s.columnSizeAndPositionManager.resetCell(i),s.rowSizeAndPositionManager.resetCell(o),this._recomputeScrollLeftFlag=a>=0&&(this.state.scrollDirectionHorizontal===ST?i<=a:i>=a),this._recomputeScrollTopFlag=r>=0&&(this.state.scrollDirectionVertical===ST?o<=r:o>=r),this._styleCache={},this._cellCache={},this.forceUpdate()}},{key:"scrollToCell",value:function(A){var e=A.columnIndex,i=A.rowIndex,t=this.props.columnCount,o=this.props;t>1&&void 0!==e&&this._updateScrollLeftForScrollToColumn(hT()({},o,{scrollToColumn:e})),void 0!==i&&this._updateScrollTopForScrollToRow(hT()({},o,{scrollToRow:i}))}},{key:"componentDidMount",value:function(){var A=this.props,i=A.getScrollbarSize,t=A.height,o=A.scrollLeft,n=A.scrollToColumn,a=A.scrollTop,r=A.scrollToRow,s=A.width,g=this.state.instanceProps;if(this._initialScrollTop=0,this._initialScrollLeft=0,this._handleInvalidatedGridSize(),g.scrollbarSizeMeasured||this.setState(function(A){var e=hT()({},A,{needToResetStyleCache:!1});return e.instanceProps.scrollbarSize=i(),e.instanceProps.scrollbarSizeMeasured=!0,e}),"number"==typeof o&&o>=0||"number"==typeof a&&a>=0){var l=e._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:o,scrollTop:a});l&&(l.needToResetStyleCache=!1,this.setState(l))}this._scrollingContainer&&(this._scrollingContainer.scrollLeft!==this.state.scrollLeft&&(this._scrollingContainer.scrollLeft=this.state.scrollLeft),this._scrollingContainer.scrollTop!==this.state.scrollTop&&(this._scrollingContainer.scrollTop=this.state.scrollTop));var c=t>0&&s>0;n>=0&&c&&this._updateScrollLeftForScrollToColumn(),r>=0&&c&&this._updateScrollTopForScrollToRow(),this._invokeOnGridRenderedHelper(),this._invokeOnScrollMemoizer({scrollLeft:o||0,scrollTop:a||0,totalColumnsWidth:g.columnSizeAndPositionManager.getTotalSize(),totalRowsHeight:g.rowSizeAndPositionManager.getTotalSize()}),this._maybeCallOnScrollbarPresenceChange()}},{key:"componentDidUpdate",value:function(A,e){var i=this,t=this.props,o=t.autoHeight,n=t.autoWidth,a=t.columnCount,r=t.height,s=t.rowCount,g=t.scrollToAlignment,l=t.scrollToColumn,c=t.scrollToRow,u=t.width,B=this.state,d=B.scrollLeft,E=B.scrollPositionChangeReason,h=B.scrollTop,C=B.instanceProps;this._handleInvalidatedGridSize();var w=a>0&&0===A.columnCount||s>0&&0===A.rowCount;E===JT&&(!n&&d>=0&&(d!==this._scrollingContainer.scrollLeft||w)&&(this._scrollingContainer.scrollLeft=d),!o&&h>=0&&(h!==this._scrollingContainer.scrollTop||w)&&(this._scrollingContainer.scrollTop=h));var m=(0===A.width||0===A.height)&&r>0&&u>0;if(this._recomputeScrollLeftFlag?(this._recomputeScrollLeftFlag=!1,this._updateScrollLeftForScrollToColumn(this.props)):NT({cellSizeAndPositionManager:C.columnSizeAndPositionManager,previousCellsCount:A.columnCount,previousCellSize:A.columnWidth,previousScrollToAlignment:A.scrollToAlignment,previousScrollToIndex:A.scrollToColumn,previousSize:A.width,scrollOffset:d,scrollToAlignment:g,scrollToIndex:l,size:u,sizeJustIncreasedFromZero:m,updateScrollIndexCallback:function(){return i._updateScrollLeftForScrollToColumn(i.props)}}),this._recomputeScrollTopFlag?(this._recomputeScrollTopFlag=!1,this._updateScrollTopForScrollToRow(this.props)):NT({cellSizeAndPositionManager:C.rowSizeAndPositionManager,previousCellsCount:A.rowCount,previousCellSize:A.rowHeight,previousScrollToAlignment:A.scrollToAlignment,previousScrollToIndex:A.scrollToRow,previousSize:A.height,scrollOffset:h,scrollToAlignment:g,scrollToIndex:c,size:r,sizeJustIncreasedFromZero:m,updateScrollIndexCallback:function(){return i._updateScrollTopForScrollToRow(i.props)}}),this._invokeOnGridRenderedHelper(),d!==e.scrollLeft||h!==e.scrollTop){var p=C.rowSizeAndPositionManager.getTotalSize(),I=C.columnSizeAndPositionManager.getTotalSize();this._invokeOnScrollMemoizer({scrollLeft:d,scrollTop:h,totalColumnsWidth:I,totalRowsHeight:p})}this._maybeCallOnScrollbarPresenceChange()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&xT(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var A=this.props,e=A.autoContainerWidth,i=A.autoHeight,t=A.autoWidth,o=A.className,a=A.containerProps,r=A.containerRole,s=A.containerStyle,g=A.height,l=A.id,c=A.noContentRenderer,u=A.role,B=A.style,d=A.tabIndex,E=A.width,h=this.state,C=h.instanceProps,w=h.needToResetStyleCache,m=this._isScrolling(),p={boxSizing:"border-box",direction:"ltr",height:i?"auto":g,position:"relative",width:t?"auto":E,WebkitOverflowScrolling:"touch",willChange:"transform"};w&&(this._styleCache={}),this.state.isScrolling||this._resetStyleCache(),this._calculateChildrenToRender(this.props,this.state);var I=C.columnSizeAndPositionManager.getTotalSize(),f=C.rowSizeAndPositionManager.getTotalSize(),Q=f>g?C.scrollbarSize:0,D=I>E?C.scrollbarSize:0;D===this._horizontalScrollBarSize&&Q===this._verticalScrollBarSize||(this._horizontalScrollBarSize=D,this._verticalScrollBarSize=Q,this._scrollbarPresenceChanged=!0),p.overflowX=I+Q<=E?"hidden":"auto",p.overflowY=f+D<=g?"hidden":"auto";var M=this._childrenToDisplay,b=0===M.length&&g>0&&E>0;return n.createElement("div",hT()({ref:this._setScrollingContainerRef},a,{"aria-label":this.props["aria-label"],"aria-readonly":this.props["aria-readonly"],className:Le()("ReactVirtualized__Grid",o),id:l,onScroll:this._onScroll,role:u,style:hT()({},p,B),tabIndex:d}),M.length>0&&n.createElement("div",{className:"ReactVirtualized__Grid__innerScrollContainer",role:r,style:hT()({width:e?"auto":I,height:f,maxWidth:I,maxHeight:f,overflow:"hidden",pointerEvents:m?"none":"",position:"relative"},s)},M),b&&c())}},{key:"_calculateChildrenToRender",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,i=A.cellRenderer,t=A.cellRangeRenderer,o=A.columnCount,n=A.deferredMeasurementCache,a=A.height,r=A.overscanColumnCount,s=A.overscanIndicesGetter,g=A.overscanRowCount,l=A.rowCount,c=A.width,u=A.isScrollingOptOut,B=e.scrollDirectionHorizontal,d=e.scrollDirectionVertical,E=e.instanceProps,h=this._initialScrollTop>0?this._initialScrollTop:e.scrollTop,C=this._initialScrollLeft>0?this._initialScrollLeft:e.scrollLeft,w=this._isScrolling(A,e);if(this._childrenToDisplay=[],a>0&&c>0){var m=E.columnSizeAndPositionManager.getVisibleCellRange({containerSize:c,offset:C}),p=E.rowSizeAndPositionManager.getVisibleCellRange({containerSize:a,offset:h}),I=E.columnSizeAndPositionManager.getOffsetAdjustment({containerSize:c,offset:C}),f=E.rowSizeAndPositionManager.getOffsetAdjustment({containerSize:a,offset:h});this._renderedColumnStartIndex=m.start,this._renderedColumnStopIndex=m.stop,this._renderedRowStartIndex=p.start,this._renderedRowStopIndex=p.stop;var Q=s({direction:"horizontal",cellCount:o,overscanCellsCount:r,scrollDirection:B,startIndex:"number"==typeof m.start?m.start:0,stopIndex:"number"==typeof m.stop?m.stop:-1}),D=s({direction:"vertical",cellCount:l,overscanCellsCount:g,scrollDirection:d,startIndex:"number"==typeof p.start?p.start:0,stopIndex:"number"==typeof p.stop?p.stop:-1}),M=Q.overscanStartIndex,b=Q.overscanStopIndex,y=D.overscanStartIndex,T=D.overscanStopIndex;if(n){if(!n.hasFixedHeight())for(var k=y;k<=T;k++)if(!n.has(k,0)){M=0,b=o-1;break}if(!n.hasFixedWidth())for(var F=M;F<=b;F++)if(!n.has(0,F)){y=0,T=l-1;break}}this._childrenToDisplay=t({cellCache:this._cellCache,cellRenderer:i,columnSizeAndPositionManager:E.columnSizeAndPositionManager,columnStartIndex:M,columnStopIndex:b,deferredMeasurementCache:n,horizontalOffsetAdjustment:I,isScrolling:w,isScrollingOptOut:u,parent:this,rowSizeAndPositionManager:E.rowSizeAndPositionManager,rowStartIndex:y,rowStopIndex:T,scrollLeft:C,scrollTop:h,styleCache:this._styleCache,verticalOffsetAdjustment:f,visibleColumnIndices:m,visibleRowIndices:p}),this._columnStartIndex=M,this._columnStopIndex=b,this._rowStartIndex=y,this._rowStopIndex=T}}},{key:"_debounceScrollEnded",value:function(){var A=this.props.scrollingResetTimeInterval;this._disablePointerEventsTimeoutId&&xT(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=_T(this._debounceScrollEndedCallback,A)}},{key:"_handleInvalidatedGridSize",value:function(){if("number"==typeof this._deferredInvalidateColumnIndex&&"number"==typeof this._deferredInvalidateRowIndex){var A=this._deferredInvalidateColumnIndex,e=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:A,rowIndex:e})}}},{key:"_invokeOnScrollMemoizer",value:function(A){var e=this,i=A.scrollLeft,t=A.scrollTop,o=A.totalColumnsWidth,n=A.totalRowsHeight;this._onScrollMemoizer({callback:function(A){var i=A.scrollLeft,t=A.scrollTop,a=e.props,r=a.height;(0,a.onScroll)({clientHeight:r,clientWidth:a.width,scrollHeight:n,scrollLeft:i,scrollTop:t,scrollWidth:o})},indices:{scrollLeft:i,scrollTop:t}})}},{key:"_isScrolling",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return Object.hasOwnProperty.call(A,"isScrolling")?Boolean(A.isScrolling):Boolean(e.isScrolling)}},{key:"_maybeCallOnScrollbarPresenceChange",value:function(){if(this._scrollbarPresenceChanged){var A=this.props.onScrollbarPresenceChange;this._scrollbarPresenceChanged=!1,A({horizontal:this._horizontalScrollBarSize>0,size:this.state.instanceProps.scrollbarSize,vertical:this._verticalScrollBarSize>0})}}},{key:"scrollToPosition",value:function(A){var i=A.scrollLeft,t=A.scrollTop,o=e._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:i,scrollTop:t});o&&(o.needToResetStyleCache=!1,this.setState(o))}},{key:"_getCalculatedScrollLeft",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return e._getCalculatedScrollLeft(A,i)}},{key:"_updateScrollLeftForScrollToColumn",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,t=e._getScrollLeftForScrollToColumnStateUpdate(A,i);t&&(t.needToResetStyleCache=!1,this.setState(t))}},{key:"_getCalculatedScrollTop",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return e._getCalculatedScrollTop(A,i)}},{key:"_resetStyleCache",value:function(){var A=this._styleCache,e=this._cellCache,i=this.props.isScrollingOptOut;this._cellCache={},this._styleCache={};for(var t=this._rowStartIndex;t<=this._rowStopIndex;t++)for(var o=this._columnStartIndex;o<=this._columnStopIndex;o++){var n=t+"-"+o;this._styleCache[n]=A[n],i&&(this._cellCache[n]=e[n])}}},{key:"_updateScrollTopForScrollToRow",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,t=e._getScrollTopForScrollToRowStateUpdate(A,i);t&&(t.needToResetStyleCache=!1,this.setState(t))}}],[{key:"getDerivedStateFromProps",value:function(A,i){var t={};0===A.columnCount&&0!==i.scrollLeft||0===A.rowCount&&0!==i.scrollTop?(t.scrollLeft=0,t.scrollTop=0):(A.scrollLeft!==i.scrollLeft&&A.scrollToColumn<0||A.scrollTop!==i.scrollTop&&A.scrollToRow<0)&&dT()(t,e._getScrollToPositionStateUpdate({prevState:i,scrollLeft:A.scrollLeft,scrollTop:A.scrollTop}));var o=i.instanceProps;t.needToResetStyleCache=!1,A.columnWidth===o.prevColumnWidth&&A.rowHeight===o.prevRowHeight||(t.needToResetStyleCache=!0),o.columnSizeAndPositionManager.configure({cellCount:A.columnCount,estimatedCellSize:e._getEstimatedColumnSize(A),cellSizeGetter:e._wrapSizeGetter(A.columnWidth)}),o.rowSizeAndPositionManager.configure({cellCount:A.rowCount,estimatedCellSize:e._getEstimatedRowSize(A),cellSizeGetter:e._wrapSizeGetter(A.rowHeight)}),0!==o.prevColumnCount&&0!==o.prevRowCount||(o.prevColumnCount=0,o.prevRowCount=0),A.autoHeight&&!1===A.isScrolling&&!0===o.prevIsScrolling&&dT()(t,{isScrolling:!1});var n=void 0,a=void 0;return CT({cellCount:o.prevColumnCount,cellSize:"number"==typeof o.prevColumnWidth?o.prevColumnWidth:null,computeMetadataCallback:function(){return o.columnSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:A,nextCellsCount:A.columnCount,nextCellSize:"number"==typeof A.columnWidth?A.columnWidth:null,nextScrollToIndex:A.scrollToColumn,scrollToIndex:o.prevScrollToColumn,updateScrollOffsetForScrollToIndex:function(){n=e._getScrollLeftForScrollToColumnStateUpdate(A,i)}}),CT({cellCount:o.prevRowCount,cellSize:"number"==typeof o.prevRowHeight?o.prevRowHeight:null,computeMetadataCallback:function(){return o.rowSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:A,nextCellsCount:A.rowCount,nextCellSize:"number"==typeof A.rowHeight?A.rowHeight:null,nextScrollToIndex:A.scrollToRow,scrollToIndex:o.prevScrollToRow,updateScrollOffsetForScrollToIndex:function(){a=e._getScrollTopForScrollToRowStateUpdate(A,i)}}),o.prevColumnCount=A.columnCount,o.prevColumnWidth=A.columnWidth,o.prevIsScrolling=!0===A.isScrolling,o.prevRowCount=A.rowCount,o.prevRowHeight=A.rowHeight,o.prevScrollToColumn=A.scrollToColumn,o.prevScrollToRow=A.scrollToRow,o.scrollbarSize=A.getScrollbarSize(),void 0===o.scrollbarSize?(o.scrollbarSizeMeasured=!1,o.scrollbarSize=0):o.scrollbarSizeMeasured=!0,t.instanceProps=o,hT()({},t,n,a)}},{key:"_getEstimatedColumnSize",value:function(A){return"number"==typeof A.columnWidth?A.columnWidth:A.estimatedColumnSize}},{key:"_getEstimatedRowSize",value:function(A){return"number"==typeof A.rowHeight?A.rowHeight:A.estimatedRowSize}},{key:"_getScrollToPositionStateUpdate",value:function(A){var e=A.prevState,i=A.scrollLeft,t=A.scrollTop,o={scrollPositionChangeReason:JT};return"number"==typeof i&&i>=0&&(o.scrollDirectionHorizontal=i>e.scrollLeft?ST:-1,o.scrollLeft=i),"number"==typeof t&&t>=0&&(o.scrollDirectionVertical=t>e.scrollTop?ST:-1,o.scrollTop=t),"number"==typeof i&&i>=0&&i!==e.scrollLeft||"number"==typeof t&&t>=0&&t!==e.scrollTop?o:null}},{key:"_wrapSizeGetter",value:function(A){return"function"==typeof A?A:function(){return A}}},{key:"_getCalculatedScrollLeft",value:function(A,e){var i=A.columnCount,t=A.height,o=A.scrollToAlignment,n=A.scrollToColumn,a=A.width,r=e.scrollLeft,s=e.instanceProps;if(i>0){var g=i-1,l=n<0?g:Math.min(g,n),c=s.rowSizeAndPositionManager.getTotalSize(),u=s.scrollbarSizeMeasured&&c>t?s.scrollbarSize:0;return s.columnSizeAndPositionManager.getUpdatedOffsetForIndex({align:o,containerSize:a-u,currentOffset:r,targetIndex:l})}return 0}},{key:"_getScrollLeftForScrollToColumnStateUpdate",value:function(A,i){var t=i.scrollLeft,o=e._getCalculatedScrollLeft(A,i);return"number"==typeof o&&o>=0&&t!==o?e._getScrollToPositionStateUpdate({prevState:i,scrollLeft:o,scrollTop:-1}):null}},{key:"_getCalculatedScrollTop",value:function(A,e){var i=A.height,t=A.rowCount,o=A.scrollToAlignment,n=A.scrollToRow,a=A.width,r=e.scrollTop,s=e.instanceProps;if(t>0){var g=t-1,l=n<0?g:Math.min(g,n),c=s.columnSizeAndPositionManager.getTotalSize(),u=s.scrollbarSizeMeasured&&c>a?s.scrollbarSize:0;return s.rowSizeAndPositionManager.getUpdatedOffsetForIndex({align:o,containerSize:i-u,currentOffset:r,targetIndex:l})}return 0}},{key:"_getScrollTopForScrollToRowStateUpdate",value:function(A,i){var t=i.scrollTop,o=e._getCalculatedScrollTop(A,i);return"number"==typeof o&&o>=0&&t!==o?e._getScrollToPositionStateUpdate({prevState:i,scrollLeft:-1,scrollTop:o}):null}}]),e}(n.PureComponent);zT.defaultProps={"aria-label":"grid","aria-readonly":!0,autoContainerWidth:!1,autoHeight:!1,autoWidth:!1,cellRangeRenderer:function(A){for(var e=A.cellCache,i=A.cellRenderer,t=A.columnSizeAndPositionManager,o=A.columnStartIndex,n=A.columnStopIndex,a=A.deferredMeasurementCache,r=A.horizontalOffsetAdjustment,s=A.isScrolling,g=A.isScrollingOptOut,l=A.parent,c=A.rowSizeAndPositionManager,u=A.rowStartIndex,B=A.rowStopIndex,d=A.styleCache,E=A.verticalOffsetAdjustment,h=A.visibleColumnIndices,C=A.visibleRowIndices,w=[],m=t.areOffsetsAdjusted()||c.areOffsetsAdjusted(),p=!s&&!m,I=u;I<=B;I++)for(var f=c.getSizeAndPositionOfCell(I),Q=o;Q<=n;Q++){var D=t.getSizeAndPositionOfCell(Q),M=Q>=h.start&&Q<=h.stop&&I>=C.start&&I<=C.stop,b=I+"-"+Q,y=void 0;p&&d[b]?y=d[b]:a&&!a.has(I,Q)?y={height:"auto",left:0,position:"absolute",top:0,width:"auto"}:(y={height:f.size,left:D.offset+r,position:"absolute",top:f.offset+E,width:D.size},d[b]=y);var T={columnIndex:Q,isScrolling:s,isVisible:M,key:b,parent:l,rowIndex:I,style:y},k=void 0;!g&&!s||r||E?k=i(T):(e[b]||(e[b]=i(T)),k=e[b]),null!=k&&!1!==k&&(RT(l,k),w.push(k))}return w},containerRole:"rowgroup",containerStyle:{},estimatedColumnSize:100,estimatedRowSize:30,getScrollbarSize:YT.a,noContentRenderer:function(){return null},onScroll:function(){},onScrollbarPresenceChange:function(){},onSectionRendered:function(){},overscanColumnCount:0,overscanIndicesGetter:function(A){var e=A.cellCount,i=A.overscanCellsCount,t=A.scrollDirection,o=A.startIndex,n=A.stopIndex;return t===ST?{overscanStartIndex:Math.max(0,o),overscanStopIndex:Math.min(e-1,n+i)}:{overscanStartIndex:Math.max(0,o-i),overscanStopIndex:Math.min(e-1,n)}},overscanRowCount:10,role:"grid",scrollingResetTimeInterval:150,scrollToAlignment:"auto",scrollToColumn:-1,scrollToRow:-1,style:{},tabIndex:0,isScrollingOptOut:!1},zT.propTypes={"aria-label":o.a.string.isRequired,"aria-readonly":o.a.bool,autoContainerWidth:o.a.bool.isRequired,autoHeight:o.a.bool.isRequired,autoWidth:o.a.bool.isRequired,cellRenderer:function(){return("function"==typeof pT?pT.isRequired?pT.isRequired:pT:o.a.shape(pT).isRequired).apply(this,arguments)},cellRangeRenderer:function(){return("function"==typeof IT?IT.isRequired?IT.isRequired:IT:o.a.shape(IT).isRequired).apply(this,arguments)},className:o.a.string,columnCount:o.a.number.isRequired,columnWidth:function(){return("function"==typeof fT?fT.isRequired?fT.isRequired:fT:o.a.shape(fT).isRequired).apply(this,arguments)},containerProps:o.a.object,containerRole:o.a.string.isRequired,containerStyle:o.a.object.isRequired,deferredMeasurementCache:o.a.object,estimatedColumnSize:o.a.number.isRequired,estimatedRowSize:o.a.number.isRequired,getScrollbarSize:o.a.func.isRequired,height:o.a.number.isRequired,id:o.a.string,isScrolling:o.a.bool,isScrollingOptOut:o.a.bool.isRequired,noContentRenderer:function(){return("function"==typeof QT?QT.isRequired?QT.isRequired:QT:o.a.shape(QT).isRequired).apply(this,arguments)},onScroll:o.a.func.isRequired,onScrollbarPresenceChange:o.a.func.isRequired,onSectionRendered:o.a.func.isRequired,overscanColumnCount:o.a.number.isRequired,overscanIndicesGetter:function(){return("function"==typeof DT?DT.isRequired?DT.isRequired:DT:o.a.shape(DT).isRequired).apply(this,arguments)},overscanRowCount:o.a.number.isRequired,role:o.a.string.isRequired,rowHeight:function(){return("function"==typeof fT?fT.isRequired?fT.isRequired:fT:o.a.shape(fT).isRequired).apply(this,arguments)},rowCount:o.a.number.isRequired,scrollingResetTimeInterval:o.a.number.isRequired,scrollLeft:o.a.number,scrollToAlignment:function(){return("function"==typeof MT?MT.isRequired?MT.isRequired:MT:o.a.shape(MT).isRequired).apply(this,arguments)},scrollToColumn:o.a.number.isRequired,scrollTop:o.a.number,scrollToRow:o.a.number.isRequired,style:o.a.object.isRequired,tabIndex:o.a.number,width:o.a.number.isRequired},Object(uT.polyfill)(zT);var KT=zT,WT=1;function VT(A){var e=A.cellCount,i=A.overscanCellsCount,t=A.scrollDirection,o=A.startIndex,n=A.stopIndex;return i=Math.max(1,i),t===WT?{overscanStartIndex:Math.max(0,o-1),overscanStopIndex:Math.min(e-1,n+i)}:{overscanStartIndex:Math.max(0,o-i),overscanStopIndex:Math.min(e-1,n+1)}}o.a.number.isRequired,o.a.number.isRequired;var XT=function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t.state={scrollToColumn:0,scrollToRow:0},t._columnStartIndex=0,t._columnStopIndex=0,t._rowStartIndex=0,t._rowStopIndex=0,t._onKeyDown=function(A){var e=t.props,i=e.columnCount,o=e.disabled,n=e.mode,a=e.rowCount;if(!o){var r=t._getScrollState(),s=r.scrollToColumn,g=r.scrollToRow,l=t._getScrollState(),c=l.scrollToColumn,u=l.scrollToRow;switch(A.key){case"ArrowDown":u="cells"===n?Math.min(u+1,a-1):Math.min(t._rowStopIndex+1,a-1);break;case"ArrowLeft":c="cells"===n?Math.max(c-1,0):Math.max(t._columnStartIndex-1,0);break;case"ArrowRight":c="cells"===n?Math.min(c+1,i-1):Math.min(t._columnStopIndex+1,i-1);break;case"ArrowUp":u="cells"===n?Math.max(u-1,0):Math.max(t._rowStartIndex-1,0)}c===s&&u===g||(A.preventDefault(),t._updateScrollState({scrollToColumn:c,scrollToRow:u}))}},t._onSectionRendered=function(A){var e=A.columnStartIndex,i=A.columnStopIndex,o=A.rowStartIndex,n=A.rowStopIndex;t._columnStartIndex=e,t._columnStopIndex=i,t._rowStartIndex=o,t._rowStopIndex=n},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"setScrollIndexes",value:function(A){var e=A.scrollToColumn,i=A.scrollToRow;this.setState({scrollToRow:i,scrollToColumn:e})}},{key:"render",value:function(){var A=this.props,e=A.className,i=A.children,t=this._getScrollState(),o=t.scrollToColumn,a=t.scrollToRow;return n.createElement("div",{className:e,onKeyDown:this._onKeyDown},i({onSectionRendered:this._onSectionRendered,scrollToColumn:o,scrollToRow:a}))}},{key:"_getScrollState",value:function(){return this.props.isControlled?this.props:this.state}},{key:"_updateScrollState",value:function(A){var e=A.scrollToColumn,i=A.scrollToRow,t=this.props,o=t.isControlled,n=t.onScrollToChange;"function"==typeof n&&n({scrollToColumn:e,scrollToRow:i}),o||this.setState({scrollToColumn:e,scrollToRow:i})}}],[{key:"getDerivedStateFromProps",value:function(A,e){return A.isControlled?null:A.scrollToColumn!==e.scrollToColumn||A.scrollToRow!==e.scrollToRow?{scrollToColumn:A.scrollToColumn,scrollToRow:A.scrollToRow}:null}}]),e}(n.PureComponent);XT.defaultProps={disabled:!1,isControlled:!1,mode:"edges",scrollToColumn:0,scrollToRow:0},XT.propTypes={children:o.a.func.isRequired,className:o.a.string,columnCount:o.a.number.isRequired,disabled:o.a.bool.isRequired,isControlled:o.a.bool.isRequired,mode:o.a.oneOf(["cells","edges"]).isRequired,onScrollToChange:o.a.func,rowCount:o.a.number.isRequired,scrollToColumn:o.a.number.isRequired,scrollToRow:o.a.number.isRequired},Object(uT.polyfill)(XT);var ZT=i(290),qT=function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t.state={height:t.props.defaultHeight||0,width:t.props.defaultWidth||0},t._onResize=function(){var A=t.props,e=A.disableHeight,i=A.disableWidth,o=A.onResize;if(t._parentNode){var n=t._parentNode.offsetHeight||0,a=t._parentNode.offsetWidth||0,r=window.getComputedStyle(t._parentNode)||{},s=parseInt(r.paddingLeft,10)||0,g=parseInt(r.paddingRight,10)||0,l=parseInt(r.paddingTop,10)||0,c=parseInt(r.paddingBottom,10)||0,u=n-l-c,B=a-s-g;(!e&&t.state.height!==u||!i&&t.state.width!==B)&&(t.setState({height:n-l-c,width:a-s-g}),o({height:n,width:a}))}},t._setRef=function(A){t._autoSizer=A},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"componentDidMount",value:function(){var A=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._detectElementResize=Object(ZT.a)(A),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var A=this.props,e=A.children,i=A.className,t=A.disableHeight,o=A.disableWidth,a=A.style,r=this.state,s=r.height,g=r.width,l={overflow:"visible"},c={};return t||(l.height=0,c.height=s),o||(l.width=0,c.width=g),n.createElement("div",{className:i,ref:this._setRef,style:hT()({},l,a)},e(c))}}]),e}(n.PureComponent);qT.defaultProps={onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}},qT.propTypes={children:o.a.func.isRequired,className:o.a.string,defaultHeight:o.a.number,defaultWidth:o.a.number,disableHeight:o.a.bool.isRequired,disableWidth:o.a.bool.isRequired,nonce:o.a.string,onResize:o.a.func.isRequired,style:o.a.object};var $T={hasFixedWidth:o.a.func.isRequired,hasFixedHeight:o.a.func.isRequired,has:o.a.func.isRequired,set:o.a.func.isRequired,getHeight:o.a.func.isRequired,getWidth:o.a.func.isRequired},Ak=function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t._measure=function(){var A=t.props,e=A.cache,i=A.columnIndex,o=void 0===i?0:i,n=A.parent,a=A.rowIndex,r=void 0===a?t.props.index||0:a,s=t._getCellMeasurements(),g=s.height,l=s.width;g===e.getHeight(r,o)&&l===e.getWidth(r,o)||(e.set(r,o,l,g),n&&"function"==typeof n.recomputeGridSize&&n.recomputeGridSize({columnIndex:o,rowIndex:r}))},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"componentDidMount",value:function(){this._maybeMeasureCell()}},{key:"componentDidUpdate",value:function(){this._maybeMeasureCell()}},{key:"render",value:function(){var A=this.props.children;return"function"==typeof A?A({measure:this._measure}):A}},{key:"_getCellMeasurements",value:function(){var A=this.props.cache,e=Object(Sy.findDOMNode)(this);if(e&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.HTMLElement){var i=e.style.width,t=e.style.height;A.hasFixedWidth()||(e.style.width="auto"),A.hasFixedHeight()||(e.style.height="auto");var o=Math.ceil(e.offsetHeight),n=Math.ceil(e.offsetWidth);return i&&(e.style.width=i),t&&(e.style.height=t),{height:o,width:n}}return{height:0,width:0}}},{key:"_maybeMeasureCell",value:function(){var A=this.props,e=A.cache,i=A.columnIndex,t=void 0===i?0:i,o=A.parent,n=A.rowIndex,a=void 0===n?this.props.index||0:n;if(!e.has(a,t)){var r=this._getCellMeasurements(),s=r.height,g=r.width;e.set(a,t,g,s),o&&"function"==typeof o.invalidateCellSizeAfterRender&&o.invalidateCellSizeAfterRender({columnIndex:t,rowIndex:a})}}}]),e}(n.PureComponent);Ak.__internalCellMeasurerFlag=!1,Ak.propTypes={cache:function(){return("function"==typeof $T?$T.isRequired?$T.isRequired:$T:o.a.shape($T).isRequired).apply(this,arguments)},children:o.a.oneOfType([o.a.func,o.a.node]).isRequired,columnIndex:o.a.number,index:o.a.number,parent:o.a.shape({invalidateCellSizeAfterRender:o.a.func,recomputeGridSize:o.a.func}).isRequired,rowIndex:o.a.number};Ak.__internalCellMeasurerFlag=!0;var ek=30,ik=100;!function(){function A(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};nT()(this,A),this._cellHeightCache={},this._cellWidthCache={},this._columnWidthCache={},this._rowHeightCache={},this._columnCount=0,this._rowCount=0,this.columnWidth=function(A){var i=A.index,t=e._keyMapper(0,i);return e._columnWidthCache.hasOwnProperty(t)?e._columnWidthCache[t]:e._defaultWidth},this.rowHeight=function(A){var i=A.index,t=e._keyMapper(i,0);return e._rowHeightCache.hasOwnProperty(t)?e._rowHeightCache[t]:e._defaultHeight};var t=i.defaultHeight,o=i.defaultWidth,n=i.fixedHeight,a=i.fixedWidth,r=i.keyMapper,s=i.minHeight,g=i.minWidth;this._hasFixedHeight=!0===n,this._hasFixedWidth=!0===a,this._minHeight=s||0,this._minWidth=g||0,this._keyMapper=r||tk,this._defaultHeight=Math.max(this._minHeight,"number"==typeof t?t:ek),this._defaultWidth=Math.max(this._minWidth,"number"==typeof o?o:ik),!1===this._hasFixedHeight&&!1===this._hasFixedWidth&&console.warn("CellMeasurerCache should only measure a cell's width or height. You have configured CellMeasurerCache to measure both. This will result in poor performance."),!1===this._hasFixedHeight&&0===this._defaultHeight&&console.warn("Fixed height CellMeasurerCache should specify a :defaultHeight greater than 0. Failing to do so will lead to unnecessary layout and poor performance."),!1===this._hasFixedWidth&&0===this._defaultWidth&&console.warn("Fixed width CellMeasurerCache should specify a :defaultWidth greater than 0. Failing to do so will lead to unnecessary layout and poor performance.")}rT()(A,[{key:"clear",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this._keyMapper(A,e);delete this._cellHeightCache[i],delete this._cellWidthCache[i],this._updateCachedColumnAndRowSizes(A,e)}},{key:"clearAll",value:function(){this._cellHeightCache={},this._cellWidthCache={},this._columnWidthCache={},this._rowHeightCache={},this._rowCount=0,this._columnCount=0}},{key:"hasFixedHeight",value:function(){return this._hasFixedHeight}},{key:"hasFixedWidth",value:function(){return this._hasFixedWidth}},{key:"getHeight",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this._hasFixedHeight)return this._defaultHeight;var i=this._keyMapper(A,e);return this._cellHeightCache.hasOwnProperty(i)?Math.max(this._minHeight,this._cellHeightCache[i]):this._defaultHeight}},{key:"getWidth",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this._hasFixedWidth)return this._defaultWidth;var i=this._keyMapper(A,e);return this._cellWidthCache.hasOwnProperty(i)?Math.max(this._minWidth,this._cellWidthCache[i]):this._defaultWidth}},{key:"has",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this._keyMapper(A,e);return this._cellHeightCache.hasOwnProperty(i)}},{key:"set",value:function(A,e,i,t){var o=this._keyMapper(A,e);e>=this._columnCount&&(this._columnCount=e+1),A>=this._rowCount&&(this._rowCount=A+1),this._cellHeightCache[o]=t,this._cellWidthCache[o]=i,this._updateCachedColumnAndRowSizes(A,e)}},{key:"_updateCachedColumnAndRowSizes",value:function(A,e){if(!this._hasFixedWidth){for(var i=0,t=0;t<this._rowCount;t++)i=Math.max(i,this.getWidth(t,e));var o=this._keyMapper(0,e);this._columnWidthCache[o]=i}if(!this._hasFixedHeight){for(var n=0,a=0;a<this._columnCount;a++)n=Math.max(n,this.getHeight(A,a));var r=this._keyMapper(A,0);this._rowHeightCache[r]=n}}},{key:"defaultHeight",get:function(){return this._defaultHeight}},{key:"defaultWidth",get:function(){return this._defaultWidth}}])}();function tk(A,e){return A+"-"+e}var ok={OBSERVED:"observed",REQUESTED:"requested"},nk=function(A){function e(){var A;nT()(this,e);for(var i=arguments.length,t=Array(i),o=0;o<i;o++)t[o]=arguments[o];var n=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(t)));return n.state={isScrolling:!1,scrollLeft:0,scrollTop:0},n._calculateSizeAndPositionDataOnNextUpdate=!1,n._onSectionRenderedMemoizer=vT(),n._onScrollMemoizer=vT(!1),n._invokeOnSectionRenderedHelper=function(){var A=n.props,e=A.cellLayoutManager,i=A.onSectionRendered;n._onSectionRenderedMemoizer({callback:i,indices:{indices:e.getLastRenderedIndices()}})},n._setScrollingContainerRef=function(A){n._scrollingContainer=A},n._updateScrollPositionForScrollToCell=function(){var A=n.props,e=A.cellLayoutManager,i=A.height,t=A.scrollToAlignment,o=A.scrollToCell,a=A.width,r=n.state,s=r.scrollLeft,g=r.scrollTop;if(o>=0){var l=e.getScrollPositionForCell({align:t,cellIndex:o,height:i,scrollLeft:s,scrollTop:g,width:a});l.scrollLeft===s&&l.scrollTop===g||n._setScrollPosition(l)}},n._onScroll=function(A){if(A.target===n._scrollingContainer){n._enablePointerEventsAfterDelay();var e=n.props,i=e.cellLayoutManager,t=e.height,o=e.isScrollingChange,a=e.width,r=n._scrollbarSize,s=i.getTotalSize(),g=s.height,l=s.width,c=Math.max(0,Math.min(l-a+r,A.target.scrollLeft)),u=Math.max(0,Math.min(g-t+r,A.target.scrollTop));if(n.state.scrollLeft!==c||n.state.scrollTop!==u){var B=A.cancelable?ok.OBSERVED:ok.REQUESTED;n.state.isScrolling||o(!0),n.setState({isScrolling:!0,scrollLeft:c,scrollPositionChangeReason:B,scrollTop:u})}n._invokeOnScrollMemoizer({scrollLeft:c,scrollTop:u,totalWidth:l,totalHeight:g})}},n._scrollbarSize=YT()(),void 0===n._scrollbarSize?(n._scrollbarSizeMeasured=!1,n._scrollbarSize=0):n._scrollbarSizeMeasured=!0,n}return cT()(e,A),rT()(e,[{key:"recomputeCellSizesAndPositions",value:function(){this._calculateSizeAndPositionDataOnNextUpdate=!0,this.forceUpdate()}},{key:"componentDidMount",value:function(){var A=this.props,e=A.cellLayoutManager,i=A.scrollLeft,t=A.scrollToCell,o=A.scrollTop;this._scrollbarSizeMeasured||(this._scrollbarSize=YT()(),this._scrollbarSizeMeasured=!0,this.setState({})),t>=0?this._updateScrollPositionForScrollToCell():(i>=0||o>=0)&&this._setScrollPosition({scrollLeft:i,scrollTop:o}),this._invokeOnSectionRenderedHelper();var n=e.getTotalSize(),a=n.height,r=n.width;this._invokeOnScrollMemoizer({scrollLeft:i||0,scrollTop:o||0,totalHeight:a,totalWidth:r})}},{key:"componentDidUpdate",value:function(A,e){var i=this.props,t=i.height,o=i.scrollToAlignment,n=i.scrollToCell,a=i.width,r=this.state,s=r.scrollLeft,g=r.scrollPositionChangeReason,l=r.scrollTop;g===ok.REQUESTED&&(s>=0&&s!==e.scrollLeft&&s!==this._scrollingContainer.scrollLeft&&(this._scrollingContainer.scrollLeft=s),l>=0&&l!==e.scrollTop&&l!==this._scrollingContainer.scrollTop&&(this._scrollingContainer.scrollTop=l)),t===A.height&&o===A.scrollToAlignment&&n===A.scrollToCell&&a===A.width||this._updateScrollPositionForScrollToCell(),this._invokeOnSectionRenderedHelper()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var A=this.props,e=A.autoHeight,i=A.cellCount,t=A.cellLayoutManager,o=A.className,a=A.height,r=A.horizontalOverscanSize,s=A.id,g=A.noContentRenderer,l=A.style,c=A.verticalOverscanSize,u=A.width,B=this.state,d=B.isScrolling,E=B.scrollLeft,h=B.scrollTop;(this._lastRenderedCellCount!==i||this._lastRenderedCellLayoutManager!==t||this._calculateSizeAndPositionDataOnNextUpdate)&&(this._lastRenderedCellCount=i,this._lastRenderedCellLayoutManager=t,this._calculateSizeAndPositionDataOnNextUpdate=!1,t.calculateSizeAndPositionData());var C=t.getTotalSize(),w=C.height,m=C.width,p=Math.max(0,E-r),I=Math.max(0,h-c),f=Math.min(m,E+u+r),Q=Math.min(w,h+a+c),D=a>0&&u>0?t.cellRenderers({height:Q-I,isScrolling:d,width:f-p,x:p,y:I}):[],M={boxSizing:"border-box",direction:"ltr",height:e?"auto":a,position:"relative",WebkitOverflowScrolling:"touch",width:u,willChange:"transform"},b=w>a?this._scrollbarSize:0,y=m>u?this._scrollbarSize:0;return M.overflowX=m+b<=u?"hidden":"auto",M.overflowY=w+y<=a?"hidden":"auto",n.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:Le()("ReactVirtualized__Collection",o),id:s,onScroll:this._onScroll,role:"grid",style:hT()({},M,l),tabIndex:0},i>0&&n.createElement("div",{className:"ReactVirtualized__Collection__innerScrollContainer",style:{height:w,maxHeight:w,maxWidth:m,overflow:"hidden",pointerEvents:d?"none":"",width:m}},D),0===i&&g())}},{key:"_enablePointerEventsAfterDelay",value:function(){var A=this;this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=setTimeout(function(){(0,A.props.isScrollingChange)(!1),A._disablePointerEventsTimeoutId=null,A.setState({isScrolling:!1})},150)}},{key:"_invokeOnScrollMemoizer",value:function(A){var e=this,i=A.scrollLeft,t=A.scrollTop,o=A.totalHeight,n=A.totalWidth;this._onScrollMemoizer({callback:function(A){var i=A.scrollLeft,t=A.scrollTop,a=e.props,r=a.height;(0,a.onScroll)({clientHeight:r,clientWidth:a.width,scrollHeight:o,scrollLeft:i,scrollTop:t,scrollWidth:n})},indices:{scrollLeft:i,scrollTop:t}})}},{key:"_setScrollPosition",value:function(A){var e=A.scrollLeft,i=A.scrollTop,t={scrollPositionChangeReason:ok.REQUESTED};e>=0&&(t.scrollLeft=e),i>=0&&(t.scrollTop=i),(e>=0&&e!==this.state.scrollLeft||i>=0&&i!==this.state.scrollTop)&&this.setState(t)}}],[{key:"getDerivedStateFromProps",value:function(A,e){return 0!==A.cellCount||0===e.scrollLeft&&0===e.scrollTop?A.scrollLeft!==e.scrollLeft||A.scrollTop!==e.scrollTop?{scrollLeft:null!=A.scrollLeft?A.scrollLeft:e.scrollLeft,scrollTop:null!=A.scrollTop?A.scrollTop:e.scrollTop}:null:{scrollLeft:0,scrollTop:0}}}]),e}(n.PureComponent);nk.defaultProps={"aria-label":"grid",horizontalOverscanSize:0,noContentRenderer:function(){return null},onScroll:function(){return null},onSectionRendered:function(){return null},scrollToAlignment:"auto",scrollToCell:-1,style:{},verticalOverscanSize:0},nk.propTypes={"aria-label":o.a.string,autoHeight:o.a.bool,cellCount:o.a.number.isRequired,cellLayoutManager:o.a.object.isRequired,className:o.a.string,height:o.a.number.isRequired,id:o.a.string,horizontalOverscanSize:o.a.number.isRequired,isScrollingChange:o.a.func,noContentRenderer:o.a.func.isRequired,onScroll:o.a.func.isRequired,onSectionRendered:o.a.func.isRequired,scrollLeft:o.a.number,scrollToAlignment:o.a.oneOf(["auto","end","start","center"]).isRequired,scrollToCell:o.a.number.isRequired,scrollTop:o.a.number,style:o.a.object,verticalOverscanSize:o.a.number.isRequired,width:o.a.number.isRequired},Object(uT.polyfill)(nk);var ak=nk,rk=(o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,function(){function A(e){var i=e.height,t=e.width,o=e.x,n=e.y;nT()(this,A),this.height=i,this.width=t,this.x=o,this.y=n,this._indexMap={},this._indices=[]}return rT()(A,[{key:"addCellIndex",value:function(A){var e=A.index;this._indexMap[e]||(this._indexMap[e]=!0,this._indices.push(e))}},{key:"getCellIndices",value:function(){return this._indices}},{key:"toString",value:function(){return this.x+","+this.y+" "+this.width+"x"+this.height}}]),A}()),sk=100,gk=function(){function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sk;nT()(this,A),this._sectionSize=e,this._cellMetadata=[],this._sections={}}return rT()(A,[{key:"getCellIndices",value:function(A){var e=A.height,i=A.width,t=A.x,o=A.y,n={};return this.getSections({height:e,width:i,x:t,y:o}).forEach(function(A){return A.getCellIndices().forEach(function(A){n[A]=A})}),FT()(n).map(function(A){return n[A]})}},{key:"getCellMetadata",value:function(A){var e=A.index;return this._cellMetadata[e]}},{key:"getSections",value:function(A){for(var e=A.height,i=A.width,t=A.x,o=A.y,n=Math.floor(t/this._sectionSize),a=Math.floor((t+i-1)/this._sectionSize),r=Math.floor(o/this._sectionSize),s=Math.floor((o+e-1)/this._sectionSize),g=[],l=n;l<=a;l++)for(var c=r;c<=s;c++){var u=l+"."+c;this._sections[u]||(this._sections[u]=new rk({height:this._sectionSize,width:this._sectionSize,x:l*this._sectionSize,y:c*this._sectionSize})),g.push(this._sections[u])}return g}},{key:"getTotalSectionCount",value:function(){return FT()(this._sections).length}},{key:"toString",value:function(){var A=this;return FT()(this._sections).map(function(e){return A._sections[e].toString()})}},{key:"registerCell",value:function(A){var e=A.cellMetadatum,i=A.index;this._cellMetadata[i]=e,this.getSections(e).forEach(function(A){return A.addCellIndex({index:i})})}}]),A}();function lk(A){var e=A.align,i=void 0===e?"auto":e,t=A.cellOffset,o=A.cellSize,n=A.containerSize,a=A.currentOffset,r=t,s=r-n+o;switch(i){case"start":return r;case"end":return s;case"center":return r-(n-o)/2;default:return Math.max(s,Math.min(r,a))}}var ck=function(A){function e(A,i){nT()(this,e);var t=gT()(this,(e.__proto__||tT()(e)).call(this,A,i));return t._cellMetadata=[],t._lastRenderedCellIndices=[],t._cellCache=[],t._isScrollingChange=t._isScrollingChange.bind(t),t._setCollectionViewRef=t._setCollectionViewRef.bind(t),t}return cT()(e,A),rT()(e,[{key:"forceUpdate",value:function(){void 0!==this._collectionView&&this._collectionView.forceUpdate()}},{key:"recomputeCellSizesAndPositions",value:function(){this._cellCache=[],this._collectionView.recomputeCellSizesAndPositions()}},{key:"render",value:function(){var A=mT()(this.props,[]);return n.createElement(ak,hT()({cellLayoutManager:this,isScrollingChange:this._isScrollingChange,ref:this._setCollectionViewRef},A))}},{key:"calculateSizeAndPositionData",value:function(){var A=this.props,e=function(A){for(var e=A.cellCount,i=A.cellSizeAndPositionGetter,t=A.sectionSize,o=[],n=new gk(t),a=0,r=0,s=0;s<e;s++){var g=i({index:s});if(null==g.height||isNaN(g.height)||null==g.width||isNaN(g.width)||null==g.x||isNaN(g.x)||null==g.y||isNaN(g.y))throw Error("Invalid metadata returned for cell "+s+":\n x:"+g.x+", y:"+g.y+", width:"+g.width+", height:"+g.height);a=Math.max(a,g.y+g.height),r=Math.max(r,g.x+g.width),o[s]=g,n.registerCell({cellMetadatum:g,index:s})}return{cellMetadata:o,height:a,sectionManager:n,width:r}}({cellCount:A.cellCount,cellSizeAndPositionGetter:A.cellSizeAndPositionGetter,sectionSize:A.sectionSize});this._cellMetadata=e.cellMetadata,this._sectionManager=e.sectionManager,this._height=e.height,this._width=e.width}},{key:"getLastRenderedIndices",value:function(){return this._lastRenderedCellIndices}},{key:"getScrollPositionForCell",value:function(A){var e=A.align,i=A.cellIndex,t=A.height,o=A.scrollLeft,n=A.scrollTop,a=A.width,r=this.props.cellCount;if(i>=0&&i<r){var s=this._cellMetadata[i];o=lk({align:e,cellOffset:s.x,cellSize:s.width,containerSize:a,currentOffset:o,targetIndex:i}),n=lk({align:e,cellOffset:s.y,cellSize:s.height,containerSize:t,currentOffset:n,targetIndex:i})}return{scrollLeft:o,scrollTop:n}}},{key:"getTotalSize",value:function(){return{height:this._height,width:this._width}}},{key:"cellRenderers",value:function(A){var e=this,i=A.height,t=A.isScrolling,o=A.width,n=A.x,a=A.y,r=this.props,s=r.cellGroupRenderer,g=r.cellRenderer;return this._lastRenderedCellIndices=this._sectionManager.getCellIndices({height:i,width:o,x:n,y:a}),s({cellCache:this._cellCache,cellRenderer:g,cellSizeAndPositionGetter:function(A){var i=A.index;return e._sectionManager.getCellMetadata({index:i})},indices:this._lastRenderedCellIndices,isScrolling:t})}},{key:"_isScrollingChange",value:function(A){A||(this._cellCache=[])}},{key:"_setCollectionViewRef",value:function(A){this._collectionView=A}}]),e}(n.PureComponent);ck.defaultProps={"aria-label":"grid",cellGroupRenderer:function(A){var e=A.cellCache,i=A.cellRenderer,t=A.cellSizeAndPositionGetter,o=A.indices,n=A.isScrolling;return o.map(function(A){var o=t({index:A}),a={index:A,isScrolling:n,key:A,style:{height:o.height,left:o.x,position:"absolute",top:o.y,width:o.width}};return n?(A in e||(e[A]=i(a)),e[A]):i(a)}).filter(function(A){return!!A})}};ck.propTypes={"aria-label":o.a.string,cellCount:o.a.number.isRequired,cellGroupRenderer:o.a.func.isRequired,cellRenderer:o.a.func.isRequired,cellSizeAndPositionGetter:o.a.func.isRequired,sectionSize:o.a.number};var uk=function(A){function e(A,i){nT()(this,e);var t=gT()(this,(e.__proto__||tT()(e)).call(this,A,i));return t._registerChild=t._registerChild.bind(t),t}return cT()(e,A),rT()(e,[{key:"componentDidUpdate",value:function(A){var e=this.props,i=e.columnMaxWidth,t=e.columnMinWidth,o=e.columnCount,n=e.width;i===A.columnMaxWidth&&t===A.columnMinWidth&&o===A.columnCount&&n===A.width||this._registeredChild&&this._registeredChild.recomputeGridSize()}},{key:"render",value:function(){var A=this.props,e=A.children,i=A.columnMaxWidth,t=A.columnMinWidth,o=A.columnCount,n=A.width,a=t||1,r=i?Math.min(i,n):n,s=n/o;return s=Math.max(a,s),s=Math.min(r,s),s=Math.floor(s),e({adjustedWidth:Math.min(n,s*o),columnWidth:s,getColumnWidth:function(){return s},registerChild:this._registerChild})}},{key:"_registerChild",value:function(A){if(A&&"function"!=typeof A.recomputeGridSize)throw Error("Unexpected child type registered; only Grid/MultiGrid children are supported.");this._registeredChild=A,this._registeredChild&&this._registeredChild.recomputeGridSize()}}]),e}(n.PureComponent);uk.propTypes={children:o.a.func.isRequired,columnMaxWidth:o.a.number,columnMinWidth:o.a.number,columnCount:o.a.number.isRequired,width:o.a.number.isRequired};var Bk=function(A){function e(A,i){nT()(this,e);var t=gT()(this,(e.__proto__||tT()(e)).call(this,A,i));return t._loadMoreRowsMemoizer=vT(),t._onRowsRendered=t._onRowsRendered.bind(t),t._registerChild=t._registerChild.bind(t),t}return cT()(e,A),rT()(e,[{key:"resetLoadMoreRowsCache",value:function(A){this._loadMoreRowsMemoizer=vT(),A&&this._doStuff(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"render",value:function(){return(0,this.props.children)({onRowsRendered:this._onRowsRendered,registerChild:this._registerChild})}},{key:"_loadUnloadedRanges",value:function(A){var e=this,i=this.props.loadMoreRows;A.forEach(function(A){var t=i(A);t&&t.then(function(){(function(A){var e=A.lastRenderedStartIndex,i=A.lastRenderedStopIndex,t=A.startIndex,o=A.stopIndex;return!(t>i||o<e)})({lastRenderedStartIndex:e._lastRenderedStartIndex,lastRenderedStopIndex:e._lastRenderedStopIndex,startIndex:A.startIndex,stopIndex:A.stopIndex})&&e._registeredChild&&function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i="function"==typeof A.recomputeGridSize?A.recomputeGridSize:A.recomputeRowHeights;i?i.call(A,e):A.forceUpdate()}(e._registeredChild,e._lastRenderedStartIndex)})})}},{key:"_onRowsRendered",value:function(A){var e=A.startIndex,i=A.stopIndex;this._lastRenderedStartIndex=e,this._lastRenderedStopIndex=i,this._doStuff(e,i)}},{key:"_doStuff",value:function(A,e){var i=this,t=this.props,o=t.isRowLoaded,n=t.minimumBatchSize,a=t.rowCount,r=t.threshold,s=function(A){for(var e=A.isRowLoaded,i=A.minimumBatchSize,t=A.rowCount,o=A.startIndex,n=A.stopIndex,a=[],r=null,s=null,g=o;g<=n;g++){var l=e({index:g});l?null!==s&&(a.push({startIndex:r,stopIndex:s}),r=s=null):(s=g,null===r&&(r=g))}if(null!==s){for(var c=Math.min(Math.max(s,r+i-1),t-1),u=s+1;u<=c&&!e({index:u});u++)s=u;a.push({startIndex:r,stopIndex:s})}if(a.length)for(var B=a[0];B.stopIndex-B.startIndex+1<i&&B.startIndex>0;){var d=B.startIndex-1;if(e({index:d}))break;B.startIndex=d}return a}({isRowLoaded:o,minimumBatchSize:n,rowCount:a,startIndex:Math.max(0,A-r),stopIndex:Math.min(a-1,e+r)}),g=s.reduce(function(A,e){return A.concat([e.startIndex,e.stopIndex])},[]);this._loadMoreRowsMemoizer({callback:function(){i._loadUnloadedRanges(s)},indices:{squashedUnloadedRanges:g}})}},{key:"_registerChild",value:function(A){this._registeredChild=A}}]),e}(n.PureComponent);Bk.defaultProps={minimumBatchSize:10,rowCount:0,threshold:15};Bk.propTypes={children:o.a.func.isRequired,isRowLoaded:o.a.func.isRequired,loadMoreRows:o.a.func.isRequired,minimumBatchSize:o.a.number.isRequired,rowCount:o.a.number.isRequired,threshold:o.a.number.isRequired};var dk=i(943),Ek=i.n(dk),hk=(o.a.number.isRequired,o.a.bool.isRequired,o.a.bool.isRequired,o.a.string.isRequired,o.a.object.isRequired,o.a.object.isRequired,o.a.func),Ck=(o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t._cellRenderer=function(A){var e=A.parent,i=A.rowIndex,o=A.style,n=A.isScrolling,a=A.isVisible,r=A.key,s=t.props.rowRenderer;return Ek()(o,"width").writable&&(o.width="100%"),s({index:i,style:o,isScrolling:n,isVisible:a,key:r,parent:e})},t._setRef=function(A){t.Grid=A},t._onScroll=function(A){var e=A.clientHeight,i=A.scrollHeight,o=A.scrollTop;(0,t.props.onScroll)({clientHeight:e,scrollHeight:i,scrollTop:o})},t._onSectionRendered=function(A){var e=A.rowOverscanStartIndex,i=A.rowOverscanStopIndex,o=A.rowStartIndex,n=A.rowStopIndex;(0,t.props.onRowsRendered)({overscanStartIndex:e,overscanStopIndex:i,startIndex:o,stopIndex:n})},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(A){var e=A.alignment,i=A.index;return this.Grid?this.Grid.getOffsetForCell({alignment:e,rowIndex:i,columnIndex:0}).scrollTop:0}},{key:"invalidateCellSizeAfterRender",value:function(A){var e=A.columnIndex,i=A.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:i,columnIndex:e})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.columnIndex,i=void 0===e?0:e,t=A.rowIndex,o=void 0===t?0:t;this.Grid&&this.Grid.recomputeGridSize({rowIndex:o,columnIndex:i})}},{key:"recomputeRowHeights",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:A,columnIndex:0})}},{key:"scrollToPosition",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:A})}},{key:"scrollToRow",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:A})}},{key:"render",value:function(){var A=this.props,e=A.className,i=A.noRowsRenderer,t=A.scrollToIndex,o=A.width,a=Le()("ReactVirtualized__List",e);return n.createElement(KT,hT()({},this.props,{autoContainerWidth:!0,cellRenderer:this._cellRenderer,className:a,columnWidth:o,columnCount:1,noContentRenderer:i,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,scrollToRow:t}))}}]),e}(n.PureComponent));Ck.defaultProps={autoHeight:!1,estimatedRowSize:30,onScroll:function(){},noRowsRenderer:function(){return null},onRowsRendered:function(){},overscanIndicesGetter:VT,overscanRowCount:10,scrollToAlignment:"auto",scrollToIndex:-1,style:{}},Ck.propTypes={"aria-label":o.a.string,autoHeight:o.a.bool.isRequired,className:o.a.string,estimatedRowSize:o.a.number.isRequired,height:o.a.number.isRequired,noRowsRenderer:function(){return("function"==typeof QT?QT.isRequired?QT.isRequired:QT:o.a.shape(QT).isRequired).apply(this,arguments)},onRowsRendered:o.a.func.isRequired,onScroll:o.a.func.isRequired,overscanIndicesGetter:function(){return("function"==typeof DT?DT.isRequired?DT.isRequired:DT:o.a.shape(DT).isRequired).apply(this,arguments)},overscanRowCount:o.a.number.isRequired,rowHeight:function(){return("function"==typeof fT?fT.isRequired?fT.isRequired:fT:o.a.shape(fT).isRequired).apply(this,arguments)},rowRenderer:function(){return("function"==typeof hk?hk.isRequired?hk.isRequired:hk:o.a.shape(hk).isRequired).apply(this,arguments)},rowCount:o.a.number.isRequired,scrollToAlignment:function(){return("function"==typeof MT?MT.isRequired?MT.isRequired:MT:o.a.shape(MT).isRequired).apply(this,arguments)},scrollToIndex:o.a.number.isRequired,scrollTop:o.a.number,style:o.a.object.isRequired,tabIndex:o.a.number,width:o.a.number.isRequired};var wk=Ck,mk=i(227),pk=i.n(mk),Ik=i(944),fk=i.n(Ik);var Qk={ge:function(A,e,i,t,o){return"function"==typeof i?function(A,e,i,t,o){for(var n=i+1;e<=i;){var a=e+i>>>1;o(A[a],t)>=0?(n=a,i=a-1):e=a+1}return n}(A,void 0===t?0:0|t,void 0===o?A.length-1:0|o,e,i):function(A,e,i,t){for(var o=i+1;e<=i;){var n=e+i>>>1;A[n]>=t?(o=n,i=n-1):e=n+1}return o}(A,void 0===i?0:0|i,void 0===t?A.length-1:0|t,e)},gt:function(A,e,i,t,o){return"function"==typeof i?function(A,e,i,t,o){for(var n=i+1;e<=i;){var a=e+i>>>1;o(A[a],t)>0?(n=a,i=a-1):e=a+1}return n}(A,void 0===t?0:0|t,void 0===o?A.length-1:0|o,e,i):function(A,e,i,t){for(var o=i+1;e<=i;){var n=e+i>>>1;A[n]>t?(o=n,i=n-1):e=n+1}return o}(A,void 0===i?0:0|i,void 0===t?A.length-1:0|t,e)},lt:function(A,e,i,t,o){return"function"==typeof i?function(A,e,i,t,o){for(var n=e-1;e<=i;){var a=e+i>>>1;o(A[a],t)<0?(n=a,e=a+1):i=a-1}return n}(A,void 0===t?0:0|t,void 0===o?A.length-1:0|o,e,i):function(A,e,i,t){for(var o=e-1;e<=i;){var n=e+i>>>1;A[n]<t?(o=n,e=n+1):i=n-1}return o}(A,void 0===i?0:0|i,void 0===t?A.length-1:0|t,e)},le:function(A,e,i,t,o){return"function"==typeof i?function(A,e,i,t,o){for(var n=e-1;e<=i;){var a=e+i>>>1;o(A[a],t)<=0?(n=a,e=a+1):i=a-1}return n}(A,void 0===t?0:0|t,void 0===o?A.length-1:0|o,e,i):function(A,e,i,t){for(var o=e-1;e<=i;){var n=e+i>>>1;A[n]<=t?(o=n,e=n+1):i=n-1}return o}(A,void 0===i?0:0|i,void 0===t?A.length-1:0|t,e)},eq:function(A,e,i,t,o){return"function"==typeof i?function(A,e,i,t,o){for(;e<=i;){var n=e+i>>>1,a=o(A[n],t);if(0===a)return n;a<=0?e=n+1:i=n-1}return-1}(A,void 0===t?0:0|t,void 0===o?A.length-1:0|o,e,i):function(A,e,i,t){for(;e<=i;){var o=e+i>>>1,n=A[o];if(n===t)return o;n<=t?e=o+1:i=o-1}return-1}(A,void 0===i?0:0|i,void 0===t?A.length-1:0|t,e)}},Dk=0,Mk=1;function bk(A,e,i,t,o){this.mid=A,this.left=e,this.right=i,this.leftPoints=t,this.rightPoints=o,this.count=(e?e.count:0)+(i?i.count:0)+t.length}var yk=bk.prototype;function Tk(A,e){A.mid=e.mid,A.left=e.left,A.right=e.right,A.leftPoints=e.leftPoints,A.rightPoints=e.rightPoints,A.count=e.count}function kk(A,e){var i=Gk(e);A.mid=i.mid,A.left=i.left,A.right=i.right,A.leftPoints=i.leftPoints,A.rightPoints=i.rightPoints,A.count=i.count}function Fk(A,e){var i=A.intervals([]);i.push(e),kk(A,i)}function vk(A,e){var i=A.intervals([]),t=i.indexOf(e);return t<0?Dk:(i.splice(t,1),kk(A,i),Mk)}function Sk(A,e,i){for(var t=0;t<A.length&&A[t][0]<=e;++t){var o=i(A[t]);if(o)return o}}function Nk(A,e,i){for(var t=A.length-1;t>=0&&A[t][1]>=e;--t){var o=i(A[t]);if(o)return o}}function Rk(A,e){for(var i=0;i<A.length;++i){var t=e(A[i]);if(t)return t}}function Ok(A,e){return A-e}function Yk(A,e){var i=A[0]-e[0];return i||A[1]-e[1]}function Uk(A,e){var i=A[1]-e[1];return i||A[0]-e[0]}function Gk(A){if(0===A.length)return null;for(var e=[],i=0;i<A.length;++i)e.push(A[i][0],A[i][1]);e.sort(Ok);var t=e[e.length>>1],o=[],n=[],a=[];for(i=0;i<A.length;++i){var r=A[i];r[1]<t?o.push(r):t<r[0]?n.push(r):a.push(r)}var s=a,g=a.slice();return s.sort(Yk),g.sort(Uk),new bk(t,Gk(o),Gk(n),s,g)}function Hk(A){this.root=A}yk.intervals=function(A){return A.push.apply(A,this.leftPoints),this.left&&this.left.intervals(A),this.right&&this.right.intervals(A),A},yk.insert=function(A){var e=this.count-this.leftPoints.length;if(this.count+=1,A[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?Fk(this,A):this.left.insert(A):this.left=Gk([A]);else if(A[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?Fk(this,A):this.right.insert(A):this.right=Gk([A]);else{var i=Qk.ge(this.leftPoints,A,Yk),t=Qk.ge(this.rightPoints,A,Uk);this.leftPoints.splice(i,0,A),this.rightPoints.splice(t,0,A)}},yk.remove=function(A){var e=this.count-this.leftPoints;if(A[1]<this.mid){return this.left?4*(this.right?this.right.count:0)>3*(e-1)?vk(this,A):2===(n=this.left.remove(A))?(this.left=null,this.count-=1,Mk):(n===Mk&&(this.count-=1),n):Dk}else{if(!(A[0]>this.mid)){if(1===this.count)return this.leftPoints[0]===A?2:Dk;if(1===this.leftPoints.length&&this.leftPoints[0]===A){if(this.left&&this.right){for(var i=this,t=this.left;t.right;)i=t,t=t.right;if(i===this)t.right=this.right;else{var o=this.left;n=this.right;i.count-=t.count,i.right=t.left,t.left=o,t.right=n}Tk(this,t),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?Tk(this,this.left):Tk(this,this.right);return Mk}for(o=Qk.ge(this.leftPoints,A,Yk);o<this.leftPoints.length&&this.leftPoints[o][0]===A[0];++o)if(this.leftPoints[o]===A){this.count-=1,this.leftPoints.splice(o,1);for(n=Qk.ge(this.rightPoints,A,Uk);n<this.rightPoints.length&&this.rightPoints[n][1]===A[1];++n)if(this.rightPoints[n]===A)return this.rightPoints.splice(n,1),Mk}return Dk}return this.right?4*(this.left?this.left.count:0)>3*(e-1)?vk(this,A):2===(n=this.right.remove(A))?(this.right=null,this.count-=1,Mk):(n===Mk&&(this.count-=1),n):Dk;var n}},yk.queryPoint=function(A,e){if(A<this.mid){if(this.left)if(i=this.left.queryPoint(A,e))return i;return Sk(this.leftPoints,A,e)}if(A>this.mid){var i;if(this.right)if(i=this.right.queryPoint(A,e))return i;return Nk(this.rightPoints,A,e)}return Rk(this.leftPoints,e)},yk.queryInterval=function(A,e,i){var t;if(A<this.mid&&this.left&&(t=this.left.queryInterval(A,e,i)))return t;if(e>this.mid&&this.right&&(t=this.right.queryInterval(A,e,i)))return t;return e<this.mid?Sk(this.leftPoints,e,i):A>this.mid?Nk(this.rightPoints,A,i):Rk(this.leftPoints,i)};var Lk=Hk.prototype;Lk.insert=function(A){this.root?this.root.insert(A):this.root=new bk(A[0],null,null,[A],[A])},Lk.remove=function(A){if(this.root){var e=this.root.remove(A);return 2===e&&(this.root=null),e!==Dk}return!1},Lk.queryPoint=function(A,e){if(this.root)return this.root.queryPoint(A,e)},Lk.queryInterval=function(A,e,i){if(A<=e&&this.root)return this.root.queryInterval(A,e,i)},Object.defineProperty(Lk,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(Lk,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});var Pk=function(){function A(){nT()(this,A),this._columnSizeMap={},this._intervalTree=function(A){return A&&0!==A.length?new Hk(Gk(A)):new Hk(null)}(),this._leftMap={}}return rT()(A,[{key:"estimateTotalHeight",value:function(A,e,i){var t=A-this.count;return this.tallestColumnSize+Math.ceil(t/e)*i}},{key:"range",value:function(A,e,i){var t=this;this._intervalTree.queryInterval(A,A+e,function(A){var e=fk()(A,3),o=e[0],n=(e[1],e[2]);return i(n,t._leftMap[n],o)})}},{key:"setPosition",value:function(A,e,i,t){this._intervalTree.insert([i,i+t,A]),this._leftMap[A]=e;var o=this._columnSizeMap,n=o[e];o[e]=void 0===n?i+t:Math.max(n,i+t)}},{key:"count",get:function(){return this._intervalTree.count}},{key:"shortestColumnSize",get:function(){var A=this._columnSizeMap,e=0;for(var i in A){var t=A[i];e=0===e?t:Math.min(e,t)}return e}},{key:"tallestColumnSize",get:function(){var A=this._columnSizeMap,e=0;for(var i in A){var t=A[i];e=Math.max(e,t)}return e}}]),A}(),xk=function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t.state={isScrolling:!1,scrollTop:0},t._invalidateOnUpdateStartIndex=null,t._invalidateOnUpdateStopIndex=null,t._positionCache=new Pk,t._startIndex=null,t._startIndexMemoized=null,t._stopIndex=null,t._stopIndexMemoized=null,t._debounceResetIsScrollingCallback=function(){t.setState({isScrolling:!1})},t._setScrollingContainerRef=function(A){t._scrollingContainer=A},t._onScroll=function(A){var e=t.props.height,i=A.target.scrollTop,o=Math.min(Math.max(0,t._getEstimatedTotalHeight()-e),i);i===o&&(t._debounceResetIsScrolling(),t.state.scrollTop!==o&&t.setState({isScrolling:!0,scrollTop:o}))},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"clearCellPositions",value:function(){this._positionCache=new Pk,this.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(A){var e=A.rowIndex;null===this._invalidateOnUpdateStartIndex?(this._invalidateOnUpdateStartIndex=e,this._invalidateOnUpdateStopIndex=e):(this._invalidateOnUpdateStartIndex=Math.min(this._invalidateOnUpdateStartIndex,e),this._invalidateOnUpdateStopIndex=Math.max(this._invalidateOnUpdateStopIndex,e))}},{key:"recomputeCellPositions",value:function(){var A=this._positionCache.count-1;this._positionCache=new Pk,this._populatePositionCache(0,A),this.forceUpdate()}},{key:"componentDidMount",value:function(){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback()}},{key:"componentDidUpdate",value:function(A,e){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback(),this.props.scrollTop!==A.scrollTop&&this._debounceResetIsScrolling()}},{key:"componentWillUnmount",value:function(){this._debounceResetIsScrollingId&&xT(this._debounceResetIsScrollingId)}},{key:"render",value:function(){var A=this,e=this.props,i=e.autoHeight,t=e.cellCount,o=e.cellMeasurerCache,a=e.cellRenderer,r=e.className,s=e.height,g=e.id,l=e.keyMapper,c=e.overscanByPixels,u=e.role,B=e.style,d=e.tabIndex,E=e.width,h=e.rowDirection,C=this.state,w=C.isScrolling,m=C.scrollTop,p=[],I=this._getEstimatedTotalHeight(),f=this._positionCache.shortestColumnSize,Q=this._positionCache.count,D=0,M=void 0;if(this._positionCache.range(Math.max(0,m-c),s+2*c,function(e,i,t){var n;void 0===M?(D=e,M=e):(D=Math.min(D,e),M=Math.max(M,e)),p.push(a({index:e,isScrolling:w,key:l(e),parent:A,style:(n={height:o.getHeight(e)},pk()(n,"ltr"===h?"left":"right",i),pk()(n,"position","absolute"),pk()(n,"top",t),pk()(n,"width",o.getWidth(e)),n)}))}),f<m+s+c&&Q<t)for(var b=Math.min(t-Q,Math.ceil((m+s+c-f)/o.defaultHeight*E/o.defaultWidth)),y=Q;y<Q+b;y++)M=y,p.push(a({index:y,isScrolling:w,key:l(y),parent:this,style:{width:o.getWidth(y)}}));return this._startIndex=D,this._stopIndex=M,n.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:Le()("ReactVirtualized__Masonry",r),id:g,onScroll:this._onScroll,role:u,style:hT()({boxSizing:"border-box",direction:"ltr",height:i?"auto":s,overflowX:"hidden",overflowY:I<s?"hidden":"auto",position:"relative",width:E,WebkitOverflowScrolling:"touch",willChange:"transform"},B),tabIndex:d},n.createElement("div",{className:"ReactVirtualized__Masonry__innerScrollContainer",style:{width:"100%",height:I,maxWidth:"100%",maxHeight:I,overflow:"hidden",pointerEvents:w?"none":"",position:"relative"}},p))}},{key:"_checkInvalidateOnUpdate",value:function(){if("number"==typeof this._invalidateOnUpdateStartIndex){var A=this._invalidateOnUpdateStartIndex,e=this._invalidateOnUpdateStopIndex;this._invalidateOnUpdateStartIndex=null,this._invalidateOnUpdateStopIndex=null,this._populatePositionCache(A,e),this.forceUpdate()}}},{key:"_debounceResetIsScrolling",value:function(){var A=this.props.scrollingResetTimeInterval;this._debounceResetIsScrollingId&&xT(this._debounceResetIsScrollingId),this._debounceResetIsScrollingId=_T(this._debounceResetIsScrollingCallback,A)}},{key:"_getEstimatedTotalHeight",value:function(){var A=this.props,e=A.cellCount,i=A.cellMeasurerCache,t=A.width,o=Math.max(1,Math.floor(t/i.defaultWidth));return this._positionCache.estimateTotalHeight(e,o,i.defaultHeight)}},{key:"_invokeOnScrollCallback",value:function(){var A=this.props,e=A.height,i=A.onScroll,t=this.state.scrollTop;this._onScrollMemoized!==t&&(i({clientHeight:e,scrollHeight:this._getEstimatedTotalHeight(),scrollTop:t}),this._onScrollMemoized=t)}},{key:"_invokeOnCellsRenderedCallback",value:function(){this._startIndexMemoized===this._startIndex&&this._stopIndexMemoized===this._stopIndex||((0,this.props.onCellsRendered)({startIndex:this._startIndex,stopIndex:this._stopIndex}),this._startIndexMemoized=this._startIndex,this._stopIndexMemoized=this._stopIndex)}},{key:"_populatePositionCache",value:function(A,e){for(var i=this.props,t=i.cellMeasurerCache,o=i.cellPositioner,n=A;n<=e;n++){var a=o(n),r=a.left,s=a.top;this._positionCache.setPosition(n,r,s,t.getHeight(n))}}}],[{key:"getDerivedStateFromProps",value:function(A,e){return void 0!==A.scrollTop&&e.scrollTop!==A.scrollTop?{isScrolling:!0,scrollTop:A.scrollTop}:null}}]),e}(n.PureComponent);function _k(){}xk.defaultProps={autoHeight:!1,keyMapper:function(A){return A},onCellsRendered:_k,onScroll:_k,overscanByPixels:20,role:"grid",scrollingResetTimeInterval:150,style:{},tabIndex:0,rowDirection:"ltr"},xk.propTypes={autoHeight:o.a.bool.isRequired,cellCount:o.a.number.isRequired,cellMeasurerCache:function(){return("function"==typeof CellMeasurerCache?o.a.instanceOf(CellMeasurerCache).isRequired:o.a.any.isRequired).apply(this,arguments)},cellPositioner:function(){return("function"==typeof Positioner?o.a.instanceOf(Positioner).isRequired:o.a.any.isRequired).apply(this,arguments)},cellRenderer:function(){return("function"==typeof CellRenderer?o.a.instanceOf(CellRenderer).isRequired:o.a.any.isRequired).apply(this,arguments)},className:o.a.string,height:o.a.number.isRequired,id:o.a.string,keyMapper:function(){return("function"==typeof KeyMapper?o.a.instanceOf(KeyMapper).isRequired:o.a.any.isRequired).apply(this,arguments)},onCellsRendered:function(){return("function"==typeof OnCellsRenderedCallback?o.a.instanceOf(OnCellsRenderedCallback):o.a.any).apply(this,arguments)},onScroll:function(){return("function"==typeof OnScrollCallback?o.a.instanceOf(OnScrollCallback):o.a.any).apply(this,arguments)},overscanByPixels:o.a.number.isRequired,role:o.a.string.isRequired,scrollingResetTimeInterval:o.a.number.isRequired,style:function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")},tabIndex:o.a.number.isRequired,width:o.a.number.isRequired,rowDirection:o.a.string.isRequired};o.a.number.isRequired,o.a.number.isRequired,o.a.func.isRequired,o.a.func.isRequired;Object(uT.polyfill)(xk);o.a.func;var jk=function(){function A(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};nT()(this,A),this.columnWidth=function(A){var i=A.index;e._cellMeasurerCache.columnWidth({index:i+e._columnIndexOffset})},this.rowHeight=function(A){var i=A.index;e._cellMeasurerCache.rowHeight({index:i+e._rowIndexOffset})};var t=i.cellMeasurerCache,o=i.columnIndexOffset,n=void 0===o?0:o,a=i.rowIndexOffset,r=void 0===a?0:a;this._cellMeasurerCache=t,this._columnIndexOffset=n,this._rowIndexOffset=r}return rT()(A,[{key:"clear",value:function(A,e){this._cellMeasurerCache.clear(A+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"clearAll",value:function(){this._cellMeasurerCache.clearAll()}},{key:"hasFixedHeight",value:function(){return this._cellMeasurerCache.hasFixedHeight()}},{key:"hasFixedWidth",value:function(){return this._cellMeasurerCache.hasFixedWidth()}},{key:"getHeight",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.getHeight(A+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"getWidth",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.getWidth(A+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"has",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.has(A+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"set",value:function(A,e,i,t){this._cellMeasurerCache.set(A+this._rowIndexOffset,e+this._columnIndexOffset,i,t)}},{key:"defaultHeight",get:function(){return this._cellMeasurerCache.defaultHeight}},{key:"defaultWidth",get:function(){return this._cellMeasurerCache.defaultWidth}}]),A}(),Jk=function(A){function e(A,i){nT()(this,e);var t=gT()(this,(e.__proto__||tT()(e)).call(this,A,i));zk.call(t);var o=A.deferredMeasurementCache,n=A.fixedColumnCount,a=A.fixedRowCount;return t._maybeCalculateCachedStyles(!0),o&&(t._deferredMeasurementCacheBottomLeftGrid=a>0?new jk({cellMeasurerCache:o,columnIndexOffset:0,rowIndexOffset:a}):o,t._deferredMeasurementCacheBottomRightGrid=n>0||a>0?new jk({cellMeasurerCache:o,columnIndexOffset:n,rowIndexOffset:a}):o,t._deferredMeasurementCacheTopRightGrid=n>0?new jk({cellMeasurerCache:o,columnIndexOffset:n,rowIndexOffset:0}):o),t}return cT()(e,A),rT()(e,[{key:"forceUpdateGrids",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.forceUpdate(),this._bottomRightGrid&&this._bottomRightGrid.forceUpdate(),this._topLeftGrid&&this._topLeftGrid.forceUpdate(),this._topRightGrid&&this._topRightGrid.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.columnIndex,i=void 0===e?0:e,t=A.rowIndex,o=void 0===t?0:t;this._deferredInvalidateColumnIndex="number"==typeof this._deferredInvalidateColumnIndex?Math.min(this._deferredInvalidateColumnIndex,i):i,this._deferredInvalidateRowIndex="number"==typeof this._deferredInvalidateRowIndex?Math.min(this._deferredInvalidateRowIndex,o):o}},{key:"measureAllCells",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.measureAllCells(),this._bottomRightGrid&&this._bottomRightGrid.measureAllCells(),this._topLeftGrid&&this._topLeftGrid.measureAllCells(),this._topRightGrid&&this._topRightGrid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.columnIndex,i=void 0===e?0:e,t=A.rowIndex,o=void 0===t?0:t,n=this.props,a=n.fixedColumnCount,r=n.fixedRowCount,s=Math.max(0,i-a),g=Math.max(0,o-r);this._bottomLeftGrid&&this._bottomLeftGrid.recomputeGridSize({columnIndex:i,rowIndex:g}),this._bottomRightGrid&&this._bottomRightGrid.recomputeGridSize({columnIndex:s,rowIndex:g}),this._topLeftGrid&&this._topLeftGrid.recomputeGridSize({columnIndex:i,rowIndex:o}),this._topRightGrid&&this._topRightGrid.recomputeGridSize({columnIndex:s,rowIndex:o}),this._leftGridWidth=null,this._topGridHeight=null,this._maybeCalculateCachedStyles(!0)}},{key:"componentDidMount",value:function(){var A=this.props,e=A.scrollLeft,i=A.scrollTop;if(e>0||i>0){var t={};e>0&&(t.scrollLeft=e),i>0&&(t.scrollTop=i),this.setState(t)}this._handleInvalidatedGridSize()}},{key:"componentDidUpdate",value:function(){this._handleInvalidatedGridSize()}},{key:"render",value:function(){var A=this.props,e=A.onScroll,i=A.onSectionRendered,t=(A.onScrollbarPresenceChange,A.scrollLeft,A.scrollToColumn),o=(A.scrollTop,A.scrollToRow),a=mT()(A,["onScroll","onSectionRendered","onScrollbarPresenceChange","scrollLeft","scrollToColumn","scrollTop","scrollToRow"]);if(this._prepareForRender(),0===this.props.width||0===this.props.height)return null;var r=this.state,s=r.scrollLeft,g=r.scrollTop;return n.createElement("div",{style:this._containerOuterStyle},n.createElement("div",{style:this._containerTopStyle},this._renderTopLeftGrid(a),this._renderTopRightGrid(hT()({},a,{onScroll:e,scrollLeft:s}))),n.createElement("div",{style:this._containerBottomStyle},this._renderBottomLeftGrid(hT()({},a,{onScroll:e,scrollTop:g})),this._renderBottomRightGrid(hT()({},a,{onScroll:e,onSectionRendered:i,scrollLeft:s,scrollToColumn:t,scrollToRow:o,scrollTop:g}))))}},{key:"_getBottomGridHeight",value:function(A){return A.height-this._getTopGridHeight(A)}},{key:"_getLeftGridWidth",value:function(A){var e=A.fixedColumnCount,i=A.columnWidth;if(null==this._leftGridWidth)if("function"==typeof i){for(var t=0,o=0;o<e;o++)t+=i({index:o});this._leftGridWidth=t}else this._leftGridWidth=i*e;return this._leftGridWidth}},{key:"_getRightGridWidth",value:function(A){return A.width-this._getLeftGridWidth(A)}},{key:"_getTopGridHeight",value:function(A){var e=A.fixedRowCount,i=A.rowHeight;if(null==this._topGridHeight)if("function"==typeof i){for(var t=0,o=0;o<e;o++)t+=i({index:o});this._topGridHeight=t}else this._topGridHeight=i*e;return this._topGridHeight}},{key:"_handleInvalidatedGridSize",value:function(){if("number"==typeof this._deferredInvalidateColumnIndex){var A=this._deferredInvalidateColumnIndex,e=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:A,rowIndex:e}),this.forceUpdate()}}},{key:"_maybeCalculateCachedStyles",value:function(A){var e=this.props,i=e.columnWidth,t=e.enableFixedColumnScroll,o=e.enableFixedRowScroll,n=e.height,a=e.fixedColumnCount,r=e.fixedRowCount,s=e.rowHeight,g=e.style,l=e.styleBottomLeftGrid,c=e.styleBottomRightGrid,u=e.styleTopLeftGrid,B=e.styleTopRightGrid,d=e.width,E=A||n!==this._lastRenderedHeight||d!==this._lastRenderedWidth,h=A||i!==this._lastRenderedColumnWidth||a!==this._lastRenderedFixedColumnCount,C=A||r!==this._lastRenderedFixedRowCount||s!==this._lastRenderedRowHeight;(A||E||g!==this._lastRenderedStyle)&&(this._containerOuterStyle=hT()({height:n,overflow:"visible",width:d},g)),(A||E||C)&&(this._containerTopStyle={height:this._getTopGridHeight(this.props),position:"relative",width:d},this._containerBottomStyle={height:n-this._getTopGridHeight(this.props),overflow:"visible",position:"relative",width:d}),(A||l!==this._lastRenderedStyleBottomLeftGrid)&&(this._bottomLeftGridStyle=hT()({left:0,overflowX:"hidden",overflowY:t?"auto":"hidden",position:"absolute"},l)),(A||h||c!==this._lastRenderedStyleBottomRightGrid)&&(this._bottomRightGridStyle=hT()({left:this._getLeftGridWidth(this.props),position:"absolute"},c)),(A||u!==this._lastRenderedStyleTopLeftGrid)&&(this._topLeftGridStyle=hT()({left:0,overflowX:"hidden",overflowY:"hidden",position:"absolute",top:0},u)),(A||h||B!==this._lastRenderedStyleTopRightGrid)&&(this._topRightGridStyle=hT()({left:this._getLeftGridWidth(this.props),overflowX:o?"auto":"hidden",overflowY:"hidden",position:"absolute",top:0},B)),this._lastRenderedColumnWidth=i,this._lastRenderedFixedColumnCount=a,this._lastRenderedFixedRowCount=r,this._lastRenderedHeight=n,this._lastRenderedRowHeight=s,this._lastRenderedStyle=g,this._lastRenderedStyleBottomLeftGrid=l,this._lastRenderedStyleBottomRightGrid=c,this._lastRenderedStyleTopLeftGrid=u,this._lastRenderedStyleTopRightGrid=B,this._lastRenderedWidth=d}},{key:"_prepareForRender",value:function(){this._lastRenderedColumnWidth===this.props.columnWidth&&this._lastRenderedFixedColumnCount===this.props.fixedColumnCount||(this._leftGridWidth=null),this._lastRenderedFixedRowCount===this.props.fixedRowCount&&this._lastRenderedRowHeight===this.props.rowHeight||(this._topGridHeight=null),this._maybeCalculateCachedStyles(),this._lastRenderedColumnWidth=this.props.columnWidth,this._lastRenderedFixedColumnCount=this.props.fixedColumnCount,this._lastRenderedFixedRowCount=this.props.fixedRowCount,this._lastRenderedRowHeight=this.props.rowHeight}},{key:"_renderBottomLeftGrid",value:function(A){var e=A.enableFixedColumnScroll,i=A.fixedColumnCount,t=A.fixedRowCount,o=A.rowCount,a=A.hideBottomLeftGridScrollbar,r=this.state.showVerticalScrollbar;if(!i)return null;var s=r?1:0,g=this._getBottomGridHeight(A),l=this._getLeftGridWidth(A),c=this.state.showVerticalScrollbar?this.state.scrollbarSize:0,u=a?l+c:l,B=n.createElement(KT,hT()({},A,{cellRenderer:this._cellRendererBottomLeftGrid,className:this.props.classNameBottomLeftGrid,columnCount:i,deferredMeasurementCache:this._deferredMeasurementCacheBottomLeftGrid,height:g,onScroll:e?this._onScrollTop:void 0,ref:this._bottomLeftGridRef,rowCount:Math.max(0,o-t)+s,rowHeight:this._rowHeightBottomGrid,style:this._bottomLeftGridStyle,tabIndex:null,width:u}));return a?n.createElement("div",{className:"BottomLeftGrid_ScrollWrapper",style:hT()({},this._bottomLeftGridStyle,{height:g,width:l,overflowY:"hidden"})},B):B}},{key:"_renderBottomRightGrid",value:function(A){var e=A.columnCount,i=A.fixedColumnCount,t=A.fixedRowCount,o=A.rowCount,a=A.scrollToColumn,r=A.scrollToRow;return n.createElement(KT,hT()({},A,{cellRenderer:this._cellRendererBottomRightGrid,className:this.props.classNameBottomRightGrid,columnCount:Math.max(0,e-i),columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheBottomRightGrid,height:this._getBottomGridHeight(A),onScroll:this._onScroll,onScrollbarPresenceChange:this._onScrollbarPresenceChange,ref:this._bottomRightGridRef,rowCount:Math.max(0,o-t),rowHeight:this._rowHeightBottomGrid,scrollToColumn:a-i,scrollToRow:r-t,style:this._bottomRightGridStyle,width:this._getRightGridWidth(A)}))}},{key:"_renderTopLeftGrid",value:function(A){var e=A.fixedColumnCount,i=A.fixedRowCount;return e&&i?n.createElement(KT,hT()({},A,{className:this.props.classNameTopLeftGrid,columnCount:e,height:this._getTopGridHeight(A),ref:this._topLeftGridRef,rowCount:i,style:this._topLeftGridStyle,tabIndex:null,width:this._getLeftGridWidth(A)})):null}},{key:"_renderTopRightGrid",value:function(A){var e=A.columnCount,i=A.enableFixedRowScroll,t=A.fixedColumnCount,o=A.fixedRowCount,a=A.scrollLeft,r=A.hideTopRightGridScrollbar,s=this.state,g=s.showHorizontalScrollbar,l=s.scrollbarSize;if(!o)return null;var c=g?1:0,u=this._getTopGridHeight(A),B=this._getRightGridWidth(A),d=g?l:0,E=u,h=this._topRightGridStyle;r&&(E=u+d,h=hT()({},this._topRightGridStyle,{left:0}));var C=n.createElement(KT,hT()({},A,{cellRenderer:this._cellRendererTopRightGrid,className:this.props.classNameTopRightGrid,columnCount:Math.max(0,e-t)+c,columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheTopRightGrid,height:E,onScroll:i?this._onScrollLeft:void 0,ref:this._topRightGridRef,rowCount:o,scrollLeft:a,style:h,tabIndex:null,width:B}));return r?n.createElement("div",{className:"TopRightGrid_ScrollWrapper",style:hT()({},this._topRightGridStyle,{height:u,width:B,overflowX:"hidden"})},C):C}}],[{key:"getDerivedStateFromProps",value:function(A,e){return A.scrollLeft!==e.scrollLeft||A.scrollTop!==e.scrollTop?{scrollLeft:null!=A.scrollLeft&&A.scrollLeft>=0?A.scrollLeft:e.scrollLeft,scrollTop:null!=A.scrollTop&&A.scrollTop>=0?A.scrollTop:e.scrollTop}:null}}]),e}(n.PureComponent);Jk.defaultProps={classNameBottomLeftGrid:"",classNameBottomRightGrid:"",classNameTopLeftGrid:"",classNameTopRightGrid:"",enableFixedColumnScroll:!1,enableFixedRowScroll:!1,fixedColumnCount:0,fixedRowCount:0,scrollToColumn:-1,scrollToRow:-1,style:{},styleBottomLeftGrid:{},styleBottomRightGrid:{},styleTopLeftGrid:{},styleTopRightGrid:{},hideTopRightGridScrollbar:!1,hideBottomLeftGridScrollbar:!1};var zk=function(){var A=this;this.state={scrollLeft:0,scrollTop:0,scrollbarSize:0,showHorizontalScrollbar:!1,showVerticalScrollbar:!1},this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this._bottomLeftGridRef=function(e){A._bottomLeftGrid=e},this._bottomRightGridRef=function(e){A._bottomRightGrid=e},this._cellRendererBottomLeftGrid=function(e){var i=e.rowIndex,t=mT()(e,["rowIndex"]),o=A.props,a=o.cellRenderer,r=o.fixedRowCount;return i===o.rowCount-r?n.createElement("div",{key:t.key,style:hT()({},t.style,{height:20})}):a(hT()({},t,{parent:A,rowIndex:i+r}))},this._cellRendererBottomRightGrid=function(e){var i=e.columnIndex,t=e.rowIndex,o=mT()(e,["columnIndex","rowIndex"]),n=A.props,a=n.cellRenderer,r=n.fixedColumnCount,s=n.fixedRowCount;return a(hT()({},o,{columnIndex:i+r,parent:A,rowIndex:t+s}))},this._cellRendererTopRightGrid=function(e){var i=e.columnIndex,t=mT()(e,["columnIndex"]),o=A.props,a=o.cellRenderer,r=o.columnCount,s=o.fixedColumnCount;return i===r-s?n.createElement("div",{key:t.key,style:hT()({},t.style,{width:20})}):a(hT()({},t,{columnIndex:i+s,parent:A}))},this._columnWidthRightGrid=function(e){var i=e.index,t=A.props,o=t.columnCount,n=t.fixedColumnCount,a=t.columnWidth,r=A.state,s=r.scrollbarSize;return r.showHorizontalScrollbar&&i===o-n?s:"function"==typeof a?a({index:i+n}):a},this._onScroll=function(e){var i=e.scrollLeft,t=e.scrollTop;A.setState({scrollLeft:i,scrollTop:t});var o=A.props.onScroll;o&&o(e)},this._onScrollbarPresenceChange=function(e){var i=e.horizontal,t=e.size,o=e.vertical,n=A.state,a=n.showHorizontalScrollbar,r=n.showVerticalScrollbar;if(i!==a||o!==r){A.setState({scrollbarSize:t,showHorizontalScrollbar:i,showVerticalScrollbar:o});var s=A.props.onScrollbarPresenceChange;"function"==typeof s&&s({horizontal:i,size:t,vertical:o})}},this._onScrollLeft=function(e){var i=e.scrollLeft;A._onScroll({scrollLeft:i,scrollTop:A.state.scrollTop})},this._onScrollTop=function(e){var i=e.scrollTop;A._onScroll({scrollTop:i,scrollLeft:A.state.scrollLeft})},this._rowHeightBottomGrid=function(e){var i=e.index,t=A.props,o=t.fixedRowCount,n=t.rowCount,a=t.rowHeight,r=A.state,s=r.scrollbarSize;return r.showVerticalScrollbar&&i===n-o?s:"function"==typeof a?a({index:i+o}):a},this._topLeftGridRef=function(e){A._topLeftGrid=e},this._topRightGridRef=function(e){A._topRightGrid=e}};Jk.propTypes={classNameBottomLeftGrid:o.a.string.isRequired,classNameBottomRightGrid:o.a.string.isRequired,classNameTopLeftGrid:o.a.string.isRequired,classNameTopRightGrid:o.a.string.isRequired,enableFixedColumnScroll:o.a.bool.isRequired,enableFixedRowScroll:o.a.bool.isRequired,fixedColumnCount:o.a.number.isRequired,fixedRowCount:o.a.number.isRequired,onScrollbarPresenceChange:o.a.func,style:o.a.object.isRequired,styleBottomLeftGrid:o.a.object.isRequired,styleBottomRightGrid:o.a.object.isRequired,styleTopLeftGrid:o.a.object.isRequired,styleTopRightGrid:o.a.object.isRequired,hideTopRightGridScrollbar:o.a.bool,hideBottomLeftGridScrollbar:o.a.bool},Object(uT.polyfill)(Jk);var Kk=function(A){function e(A,i){nT()(this,e);var t=gT()(this,(e.__proto__||tT()(e)).call(this,A,i));return t.state={clientHeight:0,clientWidth:0,scrollHeight:0,scrollLeft:0,scrollTop:0,scrollWidth:0},t._onScroll=t._onScroll.bind(t),t}return cT()(e,A),rT()(e,[{key:"render",value:function(){var A=this.props.children,e=this.state,i=e.clientHeight,t=e.clientWidth,o=e.scrollHeight,n=e.scrollLeft,a=e.scrollTop,r=e.scrollWidth;return A({clientHeight:i,clientWidth:t,onScroll:this._onScroll,scrollHeight:o,scrollLeft:n,scrollTop:a,scrollWidth:r})}},{key:"_onScroll",value:function(A){var e=A.clientHeight,i=A.clientWidth,t=A.scrollHeight,o=A.scrollLeft,n=A.scrollTop,a=A.scrollWidth;this.setState({clientHeight:e,clientWidth:i,scrollHeight:t,scrollLeft:o,scrollTop:n,scrollWidth:a})}}]),e}(n.PureComponent);Kk.propTypes={children:o.a.func.isRequired};o.a.any,o.a.string.isRequired,o.a.any,o.a.any,o.a.string.isRequired,o.a.number.isRequired;var Wk={className:o.a.string.isRequired,columns:o.a.arrayOf(function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")}).isRequired,style:function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")}},Vk={columnData:o.a.any,dataKey:o.a.string.isRequired,disableSort:o.a.bool,label:o.a.any,sortBy:o.a.string,sortDirection:o.a.string},Xk={className:o.a.string.isRequired,columns:o.a.arrayOf(function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")}).isRequired,index:o.a.number.isRequired,isScrolling:o.a.bool.isRequired,onRowClick:o.a.func,onRowDoubleClick:o.a.func,onRowMouseOver:o.a.func,onRowMouseOut:o.a.func,rowData:function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")},style:function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")}};function Zk(A){var e=A.className,i=A.columns,t=A.style;return n.createElement("div",{className:e,role:"row",style:t},i)}Zk.propTypes=Wk===o.a.any?{}:Wk;var qk={ASC:"ASC",DESC:"DESC"};function $k(A){var e=A.sortDirection,i=Le()("ReactVirtualized__Table__sortableHeaderIcon",{"ReactVirtualized__Table__sortableHeaderIcon--ASC":e===qk.ASC,"ReactVirtualized__Table__sortableHeaderIcon--DESC":e===qk.DESC});return n.createElement("svg",{className:i,width:18,height:18,viewBox:"0 0 24 24"},e===qk.ASC?n.createElement("path",{d:"M7 14l5-5 5 5z"}):n.createElement("path",{d:"M7 10l5 5 5-5z"}),n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}function AF(A){var e=A.dataKey,i=A.label,t=A.sortBy,o=A.sortDirection,a=t===e,r=[n.createElement("span",{className:"ReactVirtualized__Table__headerTruncatedText",key:"label",title:i},i)];return a&&r.push(n.createElement($k,{key:"SortIndicator",sortDirection:o})),r}function eF(A){var e=A.className,i=A.columns,t=A.index,o=A.key,a=A.onRowClick,r=A.onRowDoubleClick,s=A.onRowMouseOut,g=A.onRowMouseOver,l=A.onRowRightClick,c=A.rowData,u=A.style,B={};return(a||r||s||g||l)&&(B["aria-label"]="row",B.tabIndex=0,a&&(B.onClick=function(A){return a({event:A,index:t,rowData:c})}),r&&(B.onDoubleClick=function(A){return r({event:A,index:t,rowData:c})}),s&&(B.onMouseOut=function(A){return s({event:A,index:t,rowData:c})}),g&&(B.onMouseOver=function(A){return g({event:A,index:t,rowData:c})}),l&&(B.onContextMenu=function(A){return l({event:A,index:t,rowData:c})})),n.createElement("div",hT()({},B,{className:e,key:o,role:"row",style:u}),i)}$k.propTypes={sortDirection:o.a.oneOf([qk.ASC,qk.DESC])},AF.propTypes=Vk===o.a.any?{}:Vk,eF.propTypes=Xk===o.a.any?{}:Xk;var iF=function(A){function e(){return nT()(this,e),gT()(this,(e.__proto__||tT()(e)).apply(this,arguments))}return cT()(e,A),e}(n.Component);iF.defaultProps={cellDataGetter:function(A){var e=A.dataKey,i=A.rowData;return"function"==typeof i.get?i.get(e):i[e]},cellRenderer:function(A){var e=A.cellData;return null==e?"":String(e)},defaultSortDirection:qk.ASC,flexGrow:0,flexShrink:1,headerRenderer:AF,style:{}};var tF=iF;iF.propTypes={"aria-label":o.a.string,cellDataGetter:o.a.func,cellRenderer:o.a.func,className:o.a.string,columnData:o.a.object,dataKey:o.a.any.isRequired,defaultSortDirection:o.a.oneOf([qk.ASC,qk.DESC]),disableSort:o.a.bool,flexGrow:o.a.number,flexShrink:o.a.number,headerClassName:o.a.string,headerRenderer:o.a.func.isRequired,headerStyle:o.a.object,id:o.a.string,label:o.a.node,maxWidth:o.a.number,minWidth:o.a.number,style:o.a.object,width:o.a.number.isRequired};var oF=function(A){function e(A){nT()(this,e);var i=gT()(this,(e.__proto__||tT()(e)).call(this,A));return i.state={scrollbarWidth:0},i._createColumn=i._createColumn.bind(i),i._createRow=i._createRow.bind(i),i._onScroll=i._onScroll.bind(i),i._onSectionRendered=i._onSectionRendered.bind(i),i._setRef=i._setRef.bind(i),i}return cT()(e,A),rT()(e,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(A){var e=A.alignment,i=A.index;return this.Grid?this.Grid.getOffsetForCell({alignment:e,rowIndex:i}).scrollTop:0}},{key:"invalidateCellSizeAfterRender",value:function(A){var e=A.columnIndex,i=A.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:i,columnIndex:e})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.columnIndex,i=void 0===e?0:e,t=A.rowIndex,o=void 0===t?0:t;this.Grid&&this.Grid.recomputeGridSize({rowIndex:o,columnIndex:i})}},{key:"recomputeRowHeights",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:A})}},{key:"scrollToPosition",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:A})}},{key:"scrollToRow",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:A})}},{key:"componentDidMount",value:function(){this._setScrollbarWidth()}},{key:"componentDidUpdate",value:function(){this._setScrollbarWidth()}},{key:"render",value:function(){var A=this,e=this.props,i=e.children,t=e.className,o=e.disableHeader,a=e.gridClassName,r=e.gridStyle,s=e.headerHeight,g=e.headerRowRenderer,l=e.height,c=e.id,u=e.noRowsRenderer,B=e.rowClassName,d=e.rowStyle,E=e.scrollToIndex,h=e.style,C=e.width,w=this.state.scrollbarWidth,m=o?l:l-s,p="function"==typeof B?B({index:-1}):B,I="function"==typeof d?d({index:-1}):d;return this._cachedColumnStyles=[],n.Children.toArray(i).forEach(function(e,i){var t=A._getFlexStyleForColumn(e,e.props.style);A._cachedColumnStyles[i]=hT()({},t,{overflow:"hidden"})}),n.createElement("div",{className:Le()("ReactVirtualized__Table",t),id:c,role:"grid",style:h},!o&&g({className:Le()("ReactVirtualized__Table__headerRow",p),columns:this._getHeaderColumns(),style:hT()({},I,{height:s,overflow:"hidden",paddingRight:w,width:C})}),n.createElement(KT,hT()({},this.props,{autoContainerWidth:!0,className:Le()("ReactVirtualized__Table__Grid",a),cellRenderer:this._createRow,columnWidth:C,columnCount:1,height:m,id:void 0,noContentRenderer:u,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,role:"rowgroup",scrollbarWidth:w,scrollToRow:E,style:hT()({},r,{overflowX:"hidden"})})))}},{key:"_createColumn",value:function(A){var e=A.column,i=A.columnIndex,t=A.isScrolling,o=A.parent,a=A.rowData,r=A.rowIndex,s=e.props,g=s.cellDataGetter,l=s.cellRenderer,c=s.className,u=s.columnData,B=s.dataKey,d=s.id,E=l({cellData:g({columnData:u,dataKey:B,rowData:a}),columnData:u,columnIndex:i,dataKey:B,isScrolling:t,parent:o,rowData:a,rowIndex:r}),h=this._cachedColumnStyles[i],C="string"==typeof E?E:null;return n.createElement("div",{"aria-describedby":d,className:Le()("ReactVirtualized__Table__rowColumn",c),key:"Row"+r+"-Col"+i,role:"gridcell",style:h,title:C},E)}},{key:"_createHeader",value:function(A){var e=A.column,i=A.index,t=this.props,o=t.headerClassName,a=t.headerStyle,r=t.onHeaderClick,s=t.sort,g=t.sortBy,l=t.sortDirection,c=e.props,u=c.columnData,B=c.dataKey,d=c.defaultSortDirection,E=c.disableSort,h=c.headerRenderer,C=c.id,w=c.label,m=!E&&s,p=Le()("ReactVirtualized__Table__headerColumn",o,e.props.headerClassName,{ReactVirtualized__Table__sortableHeaderColumn:m}),I=this._getFlexStyleForColumn(e,hT()({},a,e.props.headerStyle)),f=h({columnData:u,dataKey:B,disableSort:E,label:w,sortBy:g,sortDirection:l}),Q=void 0,D=void 0,M=void 0,b=void 0,y=void 0;if(m||r){var T=g!==B?d:l===qk.DESC?qk.ASC:qk.DESC,k=function(A){m&&s({defaultSortDirection:d,event:A,sortBy:B,sortDirection:T}),r&&r({columnData:u,dataKey:B,event:A})};y=e.props["aria-label"]||w||B,M=0,Q=k,D=function(A){"Enter"!==A.key&&" "!==A.key||k(A)}}return g===B&&(b=l===qk.ASC?"ascending":"descending"),n.createElement("div",{"aria-label":y,"aria-sort":b,className:p,id:C,key:"Header-Col"+i,onClick:Q,onKeyDown:D,role:"columnheader",style:I,tabIndex:M},f)}},{key:"_createRow",value:function(A){var e=this,i=A.rowIndex,t=A.isScrolling,o=A.key,a=A.parent,r=A.style,s=this.props,g=s.children,l=s.onRowClick,c=s.onRowDoubleClick,u=s.onRowRightClick,B=s.onRowMouseOver,d=s.onRowMouseOut,E=s.rowClassName,h=s.rowGetter,C=s.rowRenderer,w=s.rowStyle,m=this.state.scrollbarWidth,p="function"==typeof E?E({index:i}):E,I="function"==typeof w?w({index:i}):w,f=h({index:i}),Q=n.Children.toArray(g).map(function(A,o){return e._createColumn({column:A,columnIndex:o,isScrolling:t,parent:a,rowData:f,rowIndex:i,scrollbarWidth:m})}),D=Le()("ReactVirtualized__Table__row",p),M=hT()({},r,I,{height:this._getRowHeight(i),overflow:"hidden",paddingRight:m});return C({className:D,columns:Q,index:i,isScrolling:t,key:o,onRowClick:l,onRowDoubleClick:c,onRowRightClick:u,onRowMouseOver:B,onRowMouseOut:d,rowData:f,style:M})}},{key:"_getFlexStyleForColumn",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=A.props.flexGrow+" "+A.props.flexShrink+" "+A.props.width+"px",t=hT()({},e,{flex:i,msFlex:i,WebkitFlex:i});return A.props.maxWidth&&(t.maxWidth=A.props.maxWidth),A.props.minWidth&&(t.minWidth=A.props.minWidth),t}},{key:"_getHeaderColumns",value:function(){var A=this,e=this.props,i=e.children;return(e.disableHeader?[]:n.Children.toArray(i)).map(function(e,i){return A._createHeader({column:e,index:i})})}},{key:"_getRowHeight",value:function(A){var e=this.props.rowHeight;return"function"==typeof e?e({index:A}):e}},{key:"_onScroll",value:function(A){var e=A.clientHeight,i=A.scrollHeight,t=A.scrollTop;(0,this.props.onScroll)({clientHeight:e,scrollHeight:i,scrollTop:t})}},{key:"_onSectionRendered",value:function(A){var e=A.rowOverscanStartIndex,i=A.rowOverscanStopIndex,t=A.rowStartIndex,o=A.rowStopIndex;(0,this.props.onRowsRendered)({overscanStartIndex:e,overscanStopIndex:i,startIndex:t,stopIndex:o})}},{key:"_setRef",value:function(A){this.Grid=A}},{key:"_setScrollbarWidth",value:function(){if(this.Grid){var A=Object(Sy.findDOMNode)(this.Grid),e=A.clientWidth||0,i=(A.offsetWidth||0)-e;this.setState({scrollbarWidth:i})}}}]),e}(n.PureComponent);oF.defaultProps={disableHeader:!1,estimatedRowSize:30,headerHeight:0,headerStyle:{},noRowsRenderer:function(){return null},onRowsRendered:function(){return null},onScroll:function(){return null},overscanIndicesGetter:VT,overscanRowCount:10,rowRenderer:eF,headerRowRenderer:Zk,rowStyle:{},scrollToAlignment:"auto",scrollToIndex:-1,style:{}};oF.propTypes={"aria-label":o.a.string,autoHeight:o.a.bool,children:function(A){for(var e=n.Children.toArray(A.children),i=0;i<e.length;i++){var t=e[i].type;if(t!==tF&&!(t.prototype instanceof tF))return new Error("Table only accepts children of type Column")}},className:o.a.string,disableHeader:o.a.bool,estimatedRowSize:o.a.number.isRequired,gridClassName:o.a.string,gridStyle:o.a.object,headerClassName:o.a.string,headerHeight:o.a.number.isRequired,headerRowRenderer:o.a.func,headerStyle:o.a.object,height:o.a.number.isRequired,id:o.a.string,noRowsRenderer:o.a.func,onHeaderClick:o.a.func,onRowClick:o.a.func,onRowDoubleClick:o.a.func,onRowMouseOut:o.a.func,onRowMouseOver:o.a.func,onRowRightClick:o.a.func,onRowsRendered:o.a.func,onScroll:o.a.func.isRequired,overscanIndicesGetter:o.a.func.isRequired,overscanRowCount:o.a.number.isRequired,rowClassName:o.a.oneOfType([o.a.string,o.a.func]),rowGetter:o.a.func.isRequired,rowHeight:o.a.oneOfType([o.a.number,o.a.func]).isRequired,rowCount:o.a.number.isRequired,rowRenderer:o.a.func,rowStyle:o.a.oneOfType([o.a.object,o.a.func]).isRequired,scrollToAlignment:o.a.oneOf(["auto","end","start","center"]).isRequired,scrollToIndex:o.a.number.isRequired,scrollTop:o.a.number,sort:o.a.func,sortBy:o.a.string,sortDirection:o.a.oneOf([qk.ASC,qk.DESC]),style:o.a.object,tabIndex:o.a.number,width:o.a.number.isRequired};var nF=[],aF=null,rF=null;function sF(){rF&&(rF=null,document.body&&null!=aF&&(document.body.style.pointerEvents=aF),aF=null)}function gF(){sF(),nF.forEach(function(A){return A.__resetIsScrolling()})}function lF(A){A.currentTarget===window&&null==aF&&document.body&&(aF=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),function(){rF&&xT(rF);var A=0;nF.forEach(function(e){A=Math.max(A,e.props.scrollingResetTimeInterval)}),rF=_T(gF,A)}(),nF.forEach(function(e){e.props.scrollElement===A.currentTarget&&e.__handleWindowScrollEvent()})}function cF(A,e){nF.some(function(A){return A.props.scrollElement===e})||e.addEventListener("scroll",lF),nF.push(A)}function uF(A,e){(nF=nF.filter(function(e){return e!==A})).length||(e.removeEventListener("scroll",lF),rF&&(xT(rF),sF()))}var BF=function(A){return A===window},dF=function(A){return A.getBoundingClientRect()};function EF(A,e){if(A){if(BF(A)){var i=window,t=i.innerHeight,o=i.innerWidth;return{height:"number"==typeof t?t:0,width:"number"==typeof o?o:0}}return dF(A)}return{height:e.serverHeight,width:e.serverWidth}}function hF(A){return BF(A)&&document.documentElement?{top:"scrollY"in window?window.scrollY:document.documentElement.scrollTop,left:"scrollX"in window?window.scrollX:document.documentElement.scrollLeft}:{top:A.scrollTop,left:A.scrollLeft}}var CF=function(){return"undefined"!=typeof window?window:void 0},wF=function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t._window=CF(),t._isMounted=!1,t._positionFromTop=0,t._positionFromLeft=0,t.state=hT()({},EF(t.props.scrollElement,t.props),{isScrolling:!1,scrollLeft:0,scrollTop:0}),t._registerChild=function(A){!A||A instanceof Element||console.warn("WindowScroller registerChild expects to be passed Element or null"),t._child=A,t.updatePosition()},t._onChildScroll=function(A){var e=A.scrollTop;if(t.state.scrollTop!==e){var i=t.props.scrollElement;i&&("function"==typeof i.scrollTo?i.scrollTo(0,e+t._positionFromTop):i.scrollTop=e+t._positionFromTop)}},t._registerResizeListener=function(A){A===window?window.addEventListener("resize",t._onResize,!1):t._detectElementResize.addResizeListener(A,t._onResize)},t._unregisterResizeListener=function(A){A===window?window.removeEventListener("resize",t._onResize,!1):A&&t._detectElementResize.removeResizeListener(A,t._onResize)},t._onResize=function(){t.updatePosition()},t.__handleWindowScrollEvent=function(){if(t._isMounted){var A=t.props.onScroll,e=t.props.scrollElement;if(e){var i=hF(e),o=Math.max(0,i.left-t._positionFromLeft),n=Math.max(0,i.top-t._positionFromTop);t.setState({isScrolling:!0,scrollLeft:o,scrollTop:n}),A({scrollLeft:o,scrollTop:n})}}},t.__resetIsScrolling=function(){t.setState({isScrolling:!1})},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"updatePosition",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.scrollElement,e=this.props.onResize,i=this.state,t=i.height,o=i.width,n=this._child||Sy.findDOMNode(this);if(n instanceof Element&&A){var a=function(A,e){if(BF(e)&&document.documentElement){var i=document.documentElement,t=dF(A),o=dF(i);return{top:t.top-o.top,left:t.left-o.left}}var n=hF(e),a=dF(A),r=dF(e);return{top:a.top+n.top-r.top,left:a.left+n.left-r.left}}(n,A);this._positionFromTop=a.top,this._positionFromLeft=a.left}var r=EF(A,this.props);t===r.height&&o===r.width||(this.setState({height:r.height,width:r.width}),e({height:r.height,width:r.width}))}},{key:"componentDidMount",value:function(){var A=this.props.scrollElement;this._detectElementResize=Object(ZT.a)(),this.updatePosition(A),A&&(cF(this,A),this._registerResizeListener(A)),this._isMounted=!0}},{key:"componentDidUpdate",value:function(A,e){var i=this.props.scrollElement,t=A.scrollElement;t!==i&&null!=t&&null!=i&&(this.updatePosition(i),uF(this,t),cF(this,i),this._unregisterResizeListener(t),this._registerResizeListener(i))}},{key:"componentWillUnmount",value:function(){var A=this.props.scrollElement;A&&(uF(this,A),this._unregisterResizeListener(A)),this._isMounted=!1}},{key:"render",value:function(){var A=this.props.children,e=this.state,i=e.isScrolling,t=e.scrollTop,o=e.scrollLeft,n=e.height,a=e.width;return A({onChildScroll:this._onChildScroll,registerChild:this._registerChild,height:n,isScrolling:i,scrollLeft:o,scrollTop:t,width:a})}}]),e}(n.PureComponent);wF.defaultProps={onResize:function(){},onScroll:function(){},scrollingResetTimeInterval:150,scrollElement:CF(),serverHeight:0,serverWidth:0},wF.propTypes={children:o.a.func.isRequired,onResize:o.a.func.isRequired,onScroll:o.a.func.isRequired,scrollElement:o.a.oneOfType([o.a.any,function(){return("function"==typeof Element?o.a.instanceOf(Element):o.a.any).apply(this,arguments)}]),scrollingResetTimeInterval:o.a.number.isRequired,serverHeight:o.a.number.isRequired,serverWidth:o.a.number.isRequired};function mF(A){"@babel/helpers - typeof";return(mF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function pF(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function IF(A,e){return(IF=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function fF(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=DF(A);if(e){var o=DF(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===mF(e)||"function"==typeof e))return e;return QF(A)}(this,i)}}function QF(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function DF(A){return(DF=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var MF=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&IF(A,e)}(i,a.a.Component);var e=fF(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(QF(t),["rowRenderer","noRowsRenderer","handleEventFactory"]),t}return function(A,e,i){e&&pF(A.prototype,e),i&&pF(A,i)}(i,[{key:"handleEventFactory",value:function(A){var e=this;return function(){return e.props.onActivate(A)}}},{key:"noRowsRenderer",value:function(){return a.a.createElement("div",{className:Le()(Oy.a.listRow,Oy.a.listEmpty)},a.a.createElement(B.a,{defaultMessage:"(empty)",id:"gui.monitor.listMonitor.empty"}))}},{key:"rowRenderer",value:function(A){var e=A.index,i=A.key,t=A.style;return a.a.createElement("div",{className:Oy.a.listRow,key:i,style:t},a.a.createElement("div",{className:Oy.a.listIndex},e+1),a.a.createElement("div",{className:Oy.a.listValue,dataIndex:e,style:{background:this.props.categoryColor},onClick:this.props.draggable?this.handleEventFactory(e):null},this.props.draggable&&this.props.activeIndex===e?a.a.createElement("div",{className:Oy.a.inputWrapper},a.a.createElement("input",{autoFocus:!0,autoComplete:!1,className:Le()(Oy.a.listInput,"no-drag"),spellCheck:!1,type:"text",value:this.props.activeValue,onBlur:this.props.onDeactivate,onChange:this.props.onInput,onFocus:this.props.onFocus,onKeyDown:this.props.onKeyPress}),a.a.createElement("div",{className:Oy.a.removeButton,onMouseDown:this.props.onRemove},"✖︎")):a.a.createElement("div",{className:Oy.a.valueInner},this.props.values[e])))}},{key:"render",value:function(){var A=this.props,e=A.height,i=A.values,t=A.width,o=A.activeIndex,n=A.activeValue,r=null===o?void 0:o;return a.a.createElement(wk,{activeIndex:o,activeValue:n,height:e-44,noRowsRenderer:this.noRowsRenderer,rowCount:i.length,rowHeight:24,rowRenderer:this.rowRenderer,scrollToIndex:r,values:i,width:t})}}]),i}();MF.propTypes={activeIndex:o.a.number,activeValue:o.a.string,categoryColor:o.a.string,draggable:o.a.bool,height:o.a.number,onActivate:o.a.func,onDeactivate:o.a.func,onFocus:o.a.func,onInput:o.a.func,onKeyPress:o.a.func,onRemove:o.a.func,values:o.a.arrayOf(o.a.oneOfType([o.a.string,o.a.number])),width:o.a.number};var bF=MF,yF=["draggable","label","width","height","value","onResizeMouseDown","onAdd"];function TF(){return(TF=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function kF(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var FF=function(A){var e=A.draggable,i=A.label,t=A.width,o=A.height,n=A.value,r=A.onResizeMouseDown,s=A.onAdd,g=kF(A,yF);return a.a.createElement("div",{className:Oy.a.listMonitor,style:{width:"".concat(t,"px"),height:"".concat(o,"px")}},a.a.createElement("div",{className:Oy.a.listHeader},i),a.a.createElement("div",{className:Oy.a.listBody},a.a.createElement(bF,TF({draggable:e,height:o,values:n,width:t},g))),a.a.createElement("div",{className:Oy.a.listFooter},a.a.createElement("div",{className:Le()(e?Oy.a.addButton:null,"no-drag"),onClick:e?s:null},"+"),a.a.createElement("div",{className:Oy.a.footerLength},a.a.createElement(B.a,{defaultMessage:"length {length}",id:"gui.monitor.listMonitor.listLength",values:{length:n.length}})),a.a.createElement("div",{className:Le()(e?Oy.a.resizeHandle:null,"no-drag"),onMouseDown:e?r:null},"=")))};FF.propTypes={activeIndex:o.a.number,categoryColor:o.a.string.isRequired,draggable:o.a.bool.isRequired,height:o.a.number,label:o.a.string.isRequired,onActivate:o.a.func,onAdd:o.a.func,onResizeMouseDown:o.a.func,value:o.a.oneOfType([o.a.string,o.a.number,o.a.arrayOf(o.a.oneOfType([o.a.string,o.a.number]))]),width:o.a.number},FF.defaultProps={width:110,height:200};var vF=FF,SF=i(68);function NF(A){"@babel/helpers - typeof";return(NF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var RF=["vm"];function OF(){return(OF=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function YF(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function UF(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function GF(A,e){return(GF=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function HF(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=PF(A);if(e){var o=PF(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===NF(e)||"function"==typeof e))return e;return LF(A)}(this,i)}}function LF(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function PF(A){return(PF=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var xF=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&GF(A,e)}(i,a.a.Component);var e=HF(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(LF(t),["handleActivate","handleDeactivate","handleInput","handleRemove","handleKeyPress","handleFocus","handleAdd","handleResizeMouseDown"]),t.state={activeIndex:null,activeValue:null,width:A.width||100,height:A.height||200},t}return function(A,e,i){e&&UF(A.prototype,e),i&&UF(A,i)}(i,[{key:"handleActivate",value:function(A){this.state.activeIndex!==A&&this.setState({activeIndex:A,activeValue:this.props.value[A]})}},{key:"handleDeactivate",value:function(){if(null!==this.state.activeIndex){var A=this.props,e=A.vm,i=A.targetId,t=A.id,o=Py(e,i,t);o[this.state.activeIndex]=this.state.activeValue,xy(e,i,t,o),this.setState({activeIndex:null,activeValue:null})}}},{key:"handleFocus",value:function(A){A.target.select()}},{key:"handleKeyPress",value:function(A){var e=this.state.activeIndex,i=this.props,t=i.vm,o=i.targetId,n=i.id,a=0;if("Tab"===A.key?a=A.shiftKey?-1:1:"ArrowUp"===A.key?a=-1:"ArrowDown"===A.key&&(a=1),a){this.handleDeactivate();var r=this.wrapListIndex(e+a,this.props.value.length);this.setState({activeIndex:r,activeValue:this.props.value[r]}),A.preventDefault()}else if("Enter"===A.key){this.handleDeactivate();var s=A.shiftKey?0:1,g=Py(t,o,n),l=g.slice(0,e+s).concat([""]).concat(g.slice(e+s));xy(t,o,n,l);var c=this.wrapListIndex(e+s,l.length);this.setState({activeIndex:c,activeValue:""})}}},{key:"handleInput",value:function(A){this.setState({activeValue:A.target.value})}},{key:"handleRemove",value:function(A){A.preventDefault(),A.stopPropagation();var e=this.props,i=e.vm,t=e.targetId,o=e.id,n=Py(i,t,o),a=n.slice(0,this.state.activeIndex).concat(n.slice(this.state.activeIndex+1));xy(i,t,o,a);var r=Math.min(a.length-1,this.state.activeIndex);this.setState({activeIndex:r,activeValue:a[r]})}},{key:"handleAdd",value:function(){var A=this.props,e=A.vm,i=A.targetId,t=A.id,o=Py(e,i,t).concat([""]);xy(e,i,t,o),this.setState({activeIndex:o.length-1,activeValue:""})}},{key:"handleResizeMouseDown",value:function(A){var e=this;this.initialPosition=Ii(A),this.initialWidth=this.state.width,this.initialHeight=this.state.height;var i=function(A){var i=Ii(A),t=i.x-e.initialPosition.x,o=i.y-e.initialPosition.y;e.setState({width:Math.max(Math.min(e.initialWidth+t,480),100),height:Math.max(Math.min(e.initialHeight+o,360),60)})};window.addEventListener("mousemove",i),window.addEventListener("mouseup",function A(t){i(t),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",A),e.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:e.props.id,height:e.state.height,width:e.state.width}))})}},{key:"wrapListIndex",value:function(A,e){return(A+e)%e}},{key:"render",value:function(){var A=this.props,e=(A.vm,YF(A,RF));return a.a.createElement(vF,OF({},e,{activeIndex:this.state.activeIndex,activeValue:this.state.activeValue,height:this.state.height,width:this.state.width,onActivate:this.handleActivate,onAdd:this.handleAdd,onDeactivate:this.handleDeactivate,onFocus:this.handleFocus,onInput:this.handleInput,onKeyPress:this.handleKeyPress,onRemove:this.handleRemove,onResizeMouseDown:this.handleResizeMouseDown}))}}]),i}();xF.propTypes={height:o.a.number,id:o.a.string,targetId:o.a.string,value:o.a.oneOfType([o.a.number,o.a.string]),vm:o.a.instanceOf(u.a),width:o.a.number,x:o.a.number,y:o.a.number};function _F(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function jF(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var JF={data:"#FF8C1A",sensing:"#5CB1D6",sound:"#CF63CF",looks:"#9966FF",motion:"#4C97FF",list:"#FC662C",extension:"#0FBD8C"},zF={default:Uy,large:Hy,slider:eT,list:Object(s.b)(function(A){return{vm:A.scratchGui.vm}})(xF)},KF=function(A){return a.a.createElement(mt,{disable:!A.draggable,holdToDisplay:"slider"===A.mode?-1:1e3,id:"monitor-".concat(A.label)},a.a.createElement(Mw.a,{bounds:".monitor-overlay",cancel:".no-drag",defaultClassNameDragging:Oy.a.dragging,disabled:!A.draggable,onStop:A.onDragEnd},a.a.createElement(hi.a,{className:Oy.a.monitorContainer,componentRef:A.componentRef,onDoubleClick:"list"!==A.mode&&A.draggable?A.onNextMode:null},a.a.createElement(zF[A.mode],function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?_F(Object(i),!0).forEach(function(e){jF(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):_F(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({categoryColor:JF[A.category]},A)))),Ny.a.createPortal(a.a.createElement(Qt,{id:"monitor-".concat(A.label)},A.onSetModeToDefault&&a.a.createElement(Dt,{onClick:A.onSetModeToDefault},a.a.createElement(B.a,{defaultMessage:"normal readout",id:"gui.monitor.contextMenu.default"})),A.onSetModeToLarge&&a.a.createElement(Dt,{onClick:A.onSetModeToLarge},a.a.createElement(B.a,{defaultMessage:"large readout",id:"gui.monitor.contextMenu.large"})),A.onSetModeToSlider&&a.a.createElement(Dt,{onClick:A.onSetModeToSlider},a.a.createElement(B.a,{defaultMessage:"slider",id:"gui.monitor.contextMenu.slider"})),A.onSliderPromptOpen&&"slider"===A.mode&&a.a.createElement(Mt,{onClick:A.onSliderPromptOpen},a.a.createElement(B.a,{defaultMessage:"change slider range",id:"gui.monitor.contextMenu.sliderRange"})),A.onImport&&a.a.createElement(Dt,{onClick:A.onImport},a.a.createElement(B.a,{defaultMessage:"import",id:"gui.monitor.contextMenu.import"})),A.onExport&&a.a.createElement(Dt,{onClick:A.onExport},a.a.createElement(B.a,{defaultMessage:"export",id:"gui.monitor.contextMenu.export"})),A.onHide&&a.a.createElement(Mt,{onClick:A.onHide},a.a.createElement(B.a,{defaultMessage:"hide",id:"gui.monitor.contextMenu.hide"}))),document.body))};KF.categories=JF;var WF=Object.keys(zF);KF.propTypes={category:o.a.oneOf(Object.keys(JF)),componentRef:o.a.func.isRequired,draggable:o.a.bool.isRequired,label:o.a.string.isRequired,mode:o.a.oneOf(WF),onDragEnd:o.a.func.isRequired,onExport:o.a.func,onImport:o.a.func,onHide:o.a.func,onNextMode:o.a.func.isRequired,onSetModeToDefault:o.a.func,onSetModeToLarge:o.a.func,onSetModeToSlider:o.a.func,onSliderPromptOpen:o.a.func},KF.defaultProps={category:"extension",mode:"default"};var VF=i(945),XF=i.n(VF),ZF=i(108),qF=i.n(ZF),$F=Object(B.d)({minValue:{id:"gui.sliderModal.min",defaultMessage:"Minimum value"},maxValue:{id:"gui.sliderModal.max",defaultMessage:"Maximum value"},title:{id:"gui.sliderModal.title",defaultMessage:"Change slider range"}}),Av=function(A){return a.a.createElement(Nl.a,{className:qF.a.modalContent,contentLabel:A.intl.formatMessage($F.title),id:"sliderPrompt",onRequestClose:A.onCancel},a.a.createElement(hi.a,{className:qF.a.body},a.a.createElement(hi.a,{className:qF.a.label},A.intl.formatMessage($F.minValue)),a.a.createElement(hi.a,null,a.a.createElement("input",{className:qF.a.minInput,name:A.intl.formatMessage($F.minValue),pattern:"-?[0-9]*(\\.[0-9]+)?",type:"text",value:A.minValue,onChange:A.onChangeMin,onKeyPress:A.onKeyPress})),a.a.createElement(hi.a,{className:qF.a.label},A.intl.formatMessage($F.maxValue)),a.a.createElement(hi.a,null,a.a.createElement("input",{className:qF.a.maxInput,name:A.intl.formatMessage($F.maxValue),pattern:"-?[0-9]*(\\.[0-9]+)?",type:"text",value:A.maxValue,onChange:A.onChangeMax,onKeyPress:A.onKeyPress})),a.a.createElement(hi.a,{className:qF.a.buttonRow},a.a.createElement("button",{className:qF.a.cancelButton,onClick:A.onCancel},a.a.createElement(B.a,{defaultMessage:"Cancel",id:"gui.sliderPrompt.cancel"})),a.a.createElement("button",{className:qF.a.okButton,onClick:A.onOk},a.a.createElement(B.a,{defaultMessage:"OK",id:"gui.sliderPrompt.ok"})))))};Av.propTypes={intl:B.f,maxValue:o.a.string,minValue:o.a.string,onCancel:o.a.func.isRequired,onChangeMax:o.a.func.isRequired,onChangeMin:o.a.func.isRequired,onKeyPress:o.a.func.isRequired,onOk:o.a.func.isRequired};var ev=Object(B.e)(Av);function iv(A){"@babel/helpers - typeof";return(iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function tv(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function ov(A,e){return(ov=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function nv(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=rv(A);if(e){var o=rv(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===iv(e)||"function"==typeof e))return e;return av(A)}(this,i)}}function av(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function rv(A){return(rv=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var sv=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&ov(A,e)}(i,a.a.Component);var e=nv(i);function i(A){var t;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(av(t),["handleOk","handleCancel","handleChangeMin","handleChangeMax","handleKeyPress","validates","shouldBeDiscrete"]);var o=t.props,n=o.isDiscrete,a=o.minValue,r=o.maxValue;return t.state={minValue:n?a.toFixed(0):a.toFixed(2),maxValue:n?r.toFixed(0):r.toFixed(2)},t}return function(A,e,i){e&&tv(A.prototype,e),i&&tv(A,i)}(i,[{key:"handleKeyPress",value:function(A){"Enter"===A.key&&this.handleOk()}},{key:"handleOk",value:function(){var A=this.state,e=A.minValue,i=A.maxValue;this.validates(e,i)?this.props.onOk(parseFloat(e),parseFloat(i),this.shouldBeDiscrete(e,i)):this.props.onCancel()}},{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleChangeMin",value:function(A){this.setState({minValue:A.target.value})}},{key:"handleChangeMax",value:function(A){this.setState({maxValue:A.target.value})}},{key:"shouldBeDiscrete",value:function(A,e){return A.indexOf(".")+e.indexOf(".")===-2}},{key:"validates",value:function(A,e){return isFinite(A)&&isFinite(e)}},{key:"render",value:function(){return a.a.createElement(ev,{maxValue:this.state.maxValue,minValue:this.state.minValue,onCancel:this.handleCancel,onChangeMax:this.handleChangeMax,onChangeMin:this.handleChangeMin,onKeyPress:this.handleKeyPress,onOk:this.handleOk})}}]),i}();sv.propTypes={isDiscrete:o.a.bool,maxValue:o.a.number,minValue:o.a.number,onCancel:o.a.func.isRequired,onOk:o.a.func.isRequired},sv.defaultProps={maxValue:100,minValue:0,isDiscrete:!0};var gv=sv;function lv(A){"@babel/helpers - typeof";return(lv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function cv(){return(cv=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function uv(A,e){var i="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!i){if(Array.isArray(A)||(i=function(A,e){if(!A)return;if("string"==typeof A)return Bv(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Bv(A,e)}(A))||e&&A&&"number"==typeof A.length){i&&(A=i);var t=0,o=function(){};return{s:o,n:function(){return t>=A.length?{done:!0}:{done:!1,value:A[t++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,r=!1;return{s:function(){i=i.call(A)},n:function(){var A=i.next();return a=A.done,A},e:function(A){r=!0,n=A},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw n}}}}function Bv(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function dv(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Ev(A,e){return(Ev=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function hv(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=wv(A);if(e){var o=wv(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===lv(e)||"function"==typeof e))return e;return Cv(A)}(this,i)}}function Cv(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function wv(A){return(wv=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var mv=function(A){return WF.filter(function(e){return"data_variable"===A?"list"!==e:"data_listcontents"===A?"list"===e:"slider"!==e&&"list"!==e})},pv=Object(B.d)({columnPrompt:{id:"gui.monitors.importListColumnPrompt",defaultMessage:"Which column should be used (1-{numberOfColumns})?"}}),Iv=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Ev(A,e)}(i,a.a.Component);var e=hv(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Cv(t),["handleDragEnd","handleHide","handleNextMode","handleSetModeToDefault","handleSetModeToLarge","handleSetModeToSlider","handleSliderPromptClose","handleSliderPromptOk","handleSliderPromptOpen","handleImport","handleExport","setElement"]),t.state={sliderPrompt:!1},t}return function(A,e,i){e&&dv(A.prototype,e),i&&dv(A,i)}(i,[{key:"componentDidMount",value:function(){var A,e=this,i=function(A){return"number"==typeof A&&!isNaN(A)},t=setTimeout(function(){i(e.props.x)&&i(e.props.y)&&!e.props.monitorLayout.savedMonitorPositions[e.props.id]?(A={upperStart:{x:e.props.x,y:e.props.y},lowerEnd:{x:e.props.x+e.element.offsetWidth,y:e.props.y+e.element.offsetHeight}},e.props.addMonitorRect(e.props.id,A,!0)):(A=Object(Ty.c)(e.props.monitorLayout,e.props.id,e.element.offsetWidth,e.element.offsetHeight),e.props.addMonitorRect(e.props.id,A),e.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:e.props.id,x:A.upperStart.x,y:A.upperStart.y}))),e.element.style.top="".concat(A.upperStart.y,"px"),e.element.style.left="".concat(A.upperStart.x,"px"),clearTimeout(t)},1)}},{key:"shouldComponentUpdate",value:function(A,e){if(e!==this.state)return!0;var i,t=uv(Object.getOwnPropertyNames(A));try{for(t.s();!(i=t.n()).done;){var o=i.value;if("monitorLayout"!==o&&A[o]!==this.props[o])return!0}}catch(A){t.e(A)}finally{t.f()}return!1}},{key:"componentDidUpdate",value:function(){this.props.resizeMonitorRect(this.props.id,this.element.offsetWidth,this.element.offsetHeight)}},{key:"componentWillUnmount",value:function(){this.props.removeMonitorRect(this.props.id)}},{key:"handleDragEnd",value:function(A,e){var i=e.x,t=e.y,o=parseInt(this.element.style.left,10)+i,n=parseInt(this.element.style.top,10)+t;this.props.onDragEnd(this.props.id,o,n),this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,x:o,y:n}))}},{key:"handleHide",value:function(){this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,visible:!1}))}},{key:"handleNextMode",value:function(){var A=mv(this.props.opcode),e=A[(A.indexOf(this.props.mode)+1)%A.length];this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,mode:e}))}},{key:"handleSetModeToDefault",value:function(){this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,mode:"default"}))}},{key:"handleSetModeToLarge",value:function(){this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,mode:"large"}))}},{key:"handleSetModeToSlider",value:function(){this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,mode:"slider"}))}},{key:"handleSliderPromptClose",value:function(){this.setState({sliderPrompt:!1})}},{key:"handleSliderPromptOpen",value:function(){this.setState({sliderPrompt:!0})}},{key:"handleSliderPromptOk",value:function(A,e,i){var t=Math.min(A,e),o=Math.max(A,e);this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,sliderMin:t,sliderMax:o,isDiscrete:i})),this.handleSliderPromptClose()}},{key:"setElement",value:function(A){this.element=A}},{key:"handleImport",value:function(){var A=this;new Promise(function(A,e){var i=document.createElement("input");i.setAttribute("type","file"),i.setAttribute("accept",".csv, .tsv, .txt"),i.onchange=function(t){var o=t.target.files[0];XF.a.parse(o,{header:!1,complete:function(e){document.body.removeChild(i),A(e.data)},error:function(A){document.body.removeChild(i),e(A)}})},document.body.appendChild(i),i.click()}).then(function(e){var i=e[0].length,t=1;if(i>1){var o=A.props.intl.formatMessage(pv.columnPrompt,{numberOfColumns:i});t=parseInt(prompt(o),10)}var n=e.map(function(A){return A[t-1]}).filter(function(A){return"string"==typeof A}),a=A.props,r=a.vm,s=a.targetId,g=a.id;xy(r,s,g,n)})}},{key:"handleExport",value:function(){var A=this.props,e=A.vm,i=A.targetId,t=A.id,o=Ly(e,i,t),n=o.value.join("\r\n"),a=new Blob([n],{type:"text/plain;charset=utf-8"});Ko("".concat(o.name,".txt"),a)}},{key:"render",value:function(){var A=function(A){var e=A.id,i=A.spriteName,t=A.opcode,o=A.params,n=A.value,a=A.vm,r=a&&a.runtime.getLabelForOpcode(t)||vy.getLabel(t),s=r.label,g=r.category,l=r.labelFn;return function(A){return void 0===A}(l)||(s=l(o)),i&&(s="".concat(i,": ").concat(s)),"number"==typeof n&&(n=Number(n.toFixed(6))),"boolean"==typeof n&&(n=n.toString()),Array.isArray(n)&&(n=n.map(function(A){return A.toString()})),{id:e,label:s,category:g,value:n}}(this.props),e=-1!==mv(this.props.opcode).indexOf("slider"),i="list"===this.props.mode;return a.a.createElement(a.a.Fragment,null,this.state.sliderPrompt&&a.a.createElement(gv,{isDiscrete:this.props.isDiscrete,maxValue:parseFloat(this.props.max),minValue:parseFloat(this.props.min),onCancel:this.handleSliderPromptClose,onOk:this.handleSliderPromptOk}),a.a.createElement(KF,cv({componentRef:this.setElement},A,{draggable:this.props.draggable,height:this.props.height,isDiscrete:this.props.isDiscrete,max:this.props.max,min:this.props.min,mode:this.props.mode,targetId:this.props.targetId,width:this.props.width,onDragEnd:this.handleDragEnd,onExport:i?this.handleExport:null,onImport:i?this.handleImport:null,onHide:this.handleHide,onNextMode:this.handleNextMode,onSetModeToDefault:i?null:this.handleSetModeToDefault,onSetModeToLarge:i?null:this.handleSetModeToLarge,onSetModeToSlider:e?this.handleSetModeToSlider:null,onSliderPromptOpen:this.handleSliderPromptOpen})))}}]),i}();Iv.propTypes={addMonitorRect:o.a.func.isRequired,draggable:o.a.bool,height:o.a.number,id:o.a.string.isRequired,intl:B.f,isDiscrete:o.a.bool,max:o.a.number,min:o.a.number,mode:o.a.oneOf(["default","slider","large","list"]),monitorLayout:o.a.shape({monitors:o.a.object,savedMonitorPositions:o.a.object}).isRequired,onDragEnd:o.a.func.isRequired,opcode:o.a.string.isRequired,params:o.a.object,removeMonitorRect:o.a.func.isRequired,resizeMonitorRect:o.a.func.isRequired,spriteName:o.a.string,targetId:o.a.string,value:o.a.oneOfType([o.a.string,o.a.number,o.a.arrayOf(o.a.oneOfType([o.a.string,o.a.number]))]),vm:o.a.instanceOf(u.a),width:o.a.number,x:o.a.number,y:o.a.number};var fv=Object(B.e)(Object(s.b)(function(A){return{monitorLayout:A.scratchGui.monitorLayout,vm:A.scratchGui.vm}},function(A){return{addMonitorRect:function(e,i,t){return A(Object(Ty.a)(e,i.upperStart,i.lowerEnd,t))},resizeMonitorRect:function(e,i,t){return A(Object(Ty.g)(e,i,t))},removeMonitorRect:function(e){return A(Object(Ty.f)(e))}}})(Iv)),Qv=i(380),Dv=i.n(Qv),Mv=function(A){return a.a.createElement(hi.a,{className:Le()(Dv.a.monitorList,"monitor-overlay"),style:{width:A.stageSize.width||0,height:A.stageSize.height||0}},a.a.createElement(hi.a,{className:Dv.a.monitorListScaler,style:VB(A.stageSize)},A.monitors.valueSeq().filter(function(A){return A.visible}).map(function(e){return a.a.createElement(fv,{draggable:A.draggable,height:e.height,id:e.id,isDiscrete:e.isDiscrete,key:e.id,max:e.sliderMax,min:e.sliderMin,mode:e.mode,opcode:e.opcode,params:e.params,spriteName:e.spriteName,targetId:e.targetId,value:e.value,width:e.width,x:null,y:null,onDragEnd:A.onMonitorChange})})))};Mv.propTypes={draggable:o.a.bool.isRequired,monitors:o.a.instanceOf(SF.OrderedMap),onMonitorChange:o.a.func.isRequired,stageSize:o.a.shape({width:o.a.number,height:o.a.number,widthDefault:o.a.number,heightDefault:o.a.number}).isRequired};var bv=Mv;function yv(A){"@babel/helpers - typeof";return(yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Tv(){return(Tv=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function kv(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Fv(A,e){return(Fv=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function vv(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Nv(A);if(e){var o=Nv(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===yv(e)||"function"==typeof e))return e;return Sv(A)}(this,i)}}function Sv(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Nv(A){return(Nv=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Rv=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Fv(A,e)}(i,a.a.Component);var e=vv(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Sv(t),["handleMonitorChange"]),vy.setTranslatorFunction(A.intl.formatMessage),t}return function(A,e,i){e&&kv(A.prototype,e),i&&kv(A,i)}(i,[{key:"handleMonitorChange",value:function(A,e,i){this.props.moveMonitorRect(A,e,i)}},{key:"render",value:function(){return a.a.createElement(bv,Tv({onMonitorChange:this.handleMonitorChange},this.props))}}]),i}();Rv.propTypes={intl:B.f.isRequired,moveMonitorRect:o.a.func.isRequired};var Ov=Object(d.a)("Monitors")(Object(B.e)(Object(s.b)(function(A){return{monitors:A.scratchGui.monitors}},function(A){return{moveMonitorRect:function(e,i,t){return A(Object(Ty.e)(e,i,t))}}})(Rv))),Yv=i(306),Uv=i.n(Yv),Gv=i(291),Hv=i.n(Gv);function Lv(A){"@babel/helpers - typeof";return(Lv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Pv(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function xv(A,e){return(xv=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function _v(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=jv(A);if(e){var o=jv(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Lv(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function jv(A){return(jv=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Jv=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&xv(A,e)}(i,a.a.Component);var e=_v(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.call(this)}return function(A,e,i){e&&Pv(A.prototype,e),i&&Pv(A,i)}(i,[{key:"render",value:function(){return a.a.createElement("div",{className:Hv.a.martyConnectBtnContainer},a.a.createElement("svg",{id:"a",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.459 41.2807"},a.a.createElement("rect",{x:".5",y:".5",width:"129.459",height:"40.2807",rx:"9.1484",ry:"9.1484",fill:"#37abc8",stroke:"#050505","stroke-miterlimit":"10"}),a.a.createElement("rect",{x:"15.2596",y:"23.9589",width:"8.6585",height:"15.8269",rx:"4.3293",ry:"4.3293",transform:"translate(51.4612 12.2835) rotate(90)",fill:"#a1d5e3",stroke:"#020202","stroke-miterlimit":"10","stroke-width":".25"}),a.a.createElement("circle",{cx:"15.7005",cy:"31.8724",r:"4.3613",fill:"#70888e",stroke:"#020202","stroke-miterlimit":"10","stroke-width":".25"}),a.a.createElement("g",null,a.a.createElement("path",{d:"M17.4972,4.2222l3.8022-.0263c1.2734,.8363,2.761,1.4764,3.7515,2.5718,.7708,.8524,.9223,2.2717,1.3491,3.4392,.0074,3.0388,.0147,6.0776,.0221,9.1164-.5164,4.2866-2.9297,5.8431-5.9385,6.2073-4.3465,.5262-6.935-1.4588-8.0642-5.6011,.0825-1.7646,.2274-3.529,.2293-5.2937,.0018-1.665-.1468-3.3302-.2293-4.9954,.5347-2.905,2.4132-4.5346,5.0778-5.4182Zm1.3235,10.6415l-3.2986,2.9308,.8646,.8287,2.4468-2.3209v7.1878l4.7277-5.7427-3.5222-3.088,3.4013-2.7912-4.6594-5.3953v6.5622q-2.6482-1.7846-3.2099-1.0286l3.2497,2.8573Z",fill:"#70888e"}),a.a.createElement("path",{d:"M18.8207,14.8637l-3.2497-2.8573q.5617-.756,3.2099,1.0286V6.4729l4.6594,5.3953-3.4013,2.7912,3.5222,3.088-4.7277,5.7427v-7.1878l-2.4468,2.3209-.8646-.8287,3.2986-2.9308Zm1.2259-1.3338l1.7429-1.8487-1.7429-1.989v3.8377Zm1.5723,4.8031l-1.5572-2.1154v3.9743l1.5572-1.8589Z",fill:"#fcfdfd"}),a.a.createElement("path",{d:"M20.0466,13.5299v-3.8377l1.7429,1.989-1.7429,1.8487Z",fill:"#70888e"}),a.a.createElement("path",{d:"M21.619,18.333l-1.5572,1.8589v-3.9743l1.5572,2.1154Z",fill:"#70888e"})),a.a.createElement("g",null,a.a.createElement("path",{d:"M38.9786,23.4017v.6881c0,1.2177-.5734,1.8259-1.7214,1.8259h-.9276c-1.1474,0-1.7208-.6083-1.7208-1.8259v-7.0946c0-1.2177,.5734-1.8259,1.7208-1.8259h.9276c1.148,0,1.7214,.6083,1.7214,1.8259v1.212h-1.4369v-1.1075c0-.4194-.2148-.6285-.6431-.6285h-.2845c-.3789,0-.5689,.2091-.5689,.6285v6.8855c0,.4183,.19,.6285,.5689,.6285h.3598c.3789,0,.5678-.2103,.5678-.6285v-.5835h1.4369Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M41.7625,25.9157c-1.157,0-1.736-.6083-1.736-1.8259v-7.08c0-1.2267,.5734-1.8406,1.7214-1.8406h1.3773c1.1468,0,1.7214,.6139,1.7214,1.8406v7.08c0,1.2177-.579,1.8259-1.736,1.8259h-1.3481Zm.3452-1.302h.7331c.3789,0,.5689-.2103,.5689-.6285v-6.8855c0-.4194-.2148-.6285-.6443-.6285h-.6735c-.4183,0-.6285,.2091-.6285,.6285v6.8855c0,.4183,.2148,.6285,.6443,.6285Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M49.0966,20.3625v-5.1934h1.4369v10.7465h-1.4369v-2.1408l-1.5415-4.8943v7.035h-1.4369V15.1692h1.4369l1.5415,5.1934Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M54.8589,20.3625v-5.1934h1.4369v10.7465h-1.4369v-2.1408l-1.5415-4.8943v7.035h-1.4369V15.1692h1.4369l1.5415,5.1934Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M57.6428,25.9157V15.1692h3.5631v1.302h-2.1261v3.2629h1.8867v1.302h-1.8867v3.5777h2.1261v1.302h-3.5631Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M66.533,23.4017v.6881c0,1.2177-.5734,1.8259-1.7214,1.8259h-.9276c-1.148,0-1.7214-.6083-1.7214-1.8259v-7.0946c0-1.2177,.5734-1.8259,1.7214-1.8259h.9276c1.148,0,1.7214,.6083,1.7214,1.8259v1.212h-1.4369v-1.1075c0-.4194-.2148-.6285-.6431-.6285h-.2845c-.3789,0-.5689,.2091-.5689,.6285v6.8855c0,.4183,.19,.6285,.5689,.6285h.3598c.3789,0,.5678-.2103,.5678-.6285v-.5835h1.4369Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M69.9465,16.4712v9.4445h-1.4369v-9.4445h-1.3773v-1.302h4.1904v1.302h-1.3762Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M76.8309,16.4712v9.4445h-1.4369v-9.4445h-1.3773v-1.302h4.1904v1.302h-1.3762Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M80.6919,25.9157c-1.1581,0-1.7371-.6083-1.7371-1.8259v-7.08c0-1.2267,.5745-1.8406,1.7214-1.8406h1.3773c1.148,0,1.7214,.6139,1.7214,1.8406v7.08c0,1.2177-.579,1.8259-1.736,1.8259h-1.347Zm.344-1.302h.7331c.3789,0,.5689-.2103,.5689-.6285v-6.8855c0-.4194-.2148-.6285-.6431-.6285h-.6735c-.4194,0-.6296,.2091-.6296,.6285v6.8855c0,.4183,.2148,.6285,.6443,.6285Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M88.8029,25.9157h-1.4369v-8.9059c0-1.2267,.5745-1.8406,1.7214-1.8406h1.0782c1.1468,0,1.7214,.6139,1.7214,1.8406v8.9059h-1.4369v-3.9363h-1.6472v3.9363Zm1.6472-5.2383v-3.5777c0-.4194-.2103-.6285-.6285-.6285h-.389c-.4194,0-.6296,.2091-.6296,.6285v3.5777h1.6472Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M98.4723,21.4858l1.3324-6.3166h1.5865v10.7465h-1.4369l.1495-7.035-1.0782,5.0888h-1.1075l-1.0771-5.0888,.1495,7.035h-1.4369V15.1692h1.5865l1.3324,6.3166Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M104.0996,25.9157h-1.4369v-8.9059c0-1.2267,.5745-1.8406,1.7214-1.8406h1.0782c1.1468,0,1.7214,.6139,1.7214,1.8406v8.9059h-1.4369v-3.9363h-1.6472v3.9363Zm1.6472-5.2383v-3.5777c0-.4194-.2103-.6285-.6285-.6285h-.389c-.4194,0-.6296,.2091-.6296,.6285v3.5777h1.6472Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M108.4553,15.1692h2.8142c1.0974,0,1.646,.6139,1.646,1.8406v2.6501c0,.9377-.2845,1.5314-.8534,1.781l1.0029,4.4749h-1.3616l-.9433-4.34h-.868v4.34h-1.4369V15.1692Zm1.4369,5.1787h.9433c.4284,0,.6431-.2597,.6431-.778v-2.3207c0-.5183-.2148-.778-.6431-.778h-.9433v3.8767Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M116.4033,16.4712v9.4445h-1.4369v-9.4445h-1.3773v-1.302h4.1904v1.302h-1.3762Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M121.2819,25.9157h-1.4369v-3.951l-1.7663-6.7955h1.4223l1.0771,4.6694h.045l.9726-4.6694h1.4223l-1.736,6.7955v3.951Z",fill:"#f9f9f9"})),a.a.createElement("rect",{x:"12.4195",y:"4.1959",width:"14.0026",height:"21.4131",rx:"7.0013",ry:"7.0013",fill:"none",stroke:"#000","stroke-miterlimit":"10","stroke-width":".25"})))}}]),i}();function zv(A){"@babel/helpers - typeof";return(zv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Kv(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Wv(A,e){return(Wv=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Vv(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Xv(A);if(e){var o=Xv(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===zv(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function Xv(A){return(Xv=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Zv=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Wv(A,e)}(i,a.a.Component);var e=Vv(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.call(this)}return function(A,e,i){e&&Kv(A.prototype,e),i&&Kv(A,i)}(i,[{key:"render",value:function(){return a.a.createElement("div",{className:Hv.a.martyDisconnectBtnContainer},a.a.createElement("svg",{id:"a",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 29.3735 42.9438"},a.a.createElement("g",null,a.a.createElement("rect",{x:".3053",y:".2501",width:"28.8736",height:"42.4442",rx:"11.2782",ry:"11.2782",fill:"#d67b7b"}),a.a.createElement("path",{d:"M17.8452,42.9438h-6.3169c-6.3569,0-11.5283-5.1709-11.5283-11.5273V11.5283C0,5.1714,5.1714,0,11.5283,0h6.3169c6.3564,0,11.5283,5.1714,11.5283,11.5283V31.4165c0,6.3564-5.1719,11.5273-11.5283,11.5273ZM11.5283,.5C5.4473,.5,.5,5.4473,.5,11.5283V31.4165c0,6.0801,4.9473,11.0273,11.0283,11.0273h6.3169c6.0811,0,11.0283-4.9473,11.0283-11.0273V11.5283C28.8735,5.4473,23.9263,.5,17.8452,.5h-6.3169Z"})),a.a.createElement("g",null,a.a.createElement("rect",{x:"10.2558",y:"25.2469",width:"9.6217",height:"17.5874",rx:"4.8108",ry:"4.8108",transform:"translate(49.1072 18.974) rotate(90)",fill:"#d6f3f6"}),a.a.createElement("path",{d:"M19.0493,38.9761h-7.9658c-2.7217,0-4.9355-2.2139-4.9355-4.9355s2.2139-4.9355,4.9355-4.9355h7.9658c2.7217,0,4.9355,2.2139,4.9355,4.9355s-2.2139,4.9355-4.9355,4.9355Zm-7.9658-9.6211c-2.5835,0-4.6855,2.1016-4.6855,4.6855s2.1021,4.6855,4.6855,4.6855h7.9658c2.584,0,4.6855-2.1016,4.6855-4.6855s-2.1016-4.6855-4.6855-4.6855h-7.9658Z",fill:"#050505"})),a.a.createElement("g",null,a.a.createElement("circle",{cx:"18.9892",cy:"34.0406",r:"4.8653",fill:"#2e8fa7"}),a.a.createElement("path",{d:"M18.9888,39.0308c-2.751,0-4.9897-2.2383-4.9897-4.9902s2.2388-4.9902,4.9897-4.9902,4.9912,2.2383,4.9912,4.9902-2.2393,4.9902-4.9912,4.9902Zm0-9.7305c-2.6133,0-4.7397,2.126-4.7397,4.7402s2.1265,4.7402,4.7397,4.7402,4.7412-2.126,4.7412-4.7402-2.127-4.7402-4.7412-4.7402Z",fill:"#050505"})),a.a.createElement("path",{d:"M13.6282,4.3198c4.1103-.1344,2.9372,.1652,3.5473,.254,.8884,.2993,.8608-.3553,4.1145,2.5785,.9211,.8306,1.0319,2.2698,1.4925,3.5298,.008,3.2797,.0159,6.5594,.0238,9.8391-.5573,4.6265-3.8375,6.0184-6.4092,6.6994-4.0961,.3912-7.4848-1.5745-8.7035-6.0451,.089-1.9044-.0021-3.6518,0-5.5563,.002-1.797,.2142-3.394,.1252-5.1912,.577-3.1353,2.9336-5.1545,5.8093-6.1082Zm.9741,11.3884l-3.5601,3.1631,.9332,.8944,2.6408-2.5049v7.7576l5.1025-6.198-3.8015-3.3328,3.671-3.0124-5.0288-5.823v7.0824q-2.8582-1.9261-3.4644-1.1102l3.5073,3.0838Z",fill:"#2e8ea6"}),a.a.createElement("path",{d:"M14.6023,15.7082l-3.5073-3.0838q.6062-.8159,3.4644,1.1102V6.6522l5.0288,5.823-3.671,3.0124,3.8015,3.3328-5.1025,6.198v-7.7576l-2.6408,2.5049-.9332-.8944,3.5601-3.1631Zm1.3231-1.4396l1.8811-1.9953-1.8811-2.1467v4.142Zm1.697,5.1838l-1.6807-2.2831v4.2894l1.6807-2.0063Z",fill:"#fcfdfd"}),a.a.createElement("path",{d:"M15.9254,14.2687v-4.142l1.8811,2.1467-1.8811,1.9953Z",fill:"#4b9eb3"}),a.a.createElement("path",{d:"M17.6224,19.4525l-1.6807,2.0063v-4.2894l1.6807,2.2831Z",fill:"#4a9eb2"}),a.a.createElement("path",{d:"M15.25,27.4351c-4.2354,0-7.6812-3.4453-7.6812-7.6812V11.751c0-4.2354,3.4458-7.6812,7.6812-7.6812s7.6812,3.4458,7.6812,7.6812v8.0029c0,4.2358-3.4453,7.6812-7.6812,7.6812Zm0-23.1152c-4.0977,0-7.4312,3.3335-7.4312,7.4312v8.0029c0,4.0972,3.3335,7.4312,7.4312,7.4312s7.4312-3.334,7.4312-7.4312V11.751c0-4.0977-3.334-7.4312-7.4312-7.4312Z"})))}}]),i}(),qv=i(185),$v=i.n(qv);function AS(A){"@babel/helpers - typeof";return(AS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function eS(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function iS(A,e){return(iS=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function tS(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=nS(A);if(e){var o=nS(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===AS(e)||"function"==typeof e))return e;return oS(A)}(this,i)}}function oS(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function nS(A){return(nS=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var aS=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&iS(A,e)}(i,a.a.Component);var e=tS(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={batteryPercent:0},t.onBatteryPerecentChange=t.onBatteryPerecentChange.bind(oS(t)),mv2Interface.addEventListener("onBattRemainCapacityPercentChange",t.onBatteryPerecentChange),t}return function(A,e,i){e&&eS(A.prototype,e),i&&eS(A,i)}(i,[{key:"componentWillUnmount",value:function(){mv2Interface.removeEventListener("onBattRemainCapacityPercentChange",this.onBatteryPerecentChange)}},{key:"onBatteryPerecentChange",value:function(A){this.setState({batteryPercent:A.battRemainCapacityPercent})}},{key:"getBorderColor",value:function(A){return A>=70?"black":A>=30?"black":"rgb(255,69,0)"}},{key:"getFillColor",value:function(A){var e=function(A){var e=A;return A<=90&&A>=71&&(e=80),A<=70&&A>=51&&(e=60),A<=50&&A>=31&&(e=40),A<=30&&A>=11&&(e=20),e}(A),i="rgb(3, 125, 60)";return e<=10?i="rgb(91, 20, 19)":e>10&&e<=30&&(i="rgb(250, 217, 5)"),i}},{key:"render",value:function(){var A=this.state.batteryPercent,e=this.getFillColor(A);return a.a.createElement("div",{className:$v.a.container},a.a.createElement("div",{className:"".concat(!1," ").concat($v.a.batteryContainer)},a.a.createElement("div",{className:$v.a.batteryCap,style:{backgroundColor:"black"}}),a.a.createElement("div",{className:$v.a.batteryCylinder,style:{borderColor:"black"}},a.a.createElement("div",{style:{backgroundColor:e,width:"100%",height:"".concat(Math.round(A),"%")}}))),a.a.createElement("p",{className:$v.a.batteryPercent},Math.round(A),"%"))}}]),i}(),rS=i(148),sS=i.n(rS);function gS(A){"@babel/helpers - typeof";return(gS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function lS(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function cS(A,e){return(cS=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function uS(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=dS(A);if(e){var o=dS(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===gS(e)||"function"==typeof e))return e;return BS(A)}(this,i)}}function BS(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function dS(A){return(dS=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ES=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&cS(A,e)}(i,a.a.Component);var e=uS(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={rssi:-200},t.onRSSIChange=t.onRSSIChange.bind(BS(t)),mv2Interface.addEventListener("onRSSIChange",t.onRSSIChange),t}return function(A,e,i){e&&lS(A.prototype,e),i&&lS(A,i)}(i,[{key:"componentWillUnmount",value:function(){mv2Interface.removeEventListener("onRSSIChange",this.onRSSIChange)}},{key:"onRSSIChange",value:function(A){this.setState({rssi:A.rssi})}},{key:"render",value:function(){var A=this.state.rssi,e=0==A?sS.a.signalFlash:"";return a.a.createElement("div",{className:"".concat(e," ").concat(sS.a.signalStrengthContainer)},a.a.createElement("div",{className:sS.a.signalBar,style:{backgroundColor:A<=-100?"white":A<=-60?"rgb(250, 217, 5)":"rgb(3, 125, 60)",height:"20%"}}),a.a.createElement("div",{className:sS.a.signalBar,style:{backgroundColor:A<=-80?"white":A<=-60?"rgb(250, 217, 5)":"rgb(3, 125, 60)",height:"40%"}}),a.a.createElement("div",{className:sS.a.signalBar,style:{backgroundColor:A<=-70?"white":A<=-60?"rgb(250, 217, 5)":"rgb(3, 125, 60)",height:"60%"}}),a.a.createElement("div",{className:sS.a.signalBar,style:{backgroundColor:A<=-60?"white":"rgb(3, 125, 60)",height:"80%"}}),a.a.createElement("div",{className:sS.a.signalBar,style:{backgroundColor:A<=-50?"white":"rgb(3, 125, 60)",height:"100%"}}))}}]),i}();function hS(A){"@babel/helpers - typeof";return(hS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function CS(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function wS(A,e){return(wS=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function mS(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=IS(A);if(e){var o=IS(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===hS(e)||"function"==typeof e))return e;return pS(A)}(this,i)}}function pS(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function IS(A){return(IS=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var fS=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&wS(A,e)}(i,a.a.Component);var e=mS(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={isConnected:mv2Interface.isConnected},H()(pS(t),["clickBtnHandler"]),t.onIsConnectedChange=t.onIsConnectedChange.bind(pS(t)),mv2Interface.addEventListener("onIsConnectedChange",t.onIsConnectedChange),t}return function(A,e,i){e&&CS(A.prototype,e),i&&CS(A,i)}(i,[{key:"componentWillUnmount",value:function(){mv2Interface.removeEventListener("onIsConnectedChange",this.onIsConnectedChange)}},{key:"onIsConnectedChange",value:function(A){this.setState({isConnected:A.isConnected})}},{key:"clickBtnHandler",value:function(){var A=mv2Interface.isConnected?"disconnect":"connect";mv2Interface.send_REST(A)}},{key:"render",value:function(){return a.a.createElement("div",{className:Uv.a.martyConnectBtnContainer,onClick:this.clickBtnHandler},this.state.isConnected?a.a.createElement("div",{className:Uv.a.batterySignalContainer},a.a.createElement(aS,null),a.a.createElement(ES,null),a.a.createElement("div",{className:Uv.a.disconnectBtnContainer},a.a.createElement(Zv,null))):a.a.createElement(Jv,null))}}]),i}(),QS=["accountNavOpen","activeTabIndex","alertsVisible","authorId","authorThumbnailUrl","authorUsername","basePath","backdropLibraryVisible","backpackHost","backpackVisible","blocksTabVisible","cardsVisible","canChangeLanguage","canCreateNew","canEditTitle","canManageFiles","canRemix","canSave","canCreateCopy","canShare","canUseCloud","children","connectionModalVisible","costumeLibraryVisible","costumesTabVisible","enableCommunity","intl","isCreating","isFullScreen","isPlayerOnly","isRtl","isShared","loading","logo","renderLogin","onClickAccountNav","onCloseAccountNav","onLogOut","onOpenRegistration","onToggleLoginOpen","onActivateCostumesTab","onActivateSaveLoadTab","onActivateSoundsTab","onActivateTab","onClickLogo","onExtensionButtonClick","onProjectTelemetryEvent","onRequestCloseBackdropLibrary","onRequestCloseCostumeLibrary","onRequestCloseTelemetryModal","onSeeCommunity","onShare","onTelemetryModalCancel","onTelemetryModalOptIn","onTelemetryModalOptOut","saveLoadTabVisible","showComingSoon","soundsTabVisible","stageSizeForSensors","stageSizeMode","targetIsStage","telemetryModalVisible","tipsLibraryVisible","useEditorDragStyle","vm"];function DS(){return(DS=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function MS(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var bS=Object(B.d)({addExtension:{id:"gui.gui.addExtension",defaultMessage:"Add Extension"}}),yS=null,TS=function(A){var e=m()(A,"dispatch"),i=(e.accountNavOpen,e.activeTabIndex),t=e.alertsVisible,o=(e.authorId,e.authorThumbnailUrl,e.authorUsername,e.basePath),n=e.backdropLibraryVisible,r=(e.backpackHost,e.backpackVisible,e.blocksTabVisible),s=e.cardsVisible,g=e.canChangeLanguage,l=(e.canCreateNew,e.canEditTitle,e.canManageFiles,e.canRemix,e.canSave,e.canCreateCopy,e.canShare,e.canUseCloud),c=e.children,u=e.connectionModalVisible,d=e.costumeLibraryVisible,E=e.costumesTabVisible,h=(e.enableCommunity,e.intl),C=e.isCreating,w=e.isFullScreen,p=e.isPlayerOnly,I=e.isRtl,f=(e.isShared,e.loading),Q=(e.logo,e.renderLogin,e.onClickAccountNav,e.onCloseAccountNav,e.onLogOut,e.onOpenRegistration,e.onToggleLoginOpen,e.onActivateCostumesTab),D=e.onActivateSaveLoadTab,M=e.onActivateSoundsTab,b=e.onActivateTab,y=(e.onClickLogo,e.onExtensionButtonClick),T=(e.onProjectTelemetryEvent,e.onRequestCloseBackdropLibrary),k=e.onRequestCloseCostumeLibrary,F=e.onRequestCloseTelemetryModal,v=(e.onSeeCommunity,e.onShare,e.onTelemetryModalCancel),S=e.onTelemetryModalOptIn,N=e.onTelemetryModalOptOut,R=e.saveLoadTabVisible,O=(e.showComingSoon,e.soundsTabVisible),Y=e.stageSizeForSensors,U=e.stageSizeMode,G=e.targetIsStage,H=e.telemetryModalVisible,L=e.tipsLibraryVisible,P=(e.useEditorDragStyle,e.vm),x=MS(e,QS);if(c)return a.a.createElement(hi.a,x,c);var _=WB(Y,w),j={tabs:Zb.a.tabs,tab:Le()(ui.a.reactTabsTab,Zb.a.tab),tabList:Le()(ui.a.reactTabsTabList,Zb.a.tabList),tabPanel:Le()(ui.a.reactTabsTabPanel,Zb.a.tabPanel),tabPanelSelected:Le()(ui.a.reactTabsTabPanelSelected,Zb.a.isSelected),tabSelected:Le()(ui.a.reactTabsTabSelected,Zb.a.isSelected)};return null===yS&&(yS=di.a.isSupported()),a.a.createElement(xe.a,{minWidth:Pa.e.fullSizeMinWidth},function(A){var e=function(A,e){return A===Pa.d.small?Pa.c.small:e?Pa.c.large:Pa.c.largeConstrained}(U,A);return p?a.a.createElement(bh,{isFullScreen:w,isRendererSupported:yS,isRtl:I,loading:f,stageSize:Pa.d.large,vm:P},t?a.a.createElement(dM,{className:Zb.a.alertsContainer}):null):a.a.createElement(hi.a,DS({className:Zb.a.pageWrapper,dir:I?"rtl":"ltr"},x),H?a.a.createElement(Vb,{onCancel:v,onOptIn:S,onOptOut:N,onRequestClose:F}):null,f?a.a.createElement(ph,null):null,C?a.a.createElement(ph,{messageId:"gui.loader.creating"}):null,yS?null:a.a.createElement(cw,{isRtl:I}),L?a.a.createElement(Qw,null):null,s?a.a.createElement(OD,null):null,t?a.a.createElement(dM,{className:Zb.a.alertsContainer}):null,u?a.a.createElement(Ub,{vm:P}):null,d?a.a.createElement(Oh,{vm:P,onRequestClose:k}):null,n?a.a.createElement(Jh,{vm:P,onRequestClose:T}):null,a.a.createElement(hi.a,{className:Zb.a.bodyWrapper},a.a.createElement(hi.a,{className:Zb.a.flexWrapper},a.a.createElement(hi.a,{className:Zb.a.editorWrapper},a.a.createElement(oi,{forceRenderTabPanel:!0,className:j.tabs,selectedIndex:i,selectedTabClassName:j.tabSelected,selectedTabPanelClassName:j.tabPanelSelected,onSelect:b},a.a.createElement(ai,{className:j.tabList},a.a.createElement(si,{className:j.tab},a.a.createElement("img",{draggable:!1,src:ey.a}),a.a.createElement(B.a,{defaultMessage:"Code",id:"gui.gui.codeTab"})),a.a.createElement(si,{className:j.tab,onClick:Q},a.a.createElement("img",{draggable:!1,src:ty.a}),G?a.a.createElement(B.a,{defaultMessage:"Backdrops",id:"gui.gui.backdropsTab"}):a.a.createElement(B.a,{defaultMessage:"Costumes",id:"gui.gui.costumesTab"})),a.a.createElement(si,{className:j.tab,onClick:M},a.a.createElement("img",{draggable:!1,src:ny.a}),a.a.createElement(B.a,{defaultMessage:"Sounds",id:"gui.gui.soundsTab"})),a.a.createElement(si,{className:j.tab,onClick:D},a.a.createElement("img",{draggable:!1,src:ry.a}),a.a.createElement(B.a,{defaultMessage:"Save / Load",id:"gui.gui.toggleSpriteTab"})),a.a.createElement(WC,{canChangeLanguage:g}),a.a.createElement(fS,null),a.a.createElement(hi.a,{className:Zb.a.controlsWrapper},a.a.createElement(JB.a,{vm:P}),a.a.createElement(yy,{stageSize:e,vm:P}))),a.a.createElement(li,{className:j.tabPanel},a.a.createElement(hi.a,{className:Zb.a.blocksWrapper},a.a.createElement(Ei.a,{canUseCloud:l,grow:1,isVisible:r,options:{media:"".concat(o,"static/blocks-media/")},stageSize:e,vm:P})),a.a.createElement(hi.a,{className:Zb.a.extensionButtonContainer},a.a.createElement("button",{className:Zb.a.extensionButton,title:h.formatMessage(bS.addExtension),onClick:y},a.a.createElement("img",{className:Zb.a.extensionButtonIcon,draggable:!1,src:$b.a}))),a.a.createElement(hi.a,{className:Zb.a.monitorWrapper},a.a.createElement(Ov,{draggable:!1,stageSize:_})),a.a.createElement(hi.a,{className:Zb.a.watermark},a.a.createElement(oC,null))),a.a.createElement(li,{className:j.tabPanel},E?a.a.createElement(In,{vm:P}):null),a.a.createElement(li,{className:j.tabPanel},O?a.a.createElement(Hu,{vm:P}):null),a.a.createElement(li,{className:[j.tabPanel,Zb.a["tab-panel-height-100"]].join(" ")},R?a.a.createElement(xB,{vm:P}):null))),a.a.createElement(hi.a,{className:Le()(Zb.a.stageAndTargetWrapper,Zb.a[e]),style:e===Pa.d.small?"":{display:"none"}},a.a.createElement(bh,{isRendererSupported:yS,isRtl:I,stageSize:e,vm:P}),a.a.createElement(hi.a,{className:Zb.a.targetWrapper},a.a.createElement(Hs,{stageSize:e,vm:P}))))),a.a.createElement(mM,null))})};TS.propTypes={accountNavOpen:o.a.bool,activeTabIndex:o.a.number,authorId:o.a.oneOfType([o.a.string,o.a.bool]),authorThumbnailUrl:o.a.string,authorUsername:o.a.oneOfType([o.a.string,o.a.bool]),backdropLibraryVisible:o.a.bool,backpackHost:o.a.string,backpackVisible:o.a.bool,basePath:o.a.string,blocksTabVisible:o.a.bool,canChangeLanguage:o.a.bool,canCreateCopy:o.a.bool,canCreateNew:o.a.bool,canEditTitle:o.a.bool,canManageFiles:o.a.bool,canRemix:o.a.bool,canSave:o.a.bool,canShare:o.a.bool,canUseCloud:o.a.bool,cardsVisible:o.a.bool,children:o.a.node,costumeLibraryVisible:o.a.bool,costumesTabVisible:o.a.bool,enableCommunity:o.a.bool,intl:B.f.isRequired,isCreating:o.a.bool,isFullScreen:o.a.bool,isPlayerOnly:o.a.bool,isRtl:o.a.bool,isShared:o.a.bool,loading:o.a.bool,logo:o.a.string,onActivateCostumesTab:o.a.func,onActivateSoundsTab:o.a.func,onActivateTab:o.a.func,onClickAccountNav:o.a.func,onClickLogo:o.a.func,onCloseAccountNav:o.a.func,onExtensionButtonClick:o.a.func,onLogOut:o.a.func,onOpenRegistration:o.a.func,onRequestCloseBackdropLibrary:o.a.func,onRequestCloseCostumeLibrary:o.a.func,onRequestCloseTelemetryModal:o.a.func,onSeeCommunity:o.a.func,onShare:o.a.func,onTabSelect:o.a.func,onTelemetryModalCancel:o.a.func,onTelemetryModalOptIn:o.a.func,onTelemetryModalOptOut:o.a.func,onToggleLoginOpen:o.a.func,renderLogin:o.a.func,saveLoadTabVisible:o.a.bool,showComingSoon:o.a.bool,soundsTabVisible:o.a.bool,stageSizeMode:o.a.oneOf(Object.keys(Pa.d)),targetIsStage:o.a.bool,telemetryModalVisible:o.a.bool,tipsLibraryVisible:o.a.bool,useEditorDragStyle:o.a.bool,vm:o.a.instanceOf(u.a).isRequired},TS.defaultProps={backpackHost:null,backpackVisible:!1,basePath:"./",canChangeLanguage:!0,canCreateNew:!1,canEditTitle:!1,canManageFiles:!0,canRemix:!1,canSave:!1,canCreateCopy:!1,canShare:!1,canUseCloud:!1,enableCommunity:!1,isCreating:!1,isShared:!1,loading:!1,showComingSoon:!1,stageSizeMode:Pa.d.large};var kS=Object(B.e)(Object(s.b)(function(A){return{stageSizeMode:A.scratchGui.stageSize.stageSize}})(TS));function FS(A){"@babel/helpers - typeof";return(FS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var vS=["assetHost","cloudHost","error","isError","isScratchDesktop","isShowingProject","onProjectLoaded","onStorageInit","onUpdateProjectId","onVmInit","projectHost","projectId","children","fetchingProject","isLoading","loadingStateVisible"];function SS(){return(SS=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function NS(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function RS(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function OS(A,e){return(OS=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function YS(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=US(A);if(e){var o=US(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===FS(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function US(A){return(US=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var GS=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&OS(A,e)}(i,a.a.Component);var e=YS(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&RS(A.prototype,e),i&&RS(A,i)}(i,[{key:"componentDidMount",value:function(){!function(A){lw=A}(this.props.isScratchDesktop),this.props.onStorageInit(eA.a),this.props.onVmInit(this.props.vm)}},{key:"componentDidUpdate",value:function(A){this.props.projectId!==A.projectId&&null!==this.props.projectId&&this.props.onUpdateProjectId(this.props.projectId),this.props.isShowingProject&&!A.isShowingProject&&this.props.onProjectLoaded()}},{key:"render",value:function(){if(this.props.isError)throw new Error("Error in Scratch GUI [location=".concat(window.location,"]: ").concat(this.props.error));var A=this.props,e=(A.assetHost,A.cloudHost,A.error,A.isError,A.isScratchDesktop,A.isShowingProject,A.onProjectLoaded,A.onStorageInit,A.onUpdateProjectId,A.onVmInit,A.projectHost,A.projectId,A.children),i=A.fetchingProject,t=A.isLoading,o=A.loadingStateVisible,n=NS(A,vS);return a.a.createElement(kS,SS({loading:i||t||o},n),e)}}]),i}();GS.propTypes={assetHost:o.a.string,children:o.a.node,cloudHost:o.a.string,error:o.a.oneOfType([o.a.object,o.a.string]),fetchingProject:o.a.bool,intl:B.f,isError:o.a.bool,isLoading:o.a.bool,isScratchDesktop:o.a.bool,isShowingProject:o.a.bool,loadingStateVisible:o.a.bool,onProjectLoaded:o.a.func,onSeeCommunity:o.a.func,onStorageInit:o.a.func,onUpdateProjectId:o.a.func,onVmInit:o.a.func,projectHost:o.a.string,projectId:o.a.oneOfType([o.a.string,o.a.number]),telemetryModalVisible:o.a.bool,vm:o.a.instanceOf(u.a).isRequired},GS.defaultProps={isScratchDesktop:!1,onStorageInit:function(A){return A.addOfficialScratchWebStores()},onProjectLoaded:function(){},onUpdateProjectId:function(){},onVmInit:function(){}};var HS=Object(B.e)(Object(s.b)(function(A){var e=A.scratchGui.projectState.loadingState;return{activeTabIndex:A.scratchGui.editorTab.activeTabIndex,alertsVisible:A.scratchGui.alerts.visible,backdropLibraryVisible:A.scratchGui.modals.backdropLibrary,blocksTabVisible:A.scratchGui.editorTab.activeTabIndex===h.a,cardsVisible:A.scratchGui.cards.visible,connectionModalVisible:A.scratchGui.modals.connectionModal,costumeLibraryVisible:A.scratchGui.modals.costumeLibrary,costumesTabVisible:A.scratchGui.editorTab.activeTabIndex===h.b,error:A.scratchGui.projectState.error,isError:Object(E.k)(e),isFullScreen:A.scratchGui.mode.isFullScreen,isPlayerOnly:A.scratchGui.mode.isPlayerOnly,isRtl:A.locales.isRtl,isShowingProject:Object(E.s)(e),loadingStateVisible:A.scratchGui.modals.loadingProject,projectId:A.scratchGui.projectState.projectId,saveLoadTabVisible:A.scratchGui.editorTab.activeTabIndex===h.c,soundsTabVisible:A.scratchGui.editorTab.activeTabIndex===h.d,targetIsStage:A.scratchGui.targets.stage&&A.scratchGui.targets.stage.id===A.scratchGui.targets.editingTarget,telemetryModalVisible:A.scratchGui.modals.telemetryModal,tipsLibraryVisible:A.scratchGui.modals.tipsLibrary,vm:A.scratchGui.vm}},function(A){return{onExtensionButtonClick:function(){return A(Object(C.p)())},onActivateTab:function(e){return A(Object(h.e)(e))},onActivateCostumesTab:function(){return A(Object(h.e)(h.b))},onActivateSoundsTab:function(){return A(Object(h.e)(h.d))},onActivateSaveLoadTab:function(){return A(Object(h.e)(h.c))},onRequestCloseBackdropLibrary:function(){return A(Object(C.a)())},onRequestCloseCostumeLibrary:function(){return A(Object(C.c)())},onRequestCloseTelemetryModal:function(){return A(Object(C.i)())}}})(GS)),LS=Object(r.d)(U,Object(d.a)("Top Level App"),function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&M(A,e)}(t,a.a.Component);var i=b(t);function t(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i.apply(this,arguments)}return function(A,e,i){e&&D(A.prototype,e),i&&D(A,i)}(t,[{key:"componentDidMount",value:function(){var A=this;if(!this.props.fontsLoaded){var e=function(){var A=[];if(document.fonts&&"function"==typeof document.fonts.values&&"function"==typeof document.fonts.values()[Symbol.iterator]){var e,i=f(document.fonts.values());try{for(i.s();!(e=i.n()).done;){var t=e.value;-1!==T.indexOf(t.family)&&(A.push(t.loaded),t.load())}}catch(A){i.e(A)}finally{i.f()}}return A};"complete"===document.readyState?Promise.all(e()).then(function(){A.props.onSetFontsLoaded()}):document.onreadystatechange=function(){"complete"===document.readyState&&(document.onreadystatechange=null,Promise.all(e()).then(function(){A.props.onSetFontsLoaded()}))}}}},{key:"render",value:function(){var e=m()(this.props,["onSetFontsLoaded"]);return a.a.createElement(A,e)}}]),t}();e.propTypes={fontsLoaded:o.a.bool.isRequired,onSetFontsLoaded:o.a.func.isRequired};return Object(s.b)(function(A){return{fontsLoaded:A.scratchGui.fontsLoaded}},function(A){return{onSetFontsLoaded:function(){return A(Object(p.c)())}}})(e)},function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&KA(A,e)}(t,a.a.Component);var i=WA(t);function t(A){var e;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A);var o=DA.a.parse(location.search),n=PA(o);return n&&("all"===n?e.openTutorials():e.setActiveCards(n)),e}return function(A,e,i){e&&zA(A.prototype,e),i&&zA(A,i)}(t,[{key:"setActiveCards",value:function(A){this.props.onUpdateReduxDeck(A)}},{key:"openTutorials",value:function(){this.props.onOpenTipsLibrary()}},{key:"render",value:function(){var e=this.props,i=(e.onOpenTipsLibrary,e.onUpdateReduxDeck,JA(e,jA));return a.a.createElement(A,i)}}]),t}();e.propTypes={onOpenTipsLibrary:o.a.func,onUpdateReduxDeck:o.a.func};return Object(s.b)(null,function(A){return{onOpenTipsLibrary:function(){A(Object(C.u)())},onUpdateReduxDeck:function(e){A(Object(xA.a)(e))}}})(e)},function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&sA(A,e)}(t,a.a.Component);var i=gA(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(lA(e),["fetchProject"]),eA.a.setProjectHost(A.projectHost),eA.a.setAssetHost(A.assetHost),eA.a.setTranslatorFunction(A.intl.formatMessage),""!==A.projectId&&null!==A.projectId&&void 0!==A.projectId&&e.props.setProjectId(A.projectId.toString()),e}return function(A,e,i){e&&rA(A.prototype,e),i&&rA(A,i)}(t,[{key:"componentDidUpdate",value:function(A){A.projectHost!==this.props.projectHost&&eA.a.setProjectHost(this.props.projectHost),A.assetHost!==this.props.assetHost&&eA.a.setAssetHost(this.props.assetHost),this.props.isFetchingWithId&&!A.isFetchingWithId&&this.fetchProject(this.props.reduxProjectId,this.props.loadingState).then(function(){return console.log("Fetch project success")},function(A){return console.error("Error fetching project",A.message)}),this.props.isShowingProject&&!A.isShowingProject&&this.props.onProjectUnchanged(),this.props.isShowingProject&&(A.isLoadingProject||A.isCreatingNew)&&this.props.onActivateTab(h.a)}},{key:"fetchProject",value:function(){var A=function(A){return function(){var e=this,i=arguments;return new Promise(function(t,o){var n=A.apply(e,i);function a(A){aA(n,t,o,a,r,"next",A)}function r(A){aA(n,t,o,a,r,"throw",A)}a(void 0)})}}(function*(A,e){try{var i=new URLSearchParams(window.location.search).get("p"),t=yield(yield fetch("https://martyblocks-projects-default-rtdb.europe-west1.firebasedatabase.app/projects/"+i+".json")).json();if(!t||!t.data)throw new Error("Invalid project id");var o=yield(yield fetch(t.data)).arrayBuffer();return this.props.onFetchedProjectData(o,e)}catch(A){console.log("Couldn't load project from db:",A)}try{var n=yield mv2Interface.loadScratchFile("__autosave");if(!n||!n.contents||!confirm("Would you like to load the last autosave?"))throw new Error("No autosave file");console.log("Using autosave file");var a=yield(yield fetch(n.contents)).arrayBuffer();return this.props.onFetchedProjectData(a,e)}catch(A){console.warn("No autosave data available")}console.log("Falling back to default project");var r=yield eA.a.load(eA.a.AssetType.Project,A,eA.a.DataFormat.JSON);return this.props.onFetchedProjectData(r.data,e)});return function(e,i){return A.apply(this,arguments)}}()},{key:"render",value:function(){var e=this.props,i=(e.assetHost,e.intl,e.isLoadingProject,e.loadingState,e.onActivateTab,e.onError,e.onFetchedProjectData,e.onProjectUnchanged,e.projectHost,e.projectId,e.reduxProjectId,e.setProjectId,e.isFetchingWithId),t=nA(e,tA);return a.a.createElement(A,oA({fetchingProject:i},t))}}]),t}();e.propTypes={assetHost:o.a.string,canSave:o.a.bool,intl:B.f.isRequired,isCreatingNew:o.a.bool,isFetchingWithId:o.a.bool,isLoadingProject:o.a.bool,isShowingProject:o.a.bool,loadingState:o.a.oneOf(E.a),onActivateTab:o.a.func,onError:o.a.func,onFetchedProjectData:o.a.func,onProjectUnchanged:o.a.func,projectHost:o.a.string,projectId:o.a.oneOfType([o.a.string,o.a.number]),reduxProjectId:o.a.oneOfType([o.a.string,o.a.number]),setProjectId:o.a.func},e.defaultProps={assetHost:"https://assets.scratch.mit.edu",projectHost:"https://projects.scratch.mit.edu"};return Object(B.e)(Object(s.b)(function(A){return{isCreatingNew:Object(E.j)(A.scratchGui.projectState.loadingState),isFetchingWithId:Object(E.l)(A.scratchGui.projectState.loadingState),isLoadingProject:Object(E.n)(A.scratchGui.projectState.loadingState),isShowingProject:Object(E.s)(A.scratchGui.projectState.loadingState),loadingState:A.scratchGui.projectState.loadingState,reduxProjectId:A.scratchGui.projectState.projectId}},function(A){return{onActivateTab:function(e){return A(Object(h.e)(e))},onError:function(e){return A(Object(E.z)(e))},onFetchedProjectData:function(e,i){return A(Object(E.x)(e,i))},setProjectId:function(e){return A(Object(E.F)(e))},onProjectUnchanged:function(){return A(Object(AA.d)())}}},function(A,e,i){return Object.assign({},A,e,i)})(e))},function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&hA(A,e)}(t,a.a.Component);var i=CA(t);function t(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i.apply(this,arguments)}return function(A,e,i){e&&EA(A.prototype,e),i&&EA(A,i)}(t,[{key:"componentDidMount",value:function(){this.handleReceivedProjectTitle(this.props.projectTitle)}},{key:"componentDidUpdate",value:function(A){if(this.props.projectTitle!==A.projectTitle&&this.handleReceivedProjectTitle(this.props.projectTitle),this.props.isShowingWithoutId&&A.isAnyCreatingNewState){var e=this.handleReceivedProjectTitle();this.props.onUpdateProjectTitle(e)}this.props.reduxProjectTitle!==A.reduxProjectTitle&&this.props.reduxProjectTitle!==this.props.projectTitle&&this.props.onUpdateProjectTitle(this.props.reduxProjectTitle)}},{key:"handleReceivedProjectTitle",value:function(A){var e=A;return null!==e&&void 0!==e||(e=this.props.intl.formatMessage(mA.defaultProjectTitle)),this.props.onChangedProjectTitle(e),e}},{key:"render",value:function(){var e=this.props,i=(e.intl,e.isAnyCreatingNewState,e.isShowingWithoutId,e.onChangedProjectTitle,e.onUpdateProjectTitle,e.projectTitle,e.reduxProjectTitle,dA(e,BA));return a.a.createElement(A,i)}}]),t}();e.propTypes={intl:B.f,isAnyCreatingNewState:o.a.bool,isShowingWithoutId:o.a.bool,onChangedProjectTitle:o.a.func,onUpdateProjectTitle:o.a.func,projectTitle:o.a.string,reduxProjectTitle:o.a.string},e.defaultProps={onUpdateProjectTitle:function(){}};return Object(B.e)(Object(s.b)(function(A){var e=A.scratchGui.projectState.loadingState;return{isAnyCreatingNewState:Object(E.h)(e),isShowingWithoutId:Object(E.u)(e),reduxProjectTitle:A.scratchGui.projectTitle}},function(A){return{onChangedProjectTitle:function(e){return A(Object(x.c)(e))}}})(e))},function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&OA(A,e)}(t,a.a.Component);var i=YA(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(UA(e),["getProjectThumbnail","leavePageConfirm","tryToAutoSave"]),e}return function(A,e,i){e&&RA(A.prototype,e),i&&RA(A,i)}(t,[{key:"componentWillMount",value:function(){var A=this;"object"===("undefined"==typeof window?"undefined":NA(window))&&(window.onbeforeunload=function(e){return A.leavePageConfirm(e)}),this.props.onSetProjectThumbnailer(this.getProjectThumbnail),this.props.onSetProjectSaver(this.tryToAutoSave)}},{key:"componentDidUpdate",value:function(A){if(!this.props.isAnyCreatingNewState&&A.isAnyCreatingNewState&&this.reportTelemetryEvent("projectWasCreated"),!this.props.isLoading&&A.isLoading&&this.reportTelemetryEvent("projectDidLoad"),this.props.projectChanged&&!A.projectChanged&&this.scheduleAutoSave(),this.props.isUpdating&&!A.isUpdating&&this.updateProjectToStorage(),this.props.isCreatingNew&&!A.isCreatingNew&&this.createNewProjectToStorage(),this.props.isCreatingCopy&&!A.isCreatingCopy&&this.createCopyToStorage(),this.props.isRemixing&&!A.isRemixing?(this.props.onRemixing(!0),this.createRemixToStorage()):!this.props.isRemixing&&A.isRemixing&&this.props.onRemixing(!1),!A.isCreatingNew&&(this.isShowingCreatable(this.props)&&!this.isShowingCreatable(A)&&this.props.onCreateProject(),!A.isUpdating)){var e=this.props.canSave&&!A.canSave,i=this.props.isShared&&!A.isShared;this.props.isShowingSaveable&&(e||i)&&this.props.onAutoUpdateProject()}}},{key:"componentWillUnmount",value:function(){this.clearAutoSaveTimeout(),this.props.onSetProjectThumbnailer(null),this.props.onSetProjectSaver(null)}},{key:"leavePageConfirm",value:function(A){if(this.props.projectChanged)return(A||window.event).returnValue=!0,!0}},{key:"clearAutoSaveTimeout",value:function(){null!==this.props.autoSaveTimeoutId&&(clearTimeout(this.props.autoSaveTimeoutId),this.props.setAutoSaveTimeoutId(null))}},{key:"scheduleAutoSave",value:function(){if(this.props.isShowingSaveable&&null===this.props.autoSaveTimeoutId){var A=setTimeout(this.tryToAutoSave,1e3*this.props.autoSaveIntervalSecs);this.props.setAutoSaveTimeoutId(A)}}},{key:"tryToAutoSave",value:function(){this.props.projectChanged&&this.props.isShowingSaveable&&this.props.onAutoUpdateProject()}},{key:"isShowingCreatable",value:function(A){return A.canCreateNew&&A.isShowingWithoutId}},{key:"updateProjectToStorage",value:function(){var A=this;return this.props.onShowSavingAlert(),this.storeProject(this.props.reduxProjectId).then(function(){A.props.onUpdatedProject(A.props.loadingState),A.props.onShowSaveSuccessAlert()}).catch(function(e){A.props.onShowAlert("savingError"),A.props.onProjectError(e)})}},{key:"createNewProjectToStorage",value:function(){var A=this;return this.storeProject(null).then(function(e){A.props.onCreatedProject(e.id.toString(),A.props.loadingState)}).catch(function(e){A.props.onShowAlert("creatingError"),A.props.onProjectError(e)})}},{key:"createCopyToStorage",value:function(){var A=this;return this.props.onShowCreatingCopyAlert(),this.storeProject(null,{originalId:this.props.reduxProjectId,isCopy:1,title:this.props.reduxProjectTitle}).then(function(e){A.props.onCreatedProject(e.id.toString(),A.props.loadingState),A.props.onShowCopySuccessAlert()}).catch(function(e){A.props.onShowAlert("creatingError"),A.props.onProjectError(e)})}},{key:"createRemixToStorage",value:function(){var A=this;return this.props.onShowCreatingRemixAlert(),this.storeProject(null,{originalId:this.props.reduxProjectId,isRemix:1,title:this.props.reduxProjectTitle}).then(function(e){A.props.onCreatedProject(e.id.toString(),A.props.loadingState),A.props.onShowRemixSuccessAlert()}).catch(function(e){A.props.onShowAlert("creatingError"),A.props.onProjectError(e)})}},{key:"storeProject",value:function(A,e){var i=this;e=e||{},this.clearAutoSaveTimeout();var t=this.props.vm.toJSON();return Promise.all(this.props.vm.assets.filter(function(A){return!A.clean}).map(function(A){return eA.a.store(A.assetType,A.dataFormat,A.data,A.assetId).then(function(e){if("ok"!==e.status)return Promise.reject(e.code);A.clean=!0})})).then(function(){return i.props.onUpdateProjectData(A,t,e)}).then(function(A){i.props.onSetProjectUnchanged();var e=A.id.toString();return e&&i.props.onUpdateProjectThumbnail&&i.storeProjectThumbnail(e),i.reportTelemetryEvent("projectDidSave"),A}).catch(function(A){throw L.a.error(A),A})}},{key:"storeProjectThumbnail",value:function(A){var e=this;try{this.getProjectThumbnail(function(i){e.props.onUpdateProjectThumbnail(A,function(A){for(var e=atob(A.split(",")[1]),i=A.split(",")[0].split(":")[1].split(";")[0],t=new ArrayBuffer(e.length),o=new Uint8Array(t),n=0;n<e.length;n++)o[n]=e.charCodeAt(n);return new Blob([t],{type:i})}(i))})}catch(A){L.a.error("Project thumbnail save error",A)}}},{key:"getProjectThumbnail",value:function(A){var e=this;this.props.vm.postIOData("video",{forceTransparentPreview:!0}),this.props.vm.renderer.requestSnapshot(function(i){e.props.vm.postIOData("video",{forceTransparentPreview:!1}),A(i)}),this.props.vm.renderer.draw()}},{key:"reportTelemetryEvent",value:function(A){try{if(this.props.onProjectTelemetryEvent){var e=fA(this.props.vm,this.props.reduxProjectTitle,this.props.locale);this.props.onProjectTelemetryEvent(A,e)}}catch(e){L.a.error("Telemetry error",A,e)}}},{key:"render",value:function(){var e=this.props,i=(e.autoSaveTimeoutId,e.autoSaveIntervalSecs,e.isCreatingCopy,e.isCreatingNew,e.projectChanged,e.isAnyCreatingNewState),t=(e.isLoading,e.isManualUpdating,e.isRemixing,e.isShowingSaveable,e.isShowingWithId,e.isShowingWithoutId,e.isUpdating,e.loadingState,e.onAutoUpdateProject,e.onCreatedProject,e.onCreateProject,e.onProjectError,e.onRemixing,e.onSetProjectUnchanged,e.onSetProjectThumbnailer,e.onSetProjectSaver,e.onShowAlert,e.onShowCopySuccessAlert,e.onShowRemixSuccessAlert,e.onShowCreatingCopyAlert,e.onShowCreatingRemixAlert,e.onShowSaveSuccessAlert,e.onShowSavingAlert,e.onUpdatedProject,e.onUpdateProjectData,e.onUpdateProjectThumbnail,e.reduxProjectId,e.reduxProjectTitle,e.setAutoSaveTimeoutId,SA(e,FA));return a.a.createElement(A,vA({isCreating:i},t))}}]),t}();e.propTypes={autoSaveIntervalSecs:o.a.number.isRequired,autoSaveTimeoutId:o.a.number,canCreateNew:o.a.bool,canSave:o.a.bool,isAnyCreatingNewState:o.a.bool,isCreatingCopy:o.a.bool,isCreatingNew:o.a.bool,isLoading:o.a.bool,isManualUpdating:o.a.bool,isRemixing:o.a.bool,isShared:o.a.bool,isShowingSaveable:o.a.bool,isShowingWithId:o.a.bool,isShowingWithoutId:o.a.bool,isUpdating:o.a.bool,loadingState:o.a.oneOf(E.a),locale:o.a.string.isRequired,onAutoUpdateProject:o.a.func,onCreateProject:o.a.func,onCreatedProject:o.a.func,onProjectError:o.a.func,onProjectTelemetryEvent:o.a.func,onRemixing:o.a.func,onSetProjectSaver:o.a.func.isRequired,onSetProjectThumbnailer:o.a.func.isRequired,onSetProjectUnchanged:o.a.func.isRequired,onShowAlert:o.a.func,onShowCopySuccessAlert:o.a.func,onShowCreatingCopyAlert:o.a.func,onShowCreatingRemixAlert:o.a.func,onShowRemixSuccessAlert:o.a.func,onShowSaveSuccessAlert:o.a.func,onShowSavingAlert:o.a.func,onUpdateProjectData:o.a.func.isRequired,onUpdateProjectThumbnail:o.a.func,onUpdatedProject:o.a.func,projectChanged:o.a.bool,reduxProjectId:o.a.oneOfType([o.a.string,o.a.number]),reduxProjectTitle:o.a.string,setAutoSaveTimeoutId:o.a.func.isRequired,vm:o.a.instanceOf(u.a).isRequired},e.defaultProps={autoSaveIntervalSecs:120,onRemixing:function(){},onSetProjectThumbnailer:function(){},onSetProjectSaver:function(){},onUpdateProjectData:yA};return Object(s.b)(function(A,e){var i=A.scratchGui.projectState.loadingState,t=Object(E.t)(i);return{autoSaveTimeoutId:A.scratchGui.timeout.autoSaveTimeoutId,isAnyCreatingNewState:Object(E.h)(i),isLoading:Object(E.n)(i),isCreatingCopy:Object(E.i)(i),isCreatingNew:Object(E.j)(i),isRemixing:Object(E.r)(i),isShowingSaveable:e.canSave&&t,isShowingWithId:t,isShowingWithoutId:Object(E.u)(i),isUpdating:Object(E.v)(i),isManualUpdating:Object(E.q)(i),loadingState:i,locale:A.locales.locale,projectChanged:A.scratchGui.projectChanged,reduxProjectId:A.scratchGui.projectState.projectId,reduxProjectTitle:A.scratchGui.projectTitle,vm:A.scratchGui.vm}},function(A){return{onAutoUpdateProject:function(){return A(Object(E.b)())},onCreatedProject:function(e,i){return A(Object(E.f)(e,i))},onCreateProject:function(){return A(Object(E.c)())},onProjectError:function(e){return A(Object(E.z)(e))},onSetProjectUnchanged:function(){return A(Object(AA.d)())},onShowAlert:function(e){return A(Object(TA.h)(e))},onShowCopySuccessAlert:function(){return Object(TA.f)(A,"createCopySuccess")},onShowRemixSuccessAlert:function(){return Object(TA.f)(A,"createRemixSuccess")},onShowCreatingCopyAlert:function(){return Object(TA.f)(A,"creatingCopy")},onShowCreatingRemixAlert:function(){return Object(TA.f)(A,"creatingRemix")},onShowSaveSuccessAlert:function(){return Object(TA.f)(A,"saveSuccess")},onShowSavingAlert:function(){return Object(TA.f)(A,"saving")},onUpdatedProject:function(e){return A(Object(E.g)(e))},setAutoSaveTimeoutId:function(e){return A(Object(kA.b)(e))}}},function(A,e,i){return Object.assign({},A,e,i)})(e)},ue,De,function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&V(A,e)}(t,a.a.Component);var i=X(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(Z(e),["createFileObjects","getProjectTitleFromFilename","handleFinishedLoadingUpload","handleStartSelectingFileUpload","handleChange","onload","removeFileObjects"]),e}return function(A,e,i){e&&W(A.prototype,e),i&&W(A,i)}(t,[{key:"componentDidUpdate",value:function(A){this.props.isLoadingUpload&&!A.isLoadingUpload&&this.handleFinishedLoadingUpload()}},{key:"componentWillUnmount",value:function(){this.removeFileObjects()}},{key:"handleStartSelectingFileUpload",value:function(){this.createFileObjects()}},{key:"createFileObjects",value:function(){this.removeFileObjects(),this.fileReader=new FileReader,this.fileReader.onload=this.onload,this.inputElement=document.createElement("input"),this.inputElement.accept=".sb,.sb2,.sb3",this.inputElement.style="display: none;",this.inputElement.type="file",this.inputElement.onchange=this.handleChange,document.body.appendChild(this.inputElement),this.inputElement.click()}},{key:"handleChange",value:function(A){var e=this.props,i=e.intl,t=e.isShowingWithoutId,o=e.loadingState,n=e.projectChanged,a=e.userOwnsProject,r=A.target;if(r.files){this.fileToUpload=r.files[0];var s=!0;(a||n&&t)&&(s=confirm(i.formatMessage(P.a.replaceProjectWarning))),s?this.props.requestProjectUpload(o):this.removeFileObjects(),this.props.closeFileMenu()}}},{key:"handleFinishedLoadingUpload",value:function(){this.fileToUpload&&this.fileReader?this.fileReader.readAsArrayBuffer(this.fileToUpload):(this.props.cancelFileUpload(this.props.loadingState),this.removeFileObjects())}},{key:"getProjectTitleFromFilename",value:function(A){if(!A)return"";var e=A.match(/^(.*)\.sb[23]?$/);return e?e[1].substring(0,100):""}},{key:"onload",value:function(){var A=this;if(this.fileReader){this.props.onLoadingStarted();var e=this.fileToUpload&&this.fileToUpload.name,i=!1;this.props.vm.loadProject(this.fileReader.result).then(function(){if(e){var t=A.getProjectTitleFromFilename(e);A.props.onSetProjectTitle(t)}i=!0}).catch(function(e){L.a.warn(e),alert(A.props.intl.formatMessage($.loadError))}).then(function(){A.props.onLoadingFinished(A.props.loadingState,i),A.removeFileObjects()})}}},{key:"removeFileObjects",value:function(){this.inputElement&&(this.inputElement.value=null,document.body.removeChild(this.inputElement)),this.inputElement=null,this.fileReader=null,this.fileToUpload=null}},{key:"render",value:function(){var e=this.props,i=(e.cancelFileUpload,e.closeFileMenu,e.isLoadingUpload,e.isShowingWithoutId,e.loadingState,e.onLoadingFinished,e.onLoadingStarted,e.onSetProjectTitle,e.projectChanged,e.requestProjectUpload,e.userOwnsProject,K(e,J));return a.a.createElement(a.a.Fragment,null,a.a.createElement(A,z({onStartSelectingFileUpload:this.handleStartSelectingFileUpload},i)))}}]),t}();e.propTypes={canSave:o.a.bool,cancelFileUpload:o.a.func,closeFileMenu:o.a.func,intl:B.f.isRequired,isLoadingUpload:o.a.bool,isShowingWithoutId:o.a.bool,loadingState:o.a.oneOf(E.a),onLoadingFinished:o.a.func,onLoadingStarted:o.a.func,onSetProjectTitle:o.a.func,projectChanged:o.a.bool,requestProjectUpload:o.a.func,userOwnsProject:o.a.bool,vm:o.a.shape({loadProject:o.a.func})};return Object(B.e)(Object(s.b)(function(A,e){var i=A.scratchGui.projectState.loadingState,t=A.session&&A.session.session&&A.session.session.user;return{isLoadingUpload:Object(E.o)(i),isShowingWithoutId:Object(E.u)(i),loadingState:i,projectChanged:A.scratchGui.projectChanged,userOwnsProject:e.authorUsername&&t&&e.authorUsername===t.username,vm:A.scratchGui.vm}},function(A,e){return{cancelFileUpload:function(e){return A(Object(E.y)(e,!1,!1))},closeFileMenu:function(){return A(Object(_.d)())},onLoadingFinished:function(i,t){A(Object(E.y)(i,e.canSave,t)),A(Object(C.e)()),A(Object(_.d)())},onLoadingStarted:function(){return A(Object(C.q)())},onSetProjectTitle:function(e){return A(Object(x.c)(e))},requestProjectUpload:function(e){return A(Object(E.D)(e))}}},function(A,e,i){return Object.assign({},A,e,i)})(e))},Ge)(HS);LS.setAppElement=l.a.setAppElement;e.a=LS},function(A,e,i){"use strict";i.d(e,"a",function(){return o}),i.d(e,"c",function(){return t}),i.d(e,"b",function(){return n});var t={stageSize:i(16).c.large},o=function(A,e){switch(void 0===A&&(A=t),e.type){case"scratch-gui/StageSize/SET_STAGE_SIZE":return{stageSize:e.stageSize};default:return A}},n=function(A){return{type:"scratch-gui/StageSize/SET_STAGE_SIZE",stageSize:A}}},function(A,e,i){"use strict";e.__esModule=!0,e.default=function(A,e){var i={};for(var t in A)e.indexOf(t)>=0||Object.prototype.hasOwnProperty.call(A,t)&&(i[t]=A[t]);return i}},function(A,e,i){"use strict";i.d(e,"a",function(){return o}),i.d(e,"e",function(){return t}),i.d(e,"b",function(){return a}),i.d(e,"c",function(){return n}),i.d(e,"d",function(){return r});var t={running:!1,started:!1,turbo:!1},o=function(A,e){switch(void 0===A&&(A=t),e.type){case"scratch-gui/vm-status/SET_STARTED_STATE":return Object.assign({},A,{started:e.started});case"scratch-gui/vm-status/SET_RUNNING_STATE":return Object.assign({},A,{running:e.running});case"scratch-gui/vm-status/SET_TURBO_STATE":return Object.assign({},A,{turbo:e.turbo});default:return A}},n=function(A){return{type:"scratch-gui/vm-status/SET_STARTED_STATE",started:A}},a=function(A){return{type:"scratch-gui/vm-status/SET_RUNNING_STATE",running:A}},r=function(A){return{type:"scratch-gui/vm-status/SET_TURBO_STATE",turbo:A}}},function(A,e,i){var t=i(1400);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e,i){var t=i(1556);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e){var i=A.exports={version:"2.5.7"};"number"==typeof __e&&(__e=i)},function(A,e,i){function t(){}i(999).mixin(t),t.prototype.write=function(A,e,i){this.emit("item",A,e,i)},t.prototype.end=function(){this.emit("end"),this.removeAllListeners()},t.prototype.pipe=function(A){var e=this;function i(){A.write.apply(A,Array.prototype.slice.call(arguments))}function t(){!A._isStdio&&A.end()}return e.emit("unpipe",A),A.emit("pipe",e),e.on("item",i),e.on("end",t),e.when("unpipe",function(o){var n=o===A||void 0===o;return n&&(e.removeListener("item",i),e.removeListener("end",t),A.emit("unpipe")),n}),A},t.prototype.unpipe=function(A){return this.emit("unpipe",A),this},t.prototype.format=function(A){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},t.mixin=function(A){var e,i=t.prototype;for(e in i)i.hasOwnProperty(e)&&(A.prototype[e]=i[e])},A.exports=t},function(A,e,i){function t(){}i(1065).mixin(t),t.prototype.write=function(A,e,i){this.emit("item",A,e,i)},t.prototype.end=function(){this.emit("end"),this.removeAllListeners()},t.prototype.pipe=function(A){var e=this;function i(){A.write.apply(A,Array.prototype.slice.call(arguments))}function t(){!A._isStdio&&A.end()}return e.emit("unpipe",A),A.emit("pipe",e),e.on("item",i),e.on("end",t),e.when("unpipe",function(o){var n=o===A||void 0===o;return n&&(e.removeListener("item",i),e.removeListener("end",t),A.emit("unpipe")),n}),A},t.prototype.unpipe=function(A){return this.emit("unpipe",A),this},t.prototype.format=function(A){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},t.mixin=function(A){var e,i=t.prototype;for(e in i)i.hasOwnProperty(e)&&(A.prototype[e]=i[e])},A.exports=t},function(A,e){function i(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var t=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return function(A,e,t){e&&i(A.prototype,e),t&&i(A,t)}(A,null,[{key:"simple",value:function(A){return JSON.parse(JSON.stringify(A))}}]),A}();A.exports=t},function(A,e,i){function t(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var o=i(101),n=i(237),a=function(){function A(e,i,t,n){switch(function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.id=e||o(),this.name=i,this.type=t,this.isCloud=n,this.type){case A.SCALAR_TYPE:this.value=0;break;case A.LIST_TYPE:this.value=[];break;case A.BROADCAST_MESSAGE_TYPE:this.value=this.name;break;default:throw new Error("Invalid variable type: ".concat(this.type))}}return function(A,e,i){e&&t(A.prototype,e),i&&t(A,i)}(A,[{key:"toXML",value:function(A){return A=!0===A,'<variable type="'.concat(this.type,'" id="').concat(this.id,'" islocal="').concat(A,'" iscloud="').concat(this.isCloud,'">').concat(n(this.name),"</variable>")}}],[{key:"SCALAR_TYPE",get:function(){return""}},{key:"LIST_TYPE",get:function(){return"list"}},{key:"BROADCAST_MESSAGE_TYPE",get:function(){return"broadcast_msg"}}]),A}();A.exports=a},function(A,e){function i(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var t=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return function(A,e,t){e&&i(A.prototype,e),t&&i(A,t)}(A,null,[{key:"BACKGROUND_LAYER",get:function(){return"background"}},{key:"VIDEO_LAYER",get:function(){return"video"}},{key:"PEN_LAYER",get:function(){return"pen"}},{key:"SPRITE_LAYER",get:function(){return"sprite"}},{key:"LAYER_GROUPS",get:function(){return[A.BACKGROUND_LAYER,A.VIDEO_LAYER,A.PEN_LAYER,A.SPRITE_LAYER]}}]),A}();A.exports=t},function(A,e,i){"use strict";(function(A){if(e.base64=!0,e.array=!0,e.string=!0,e.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,e.nodebuffer=void 0!==A,e.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)e.blob=!1;else{var t=new ArrayBuffer(0);try{e.blob=0===new Blob([t],{type:"application/zip"}).size}catch(A){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(t),e.blob=0===o.getBlob("application/zip").size}catch(A){e.blob=!1}}}try{e.nodestream=!!i(485).Readable}catch(A){e.nodestream=!1}}).call(this,i(56).Buffer)},function(A,e,i){"use strict";var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function o(A,e){return Object.prototype.hasOwnProperty.call(A,e)}e.assign=function(A){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var t in i)o(i,t)&&(A[t]=i[t])}}return A},e.shrinkBuf=function(A,e){return A.length===e?A:A.subarray?A.subarray(0,e):(A.length=e,A)};var n={arraySet:function(A,e,i,t,o){if(e.subarray&&A.subarray)A.set(e.subarray(i,i+t),o);else for(var n=0;n<t;n++)A[o+n]=e[i+n]},flattenChunks:function(A){var e,i,t,o,n,a;for(t=0,e=0,i=A.length;e<i;e++)t+=A[e].length;for(a=new Uint8Array(t),o=0,e=0,i=A.length;e<i;e++)n=A[e],a.set(n,o),o+=n.length;return a}},a={arraySet:function(A,e,i,t,o){for(var n=0;n<t;n++)A[o+n]=e[i+n]},flattenChunks:function(A){return[].concat.apply([],A)}};e.setTyped=function(A){A?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(t)},function(A,e,i){var t=i(103),o=i(560),n=i(352),a=Object.defineProperty;e.f=i(132)?Object.defineProperty:function(A,e,i){if(t(A),e=n(e,!0),t(i),o)try{return a(A,e,i)}catch(A){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(A[e]=i.value),A}},function(A,e){A.exports=function(A){return"object"==typeof A?null!==A:"function"==typeof A}},function(A,e,i){A.exports=!i(169)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(A,e,i){"use strict";i.r(e),i.d(e,"default",function(){return z}),i.d(e,"guiInitialState",function(){return L}),i.d(e,"guiMiddleware",function(){return H}),i.d(e,"initEmbedded",function(){return _}),i.d(e,"initFullScreen",function(){return x}),i.d(e,"initPlayer",function(){return P}),i.d(e,"initTelemetryModal",function(){return J}),i.d(e,"initTutorialCard",function(){return j});var t=i(41),o=i(35),n=i(204),a=i(61),r=i(140),s=i(155),g=i(178),l=i(205),c=i(19),u=i(112),B=i(43),d=i(206),E=i(24),h=i(60),C=i(207),w=i(105),m=i(86),p=i(13),I=i(113),f=i(208),Q=i(114),D=i(117),M=i(156),b=i(209),y=i(210),T=i(11),k=i.n(T),F=i(42),v="scratch-gui/vm/SET_VM",S=new k.a;S.attachStorage(F.a);var N=S;window.vm=S;var R=i(119),O=i(211),Y=i(707),U=i.n(Y),G=i(65),H=Object(t.d)(Object(t.a)(U()(300,{leading:!0,trailing:!0}))),L={alerts:o.a,assetDrag:n.a,blockDrag:l.a,cards:a.b,colorPicker:r.b,connectionModal:s.a,customProcedures:g.b,editorTab:c.g,mode:h.b,hoveredTarget:u.b,stageSize:D.c,menus:B.l,micIndicator:d.b,modals:E.l,monitors:C.b,monitorLayout:w.d,projectChanged:m.b,projectState:p.A,projectTitle:I.b,fontsLoaded:f.b,restoreDeletion:Q.b,targets:M.c,timeout:b.c,toolbox:y.b,vm:N,vmStatus:R.e,workspaceMetrics:O.c},P=function(A){return Object.assign({},A,{mode:{isFullScreen:A.mode.isFullScreen,isPlayerOnly:!0,hasEverEnteredEditor:!1}})},x=function(A){return Object.assign({},A,{mode:{isFullScreen:!0,isPlayerOnly:A.mode.isPlayerOnly,hasEverEnteredEditor:A.mode.hasEverEnteredEditor}})},_=function(A){return Object.assign({},A,{mode:{showBranding:!0,isFullScreen:!0,isPlayerOnly:!0,hasEverEnteredEditor:!1}})},j=function(A,e){return Object.assign({},A,{cards:{visible:!0,content:G.a,activeDeckId:e,expanded:!0,step:0,x:0,y:0,dragging:!1}})},J=function(A){return Object.assign({},A,{modals:{telemetryModal:!0}})},z=Object(t.c)({alerts:o.d,assetDrag:n.b,blockDrag:l.b,cards:a.d,colorPicker:r.d,connectionModal:s.b,customProcedures:g.d,editorTab:c.f,mode:h.a,hoveredTarget:u.a,stageSize:D.a,menus:B.g,micIndicator:d.a,modals:E.k,monitors:C.a,monitorLayout:w.b,projectChanged:m.a,projectState:p.d,projectTitle:I.a,fontsLoaded:f.a,restoreDeletion:Q.a,targets:M.a,timeout:b.a,toolbox:y.a,vm:function(A,e){switch(void 0===A&&(A=N),e.type){case v:return window.vm=e.vm,e.vm;default:return A}},vmStatus:R.a,workspaceMetrics:O.a})},function(A,e,i){"use strict";var t=i(1),o=i.n(t),n=i(2),a=i(651),r=i.n(a),s=i(652),g=i.n(s),l=i(653),c=i.n(l),u=i(654),B=i.n(u),d=i(655),E=i.n(d),h=i(656),C=i.n(h),w=i(657),m=i.n(w),p=i(658),I=i.n(p),f=i(659),Q=i.n(f),D=i(660),M=i.n(D),b=i(661),y=i.n(b),T=i(662),k=i.n(T),F=i(663),v=i.n(F),S=i(260),N=i.n(S),R=i(664),O=i.n(R),Y=i(665),U=i.n(Y),G=i(261),H=i.n(G),L=i(666),P=i.n(L),x=i(667),_=i.n(x),j=i(262),J=i.n(j),z=i(668),K=i.n(z),W=i(669),V=i.n(W),X=i(670),Z=i.n(X),q=i(263),$=i.n(q),AA=i(671),eA=i.n(AA),iA=i(672),tA=i.n(iA),oA=i(673),nA=i.n(oA),aA=i(264),rA=i.n(aA),sA=i(674),gA=i.n(sA);e.a=[{name:o.a.createElement(n.a,{defaultMessage:"Music",id:"gui.extension.music.name"}),extensionId:"music",iconURL:r.a,insetIconURL:g.a,description:o.a.createElement(n.a,{defaultMessage:"Play instruments and drums.",id:"gui.extension.music.description"}),featured:!0},{name:o.a.createElement(n.a,{defaultMessage:"Pen",id:"gui.extension.pen.name"}),extensionId:"pen",iconURL:c.a,insetIconURL:B.a,description:o.a.createElement(n.a,{defaultMessage:"Draw with your sprites.",id:"gui.extension.pen.description"}),featured:!0},{name:o.a.createElement(n.a,{defaultMessage:"Video Sensing",id:"gui.extension.videosensing.name"}),extensionId:"videoSensing",iconURL:E.a,insetIconURL:C.a,description:o.a.createElement(n.a,{defaultMessage:"Sense motion with the camera.",id:"gui.extension.videosensing.description"}),featured:!0},{name:o.a.createElement(n.a,{defaultMessage:"Text to Speech",id:"gui.extension.text2speech.name"}),extensionId:"text2speech",collaborator:"Amazon Web Services",iconURL:m.a,insetIconURL:I.a,description:o.a.createElement(n.a,{defaultMessage:"Make your projects talk.",id:"gui.extension.text2speech.description"}),featured:!0,internetConnectionRequired:!0},{name:o.a.createElement(n.a,{defaultMessage:"Translate",id:"gui.extension.translate.name"}),extensionId:"translate",collaborator:"Google",iconURL:Q.a,insetIconURL:M.a,description:o.a.createElement(n.a,{defaultMessage:"Translate text into many languages.",id:"gui.extension.translate.description"}),featured:!0,internetConnectionRequired:!0},{name:"Makey Makey",extensionId:"makeymakey",collaborator:"JoyLabz",iconURL:y.a,insetIconURL:k.a,description:o.a.createElement(n.a,{defaultMessage:"Make anything into a key.",id:"gui.extension.makeymakey.description"}),featured:!0},{name:"micro:bit",extensionId:"microbit",collaborator:"micro:bit",iconURL:v.a,insetIconURL:N.a,description:o.a.createElement(n.a,{defaultMessage:"Connect your projects with the world.",id:"gui.extension.microbit.description"}),featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!1,connectionIconURL:O.a,connectionSmallIconURL:N.a,connectingMessage:o.a.createElement(n.a,{defaultMessage:"Connecting",id:"gui.extension.microbit.connectingMessage"}),helpLink:"https://scratch.mit.edu/microbit"},{name:"LEGO MINDSTORMS EV3",extensionId:"ev3",collaborator:"LEGO",iconURL:U.a,insetIconURL:H.a,description:o.a.createElement(n.a,{defaultMessage:"Build interactive robots and more.",id:"gui.extension.ev3.description"}),featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!1,connectionIconURL:P.a,connectionSmallIconURL:H.a,connectingMessage:o.a.createElement(n.a,{defaultMessage:"Connecting. Make sure the pin on your EV3 is set to 1234.",id:"gui.extension.ev3.connectingMessage"}),helpLink:"https://scratch.mit.edu/ev3"},{name:"LEGO BOOST",extensionId:"boost",collaborator:"LEGO",iconURL:Z.a,insetIconURL:$.a,description:o.a.createElement(n.a,{defaultMessage:"Bring robotic creations to life.",id:"gui.extension.boost.description"}),featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!0,connectionIconURL:eA.a,connectionSmallIconURL:$.a,connectionTipIconURL:tA.a,connectingMessage:o.a.createElement(n.a,{defaultMessage:"Connecting",id:"gui.extension.boost.connectingMessage"}),helpLink:"https://scratch.mit.edu/boost"},{name:"LEGO Education WeDo 2.0",extensionId:"wedo2",collaborator:"LEGO",iconURL:_.a,insetIconURL:J.a,description:o.a.createElement(n.a,{defaultMessage:"Build with motors and sensors.",id:"gui.extension.wedo2.description"}),featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!0,connectionIconURL:K.a,connectionSmallIconURL:J.a,connectionTipIconURL:V.a,connectingMessage:o.a.createElement(n.a,{defaultMessage:"Connecting",id:"gui.extension.wedo2.connectingMessage"}),helpLink:"https://scratch.mit.edu/wedo"},{name:"Go Direct Force & Acceleration",extensionId:"gdxfor",collaborator:"Vernier",iconURL:nA.a,insetIconURL:rA.a,description:o.a.createElement(n.a,{defaultMessage:"Sense push, pull, motion, and spin.",id:"gui.extension.gdxfor.description"}),featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!1,connectionIconURL:gA.a,connectionSmallIconURL:rA.a,connectingMessage:o.a.createElement(n.a,{defaultMessage:"Connecting",id:"gui.extension.gdxfor.connectingMessage"}),helpLink:"https://scratch.mit.edu/vernier"}]},function(A,e,i){A.exports=i.p+"static/assets/e587d9d7e9a2f1f28041ba5c15db7a40.svg"},function(A,e,i){A.exports=i.p+"static/assets/301439e2e5ab88b658368ee525e6752b.svg"},function(A,e,i){A.exports=i.p+"static/assets/551aae506dfa65ce3b45713b5300a678.svg"},function(A,e,i){"use strict";i.d(e,"a",function(){return m});var t=i(5),o=i.n(t),n=i(1),a=i.n(n),r=i(0),s=i.n(r),g=i(6),l=i(13);function c(A){"@babel/helpers - typeof";return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var u=["isFetchingWithoutId","reduxProjectId","setProjectId"];function B(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function d(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function E(A,e){return(E=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function h(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=w(A);if(e){var o=w(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===c(e)||"function"==typeof e))return e;return C(A)}(this,i)}}function C(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function w(A){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var m=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&E(A,e)}(t,a.a.Component);var i=h(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),o()(C(e),["handleHashChange"]),e}return function(A,e,i){e&&d(A.prototype,e),i&&d(A,i)}(t,[{key:"componentDidMount",value:function(){window.addEventListener("hashchange",this.handleHashChange),this.handleHashChange()}},{key:"componentDidUpdate",value:function(A){this.props.isFetchingWithoutId&&!A.isFetchingWithoutId&&history.pushState("new-project","new-project",window.location.pathname+window.location.search)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("hashchange",this.handleHashChange)}},{key:"handleHashChange",value:function(){var A=window.location.hash.match(/#(\d+)/),e=null===A?l.e:A[1];this.props.setProjectId(e.toString())}},{key:"render",value:function(){var e=this.props,i=(e.isFetchingWithoutId,e.reduxProjectId,e.setProjectId,B(e,u));return a.a.createElement(A,i)}}]),t}();e.propTypes={isFetchingWithoutId:s.a.bool,reduxProjectId:s.a.oneOfType([s.a.string,s.a.number]),setProjectId:s.a.func};return Object(g.b)(function(A){var e=A.scratchGui.projectState.loadingState;return{isFetchingWithoutId:Object(l.m)(e),reduxProjectId:A.scratchGui.projectState.projectId}},function(A){return{setProjectId:function(e){A(Object(l.F)(e))}}},function(A,e,i){return Object.assign({},A,e,i)})(e)}},function(A,e,i){"use strict";var t=i(5),o=i.n(t),n=i(0),a=i.n(n),r=i(1),s=i.n(r),g=i(11),l=i.n(g),c=i(6),u=i(4),B=i.n(u),d=i(2),E=i(284),h=i.n(E),C=i(376),w=i.n(C),m=["active","className","onClick","title"];function p(){return(p=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function I(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var f=function(A){var e=A.active,i=A.className,t=A.onClick,o=A.title,n=I(A,m);return s.a.createElement("img",p({className:B()(i,w.a.greenFlag,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},w.a.isActive,e)),draggable:!1,src:h.a,title:o,onClick:t},n))};f.propTypes={active:a.a.bool,className:a.a.string,onClick:a.a.func.isRequired,title:a.a.string},f.defaultProps={active:!1,title:"Go"};var Q=f,D=i(806),M=i.n(D),b=i(377),y=i.n(b),T=["active","className","onClick","title"];function k(){return(k=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function F(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var v=function(A){var e=A.active,i=A.className,t=A.onClick,o=A.title,n=F(A,T);return s.a.createElement("img",k({className:B()(i,y.a.stopAll,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},y.a.isActive,e)),draggable:!1,src:M.a,title:o,onClick:t},n))};v.propTypes={active:a.a.bool,className:a.a.string,onClick:a.a.func.isRequired,title:a.a.string},v.defaultProps={active:!1,title:"Stop"};var S=v,N=i(807),R=i.n(N),O=i(304),Y=i.n(O),U=function(){return s.a.createElement("div",{className:Y.a.turboContainer},s.a.createElement("img",{className:Y.a.turboIcon,src:R.a}),s.a.createElement("div",{className:Y.a.turboLabel},s.a.createElement(d.a,{defaultMessage:"Turbo Mode",id:"gui.turboMode.active"})))},G=i(808),H=i.n(G),L=["active","className","intl","onGreenFlagClick","onStopAllClick","turbo"];function P(){return(P=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function x(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var _=Object(d.d)({goTitle:{id:"gui.controls.go",defaultMessage:"Go"},stopTitle:{id:"gui.controls.stop",defaultMessage:"Stop"}}),j=function(A){var e=A.active,i=A.className,t=A.intl,o=A.onGreenFlagClick,n=A.onStopAllClick,a=A.turbo,r=x(A,L);return s.a.createElement("div",P({className:B()(H.a.controlsContainer,i)},r),s.a.createElement(Q,{active:e,title:t.formatMessage(_.goTitle),onClick:o}),s.a.createElement(S,{active:e,title:t.formatMessage(_.stopTitle),onClick:n}),a?s.a.createElement(U,null):null)};j.propTypes={active:a.a.bool,className:a.a.string,intl:d.f.isRequired,onGreenFlagClick:a.a.func.isRequired,onStopAllClick:a.a.func.isRequired,turbo:a.a.bool},j.defaultProps={active:!1,turbo:!1};var J=Object(d.e)(j);function z(A){"@babel/helpers - typeof";return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var K=["vm","isStarted","projectRunning","turbo"];function W(){return(W=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function V(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function X(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Z(A,e){return(Z=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function q(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=AA(A);if(e){var o=AA(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===z(e)||"function"==typeof e))return e;return $(A)}(this,i)}}function $(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function AA(A){return(AA=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var eA=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Z(A,e)}(i,s.a.Component);var e=q(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),o()($(t),["handleGreenFlagClick","handleStopAllClick"]),t}return function(A,e,i){e&&X(A.prototype,e),i&&X(A,i)}(i,[{key:"handleGreenFlagClick",value:function(A){A.preventDefault(),A.shiftKey?this.props.vm.setTurboMode(!this.props.turbo):(this.props.isStarted||this.props.vm.start(),this.props.vm.greenFlag())}},{key:"handleStopAllClick",value:function(A){A.preventDefault(),this.props.vm.stopAll(),mv2Interface.send_REST("robot/stop")}},{key:"render",value:function(){var A=this.props,e=(A.vm,A.isStarted,A.projectRunning),i=A.turbo,t=V(A,K);return s.a.createElement(J,W({},t,{active:e,turbo:i,onGreenFlagClick:this.handleGreenFlagClick,onStopAllClick:this.handleStopAllClick}))}}]),i}();eA.propTypes={isStarted:a.a.bool.isRequired,projectRunning:a.a.bool.isRequired,turbo:a.a.bool.isRequired,vm:a.a.instanceOf(l.a)};e.a=Object(c.b)(function(A){return{isStarted:A.scratchGui.vmStatus.running,projectRunning:A.scratchGui.vmStatus.running,turbo:A.scratchGui.vmStatus.turbo}},function(){return{}})(eA)},function(A,e,i){"use strict";i.d(e,"d",function(){return n}),i.d(e,"b",function(){return o}),i.d(e,"a",function(){return a}),i.d(e,"c",function(){return r});var t="scratch-gui/color-picker/SET_CALLBACK",o={active:!1,callback:function(){throw new Error("Color picker callback not initialized")}},n=function(A,e){switch(void 0===A&&(A=o),e.type){case"scratch-gui/color-picker/ACTIVATE_COLOR_PICKER":return Object.assign({},A,{active:!0,callback:e.callback});case"scratch-gui/color-picker/DEACTIVATE_COLOR_PICKER":return"string"==typeof e.color&&A.callback(e.color),Object.assign({},A,{active:!1});case t:return Object.assign({},A,{callback:e.callback});default:return A}},a=function(A){return{type:"scratch-gui/color-picker/ACTIVATE_COLOR_PICKER",callback:A}},r=function(A){return{type:"scratch-gui/color-picker/DEACTIVATE_COLOR_PICKER",color:A}}},function(A,e,i){A.exports=i.p+"static/assets/cb666b99d3528f91b52f985dfb102afa.svg"},function(A){A.exports=JSON.parse('[{"name":"Arctic","tags":["outdoors","cold","north pole","south pole","ice","antarctica","robert hunter"],"assetId":"67e0db3305b3c8bac3a363b1c428892e","bitmapResolution":2,"dataFormat":"png","md5ext":"67e0db3305b3c8bac3a363b1c428892e.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Baseball 1","tags":["baseball","sports","outdoors","alex eben meyer"],"assetId":"825d9b54682c406215d9d1f98a819449","bitmapResolution":1,"dataFormat":"svg","md5ext":"825d9b54682c406215d9d1f98a819449.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Baseball 2","tags":["baseball","sports","outdoors","alex eben meyer"],"assetId":"7be1f5b3e682813dac1f297e52ff7dca","bitmapResolution":1,"dataFormat":"svg","md5ext":"7be1f5b3e682813dac1f297e52ff7dca.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Basketball 1","tags":["sports","outdoors","basketball","alex eben meyer"],"assetId":"ae21eac3d1814aee1d37ae82ea287816","bitmapResolution":1,"dataFormat":"svg","md5ext":"ae21eac3d1814aee1d37ae82ea287816.svg","rotationCenterX":249,"rotationCenterY":186},{"name":"Basketball 2","tags":["outdoors","sports","basketball"],"assetId":"a5865738283613a2725b2c9dda6d8c78","bitmapResolution":2,"dataFormat":"png","md5ext":"a5865738283613a2725b2c9dda6d8c78.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Beach Malibu","tags":["outdoors"],"assetId":"050615fe992a00d6af0e664e497ebf53","bitmapResolution":2,"dataFormat":"png","md5ext":"050615fe992a00d6af0e664e497ebf53.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Beach Rio","tags":["outdoors"],"assetId":"968f0ede6e70e1dbb763d6fd4c5003e0","bitmapResolution":2,"dataFormat":"png","md5ext":"968f0ede6e70e1dbb763d6fd4c5003e0.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Bedroom 1","tags":["bedroom","indoors"],"assetId":"7aa6bbb2ddc4c10f901e1a50aeac1c7e","bitmapResolution":2,"dataFormat":"png","md5ext":"7aa6bbb2ddc4c10f901e1a50aeac1c7e.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Bedroom 2","tags":["indoors"],"assetId":"e2f8b0dbd0a65d2ad8bfc21616662a6a","bitmapResolution":2,"dataFormat":"png","md5ext":"e2f8b0dbd0a65d2ad8bfc21616662a6a.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Bedroom 3","tags":["indoors"],"assetId":"8cc0b88d53345b3e337e8f028a32a4e7","bitmapResolution":2,"dataFormat":"png","md5ext":"8cc0b88d53345b3e337e8f028a32a4e7.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Bench With View","tags":["outdoors","hill","view"],"assetId":"962201a2b712a302fb087f8f0dcb2076","bitmapResolution":2,"dataFormat":"png","md5ext":"962201a2b712a302fb087f8f0dcb2076.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Blue Sky","tags":["outdoors","flying"],"assetId":"e7c147730f19d284bcd7b3f00af19bb6","bitmapResolution":1,"dataFormat":"svg","md5ext":"e7c147730f19d284bcd7b3f00af19bb6.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Blue Sky 2 ","tags":["outdoors","flying"],"assetId":"8eb8790be5507fdccf73e7c1570bbbab","bitmapResolution":1,"dataFormat":"svg","md5ext":"8eb8790be5507fdccf73e7c1570bbbab.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Boardwalk","tags":["outdoors","ocean"],"assetId":"de0e54cd11551566f044e7e6bc588b2c","bitmapResolution":2,"dataFormat":"png","md5ext":"de0e54cd11551566f044e7e6bc588b2c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Canyon","tags":["outdoors","nature"],"assetId":"c7c0b27b959193a0b570a9639cfe8158","bitmapResolution":2,"dataFormat":"png","md5ext":"c7c0b27b959193a0b570a9639cfe8158.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Castle 1","tags":["fantasy"],"assetId":"e1914ed7917267f1c2ef2b48004cade9","bitmapResolution":2,"dataFormat":"png","md5ext":"e1914ed7917267f1c2ef2b48004cade9.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Castle 2","tags":["fantasy"],"assetId":"951765ee7f7370f120c9df20b577c22f","bitmapResolution":2,"dataFormat":"png","md5ext":"951765ee7f7370f120c9df20b577c22f.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Castle 3","tags":["fantasy"],"assetId":"76fa99f67569fcd39b4be74ed38c33f3","bitmapResolution":2,"dataFormat":"png","md5ext":"76fa99f67569fcd39b4be74ed38c33f3.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Castle 4","tags":["fantasy"],"assetId":"4f45f79af8e8dac3d41eb5a06ade61d4","bitmapResolution":2,"dataFormat":"png","md5ext":"4f45f79af8e8dac3d41eb5a06ade61d4.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Chalkboard","tags":["indoors","school"],"assetId":"a8a24b5aa717bbef09dbe31368914427","bitmapResolution":2,"dataFormat":"png","md5ext":"a8a24b5aa717bbef09dbe31368914427.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Circles","tags":["patterns"],"assetId":"c9847be305920807c5597d81576dd0c4","bitmapResolution":1,"dataFormat":"svg","md5ext":"c9847be305920807c5597d81576dd0c4.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"City With Water","tags":["outdoors","boston"],"assetId":"1ef98019fc94ea65a1b55d5521285c7a","bitmapResolution":2,"dataFormat":"png","md5ext":"1ef98019fc94ea65a1b55d5521285c7a.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Colorful City","tags":["city","town","road","skyline","outdoors"],"assetId":"04d18ddd1b85f0ea30beb14b8da49f60","bitmapResolution":2,"dataFormat":"png","md5ext":"04d18ddd1b85f0ea30beb14b8da49f60.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Concert","tags":["indoors","music","andrew rae"],"assetId":"c8d90320d2966c08af8cdd1c6a7a93b5","bitmapResolution":2,"dataFormat":"png","md5ext":"c8d90320d2966c08af8cdd1c6a7a93b5.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Desert","tags":["desert"," landscape"," outdoors"," cacti"],"assetId":"d98a9526a34890cf4bad11b5409eae2a","bitmapResolution":2,"dataFormat":"png","md5ext":"d98a9526a34890cf4bad11b5409eae2a.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Farm","tags":["outdoors","chicken","barn","coup","owen davey"],"assetId":"1e8a70bd07f1dcba3383883f3b948266","bitmapResolution":2,"dataFormat":"png","md5ext":"1e8a70bd07f1dcba3383883f3b948266.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Field At Mit","tags":["outdoors","architecture"],"assetId":"5b0a970202b464915915260c03f05455","bitmapResolution":2,"dataFormat":"png","md5ext":"5b0a970202b464915915260c03f05455.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Flowers","tags":["outdoors","nature"],"assetId":"25a6ede51a96d4e55de2ffb81ae96f8c","bitmapResolution":2,"dataFormat":"png","md5ext":"25a6ede51a96d4e55de2ffb81ae96f8c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Forest","tags":["outdoors","forest"],"assetId":"92968ac16b2f0c3f7835a6dacd172c7b","bitmapResolution":2,"dataFormat":"png","md5ext":"92968ac16b2f0c3f7835a6dacd172c7b.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Galaxy","tags":["space","stars","nasa"],"assetId":"5fab1922f254ae9fd150162c3e392bef","bitmapResolution":2,"dataFormat":"png","md5ext":"5fab1922f254ae9fd150162c3e392bef.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Garden-rock","tags":["outdoors"," garden"," park"],"assetId":"4f66053598bea0905e1559ab9d5a6e31","bitmapResolution":2,"dataFormat":"png","md5ext":"4f66053598bea0905e1559ab9d5a6e31.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Greek Theater","tags":["outdoors","theatre"],"assetId":"93d71e8b8a96cc007b8d68f36acd338a","bitmapResolution":2,"dataFormat":"png","md5ext":"93d71e8b8a96cc007b8d68f36acd338a.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Hall","tags":["indoors"],"assetId":"ea86ca30b346f27ca5faf1254f6a31e3","bitmapResolution":2,"dataFormat":"png","md5ext":"ea86ca30b346f27ca5faf1254f6a31e3.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Hay Field","tags":["outdoors","farm"],"assetId":"da102a69d135973e0fc139131dec785a","bitmapResolution":2,"dataFormat":"png","md5ext":"da102a69d135973e0fc139131dec785a.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Hearts","tags":["patterns"],"assetId":"f98526ccb0eec3ac7d6c8f8ab502825e","bitmapResolution":1,"dataFormat":"svg","md5ext":"f98526ccb0eec3ac7d6c8f8ab502825e.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Hill","tags":["outdoors","nature"],"assetId":"2129c842f28d6881f622fdc3497ff2da","bitmapResolution":2,"dataFormat":"png","md5ext":"2129c842f28d6881f622fdc3497ff2da.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Jungle","tags":["outdoors","forest","robert hunter"],"assetId":"f4f908da19e2753f3ed679d7b37650ca","bitmapResolution":2,"dataFormat":"png","md5ext":"f4f908da19e2753f3ed679d7b37650ca.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Jurassic","tags":["outdoors","dinosaur","alex eben meyer"],"assetId":"64025bdca5db4938f65597e3682fddcf","bitmapResolution":1,"dataFormat":"svg","md5ext":"64025bdca5db4938f65597e3682fddcf.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Light","tags":["patterns"],"assetId":"4b98c07876ed8997c3762e75790507b4","bitmapResolution":1,"dataFormat":"svg","md5ext":"4b98c07876ed8997c3762e75790507b4.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Metro","tags":["outdoors","city","urban"],"assetId":"0b4a15ba028bf205ec051390d6ac4de7","bitmapResolution":2,"dataFormat":"png","md5ext":"0b4a15ba028bf205ec051390d6ac4de7.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Moon","tags":["space","nasa","apollo"],"assetId":"0b1d2eaf22d62ef88de80ccde5578fba","bitmapResolution":2,"dataFormat":"png","md5ext":"0b1d2eaf22d62ef88de80ccde5578fba.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Mountain","tags":["outdoors","snow","cave","robert hunter"],"assetId":"f84989feee2cf462a1c597169777ee3c","bitmapResolution":2,"dataFormat":"png","md5ext":"f84989feee2cf462a1c597169777ee3c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Mural","tags":["outdoors","mural","graffiti","street","art"],"assetId":"efb625f7e0b199b15f69e116cd053cea","bitmapResolution":2,"dataFormat":"png","md5ext":"efb625f7e0b199b15f69e116cd053cea.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Nebula","tags":["space","nasa","bubble","hubble"],"assetId":"9b5cdbd596da1b6149f56b794b6394f4","bitmapResolution":2,"dataFormat":"png","md5ext":"9b5cdbd596da1b6149f56b794b6394f4.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Neon Tunnel","tags":["games","game","space"],"assetId":"57d2b13b2f73d3d878c72810c137b0d6","bitmapResolution":2,"dataFormat":"png","md5ext":"57d2b13b2f73d3d878c72810c137b0d6.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Night City","tags":["outdoors","urban","city","metro"],"assetId":"6fdc795ff487204f72740567be5f64f9","bitmapResolution":2,"dataFormat":"png","md5ext":"6fdc795ff487204f72740567be5f64f9.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Night City With Street","tags":["urban","city","metro","transportation"],"assetId":"14443ad7907b6479d7562a12b8ae0efb","bitmapResolution":2,"dataFormat":"png","md5ext":"14443ad7907b6479d7562a12b8ae0efb.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Party","tags":["indoors","inflatable"],"assetId":"108160d0e44d1c340182e31c9dc0758a","bitmapResolution":1,"dataFormat":"svg","md5ext":"108160d0e44d1c340182e31c9dc0758a.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Pathway","tags":["outdoors","garden"],"assetId":"5d747ec036755a4b129f0d5b978bc61c","bitmapResolution":2,"dataFormat":"png","md5ext":"5d747ec036755a4b129f0d5b978bc61c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Playground","tags":["outdoors","play"],"assetId":"e5f794c8756ca0cead5cb7e7fe354c41","bitmapResolution":2,"dataFormat":"png","md5ext":"e5f794c8756ca0cead5cb7e7fe354c41.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Playing Field","tags":["outdoors","sports"],"assetId":"2de108f3098e92f5c5976cf75d38e99d","bitmapResolution":2,"dataFormat":"png","md5ext":"2de108f3098e92f5c5976cf75d38e99d.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Pool","tags":["outdoors","sports","swim","swimming"],"assetId":"6cab934df643d2fc508cfa90c0c4059b","bitmapResolution":2,"dataFormat":"png","md5ext":"6cab934df643d2fc508cfa90c0c4059b.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Rays","tags":["patterns","raimondious"],"assetId":"87e963282db9e020e8c4d075891ea12b","bitmapResolution":1,"dataFormat":"svg","md5ext":"87e963282db9e020e8c4d075891ea12b.svg","rotationCenterX":240.1199951171875,"rotationCenterY":180},{"name":"Refrigerator","tags":["food","indoors","alex eben meyer"],"assetId":"98f053f9681e872f34fafd783ce72205","bitmapResolution":1,"dataFormat":"svg","md5ext":"98f053f9681e872f34fafd783ce72205.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Room 1","tags":["indoors","books","library"],"assetId":"a81668321aa3dcc0fc185d3e36ae76f6","bitmapResolution":2,"dataFormat":"png","md5ext":"a81668321aa3dcc0fc185d3e36ae76f6.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Room 2","tags":["indoors"],"assetId":"05ae3e3bbea890a6e3552ffe8456775e","bitmapResolution":2,"dataFormat":"png","md5ext":"05ae3e3bbea890a6e3552ffe8456775e.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Savanna","tags":["africa","savanna","savanah","outdoors","robert hunter"],"assetId":"9b020b8c7cb6a9592f7303add9441d8f","bitmapResolution":2,"dataFormat":"png","md5ext":"9b020b8c7cb6a9592f7303add9441d8f.png","rotationCenterX":480,"rotationCenterY":360},{"name":"School","tags":["outdoors","building","education","learning"],"assetId":"1dea69ac0f62cf538d368a7bde1372ac","bitmapResolution":2,"dataFormat":"png","md5ext":"1dea69ac0f62cf538d368a7bde1372ac.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Slopes","tags":["outdoors","winter","ski","snowboard","cold","snow"],"assetId":"63b6a69594a0a87888b56244bfa2ac1b","bitmapResolution":2,"dataFormat":"png","md5ext":"63b6a69594a0a87888b56244bfa2ac1b.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Soccer","tags":["soccer","football","sports","alex eben meyer"],"assetId":"04a63154f04b09494354090f7cc2f1b9","bitmapResolution":2,"dataFormat":"png","md5ext":"04a63154f04b09494354090f7cc2f1b9.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Soccer 2","tags":["soccer","football","sports","alex eben meyer"],"assetId":"b0dc1268cb595aaeef405bce40d1639c","bitmapResolution":2,"dataFormat":"png","md5ext":"b0dc1268cb595aaeef405bce40d1639c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Space","tags":["space","moon","science fiction","planet","wren mcdonald"],"assetId":"84208d9a3718ec3c9fc5a32a792fa1d0","bitmapResolution":2,"dataFormat":"png","md5ext":"84208d9a3718ec3c9fc5a32a792fa1d0.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Space City 1","tags":["space","moon","science fiction","planet","wren mcdonald"],"assetId":"20344b0edcc498281e4cb80242a72667","bitmapResolution":2,"dataFormat":"png","md5ext":"20344b0edcc498281e4cb80242a72667.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Space City 2","tags":["space","moon","science fiction","planet","wren mcdonald"],"assetId":"32b2316fd375faa18088f6c57ebb1c8d","bitmapResolution":2,"dataFormat":"png","md5ext":"32b2316fd375faa18088f6c57ebb1c8d.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Spaceship","tags":["space","moon","science fiction","planet","wren mcdonald"],"assetId":"0c450891306fa63ef02aa0fda7fd0ef9","bitmapResolution":2,"dataFormat":"png","md5ext":"0c450891306fa63ef02aa0fda7fd0ef9.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Spotlight","tags":["music","dance"],"assetId":"d26bf4c3980163d9106625cc2ea6c50d","bitmapResolution":2,"dataFormat":"png","md5ext":"d26bf4c3980163d9106625cc2ea6c50d.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Stars","tags":["space","nasa"],"assetId":"47282ff0f7047c6fab9c94b531abf721","bitmapResolution":2,"dataFormat":"png","md5ext":"47282ff0f7047c6fab9c94b531abf721.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Stripes","tags":["patterns"],"assetId":"a6a21f5c08d586e8daaebde37c97fb6f","bitmapResolution":1,"dataFormat":"svg","md5ext":"a6a21f5c08d586e8daaebde37c97fb6f.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Theater","tags":["indoors","music","andrew rae"],"assetId":"c2b097bc5cdb6a14ef5485202bc5ee76","bitmapResolution":2,"dataFormat":"png","md5ext":"c2b097bc5cdb6a14ef5485202bc5ee76.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Theater 2","tags":["music"],"assetId":"061a78ed83495dd0acd6d62e83e1b972","bitmapResolution":2,"dataFormat":"png","md5ext":"061a78ed83495dd0acd6d62e83e1b972.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Tree","tags":["outdoors","nature"],"assetId":"a23fbf972001c94637b568992f8fd7bd","bitmapResolution":2,"dataFormat":"png","md5ext":"a23fbf972001c94637b568992f8fd7bd.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Underwater 1","tags":["ocean","outdoors","underwater","ipzy"],"assetId":"d3344650f594bcecdf46aa4a9441badd","bitmapResolution":1,"dataFormat":"svg","md5ext":"d3344650f594bcecdf46aa4a9441badd.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Underwater 2","tags":["outdoors","nature","underwater"],"assetId":"1517c21786d2d0edc2f3037408d850bd","bitmapResolution":2,"dataFormat":"png","md5ext":"1517c21786d2d0edc2f3037408d850bd.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Urban","tags":["outdoors","city","metro","transportation"],"assetId":"1679049718869e1f548e1e8823e29c1c","bitmapResolution":2,"dataFormat":"png","md5ext":"1679049718869e1f548e1e8823e29c1c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Wall 1","tags":["outdoors","brick"],"assetId":"7e5327c68ff6ddabc48dbfe4717a04fe","bitmapResolution":2,"dataFormat":"png","md5ext":"7e5327c68ff6ddabc48dbfe4717a04fe.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Wall 2","tags":["outdoors","brick"],"assetId":"82d867fcd9f1b5f49e29c2f853d55665","bitmapResolution":2,"dataFormat":"png","md5ext":"82d867fcd9f1b5f49e29c2f853d55665.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Water And Rocks","tags":["outdoors","nature","tree","river","stream"],"assetId":"0015433a406a53f00b792424b823268c","bitmapResolution":2,"dataFormat":"png","md5ext":"0015433a406a53f00b792424b823268c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Wetland","tags":["outdoor","nature","swamp","wetland","owen davey"],"assetId":"ef9973bcff6d4cbc558e946028ec7d23","bitmapResolution":2,"dataFormat":"png","md5ext":"ef9973bcff6d4cbc558e946028ec7d23.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Winter","tags":["outdoors","trees","forest","winter"],"assetId":"5fa9385a60b904672d0e46e9d768bb32","bitmapResolution":1,"dataFormat":"svg","md5ext":"5fa9385a60b904672d0e46e9d768bb32.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Witch House","tags":["fantasy","indoors","ipzy"],"assetId":"30085b2d27beb5acdbe895d8b3e64b04","bitmapResolution":1,"dataFormat":"svg","md5ext":"30085b2d27beb5acdbe895d8b3e64b04.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Woods","tags":["fantasy","spooky","halloween","outdoors","haunted","forest","alex eben meyer"],"assetId":"f3eb165d6f3fd23370f97079f2e631bf","bitmapResolution":1,"dataFormat":"svg","md5ext":"f3eb165d6f3fd23370f97079f2e631bf.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Woods And Bench","tags":["outdoors","park"],"assetId":"4fcf7ed0de6c6b6e9b52c511b0650e9c","bitmapResolution":2,"dataFormat":"png","md5ext":"4fcf7ed0de6c6b6e9b52c511b0650e9c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Xy-grid","tags":["grid","xy","coordinates"],"assetId":"9838d02002d05f88dc54d96494fbc202","bitmapResolution":2,"dataFormat":"png","md5ext":"9838d02002d05f88dc54d96494fbc202.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Xy-grid-20px","tags":["grid","xy","coordinates"],"assetId":"4eec0e1db92b8dea3e5bee25105e8f46","bitmapResolution":2,"dataFormat":"png","md5ext":"4eec0e1db92b8dea3e5bee25105e8f46.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Xy-grid-30px","tags":["grid","xy","coordinates"],"assetId":"3b8bcabd0ac683b7cb3673208039764b","bitmapResolution":2,"dataFormat":"png","md5ext":"3b8bcabd0ac683b7cb3673208039764b.png","rotationCenterX":480,"rotationCenterY":360}]')},function(A,e,i){"use strict";var t=i(1008).default;i(1015),(e=A.exports=t).default=e},function(A,e,i){"use strict";var t,o=i(0),n=i.n(o),a=i(1),r=i.n(a),s=i(4),g=i.n(s),l=i(145),c=i.n(l),u=i(141),B=i.n(u),d=i(749),E=i.n(d),h=i(277),C=i.n(h);function w(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var m={},p=function A(e){var i;return r.a.createElement("div",{"aria-label":"Close",className:g()(c.a.closeButton,e.className,(i={},w(i,c.a.small,e.size===A.SIZE_SMALL),w(i,c.a.large,e.size===A.SIZE_LARGE),w(i,c.a.orange,e.color===A.COLOR_ORANGE),i)),role:"button",tabIndex:"0",onClick:e.onClick},"back"===e.buttonType?r.a.createElement("img",{className:c.a.backIcon,src:C.a}):r.a.createElement("img",{className:g()(c.a.closeIcon,w({},c.a[e.color],e.color!==A.COLOR_NEUTRAL)),src:e.color&&m[e.color]?m[e.color]:B.a}))};p.SIZE_SMALL="small",p.SIZE_LARGE="large",p.COLOR_NEUTRAL="neutral",p.COLOR_GREEN="green",p.COLOR_ORANGE="orange",w(t={},p.COLOR_NEUTRAL,B.a),w(t,p.COLOR_GREEN,B.a),w(t,p.COLOR_ORANGE,E.a),m=t,p.propTypes={buttonType:n.a.oneOf(["back","close"]),className:n.a.string,color:n.a.string,onClick:n.a.func.isRequired,size:n.a.oneOf([p.SIZE_SMALL,p.SIZE_LARGE])},p.defaultProps={color:p.COLOR_NEUTRAL,size:p.SIZE_LARGE,buttonType:"close"},e.a=p},function(A,e,i){var t=i(1481);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e,i){var t=i(1501);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e,i){var t=i(1519);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e,i){var t=i(1635);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e,i){function t(A,e){var i="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!i){if(Array.isArray(A)||(i=function(A,e){if(!A)return;if("string"==typeof A)return o(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return o(A,e)}(A))||e&&A&&"number"==typeof A.length){i&&(A=i);var t=0,n=function(){};return{s:n,n:function(){return t>=A.length?{done:!0}:{done:!1,value:A[t++]}},e:function(A){throw A},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){i=i.call(A)},n:function(){var A=i.next();return r=A.done,A},e:function(A){s=!0,a=A},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw a}}}}function o(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function n(A){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function a(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var r=i(1083),s=i(459),g=i(237),l=i(318),c=i(125),u=i(190).Map,B=i(466),d=i(467),E=i(39),h=i(126),C=i(319),w=function(){function A(e,i){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.runtime=e,this._blocks={},this._scripts=[],Object.defineProperty(this,"_cache",{writable:!0,enumerable:!1}),this._cache={inputs:{},procedureParamNames:{},procedureDefinitions:{},_executeCached:{},_monitored:null,scripts:{}},this.forceNoGlow=i||!1}return function(A,e,i){e&&a(A.prototype,e),i&&a(A,i)}(A,[{key:"getBlock",value:function(A){return this._blocks[A]}},{key:"getScripts",value:function(){return this._scripts}},{key:"getNextBlock",value:function(A){var e=this._blocks[A];return void 0===e?null:e.next}},{key:"getBranch",value:function(e,i){var t=this._blocks[e];if(void 0===t)return null;i||(i=1);var o=A.BRANCH_INPUT_PREFIX;i>1&&(o+=i);var n=t.inputs[o];return void 0===n?null:n.block}},{key:"getOpcode",value:function(A){return void 0===A?null:A.opcode}},{key:"getFields",value:function(A){return void 0===A?null:A.fields}},{key:"getInputs",value:function(e){if(void 0===e)return null;var i=this._cache.inputs[e.id];if(void 0!==i)return i;for(var t in i={},e.inputs)t.substring(0,A.BRANCH_INPUT_PREFIX.length)!==A.BRANCH_INPUT_PREFIX&&(i[t]=e.inputs[t]);return this._cache.inputs[e.id]=i,i}},{key:"getMutation",value:function(A){return void 0===A?null:A.mutation}},{key:"getTopLevelScript",value:function(A){var e=this._blocks[A];if(void 0===e)return null;for(;null!==e.parent;)e=this._blocks[e.parent];return e.id}},{key:"getProcedureDefinition",value:function(A){var e=this._cache.procedureDefinitions[A];if(void 0!==e)return e;for(var i in this._blocks)if(this._blocks.hasOwnProperty(i)){var t=this._blocks[i];if("procedures_definition"===t.opcode){var o=this._getCustomBlockInternal(t);if(o&&o.mutation.proccode===A)return this._cache.procedureDefinitions[A]=i,i}}return this._cache.procedureDefinitions[A]=null,null}},{key:"getProcedureParamNamesAndIds",value:function(A){return this.getProcedureParamNamesIdsAndDefaults(A).slice(0,2)}},{key:"getProcedureParamNamesIdsAndDefaults",value:function(A){var e=this._cache.procedureParamNames[A];if(void 0!==e)return e;for(var i in this._blocks)if(this._blocks.hasOwnProperty(i)){var t=this._blocks[i];if("procedures_prototype"===t.opcode&&t.mutation.proccode===A){var o=JSON.parse(t.mutation.argumentnames),n=JSON.parse(t.mutation.argumentids),a=JSON.parse(t.mutation.argumentdefaults);return this._cache.procedureParamNames[A]=[o,n,a],this._cache.procedureParamNames[A]}}return this._cache.procedureParamNames[A]=null,null}},{key:"duplicate",value:function(){var e=new A(this.runtime,this.forceNoGlow);return e._blocks=c.simple(this._blocks),e._scripts=c.simple(this._scripts),e}},{key:"blocklyListen",value:function(A){if("object"===n(A)&&("string"==typeof A.blockId||"string"==typeof A.varId||"string"==typeof A.commentId)){var e=this.runtime.getTargetForStage(),i=this.runtime.getEditingTarget();if("stackclick"!==A.element)switch(A.type){case"create":for(var o=r(A),a=0;a<o.length;a++)this.createBlock(o[a]);break;case"change":this.changeBlock({id:A.blockId,element:A.element,name:A.name,value:A.newValue});break;case"move":this.moveBlock({id:A.blockId,oldParent:A.oldParentId,oldInput:A.oldInputName,newParent:A.newParentId,newInput:A.newInputName,newCoordinate:A.newCoordinate});break;case"dragOutside":this.runtime.emitBlockDragUpdate(A.isOutside);break;case"endDrag":if(this.runtime.emitBlockDragUpdate(!1),A.isOutside){var s=r(A);this.runtime.emitBlockEndDrag(s,A.blockId)}break;case"delete":if(!this._blocks.hasOwnProperty(A.blockId)||this._blocks[A.blockId].shadow)return;this._blocks[A.blockId].topLevel&&this.runtime.quietGlow(A.blockId),this.deleteBlock(A.blockId);break;case"var_create":if(A.isLocal&&i&&!i.isStage&&!A.isCloud)i.lookupVariableById(A.varId)||(i.createVariable(A.varId,A.varName,A.varType),this.emitProjectChanged());else{if(e.lookupVariableById(A.varId))return;var g,l=t(this.runtime.targets.filter(function(A){return A.isOriginal}));try{for(l.s();!(g=l.n()).done;){if(g.value.lookupVariableByNameAndType(A.varName,A.varType,!0))return}}catch(A){l.e(A)}finally{l.f()}e.createVariable(A.varId,A.varName,A.varType,A.isCloud),this.emitProjectChanged()}break;case"var_rename":if(i&&i.variables.hasOwnProperty(A.varId))i.renameVariable(A.varId,A.newName),i.blocks.updateBlocksAfterVarRename(A.varId,A.newName);else{e.renameVariable(A.varId,A.newName);for(var c=this.runtime.targets,u=0;u<c.length;u++){c[u].blocks.updateBlocksAfterVarRename(A.varId,A.newName)}}this.emitProjectChanged();break;case"var_delete":(i&&i.variables.hasOwnProperty(A.varId)?i:e).deleteVariable(A.varId),this.emitProjectChanged();break;case"comment_create":if(this.runtime.getEditingTarget()){var B=this.runtime.getEditingTarget();B.createComment(A.commentId,A.blockId,A.text,A.xy.x,A.xy.y,A.width,A.height,A.minimized),null===B.comments[A.commentId].x&&null===B.comments[A.commentId].y&&(B.comments[A.commentId].x=A.xy.x,B.comments[A.commentId].y=A.xy.y)}this.emitProjectChanged();break;case"comment_change":if(this.runtime.getEditingTarget()){var d=this.runtime.getEditingTarget();if(!d.comments.hasOwnProperty(A.commentId))return void E.warn("Cannot change comment with id ".concat(A.commentId," because it does not exist."));var h=d.comments[A.commentId],C=A.newContents_;C.hasOwnProperty("minimized")&&(h.minimized=C.minimized),C.hasOwnProperty("width")&&C.hasOwnProperty("height")&&(h.width=C.width,h.height=C.height),C.hasOwnProperty("text")&&(h.text=C.text),this.emitProjectChanged()}break;case"comment_move":if(this.runtime.getEditingTarget()){var w=this.runtime.getEditingTarget();if(w&&!w.comments.hasOwnProperty(A.commentId))return void E.warn("Cannot change comment with id ".concat(A.commentId," because it does not exist."));var m=w.comments[A.commentId],p=A.newCoordinate_;m.x=p.x,m.y=p.y,this.emitProjectChanged()}break;case"comment_delete":if(this.runtime.getEditingTarget()){var I=this.runtime.getEditingTarget();if(!I.comments.hasOwnProperty(A.commentId))return;if(delete I.comments[A.commentId],A.blockId){var f=I.blocks.getBlock(A.blockId);if(!f)return void E.warn("Could not find block referenced by comment with id: ".concat(A.commentId));delete f.comment}this.emitProjectChanged()}}else this.runtime.toggleScript(A.blockId,{stackClick:!0})}}},{key:"resetCache",value:function(){this._cache.inputs={},this._cache.procedureParamNames={},this._cache.procedureDefinitions={},this._cache._executeCached={},this._cache._monitored=null,this._cache.scripts={}}},{key:"emitProjectChanged",value:function(){this.forceNoGlow||this.runtime.emitProjectChanged()}},{key:"createBlock",value:function(A){this._blocks.hasOwnProperty(A.id)||(this._blocks[A.id]=A,A.topLevel&&this._addScript(A.id),this.resetCache(),this.emitProjectChanged())}},{key:"changeBlock",value:function(A){if(-1!==["field","mutation","checkbox"].indexOf(A.element)){var e=this._blocks[A.id];if(void 0!==e){switch(A.element){case"field":if(!e.fields[A.name])return;if("VARIABLE"===A.name||"LIST"===A.name||"BROADCAST_OPTION"===A.name){var i=this.runtime.getEditingTarget().lookupVariableById(A.value);i&&(e.fields[A.name].value=i.name,e.fields[A.name].id=A.value)}else{e.fields[A.name].value=A.value,"sensing_of_object_menu"===e.opcode&&("_stage_"===e.fields.OBJECT.value?this._blocks[e.parent].fields.PROPERTY.value="backdrop #":this._blocks[e.parent].fields.PROPERTY.value="x position",this.runtime.requestBlocksUpdate());var t=e.shadow&&e.parent?this._blocks[e.parent]:e;t.isMonitored&&this.runtime.requestUpdateMonitor(u({id:t.id,params:this._getBlockParams(t)}))}break;case"mutation":e.mutation=s(A.value);break;case"checkbox":if(e.fields&&Object.keys(e.fields).length>0&&"data_variable"!==e.opcode&&"data_listcontents"!==e.opcode){var o=C(e.id,e.fields),n=this.runtime.monitorBlocks.getBlock(o);n||((n=JSON.parse(JSON.stringify(e))).id=o,this.runtime.monitorBlocks.createBlock(n)),e=n}var a=e.isMonitored;e.isMonitored=A.value;var r=!1;"data_variable"===e.opcode?r=!this.runtime.getTargetForStage().variables[e.fields.VARIABLE.id]:"data_listcontents"===e.opcode&&(r=!this.runtime.getTargetForStage().variables[e.fields.LIST.id]);var g=r||this.runtime.monitorBlockInfo.hasOwnProperty(e.opcode)&&this.runtime.monitorBlockInfo[e.opcode].isSpriteSpecific;e.targetId=g?e.targetId||this.runtime.getEditingTarget().id:null,a&&!e.isMonitored?this.runtime.requestHideMonitor(e.id):!a&&e.isMonitored&&(this.runtime.requestShowMonitor(e.id)||this.runtime.requestAddMonitor(l({id:e.id,targetId:e.targetId,spriteName:e.targetId?this.runtime.getTargetById(e.targetId).getName():null,opcode:e.opcode,params:this._getBlockParams(e),value:"",mode:"data_listcontents"===e.opcode?"list":"default"})))}this.emitProjectChanged(),this.resetCache()}}}},{key:"moveBlock",value:function(A){if(this._blocks.hasOwnProperty(A.id)){var e=this._blocks[A.id],i=!1;if(A.newCoordinate&&(i=e.x!==A.newCoordinate.x||e.y!==A.newCoordinate.y,e.x=A.newCoordinate.x,e.y=A.newCoordinate.y),void 0!==A.oldParent){var t=this._blocks[A.oldParent];void 0!==A.oldInput&&t.inputs[A.oldInput].block===A.id?t.inputs[A.oldInput].block=null:t.next===A.id&&(t.next=null),this._blocks[A.id].parent=null,i=!0}if(void 0===A.newParent)this._addScript(A.id);else{if(this._deleteScript(A.id),void 0===A.newInput)this._blocks[A.newParent].next=A.id;else{var o=null;this._blocks[A.newParent].inputs.hasOwnProperty(A.newInput)&&(o=this._blocks[A.newParent].inputs[A.newInput].shadow),this._blocks[A.id].shadow&&(o=A.id),this._blocks[A.newParent].inputs[A.newInput]={name:A.newInput,block:A.id,shadow:o}}this._blocks[A.id].parent=A.newParent,i=!0}this.resetCache(),i&&this.emitProjectChanged()}}},{key:"runAllMonitored",value:function(A){var e=this;null===this._cache._monitored&&(this._cache._monitored=Object.keys(this._blocks).filter(function(A){return e.getBlock(A).isMonitored}).map(function(i){var t=e.getBlock(i).targetId;return{blockId:i,target:t?A.getTargetById(t):null}}));for(var i=this._cache._monitored,t=0;t<i.length;t++){var o=i[t],n=o.blockId,a=o.target;A.addMonitorScript(n,a)}}},{key:"deleteBlock",value:function(A){var e=this._blocks[A];if(e){for(var i in null!==e.next&&this.deleteBlock(e.next),e.inputs)null!==e.inputs[i].block&&this.deleteBlock(e.inputs[i].block),null!==e.inputs[i].shadow&&e.inputs[i].shadow!==e.inputs[i].block&&this.deleteBlock(e.inputs[i].shadow);this._deleteScript(A),delete this._blocks[A],this.resetCache(),this.emitProjectChanged()}}},{key:"getAllVariableAndListReferences",value:function(A,e){var i=A||this._blocks,t=Object.create(null);for(var o in i){var n=null,a=null;if(i[o].fields.VARIABLE?(n=i[o].fields.VARIABLE,a=h.SCALAR_TYPE):i[o].fields.LIST?(n=i[o].fields.LIST,a=h.LIST_TYPE):e&&i[o].fields.BROADCAST_OPTION&&(n=i[o].fields.BROADCAST_OPTION,a=h.BROADCAST_MESSAGE_TYPE),n){var r=n.id;t[r]?t[r].push({referencingField:n,type:a}):t[r]=[{referencingField:n,type:a}]}}return t}},{key:"updateBlocksAfterVarRename",value:function(A,e){var i=this._blocks;for(var t in i){var o=null;if(i[t].fields.VARIABLE?o=i[t].fields.VARIABLE:i[t].fields.LIST&&(o=i[t].fields.LIST),o)A===o.id&&(o.value=e)}}},{key:"updateTargetSpecificBlocks",value:function(A){var e=this._blocks;for(var i in e)A&&"event_whenthisspriteclicked"===e[i].opcode?e[i].opcode="event_whenstageclicked":A||"event_whenstageclicked"!==e[i].opcode||(e[i].opcode="event_whenthisspriteclicked")}},{key:"updateAssetName",value:function(A,e,i){var t;if("costume"===i)t=this._getCostumeField.bind(this);else if("sound"===i)t=this._getSoundField.bind(this);else if("backdrop"===i)t=this._getBackdropField.bind(this);else{if("sprite"!==i)return;t=this._getSpriteField.bind(this)}var o=this._blocks;for(var n in o){var a=t(n);a&&a.value===A&&(a.value=e)}}},{key:"updateSensingOfReference",value:function(A,e,i){var t=this._blocks,o=!1;for(var n in t){var a=t[n];if("sensing_of"===a.opcode&&a.fields.PROPERTY.value===A&&a.inputs.OBJECT.block===a.inputs.OBJECT.shadow)this.getBlock(a.inputs.OBJECT.block).fields.OBJECT.value===i&&(a.fields.PROPERTY.value=e,o=!0)}return o&&this.resetCache(),o}},{key:"_getCostumeField",value:function(A){var e=this.getBlock(A);return e&&e.fields.hasOwnProperty("COSTUME")?e.fields.COSTUME:null}},{key:"_getSoundField",value:function(A){var e=this.getBlock(A);return e&&e.fields.hasOwnProperty("SOUND_MENU")?e.fields.SOUND_MENU:null}},{key:"_getBackdropField",value:function(A){var e=this.getBlock(A);return e&&e.fields.hasOwnProperty("BACKDROP")?e.fields.BACKDROP:null}},{key:"_getSpriteField",value:function(A){var e=this.getBlock(A);if(!e)return null;for(var i=["TOWARDS","TO","OBJECT","VIDEOONMENU2","DISTANCETOMENU","TOUCHINGOBJECTMENU","CLONE_OPTION"],t=0;t<i.length;t++){var o=i[t];if(e.fields.hasOwnProperty(o))return e.fields[o]}return null}},{key:"toXML",value:function(A){var e=this;return this._scripts.map(function(i){return e.blockToXML(i,A)}).join()}},{key:"blockToXML",value:function(A,e){var i=this._blocks[A];if(i){var t=i.shadow?"shadow":"block",o="<".concat(t,'\n id="').concat(i.id,'"\n type="').concat(i.opcode,'"\n ').concat(i.topLevel?'x="'.concat(i.x,'" y="').concat(i.y,'"'):"","\n >"),n=i.comment;for(var a in n&&(e?e.hasOwnProperty(n)?o+=e[n].toXML():E.warn("Could not find comment with id: ".concat(n," in provided comment descriptions.")):E.warn("Cannot serialize comment with id: ".concat(n,"; no comment descriptions provided."))),i.mutation&&(o+=this.mutationToXML(i.mutation)),i.inputs)if(i.inputs.hasOwnProperty(a)){var r=i.inputs[a];(r.block||r.shadow)&&(o+='<value name="'.concat(r.name,'">'),r.block&&(o+=this.blockToXML(r.block,e)),r.shadow&&r.shadow!==r.block&&(o+=this.blockToXML(r.shadow,e)),o+="</value>")}for(var s in i.fields)if(i.fields.hasOwnProperty(s)){var l=i.fields[s];o+='<field name="'.concat(l.name,'"');var c=l.id;c&&(o+=' id="'.concat(c,'"'));var u=l.variableType;"string"==typeof u&&(o+=' variabletype="'.concat(u,'"'));var B=l.value;"string"==typeof B&&(B=g(l.value)),o+=">".concat(B,"</field>")}return i.next&&(o+="<next>".concat(this.blockToXML(i.next,e),"</next>")),o+="</".concat(t,">")}}},{key:"mutationToXML",value:function(A){var e="<".concat(A.tagName);for(var i in A)if("children"!==i&&"tagName"!==i){var t="string"==typeof A[i]?g(A[i]):A[i];"blockInfo"===i&&(t=g(JSON.stringify(A[i]))),e+=" ".concat(i,'="').concat(t,'"')}e+=">";for(var o=0;o<A.children.length;o++)e+=this.mutationToXML(A.children[o]);return e+="</".concat(A.tagName,">")}},{key:"_getBlockParams",value:function(A){var e={};for(var i in A.fields)e[i]=A.fields[i].value;for(var t in A.inputs){var o=this._blocks[A.inputs[t].block];for(var n in o.fields)e[n]=o.fields[n].value}return e}},{key:"_getCustomBlockInternal",value:function(A){if(A.inputs&&A.inputs.custom_block)return this._blocks[A.inputs.custom_block.block]}},{key:"_addScript",value:function(A){this._scripts.indexOf(A)>-1||(this._scripts.push(A),this._blocks[A].topLevel=!0)}},{key:"_deleteScript",value:function(A){var e=this._scripts.indexOf(A);e>-1&&this._scripts.splice(e,1),this._blocks[A]&&(this._blocks[A].topLevel=!1)}}],[{key:"BRANCH_INPUT_PREFIX",get:function(){return"SUBSTACK"}}]),A}();B.getCached=function(A,e,i){var t=A._cache._executeCached[e];if(void 0!==t)return t;var o=A.getBlock(e);return void 0===o?null:(t=void 0===i?{id:e,opcode:A.getOpcode(o),fields:A.getFields(o),inputs:A.getInputs(o),mutation:A.getMutation(o)}:new i(A,{id:e,opcode:A.getOpcode(o),fields:A.getFields(o),inputs:A.getInputs(o),mutation:A.getMutation(o)}),A._cache._executeCached[e]=t,t)};var m=d._RuntimeScriptCache;d.getScripts=function(A,e){var i=A._cache.scripts[e];if(!i){i=A._cache.scripts[e]=[];for(var t=A._scripts,o=0;o<t.length;o++){var n=t[o];A.getBlock(n).opcode===e&&i.push(new m(A,n))}}return i},A.exports=w},function(A,e,i){(function(e){function i(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var t=function(){function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A.nowObj;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.startTime=0,this.nowObj=e}return function(A,e,t){e&&i(A.prototype,e),t&&i(A,t)}(A,[{key:"time",value:function(){return this.nowObj.now()}},{key:"relativeTime",value:function(){return this.nowObj.now()}},{key:"start",value:function(){this.startTime=this.nowObj.now()}},{key:"timeElapsed",value:function(){return this.nowObj.now()-this.startTime}},{key:"setTimeout",value:function(A,i){return e.setTimeout(A,i)}},{key:"clearTimeout",value:function(A){e.clearTimeout(A)}}],[{key:"USE_PERFORMANCE",get:function(){return!1}},{key:"legacyDateCode",get:function(){return{now:function(){return(new Date).getTime()}}}},{key:"nowObj",get:function(){return A.USE_PERFORMANCE&&"undefined"!=typeof self&&self.performance&&"now"in self.performance?self.performance:Date.now?Date:A.legacyDateCode}}]),A}();A.exports=t}).call(this,i(36))},function(A,e,i){"use strict";var t=i(243),o=Object.keys||function(A){var e=[];for(var i in A)e.push(i);return e};A.exports=c;var n=i(192);n.inherits=i(167);var a=i(486),r=i(324);n.inherits(c,a);for(var s=o(r.prototype),g=0;g<s.length;g++){var l=s[g];c.prototype[l]||(c.prototype[l]=r.prototype[l])}function c(A){if(!(this instanceof c))return new c(A);a.call(this,A),r.call(this,A),A&&!1===A.readable&&(this.readable=!1),A&&!1===A.writable&&(this.writable=!1),this.allowHalfOpen=!0,A&&!1===A.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",u)}function u(){this.allowHalfOpen||this._writableState.ended||t.nextTick(B,this)}function B(A){A.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(A){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=A,this._writableState.destroyed=A)}}),c.prototype._destroy=function(A,e){this.push(null),this.end(),t.nextTick(e,A)}},function(A,e){var i={}.hasOwnProperty;A.exports=function(A,e){return i.call(A,e)}},function(A,e,i){var t=i(130),o=i(253);A.exports=i(132)?function(A,e,i){return t.f(A,e,o(1,i))}:function(A,e,i){return A[e]=i,A}},function(A,e,i){var t=i(566),o=i(347);A.exports=function(A){return t(o(A))}},function(A,e,i){"use strict";i.d(e,"b",function(){return n}),i.d(e,"a",function(){return o}),i.d(e,"c",function(){return a});var t="scratch-gui/connection-modal/setId",o={extensionId:null},n=function(A,e){switch(void 0===A&&(A=o),e.type){case t:return Object.assign({},A,{extensionId:e.extensionId});default:return A}},a=function(A){return{type:t,extensionId:A}}},function(A,e,i){"use strict";function t(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function o(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}i.d(e,"a",function(){return a}),i.d(e,"c",function(){return n}),i.d(e,"d",function(){return r}),i.d(e,"b",function(){return s});var n={sprites:{},stage:{},highlightedTargetId:null,highlightedTargetTime:null},a=function(A,e){switch(void 0===A&&(A=n),e.type){case"scratch-gui/targets/UPDATE_TARGET_LIST":return Object.assign({},A,{sprites:e.targets.filter(function(A){return!A.isStage}).reduce(function(A,e,i){return Object.assign(A,o({},e.id,function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?t(Object(i),!0).forEach(function(e){o(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({order:i},e)))},{}),stage:e.targets.filter(function(A){return A.isStage})[0]||{},editingTarget:e.editingTarget});case"scratch-gui/targets/HIGHLIGHT_TARGET":return Object.assign({},A,{highlightedTargetId:e.targetId,highlightedTargetTime:e.updateTime});default:return A}},r=function(A,e){return{type:"scratch-gui/targets/UPDATE_TARGET_LIST",targets:A,editingTarget:e}},s=function(A){return{type:"scratch-gui/targets/HIGHLIGHT_TARGET",targetId:A,updateTime:Date.now()}}},function(A,e,i){"undefined"!=typeof self&&self,A.exports=function(A){return function(A){function e(t){if(i[t])return i[t].exports;var o=i[t]={i:t,l:!1,exports:{}};return A[t].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var i={};return e.m=A,e.c=i,e.d=function(A,i,t){e.o(A,i)||Object.defineProperty(A,i,{configurable:!1,enumerable:!0,get:t})},e.n=function(A){var i=A&&A.__esModule?function(){return A.default}:function(){return A};return e.d(i,"a",i),i},e.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},e.p="",e(e.s=4)}([function(A,e,i){var t="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;A.exports=i(6)(function(A){return"object"==typeof A&&null!==A&&A.$$typeof===t},!0)},function(A,e,i){"use strict";A.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(A,e,i){"use strict";var t=/[A-Z]/g,o=/^ms-/,n={};A.exports=function(A){return A in n?n[A]:n[A]=A.replace(t,"-$&").toLowerCase().replace(o,"-ms-")}},function(A,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A},o=i(0),n=function(A){return A&&A.__esModule?A:{default:A}}(o),a=n.default.oneOfType([n.default.string,n.default.number]),r={orientation:n.default.oneOf(["portrait","landscape"]),scan:n.default.oneOf(["progressive","interlace"]),aspectRatio:n.default.string,deviceAspectRatio:n.default.string,height:a,deviceHeight:a,width:a,deviceWidth:a,color:n.default.bool,colorIndex:n.default.bool,monochrome:n.default.bool,resolution:a},s=t({minAspectRatio:n.default.string,maxAspectRatio:n.default.string,minDeviceAspectRatio:n.default.string,maxDeviceAspectRatio:n.default.string,minHeight:a,maxHeight:a,minDeviceHeight:a,maxDeviceHeight:a,minWidth:a,maxWidth:a,minDeviceWidth:a,maxDeviceWidth:a,minColor:n.default.number,maxColor:n.default.number,minColorIndex:n.default.number,maxColorIndex:n.default.number,minMonochrome:n.default.number,maxMonochrome:n.default.number,minResolution:a,maxResolution:a},r),g={all:n.default.bool,grid:n.default.bool,aural:n.default.bool,braille:n.default.bool,handheld:n.default.bool,print:n.default.bool,projection:n.default.bool,screen:n.default.bool,tty:n.default.bool,tv:n.default.bool,embossed:n.default.bool},l=t({},g,s);r.type=Object.keys(g),e.default={all:l,types:g,matchers:r,features:s},A.exports=e.default},function(A,e,i){"use strict";function t(A){return A&&A.__esModule?A:{default:A}}function o(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}function n(A,e){var i=r({},A);return e.forEach(function(A){return delete i[A]}),i}Object.defineProperty(e,"__esModule",{value:!0}),e.toQuery=e.default=void 0;var a=function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}return function(e,i,t){return i&&A(e.prototype,i),t&&A(e,t),e}}(),r=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A},s=i(5),g=t(s),l=i(0),c=t(l),u=i(9),B=t(u),d=i(2),E=t(d),h=i(3),C=t(h),w=i(11),m=t(w),p={component:c.default.node,query:c.default.string,values:c.default.shape(C.default.matchers),children:c.default.oneOfType([c.default.node,c.default.func]),onChange:c.default.func,onBeforeChange:c.default.func},I=Object.keys(C.default.all),f=Object.keys(p),Q=f.concat(I),D=function(A){function e(){var A,i,t;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=o(this,(A=e.__proto__||Object.getPrototypeOf(e)).call.apply(A,[this].concat(a))),t.state={matches:!1},t.updateMatches=function(){t._mql.matches!==t.state.matches&&t.setState({matches:t._mql.matches})},t.removeMql=function(){t._mql&&(t._mql.removeListener(t.updateMatches),t._mql.dispose())},o(t,i)}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,A),a(e,[{key:"componentWillMount",value:function(){this.updateQuery(this.props)}},{key:"componentWillReceiveProps",value:function(A){this.updateQuery(A)}},{key:"updateQuery",value:function(A){var e=void 0,i=!1;if(A.query?this.query=A.query:this.query=(0,m.default)(n(A,f)),!this.query)throw new Error("Invalid or missing MediaQuery!");A.values&&(e=Object.keys(A.values).reduce(function(e,i){return e[(0,E.default)(i)]=A.values[i],e},{}),0!==Object.keys(e).length&&(i=!0)),this.removeMql(),this._mql=(0,B.default)(this.query,e,i),this._mql.addListener(this.updateMatches),this.updateMatches()}},{key:"componentWillUpdate",value:function(A,e){this.props.onBeforeChange&&this.state.matches!==e.matches&&this.props.onBeforeChange(this.state.matches)}},{key:"componentDidUpdate",value:function(A,e){this.props.onChange&&e.matches!==this.state.matches&&this.props.onChange(this.state.matches)}},{key:"componentWillUnmount",value:function(){this.removeMql()}},{key:"render",value:function(){if("function"==typeof this.props.children)return this.props.children(this.state.matches);if(!1===this.state.matches)return null;var A=n(this.props,Q),e=Object.keys(A).length>0,i=g.default.Children.count(this.props.children);return this.props.component||null==this.props.children||e&&i>1?g.default.createElement(this.props.component||"div",A,this.props.children):e?g.default.cloneElement(this.props.children,A):i?this.props.children:null}}]),e}(g.default.Component);D.displayName="MediaQuery",D.defaultProps={values:{}},e.default=D,e.toQuery=m.default},function(e,i){e.exports=A},function(A,e,i){"use strict";function t(){return null}var o=i(7),n=i(1),a=i(8),r=function(){};r=function(A){var e="Warning: "+A;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(A){}},A.exports=function(A,e){function i(A,e){return A===e?0!==A||1/A==1/e:A!=A&&e!=e}function s(A){this.message=A,this.stack=""}function g(A){function i(i,a,g,l,c,u,B){if(l=l||C,u=u||g,B!==n){if(e){var d=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 d.name="Invariant Violation",d}if("undefined"!=typeof console){var E=l+":"+g;!t[E]&&o<3&&(r("You are manually calling a React.PropTypes validation function for the `"+u+"` 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."),t[E]=!0,o++)}}return null==a[g]?i?new s(null===a[g]?"The "+c+" `"+u+"` is marked as required in `"+l+"`, but its value is `null`.":"The "+c+" `"+u+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:A(a,g,l,c,u)}var t={},o=0,a=i.bind(null,!1);return a.isRequired=i.bind(null,!0),a}function l(A){return g(function(e,i,t,o,n,a){var r=e[i];return u(r)!==A?new s("Invalid "+o+" `"+n+"` of type `"+B(r)+"` supplied to `"+t+"`, expected `"+A+"`."):null})}function c(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(c);if(null===e||A(e))return!0;var i=function(A){var e=A&&(E&&A[E]||A[h]);if("function"==typeof e)return e}(e);if(!i)return!1;var t,o=i.call(e);if(i!==e.entries){for(;!(t=o.next()).done;)if(!c(t.value))return!1}else for(;!(t=o.next()).done;){var n=t.value;if(n&&!c(n[1]))return!1}return!0;default:return!1}}function u(A){var e=typeof A;return Array.isArray(A)?"array":A instanceof RegExp?"object":function(A,e){return"symbol"===A||"Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol}(e,A)?"symbol":e}function B(A){if(void 0===A||null===A)return""+A;var e=u(A);if("object"===e){if(A instanceof Date)return"date";if(A instanceof RegExp)return"regexp"}return e}function d(A){var e=B(A);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}var E="function"==typeof Symbol&&Symbol.iterator,h="@@iterator",C="<<anonymous>>",w={array:l("array"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:g(t),arrayOf:function(A){return g(function(e,i,t,o,a){if("function"!=typeof A)return new s("Property `"+a+"` of component `"+t+"` has invalid PropType notation inside arrayOf.");var r=e[i];if(!Array.isArray(r))return new s("Invalid "+o+" `"+a+"` of type `"+u(r)+"` supplied to `"+t+"`, expected an array.");for(var g=0;g<r.length;g++){var l=A(r,g,t,o,a+"["+g+"]",n);if(l instanceof Error)return l}return null})},element:g(function(e,i,t,o,n){var a=e[i];return A(a)?null:new s("Invalid "+o+" `"+n+"` of type `"+u(a)+"` supplied to `"+t+"`, expected a single ReactElement.")}),instanceOf:function(A){return g(function(e,i,t,o,n){if(!(e[i]instanceof A)){var a=A.name||C;return new s("Invalid "+o+" `"+n+"` of type `"+function(A){return A.constructor&&A.constructor.name?A.constructor.name:C}(e[i])+"` supplied to `"+t+"`, expected instance of `"+a+"`.")}return null})},node:g(function(A,e,i,t,o){return c(A[e])?null:new s("Invalid "+t+" `"+o+"` supplied to `"+i+"`, expected a ReactNode.")}),objectOf:function(A){return g(function(e,i,t,o,a){if("function"!=typeof A)return new s("Property `"+a+"` of component `"+t+"` has invalid PropType notation inside objectOf.");var r=e[i],g=u(r);if("object"!==g)return new s("Invalid "+o+" `"+a+"` of type `"+g+"` supplied to `"+t+"`, expected an object.");for(var l in r)if(r.hasOwnProperty(l)){var c=A(r,l,t,o,a+"."+l,n);if(c instanceof Error)return c}return null})},oneOf:function(A){return Array.isArray(A)?g(function(e,t,o,n,a){for(var r=e[t],g=0;g<A.length;g++)if(i(r,A[g]))return null;return new s("Invalid "+n+" `"+a+"` of value `"+r+"` supplied to `"+o+"`, expected one of "+JSON.stringify(A)+".")}):(r("Invalid argument supplied to oneOf, expected an instance of array."),t)},oneOfType:function(A){if(!Array.isArray(A))return r("Invalid argument supplied to oneOfType, expected an instance of array."),t;for(var e=0;e<A.length;e++){var i=A[e];if("function"!=typeof i)return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+d(i)+" at index "+e+"."),t}return g(function(e,i,t,o,a){for(var r=0;r<A.length;r++)if(null==(0,A[r])(e,i,t,o,a,n))return null;return new s("Invalid "+o+" `"+a+"` supplied to `"+t+"`.")})},shape:function(A){return g(function(e,i,t,o,a){var r=e[i],g=u(r);if("object"!==g)return new s("Invalid "+o+" `"+a+"` of type `"+g+"` supplied to `"+t+"`, expected `object`.");for(var l in A){var c=A[l];if(c){var B=c(r,l,t,o,a+"."+l,n);if(B)return B}}return null})},exact:function(A){return g(function(e,i,t,a,r){var g=e[i],l=u(g);if("object"!==l)return new s("Invalid "+a+" `"+r+"` of type `"+l+"` supplied to `"+t+"`, expected `object`.");var c=o({},e[i],A);for(var B in c){var d=A[B];if(!d)return new s("Invalid "+a+" `"+r+"` key `"+B+"` supplied to `"+t+"`.\nBad object: "+JSON.stringify(e[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(A),null," "));var E=d(g,B,t,a,r+"."+B,n);if(E)return E}return null})}};return s.prototype=Error.prototype,w.checkPropTypes=a,w.PropTypes=w,w}},function(A,e,i){"use strict";
|
|
41
|
+
!function(e,i){A.exports=i()}("undefined"!=typeof self&&self,function(){return function(A){var e={};function i(t){if(e[t])return e[t].exports;var o=e[t]={i:t,l:!1,exports:{}};return A[t].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=A,i.c=e,i.d=function(A,e,t){i.o(A,e)||Object.defineProperty(A,e,{configurable:!1,enumerable:!0,get:t})},i.n=function(A){var e=A&&A.__esModule?function(){return A.default}:function(){return A};return i.d(e,"a",e),e},i.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},i.p="",i(i.s=9)}([function(A,e,i){"use strict";e.__esModule=!0,e.copyExistingProperties=function(A,e){Object.keys(e).forEach(function(i){e.hasOwnProperty(i)&&A.hasOwnProperty(i)&&(e[i]=A[i])})},e.copyNamedProperties=function(A,e,i){A.forEach(function(A){var t=e[A];void 0!==t&&(i[A]=t)})},e.isBuffer=function(A,e){n||(n=A.createBuffer());return e instanceof n.constructor},e.isRenderbuffer=function(A,e){a||(a=A.createRenderbuffer());return e instanceof a.constructor},e.isShader=function(A,e){r||(r=A.createShader(A.VERTEX_SHADER));return e instanceof r.constructor},e.isTexture=function(A,e){s||(s=A.createTexture());return e instanceof s.constructor},e.isSampler=function(A,e){if(!g){if(!A.createSampler)return!1;g=A.createSampler()}return e instanceof g.constructor},e.warn=e.error=void 0;var t=function(A){return A&&A.__esModule?A:{default:A}}(i(2));var o=t.default.console&&t.default.console.error&&"function"==typeof t.default.console.error?t.default.console.error.bind(t.default.console):function(){};e.error=o;var n,a,r,s,g,l=t.default.console&&t.default.console.warn&&"function"==typeof t.default.console.warn?t.default.console.warn.bind(t.default.console):function(){};e.warn=l},function(A,e,i){"use strict";e.__esModule=!0,e.getGLTypeForTypedArray=function(A){if(A instanceof Int8Array)return o;if(A instanceof Uint8Array)return n;if(A instanceof Uint8ClampedArray)return n;if(A instanceof Int16Array)return a;if(A instanceof Uint16Array)return r;if(A instanceof Int32Array)return s;if(A instanceof Uint32Array)return g;if(A instanceof Float32Array)return l;throw"unsupported typed array type"},e.getGLTypeForTypedArrayType=function(A){if(A===Int8Array)return o;if(A===Uint8Array)return n;if(A===Uint8ClampedArray)return n;if(A===Int16Array)return a;if(A===Uint16Array)return r;if(A===Int32Array)return s;if(A===Uint32Array)return g;if(A===Float32Array)return l;throw"unsupported typed array type"},e.getTypedArrayTypeForGLType=function(A){var e=c[A];if(!e)throw"unknown gl type";return e},e.isArrayBuffer=void 0;var t=function(A){return A&&A.__esModule?A:{default:A}}(i(2));var o=5120,n=5121,a=5122,r=5123,s=5124,g=5125,l=5126,c={},u=c;u[o]=Int8Array,u[n]=Uint8Array,u[a]=Int16Array,u[r]=Uint16Array,u[s]=Int32Array,u[g]=Uint32Array,u[l]=Float32Array,u[32819]=Uint16Array,u[32820]=Uint16Array,u[33635]=Uint16Array,u[5131]=Uint16Array,u[33640]=Uint32Array,u[35899]=Uint32Array,u[35902]=Uint32Array,u[36269]=Uint32Array,u[34042]=Uint32Array;var B=t.default.SharedArrayBuffer?function(A){return A&&A.buffer&&(A.buffer instanceof ArrayBuffer||A.buffer instanceof t.default.SharedArrayBuffer)}:function(A){return A&&A.buffer&&A.buffer instanceof ArrayBuffer};e.isArrayBuffer=B},function(A,e,i){"use strict";e.__esModule=!0,e.default=void 0;var t=void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};e.default=t},function(A,e,i){"use strict";e.__esModule=!0,e.add=function(A,e,i){return(i=i||new t(3))[0]=A[0]+e[0],i[1]=A[1]+e[1],i[2]=A[2]+e[2],i},e.copy=function(A,e){return(e=e||new t(3))[0]=A[0],e[1]=A[1],e[2]=A[2],e},e.create=function(A,e,i){var o=new t(3);A&&(o[0]=A);e&&(o[1]=e);i&&(o[2]=i);return o},e.cross=function(A,e,i){i=i||new t(3);var o=A[2]*e[0]-A[0]*e[2],n=A[0]*e[1]-A[1]*e[0];return i[0]=A[1]*e[2]-A[2]*e[1],i[1]=o,i[2]=n,i},e.distance=function(A,e){var i=A[0]-e[0],t=A[1]-e[1],o=A[2]-e[2];return Math.sqrt(i*i+t*t+o*o)},e.distanceSq=function(A,e){var i=A[0]-e[0],t=A[1]-e[1],o=A[2]-e[2];return i*i+t*t+o*o},e.divide=function(A,e,i){return(i=i||new t(3))[0]=A[0]/e[0],i[1]=A[1]/e[1],i[2]=A[2]/e[2],i},e.divScalar=function(A,e,i){return(i=i||new t(3))[0]=A[0]/e,i[1]=A[1]/e,i[2]=A[2]/e,i},e.dot=function(A,e){return A[0]*e[0]+A[1]*e[1]+A[2]*e[2]},e.lerp=function(A,e,i,o){return(o=o||new t(3))[0]=(1-i)*A[0]+i*e[0],o[1]=(1-i)*A[1]+i*e[1],o[2]=(1-i)*A[2]+i*e[2],o},e.length=function(A){return Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2])},e.lengthSq=function(A){return A[0]*A[0]+A[1]*A[1]+A[2]*A[2]},e.mulScalar=function(A,e,i){return(i=i||new t(3))[0]=A[0]*e,i[1]=A[1]*e,i[2]=A[2]*e,i},e.multiply=function(A,e,i){return(i=i||new t(3))[0]=A[0]*e[0],i[1]=A[1]*e[1],i[2]=A[2]*e[2],i},e.negate=function(A,e){return(e=e||new t(3))[0]=-A[0],e[1]=-A[1],e[2]=-A[2],e},e.normalize=function(A,e){e=e||new t(3);var i=A[0]*A[0]+A[1]*A[1]+A[2]*A[2],o=Math.sqrt(i);o>1e-5?(e[0]=A[0]/o,e[1]=A[1]/o,e[2]=A[2]/o):(e[0]=0,e[1]=0,e[2]=0);return e},e.setDefaultType=function(A){var e=t;return t=A,e},e.subtract=function(A,e,i){return(i=i||new t(3))[0]=A[0]-e[0],i[1]=A[1]-e[1],i[2]=A[2]-e[2],i};var t=Float32Array},function(A,e,i){"use strict";e.__esModule=!0,e.isWebGL1=function(A){return!A.texStorage2D},e.isWebGL2=function(A){return!!A.texStorage2D},e.glEnumToString=void 0;var t=function(){var A={},e={};return function(i,t){return function(i){var t=i.constructor.name;if(!A[t]){for(var o in i)if("number"==typeof i[o]){var n=e[i[o]];e[i[o]]=n?"".concat(n," | ").concat(o):o}A[t]=!0}}(i),e[t]||"0x"+t.toString(16)}}();e.glEnumToString=t},function(A,e,i){"use strict";e.__esModule=!0,e.createAttributeSetters=P,e.createProgram=F,e.createProgramFromScripts=function(A,e,i,t,o){for(var n=b(i,t,o),a=[],r=0;r<e.length;++r){var s=v(A,e[r],A[y[r]],n.errorCallback);if(!s)return null;a.push(s)}return F(A,a,n)},e.createProgramFromSources=S,e.createProgramInfo=function(A,e,i,t,o){var n=b(i,t,o),a=!0;if(e=e.map(function(A){if(A.indexOf("\n")<0){var e=g(A);e?A=e.text:(n.errorCallback("no element with id: "+A),a=!1)}return A}),!a)return null;var r=S(A,e,n);if(!r)return null;return _(A,r)},e.createProgramInfoFromProgram=_,e.createUniformSetters=R,e.createUniformBlockSpecFromProgram=U,e.createUniformBlockInfoFromProgram=H,e.createUniformBlockInfo=function(A,e,i){return H(A,e.program,e.uniformBlockSpec,i)},e.createTransformFeedback=function(A,e,i){var t=A.createTransformFeedback();return A.bindTransformFeedback(A.TRANSFORM_FEEDBACK,t),A.useProgram(e.program),Y(A,e,i),A.bindTransformFeedback(A.TRANSFORM_FEEDBACK,null),function(A,e,i){for(var t in e.transformFeedbackInfo&&(e=e.transformFeedbackInfo),i.attribs&&(i=i.attribs),i){var o=e[t];o&&A.bindBufferBase(A.TRANSFORM_FEEDBACK_BUFFER,o.index,null)}}(A,e,i),t},e.createTransformFeedbackInfo=O,e.bindTransformFeedbackInfo=Y,e.setAttributes=x,e.setBuffersAndAttributes=function(A,e,i){i.vertexArrayObject?A.bindVertexArray(i.vertexArrayObject):(x(e.attribSetters||e,i.attribs),i.indices&&A.bindBuffer(A.ELEMENT_ARRAY_BUFFER,i.indices))},e.setUniforms=function A(e,i){var t=e.uniformSetters||e;var o=arguments.length;for(var n=1;n<o;++n){var a=arguments[n];if(Array.isArray(a))for(var r=a.length,s=0;s<r;++s)A(t,a[s]);else for(var g in a){var l=t[g];l&&l(a[g])}}},e.setUniformBlock=function(A,e,i){L(A,e,i)&&A.bufferData(A.UNIFORM_BUFFER,i.array,A.DYNAMIC_DRAW)},e.setBlockUniforms=function(A,e){var i=A.uniforms;for(var t in e){var o=i[t];if(o){var n=e[t];n.length?o.set(n):o[0]=n}}},e.bindUniformBlock=L;var t=a(i(4)),o=a(i(0)),n=function(A){return A&&A.__esModule?A:{default:A}}(i(2));function a(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}var r=o.error,s=o.warn,g=n.default&&n.default.document&&n.default.document.getElementById?n.default.document.getElementById.bind(n.default.document):function(){return null},l={};function c(A,e){return l[e].bindPoint}function u(A,e){return function(i){A.uniform1i(e,i)}}function B(A,e){return function(i){A.uniform1iv(e,i)}}function d(A,e){return function(i){A.uniform2iv(e,i)}}function E(A,e){return function(i){A.uniform3iv(e,i)}}function h(A,e){return function(i){A.uniform4iv(e,i)}}function C(A,e,i,n){var a=c(0,e);return t.isWebGL2(A)?function(e){var t,r;o.isTexture(A,e)?(t=e,r=null):(t=e.texture,r=e.sampler),A.uniform1i(n,i),A.activeTexture(A.TEXTURE0+i),A.bindTexture(a,t),A.bindSampler(i,r)}:function(e){A.uniform1i(n,i),A.activeTexture(A.TEXTURE0+i),A.bindTexture(a,e)}}function w(A,e,i,n,a){for(var r=c(0,e),s=new Int32Array(a),g=0;g<a;++g)s[g]=i+g;return t.isWebGL2(A)?function(e){A.uniform1iv(n,s),e.forEach(function(e,t){var n,a;A.activeTexture(A.TEXTURE0+s[t]),o.isTexture(A,e)?(n=e,a=null):(n=e.texture,a=e.sampler),A.bindSampler(i,a),A.bindTexture(r,n)})}:function(e){A.uniform1iv(n,s),e.forEach(function(e,i){A.activeTexture(A.TEXTURE0+s[i]),A.bindTexture(r,e)})}}function m(A,e){return function(i){A.bindBuffer(A.ARRAY_BUFFER,i.buffer),A.enableVertexAttribArray(e),A.vertexAttribPointer(e,i.numComponents||i.size,i.type||A.FLOAT,i.normalize||!1,i.stride||0,i.offset||0),void 0!==i.divisor&&A.vertexAttribDivisor(e,i.divisor)}}function p(A,e){return function(i){A.bindBuffer(A.ARRAY_BUFFER,i.buffer),A.enableVertexAttribArray(e),A.vertexAttribIPointer(e,i.numComponents||i.size,i.type||A.INT,i.stride||0,i.offset||0),void 0!==i.divisor&&A.vertexAttribDivisor(e,i.divisor)}}function I(A,e,i){var t=i.size,o=i.count;return function(i){A.bindBuffer(A.ARRAY_BUFFER,i.buffer);for(var n=i.size||i.numComponents||t,a=n/o,r=i.type||A.FLOAT,s=l[r].size*n,g=i.normalize||!1,c=i.offset||0,u=s/o,B=0;B<o;++B)A.enableVertexAttribArray(e+B),A.vertexAttribPointer(e+B,a,r,g,s,c+u*B),void 0!==i.divisor&&A.vertexAttribDivisor(e+B,i.divisor)}}l[5126]={Type:Float32Array,size:4,setter:function(A,e){return function(i){A.uniform1f(e,i)}},arraySetter:function(A,e){return function(i){A.uniform1fv(e,i)}}},l[35664]={Type:Float32Array,size:8,setter:function(A,e){return function(i){A.uniform2fv(e,i)}}},l[35665]={Type:Float32Array,size:12,setter:function(A,e){return function(i){A.uniform3fv(e,i)}}},l[35666]={Type:Float32Array,size:16,setter:function(A,e){return function(i){A.uniform4fv(e,i)}}},l[5124]={Type:Int32Array,size:4,setter:u,arraySetter:B},l[35667]={Type:Int32Array,size:8,setter:d},l[35668]={Type:Int32Array,size:12,setter:E},l[35669]={Type:Int32Array,size:16,setter:h},l[5125]={Type:Uint32Array,size:4,setter:function(A,e){return function(i){A.uniform1ui(e,i)}},arraySetter:function(A,e){return function(i){A.uniform1uiv(e,i)}}},l[36294]={Type:Uint32Array,size:8,setter:function(A,e){return function(i){A.uniform2uiv(e,i)}}},l[36295]={Type:Uint32Array,size:12,setter:function(A,e){return function(i){A.uniform3uiv(e,i)}}},l[36296]={Type:Uint32Array,size:16,setter:function(A,e){return function(i){A.uniform4uiv(e,i)}}},l[35670]={Type:Uint32Array,size:4,setter:u,arraySetter:B},l[35671]={Type:Uint32Array,size:8,setter:d},l[35672]={Type:Uint32Array,size:12,setter:E},l[35673]={Type:Uint32Array,size:16,setter:h},l[35674]={Type:Float32Array,size:16,setter:function(A,e){return function(i){A.uniformMatrix2fv(e,!1,i)}}},l[35675]={Type:Float32Array,size:36,setter:function(A,e){return function(i){A.uniformMatrix3fv(e,!1,i)}}},l[35676]={Type:Float32Array,size:64,setter:function(A,e){return function(i){A.uniformMatrix4fv(e,!1,i)}}},l[35685]={Type:Float32Array,size:24,setter:function(A,e){return function(i){A.uniformMatrix2x3fv(e,!1,i)}}},l[35686]={Type:Float32Array,size:32,setter:function(A,e){return function(i){A.uniformMatrix2x4fv(e,!1,i)}}},l[35687]={Type:Float32Array,size:24,setter:function(A,e){return function(i){A.uniformMatrix3x2fv(e,!1,i)}}},l[35688]={Type:Float32Array,size:48,setter:function(A,e){return function(i){A.uniformMatrix3x4fv(e,!1,i)}}},l[35689]={Type:Float32Array,size:32,setter:function(A,e){return function(i){A.uniformMatrix4x2fv(e,!1,i)}}},l[35690]={Type:Float32Array,size:48,setter:function(A,e){return function(i){A.uniformMatrix4x3fv(e,!1,i)}}},l[35678]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:3553},l[35680]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:34067},l[35679]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:32879},l[35682]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:3553},l[36289]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:35866},l[36292]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:35866},l[36293]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:34067},l[36298]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:3553},l[36299]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:32879},l[36300]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:34067},l[36303]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:35866},l[36306]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:3553},l[36307]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:32879},l[36308]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:34067},l[36311]={Type:null,size:0,setter:C,arraySetter:w,bindPoint:35866};var f={};f[5126]={size:4,setter:m},f[35664]={size:8,setter:m},f[35665]={size:12,setter:m},f[35666]={size:16,setter:m},f[5124]={size:4,setter:p},f[35667]={size:8,setter:p},f[35668]={size:12,setter:p},f[35669]={size:16,setter:p},f[5125]={size:4,setter:p},f[36294]={size:8,setter:p},f[36295]={size:12,setter:p},f[36296]={size:16,setter:p},f[35670]={size:4,setter:p},f[35671]={size:8,setter:p},f[35672]={size:12,setter:p},f[35673]={size:16,setter:p},f[35674]={size:4,setter:I,count:2},f[35675]={size:9,setter:I,count:3},f[35676]={size:16,setter:I,count:4};var Q=void 0;var D=/^[ \t]*\n/;function M(A,e,i,t){var o=t||r,n=A.createShader(i),a=0;if(D.test(e)&&(a=1,e=e.replace(D,"")),A.shaderSource(n,e),A.compileShader(n),!A.getShaderParameter(n,A.COMPILE_STATUS)){var s=A.getShaderInfoLog(n);return o(function(A,e){return e=e||0,++e,A.split("\n").map(function(A,i){return i+e+": "+A}).join("\n")}(e,a)+"\n*** Error compiling shader: "+s),A.deleteShader(n),null}return n}function b(A,e,i){var t;if("function"==typeof e&&(i=e,e=void 0),"function"==typeof A)i=A,A=void 0;else if(A&&!Array.isArray(A)){if(A.errorCallback)return A;var o=A;i=o.errorCallback,A=o.attribLocations,t=o.transformFeedbackVaryings}var n={errorCallback:i||r,transformFeedbackVaryings:t};if(A){var a={};Array.isArray(A)?A.forEach(function(A,i){a[A]=e?e[i]:i}):a=A,n.attribLocations=a}return n}var y=["VERTEX_SHADER","FRAGMENT_SHADER"];function T(A){return A.indexOf("frag")>=0?Q.FRAGMENT_SHADER:A.indexOf("vert")>=0?Q.VERTEX_SHADER:void 0}function k(A,e){e.forEach(function(e){A.deleteShader(e)})}function F(A,e,i,t,n){for(var a=b(i,t,n),r=[],s=[],l=0;l<e.length;++l){var c=e[l];if("string"==typeof c){var u=g(c),B=u?u.text:c,d=A[y[l]];u&&u.type&&(d=T(u.type)||d),c=M(A,B,d,a.errorCallback),s.push(c)}o.isShader(A,c)&&r.push(c)}if(r.length!==e.length)return a.errorCallback("not enough shaders for program"),k(A,s),null;var E=A.createProgram();r.forEach(function(e){A.attachShader(E,e)}),a.attribLocations&&Object.keys(a.attribLocations).forEach(function(e){A.bindAttribLocation(E,a.attribLocations[e],e)});var h=a.transformFeedbackVaryings;if(h&&(h.attribs&&(h=h.attribs),Array.isArray(h)||(h=Object.keys(h)),A.transformFeedbackVaryings(E,h,a.transformFeedbackMode||A.SEPARATE_ATTRIBS)),A.linkProgram(E),!A.getProgramParameter(E,A.LINK_STATUS)){var C=A.getProgramInfoLog(E);return a.errorCallback("Error in program linking:"+C),A.deleteProgram(E),k(A,s),null}return E}function v(A,e,i,t){var o,n=g(e);if(!n)throw"*** Error: unknown script element"+e;o=n.text;var a=i||T(n.type);if(!a)throw"*** Error: unknown shader type";return M(A,o,a,t)}function S(A,e,i,t,o){for(var n=b(i,t,o),a=[],r=0;r<e.length;++r){var s=M(A,e[r],A[y[r]],n.errorCallback);if(!s)return null;a.push(s)}return F(A,a,n)}function N(A){var e=A.name;return e.startsWith("gl_")||e.startsWith("webgl_")}function R(A,e){var i=0;function t(e,t){var o,n=A.getUniformLocation(e,t.name),a=t.size>1&&"[0]"===t.name.substr(-3),r=t.type,s=l[r];if(!s)throw"unknown type: 0x"+r.toString(16);if(s.bindPoint){var g=i;i+=t.size,o=a?s.arraySetter(A,r,g,n,t.size):s.setter(A,r,g,n,t.size)}else o=s.arraySetter&&a?s.arraySetter(A,n):s.setter(A,n);return o.location=n,o}for(var o={},n=A.getProgramParameter(e,A.ACTIVE_UNIFORMS),a=0;a<n;++a){var r=A.getActiveUniform(e,a);if(!N(r)){var s=r.name;"[0]"===s.substr(-3)&&(s=s.substr(0,s.length-3));var g=t(e,r);o[s]=g}}return o}function O(A,e){for(var i={},t=A.getProgramParameter(e,A.TRANSFORM_FEEDBACK_VARYINGS),o=0;o<t;++o){var n=A.getTransformFeedbackVarying(e,o);i[n.name]={index:o,type:n.type,size:n.size}}return i}function Y(A,e,i){for(var t in e.transformFeedbackInfo&&(e=e.transformFeedbackInfo),i.attribs&&(i=i.attribs),i){var o=e[t];if(o){var n=i[t];n.offset?A.bindBufferRange(A.TRANSFORM_FEEDBACK_BUFFER,o.index,n.buffer,n.offset,n.size):A.bindBufferBase(A.TRANSFORM_FEEDBACK_BUFFER,o.index,n.buffer)}}}function U(A,e){for(var i=A.getProgramParameter(e,A.ACTIVE_UNIFORMS),t=[],o=[],n=0;n<i;++n){o.push(n),t.push({});var a=A.getActiveUniform(e,n);if(N(a))break;t[n].name=a.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach(function(i){var n=i[0],a=i[1];A.getActiveUniforms(e,o,A[n]).forEach(function(A,e){t[e][a]=A})});for(var r={},s=A.getProgramParameter(e,A.ACTIVE_UNIFORM_BLOCKS),g=0;g<s;++g){var l=A.getActiveUniformBlockName(e,g),c={index:g,usedByVertexShader:A.getActiveUniformBlockParameter(e,g,A.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),usedByFragmentShader:A.getActiveUniformBlockParameter(e,g,A.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),size:A.getActiveUniformBlockParameter(e,g,A.UNIFORM_BLOCK_DATA_SIZE),uniformIndices:A.getActiveUniformBlockParameter(e,g,A.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES)};c.used=c.usedByVertexSahder||c.usedByFragmentShader,r[l]=c}return{blockSpecs:r,uniformData:t}}var G=/\[\d+\]\.$/;function H(A,e,i,t){var o=i.blockSpecs,n=i.uniformData,a=o[t];if(!a)return s("no uniform block object named:",t),{name:t,uniforms:{}};var r=new ArrayBuffer(a.size),g=A.createBuffer(),c=a.index;A.bindBuffer(A.UNIFORM_BUFFER,g),A.uniformBlockBinding(e,a.index,c);var u=t+".";G.test(u)&&(u=u.replace(G,"."));var B={};return a.uniformIndices.forEach(function(A){var e=n[A],i=l[e.type],t=i.Type,o=e.size*i.size,a=e.name;a.substr(0,u.length)===u&&(a=a.substr(u.length)),B[a]=new t(r,e.offset,o/t.BYTES_PER_ELEMENT)}),{name:t,array:r,asFloat:new Float32Array(r),buffer:g,uniforms:B}}function L(A,e,i){var t=(e.uniformBlockSpec||e).blockSpecs[i.name];if(t){var o=t.index;return A.bindBufferRange(A.UNIFORM_BUFFER,o,i.buffer,i.offset||0,i.array.byteLength),!0}return!1}function P(A,e){for(var i={},t=A.getProgramParameter(e,A.ACTIVE_ATTRIBUTES),o=0;o<t;++o){var n=A.getActiveAttrib(e,o);if(!N(n)){var a=A.getAttribLocation(e,n.name),r=f[n.type],s=r.setter(A,a,r);s.location=a,i[n.name]=s}}return i}function x(A,e){for(var i in e){var t=A[i];t&&t(e[i])}}function _(A,e){var i={program:e,uniformSetters:R(A,e),attribSetters:P(A,e)};return t.isWebGL2(A)&&(i.uniformBlockSpec=U(A,e),i.transformFeedbackInfo=O(A,e)),i}},function(A,e,i){"use strict";e.__esModule=!0,e.axisRotate=function(A,e,i,t){t=t||new o(16);var n=e[0],a=e[1],r=e[2],s=Math.sqrt(n*n+a*a+r*r),g=(n/=s)*n,l=(a/=s)*a,c=(r/=s)*r,u=Math.cos(i),B=Math.sin(i),d=1-u,E=g+(1-g)*u,h=n*a*d+r*B,C=n*r*d-a*B,w=n*a*d-r*B,m=l+(1-l)*u,p=a*r*d+n*B,I=n*r*d+a*B,f=a*r*d-n*B,Q=c+(1-c)*u,D=A[0],M=A[1],b=A[2],y=A[3],T=A[4],k=A[5],F=A[6],v=A[7],S=A[8],N=A[9],R=A[10],O=A[11];t[0]=E*D+h*T+C*S,t[1]=E*M+h*k+C*N,t[2]=E*b+h*F+C*R,t[3]=E*y+h*v+C*O,t[4]=w*D+m*T+p*S,t[5]=w*M+m*k+p*N,t[6]=w*b+m*F+p*R,t[7]=w*y+m*v+p*O,t[8]=I*D+f*T+Q*S,t[9]=I*M+f*k+Q*N,t[10]=I*b+f*F+Q*R,t[11]=I*y+f*v+Q*O,A!==t&&(t[12]=A[12],t[13]=A[13],t[14]=A[14],t[15]=A[15]);return t},e.axisRotation=function(A,e,i){i=i||new o(16);var t=A[0],n=A[1],a=A[2],r=Math.sqrt(t*t+n*n+a*a),s=(t/=r)*t,g=(n/=r)*n,l=(a/=r)*a,c=Math.cos(e),u=Math.sin(e),B=1-c;return i[0]=s+(1-s)*c,i[1]=t*n*B+a*u,i[2]=t*a*B-n*u,i[3]=0,i[4]=t*n*B-a*u,i[5]=g+(1-g)*c,i[6]=n*a*B+t*u,i[7]=0,i[8]=t*a*B+n*u,i[9]=n*a*B-t*u,i[10]=l+(1-l)*c,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},e.copy=s,e.frustum=function(A,e,i,t,n,a,r){r=r||new o(16);var s=e-A,g=t-i,l=n-a;return r[0]=2*n/s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2*n/g,r[6]=0,r[7]=0,r[8]=(A+e)/s,r[9]=(t+i)/g,r[10]=a/l,r[11]=-1,r[12]=0,r[13]=0,r[14]=n*a/l,r[15]=0,r},e.getAxis=function(A,e,i){i=i||t.create();var o=4*e;return i[0]=A[o+0],i[1]=A[o+1],i[2]=A[o+2],i},e.getTranslation=function(A,e){return(e=e||t.create())[0]=A[12],e[1]=A[13],e[2]=A[14],e},e.identity=g,e.inverse=l,e.lookAt=function(A,e,i,s){s=s||new o(16);var g=n,l=a,c=r;return t.normalize(t.subtract(A,e,c),c),t.normalize(t.cross(i,c,g),g),t.normalize(t.cross(c,g,l),l),s[0]=g[0],s[1]=g[1],s[2]=g[2],s[3]=0,s[4]=l[0],s[5]=l[1],s[6]=l[2],s[7]=0,s[8]=c[0],s[9]=c[1],s[10]=c[2],s[11]=0,s[12]=A[0],s[13]=A[1],s[14]=A[2],s[15]=1,s},e.multiply=function(A,e,i){i=i||new o(16);var t=A[0],n=A[1],a=A[2],r=A[3],s=A[4],g=A[5],l=A[6],c=A[7],u=A[8],B=A[9],d=A[10],E=A[11],h=A[12],C=A[13],w=A[14],m=A[15],p=e[0],I=e[1],f=e[2],Q=e[3],D=e[4],M=e[5],b=e[6],y=e[7],T=e[8],k=e[9],F=e[10],v=e[11],S=e[12],N=e[13],R=e[14],O=e[15];return i[0]=t*p+s*I+u*f+h*Q,i[1]=n*p+g*I+B*f+C*Q,i[2]=a*p+l*I+d*f+w*Q,i[3]=r*p+c*I+E*f+m*Q,i[4]=t*D+s*M+u*b+h*y,i[5]=n*D+g*M+B*b+C*y,i[6]=a*D+l*M+d*b+w*y,i[7]=r*D+c*M+E*b+m*y,i[8]=t*T+s*k+u*F+h*v,i[9]=n*T+g*k+B*F+C*v,i[10]=a*T+l*k+d*F+w*v,i[11]=r*T+c*k+E*F+m*v,i[12]=t*S+s*N+u*R+h*O,i[13]=n*S+g*N+B*R+C*O,i[14]=a*S+l*N+d*R+w*O,i[15]=r*S+c*N+E*R+m*O,i},e.negate=function(A,e){return(e=e||new o(16))[0]=-A[0],e[1]=-A[1],e[2]=-A[2],e[3]=-A[3],e[4]=-A[4],e[5]=-A[5],e[6]=-A[6],e[7]=-A[7],e[8]=-A[8],e[9]=-A[9],e[10]=-A[10],e[11]=-A[11],e[12]=-A[12],e[13]=-A[13],e[14]=-A[14],e[15]=-A[15],e},e.ortho=function(A,e,i,t,n,a,r){return(r=r||new o(16))[0]=2/(e-A),r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2/(t-i),r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2/(n-a),r[11]=0,r[12]=(e+A)/(A-e),r[13]=(t+i)/(i-t),r[14]=(a+n)/(n-a),r[15]=1,r},e.perspective=function(A,e,i,t,n){n=n||new o(16);var a=Math.tan(.5*Math.PI-.5*A),r=1/(i-t);return n[0]=a/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=(i+t)*r,n[11]=-1,n[12]=0,n[13]=0,n[14]=i*t*r*2,n[15]=0,n},e.rotateX=function(A,e,i){i=i||new o(16);var t=A[4],n=A[5],a=A[6],r=A[7],s=A[8],g=A[9],l=A[10],c=A[11],u=Math.cos(e),B=Math.sin(e);i[4]=u*t+B*s,i[5]=u*n+B*g,i[6]=u*a+B*l,i[7]=u*r+B*c,i[8]=u*s-B*t,i[9]=u*g-B*n,i[10]=u*l-B*a,i[11]=u*c-B*r,A!==i&&(i[0]=A[0],i[1]=A[1],i[2]=A[2],i[3]=A[3],i[12]=A[12],i[13]=A[13],i[14]=A[14],i[15]=A[15]);return i},e.rotateY=function(A,e,i){i=i||new o(16);var t=A[0],n=A[1],a=A[2],r=A[3],s=A[8],g=A[9],l=A[10],c=A[11],u=Math.cos(e),B=Math.sin(e);i[0]=u*t-B*s,i[1]=u*n-B*g,i[2]=u*a-B*l,i[3]=u*r-B*c,i[8]=u*s+B*t,i[9]=u*g+B*n,i[10]=u*l+B*a,i[11]=u*c+B*r,A!==i&&(i[4]=A[4],i[5]=A[5],i[6]=A[6],i[7]=A[7],i[12]=A[12],i[13]=A[13],i[14]=A[14],i[15]=A[15]);return i},e.rotateZ=function(A,e,i){i=i||new o(16);var t=A[0],n=A[1],a=A[2],r=A[3],s=A[4],g=A[5],l=A[6],c=A[7],u=Math.cos(e),B=Math.sin(e);i[0]=u*t+B*s,i[1]=u*n+B*g,i[2]=u*a+B*l,i[3]=u*r+B*c,i[4]=u*s-B*t,i[5]=u*g-B*n,i[6]=u*l-B*a,i[7]=u*c-B*r,A!==i&&(i[8]=A[8],i[9]=A[9],i[10]=A[10],i[11]=A[11],i[12]=A[12],i[13]=A[13],i[14]=A[14],i[15]=A[15]);return i},e.rotationX=function(A,e){e=e||new o(16);var i=Math.cos(A),t=Math.sin(A);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=t,e[7]=0,e[8]=0,e[9]=-t,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.rotationY=function(A,e){e=e||new o(16);var i=Math.cos(A),t=Math.sin(A);return e[0]=i,e[1]=0,e[2]=-t,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=t,e[9]=0,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.rotationZ=function(A,e){e=e||new o(16);var i=Math.cos(A),t=Math.sin(A);return e[0]=i,e[1]=t,e[2]=0,e[3]=0,e[4]=-t,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.scale=function(A,e,i){i=i||new o(16);var t=e[0],n=e[1],a=e[2];i[0]=t*A[0],i[1]=t*A[1],i[2]=t*A[2],i[3]=t*A[3],i[4]=n*A[4],i[5]=n*A[5],i[6]=n*A[6],i[7]=n*A[7],i[8]=a*A[8],i[9]=a*A[9],i[10]=a*A[10],i[11]=a*A[11],A!==i&&(i[12]=A[12],i[13]=A[13],i[14]=A[14],i[15]=A[15]);return i},e.scaling=function(A,e){return(e=e||new o(16))[0]=A[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=A[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=A[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.setAxis=function(A,e,i,t){t!==A&&(t=s(A,t));var o=4*i;return t[o+0]=e[0],t[o+1]=e[1],t[o+2]=e[2],t},e.setDefaultType=function(A){var e=o;return o=A,e},e.setTranslation=function(A,e,i){i=i||g(),A!==i&&(i[0]=A[0],i[1]=A[1],i[2]=A[2],i[3]=A[3],i[4]=A[4],i[5]=A[5],i[6]=A[6],i[7]=A[7],i[8]=A[8],i[9]=A[9],i[10]=A[10],i[11]=A[11]);return i[12]=e[0],i[13]=e[1],i[14]=e[2],i[15]=1,i},e.transformDirection=function(A,e,i){i=i||t.create();var o=e[0],n=e[1],a=e[2];return i[0]=o*A[0]+n*A[4]+a*A[8],i[1]=o*A[1]+n*A[5]+a*A[9],i[2]=o*A[2]+n*A[6]+a*A[10],i},e.transformNormal=function(A,e,i){i=i||t.create();var o=l(A),n=e[0],a=e[1],r=e[2];return i[0]=n*o[0]+a*o[1]+r*o[2],i[1]=n*o[4]+a*o[5]+r*o[6],i[2]=n*o[8]+a*o[9]+r*o[10],i},e.transformPoint=function(A,e,i){i=i||t.create();var o=e[0],n=e[1],a=e[2],r=o*A[3]+n*A[7]+a*A[11]+A[15];return i[0]=(o*A[0]+n*A[4]+a*A[8]+A[12])/r,i[1]=(o*A[1]+n*A[5]+a*A[9]+A[13])/r,i[2]=(o*A[2]+n*A[6]+a*A[10]+A[14])/r,i},e.translate=function(A,e,i){i=i||new o(16);var t=e[0],n=e[1],a=e[2],r=A[0],s=A[1],g=A[2],l=A[3],c=A[4],u=A[5],B=A[6],d=A[7],E=A[8],h=A[9],C=A[10],w=A[11],m=A[12],p=A[13],I=A[14],f=A[15];A!==i&&(i[0]=r,i[1]=s,i[2]=g,i[3]=l,i[4]=c,i[5]=u,i[6]=B,i[7]=d,i[8]=E,i[9]=h,i[10]=C,i[11]=w);return i[12]=r*t+c*n+E*a+m,i[13]=s*t+u*n+h*a+p,i[14]=g*t+B*n+C*a+I,i[15]=l*t+d*n+w*a+f,i},e.translation=function(A,e){return(e=e||new o(16))[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=A[0],e[13]=A[1],e[14]=A[2],e[15]=1,e},e.transpose=function(A,e){if((e=e||new o(16))===A){var i;return i=A[1],A[1]=A[4],A[4]=i,i=A[2],A[2]=A[8],A[8]=i,i=A[3],A[3]=A[12],A[12]=i,i=A[6],A[6]=A[9],A[9]=i,i=A[7],A[7]=A[13],A[13]=i,i=A[11],A[11]=A[14],A[14]=i,e}var t=A[0],n=A[1],a=A[2],r=A[3],s=A[4],g=A[5],l=A[6],c=A[7],u=A[8],B=A[9],d=A[10],E=A[11],h=A[12],C=A[13],w=A[14],m=A[15];return e[0]=t,e[1]=s,e[2]=u,e[3]=h,e[4]=n,e[5]=g,e[6]=B,e[7]=C,e[8]=a,e[9]=l,e[10]=d,e[11]=w,e[12]=r,e[13]=c,e[14]=E,e[15]=m,e};var t=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}(i(3));var o=Float32Array,n=t.create(),a=t.create(),r=t.create();function s(A,e){return(e=e||new o(16))[0]=A[0],e[1]=A[1],e[2]=A[2],e[3]=A[3],e[4]=A[4],e[5]=A[5],e[6]=A[6],e[7]=A[7],e[8]=A[8],e[9]=A[9],e[10]=A[10],e[11]=A[11],e[12]=A[12],e[13]=A[13],e[14]=A[14],e[15]=A[15],e}function g(A){return(A=A||new o(16))[0]=1,A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,A[9]=0,A[10]=1,A[11]=0,A[12]=0,A[13]=0,A[14]=0,A[15]=1,A}function l(A,e){e=e||new o(16);var i=A[0],t=A[1],n=A[2],a=A[3],r=A[4],s=A[5],g=A[6],l=A[7],c=A[8],u=A[9],B=A[10],d=A[11],E=A[12],h=A[13],C=A[14],w=A[15],m=B*w,p=C*d,I=g*w,f=C*l,Q=g*d,D=B*l,M=n*w,b=C*a,y=n*d,T=B*a,k=n*l,F=g*a,v=c*h,S=E*u,N=r*h,R=E*s,O=r*u,Y=c*s,U=i*h,G=E*t,H=i*u,L=c*t,P=i*s,x=r*t,_=m*s+f*u+Q*h-(p*s+I*u+D*h),j=p*t+M*u+T*h-(m*t+b*u+y*h),J=I*t+b*s+k*h-(f*t+M*s+F*h),z=D*t+y*s+F*u-(Q*t+T*s+k*u),K=1/(i*_+r*j+c*J+E*z);return e[0]=K*_,e[1]=K*j,e[2]=K*J,e[3]=K*z,e[4]=K*(p*r+I*c+D*E-(m*r+f*c+Q*E)),e[5]=K*(m*i+b*c+y*E-(p*i+M*c+T*E)),e[6]=K*(f*i+M*r+F*E-(I*i+b*r+k*E)),e[7]=K*(Q*i+T*r+k*c-(D*i+y*r+F*c)),e[8]=K*(v*l+R*d+O*w-(S*l+N*d+Y*w)),e[9]=K*(S*a+U*d+L*w-(v*a+G*d+H*w)),e[10]=K*(N*a+G*l+P*w-(R*a+U*l+x*w)),e[11]=K*(Y*a+H*l+x*d-(O*a+L*l+P*d)),e[12]=K*(N*B+Y*C+S*g-(O*C+v*g+R*B)),e[13]=K*(H*C+v*n+G*B-(U*B+L*C+S*n)),e[14]=K*(U*g+x*C+R*n-(P*C+N*n+G*g)),e[15]=K*(P*B+O*n+L*g-(H*g+x*B+Y*n)),e}},function(A,e,i){"use strict";e.__esModule=!0,e.createAttribsFromArrays=h,e.createBuffersFromArrays=function(A,e){var i={};Object.keys(e).forEach(function(t){i[t]=w(A,e[t],t)}),e.indices?(i.numElements=e.indices.length,i.elementType=t.getGLTypeForTypedArray(E(e.indices),"indices")):i.numElements=function(A){for(var e,i=0;i<C.length&&!((e=C[i])in A);++i);ii===C.length&&(e=Object.keys(A)[0]);var t=A[e],o=l(t).length,n=d(t,e),a=o/n;if(o%n>0)throw"numComponents "+n+" not correct for length "+o;return a}(e);return i},e.createBufferFromArray=w,e.createBufferFromTypedArray=s,e.createBufferInfoFromArrays=function(A,e){var i={attribs:h(A,e)},o=e.indices;if(o){var n=E(o,"indices");i.indices=s(A,n,A.ELEMENT_ARRAY_BUFFER),i.numElements=n.length,i.elementType=t.getGLTypeForTypedArray(n)}else i.numElements=function(A,e){var i,t;for(t=0;t<C.length&&!((i=C[t])in e)&&!((i=a.attribPrefix+i)in e);++t);t===C.length&&(i=Object.keys(e)[0]);var o=e[i];A.bindBuffer(A.ARRAY_BUFFER,o.buffer);var n=A.getBufferParameter(A.ARRAY_BUFFER,A.BUFFER_SIZE);A.bindBuffer(A.ARRAY_BUFFER,null);var r=function(A,e){return e===A.BYTE?1:e===A.UNSIGNED_BYTE?1:e===A.SHORT?2:e===A.UNSIGNED_SHORT?2:e===A.INT?4:e===A.UNSIGNED_INT?4:e===A.FLOAT?4:0}(A,o.type),s=n/r,g=o.numComponents||o.size,l=s/g;if(l%1!=0)throw"numComponents "+g+" not correct for length "+length;return l}(A,i.attribs);return i},e.setAttribInfoBufferFromArray=function(A,e,i,t){i=E(i),void 0!==t?(A.bindBuffer(A.ARRAY_BUFFER,e.buffer),A.bufferSubData(A.ARRAY_BUFFER,t,i)):r(A,A.ARRAY_BUFFER,e.buffer,i,e.drawType)},e.setAttributePrefix=function(A){a.attribPrefix=A},e.setAttributeDefaults_=function(A){o.copyExistingProperties(A,a)},e.getNumComponents_=d,e.getArray_=l;var t=n(i(1)),o=n(i(0));function n(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}var a={attribPrefix:""};function r(A,e,i,t,o){A.bindBuffer(e,i),A.bufferData(e,t,o||A.STATIC_DRAW)}function s(A,e,i,t){if(o.isBuffer(A,e))return e;i=i||A.ARRAY_BUFFER;var n=A.createBuffer();return r(A,i,n,e,t),n}function g(A){return"indices"===A}function l(A){return A.length?A:A.data}var c=/coord|texture/i,u=/color|colour/i;function B(A,e){var i;if(e%(i=c.test(A)?2:u.test(A)?4:3)>0)throw"Can not guess numComponents for attribute '"+A+"'. Tried "+i+" but "+e+" values is not evenly divisible by "+i+". You should specify it.";return i}function d(A,e){return A.numComponents||A.size||B(e,l(A).length)}function E(A,e){if(t.isArrayBuffer(A))return A;if(t.isArrayBuffer(A.data))return A.data;Array.isArray(A)&&(A={data:A});var i=A.type;return i||(i=g(e)?Uint16Array:Float32Array),new i(A.data)}function h(A,e){var i={};return Object.keys(e).forEach(function(o){if(!g(o)){var n,r,l,c,u,h=e[o],C=h.attrib||h.name||h.attribName||a.attribPrefix+o;if("number"==typeof h||"number"==typeof h.data){u=h.data||h;var w=h.type||Float32Array,m=u*w.BYTES_PER_ELEMENT;r=t.getGLTypeForTypedArrayType(w),l=void 0!==h.normalize?h.normalize:function(A){return A===Int8Array||A===Uint8Array}(w),c=h.numComponents||h.size||B(o,u),n=A.createBuffer(),A.bindBuffer(A.ARRAY_BUFFER,n),A.bufferData(A.ARRAY_BUFFER,m,h.drawType||A.STATIC_DRAW)}else{var p=E(h,o);n=s(A,p,void 0,h.drawType),r=t.getGLTypeForTypedArray(p),l=void 0!==h.normalize?h.normalize:function(A){return A instanceof Int8Array||A instanceof Uint8Array}(p),c=d(h,o),u=p.length}i[C]={buffer:n,numComponents:c,type:r,normalize:l,stride:h.stride||0,offset:h.offset||0,divisor:void 0===h.divisor?void 0:h.divisor,drawType:h.drawType}}}),A.bindBuffer(A.ARRAY_BUFFER,null),i}var C=["position","positions","a_position"];function w(A,e,i){var t="indices"===i?A.ELEMENT_ARRAY_BUFFER:A.ARRAY_BUFFER;return s(A,E(e,i),t)}},function(A,e,i){"use strict";e.__esModule=!0,e.setTextureDefaults_=function(A){n.copyExistingProperties(A,s),A.textureColor&&f(A.textureColor)},e.createSampler=v,e.createSamplers=function(A,e){var i={};return Object.keys(e).forEach(function(t){i[t]=v(A,e[t])}),i},e.setSamplerParameters=F,e.createTexture=z,e.setEmptyTexture=J,e.setTextureFromArray=j,e.loadTextureFromUrl=P,e.setTextureFromElement=Y,e.setTextureFilteringForSize=S,e.setTextureParameters=k,e.setDefaultTextureColor=f,e.createTextures=function(A,e,i){i=i||U;var t=0,o=[],n={},a={};function r(){0===t&&setTimeout(function(){i(o.length?o:void 0,n,a)},0)}return Object.keys(e).forEach(function(i){var s,g=e[i];(function(A){return"string"==typeof A||Array.isArray(A)&&"string"==typeof A[0]})(g.src)&&(s=function(A,e,n){a[i]=n,--t,A&&o.push(A),r()},++t),n[i]=z(A,g,s)}),r(),n},e.resizeTexture=function(A,e,i,t,o){t=t||i.width,o=o||i.height;var n=i.target||A.TEXTURE_2D;A.bindTexture(n,e);var a,r=i.level||0,s=i.internalFormat||i.format||A.RGBA,l=w(s),c=i.format||l.format,u=i.src;a=u&&(g(u)||Array.isArray(u)&&"number"==typeof u[0])?i.type||p(A,u,l.type):i.type||l.type;if(n===A.TEXTURE_CUBE_MAP)for(var B=0;B<6;++B)A.texImage2D(A.TEXTURE_CUBE_MAP_POSITIVE_X+B,r,s,t,o,0,c,a,null);else A.texImage2D(n,r,s,t,o,0,c,a,null)},e.getNumComponentsForFormat=function(A){var e=B[A];if(!e)throw"unknown format: "+A;return e.numColorComponents},e.getBytesPerElementForInternalFormat=C;var t=r(i(4)),o=r(i(1)),n=r(i(0)),a=function(A){return A&&A.__esModule?A:{default:A}}(i(2));function r(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}var s={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},g=o.isArrayBuffer,l=a.default.document&&a.default.document.createElement?a.default.document.createElement("canvas").getContext("2d"):null,c=6407,u=33319,B={},d=B;d[6406]={numColorComponents:1},d[6409]={numColorComponents:1},d[6410]={numColorComponents:2},d[c]={numColorComponents:3},d[6408]={numColorComponents:4},d[6403]={numColorComponents:1},d[36244]={numColorComponents:1},d[u]={numColorComponents:2},d[33320]={numColorComponents:2},d[c]={numColorComponents:3},d[36248]={numColorComponents:3},d[6408]={numColorComponents:4},d[36249]={numColorComponents:4},d[6402]={numColorComponents:1},d[34041]={numColorComponents:2};var E={},h=E;function C(A,e){var i=E[A];if(!i)throw"unknown internal format";var t=i.bytesPerElementMap[e];if(void 0===t)throw"unknown internal format";return t}function w(A){var e=E[A];if(!e)throw"unknown internal format";return{format:e.textureFormat,type:Array.isArray(e.type)?e.type[0]:e.type}}function m(A){return 0==(A&A-1)}function p(A,e,i){return g(e)?o.getGLTypeForTypedArray(e):i||A.UNSIGNED_BYTE}function I(A,e,i,t,o){if(o%1!=0)throw"can't guess dimensions";if(i||t){if(t){if(!i&&(i=o/t)%1)throw"can't guess dimensions"}else if((t=o/i)%1)throw"can't guess dimensions"}else{var n=Math.sqrt(o/(e===A.TEXTURE_CUBE_MAP?6:1));n%1==0?(i=n,t=n):(i=o,t=1)}return{width:i,height:t}}function f(A){s.textureColor=new Uint8Array([255*A[0],255*A[1],255*A[2],255*A[3]])}h[6406]={textureFormat:6406,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},h[6409]={textureFormat:6409,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[5121,5131,36193,5126]},h[6410]={textureFormat:6410,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[5121,5131,36193,5126]},h[c]={textureFormat:c,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[5121,5131,36193,5126,33635]},h[6408]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[5121,5131,36193,5126,32819,32820]},h[33321]={textureFormat:6403,colorRenderable:!0,textureFilterable:!0,bytesPerElement:1,type:5121},h[36756]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:1,type:5120},h[33325]={textureFormat:6403,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[5126,5131]},h[33326]={textureFormat:6403,colorRenderable:!1,textureFilterable:!1,bytesPerElement:4,type:5126},h[33330]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:5121},h[33329]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:1,type:5120},h[33332]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5123},h[33331]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5122},h[33334]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5125},h[33333]={textureFormat:36244,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5124},h[33323]={textureFormat:u,colorRenderable:!0,textureFilterable:!0,bytesPerElement:2,type:5121},h[36757]={textureFormat:u,colorRenderable:!1,textureFilterable:!0,bytesPerElement:2,type:5120},h[33327]={textureFormat:u,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[5126,5131]},h[33328]={textureFormat:u,colorRenderable:!1,textureFilterable:!1,bytesPerElement:8,type:5126},h[33336]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5121},h[33335]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:2,type:5120},h[33338]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5123},h[33337]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5122},h[33340]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5125},h[33339]={textureFormat:33320,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5124},h[32849]={textureFormat:c,colorRenderable:!0,textureFilterable:!0,bytesPerElement:3,type:5121},h[35905]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:5121},h[36194]={textureFormat:c,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[5121,33635]},h[36758]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:3,type:5120},h[35898]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35899]},h[35901]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[5126,5131,35902]},h[34843]={textureFormat:c,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[5126,5131]},h[34837]={textureFormat:c,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5126},h[36221]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:5121},h[36239]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:3,type:5120},h[36215]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:5123},h[36233]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:6,type:5122},h[36209]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5125},h[36227]={textureFormat:36248,colorRenderable:!1,textureFilterable:!1,bytesPerElement:12,type:5124},h[32856]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:5121},h[35907]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:5121},h[36759]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:4,type:5120},h[32855]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[5121,32820,33640]},h[32854]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[5121,32819]},h[32857]={textureFormat:6408,colorRenderable:!0,textureFilterable:!0,bytesPerElement:4,type:33640},h[34842]={textureFormat:6408,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[5126,5131]},h[34836]={textureFormat:6408,colorRenderable:!1,textureFilterable:!1,bytesPerElement:16,type:5126},h[36220]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5121},h[36238]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5120},h[36975]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:33640},h[36214]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5123},h[36232]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:8,type:5122},h[36226]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:5124},h[36208]={textureFormat:36249,colorRenderable:!0,textureFilterable:!1,bytesPerElement:16,type:5125},h[33189]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[5123,5125]},h[33190]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5125},h[36012]={textureFormat:6402,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:5126},h[35056]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:34042},h[36013]={textureFormat:34041,colorRenderable:!0,textureFilterable:!1,bytesPerElement:4,type:36269},Object.keys(h).forEach(function(A){var e=h[A];if(e.bytesPerElementMap={},Array.isArray(e.bytesPerElement))e.bytesPerElement.forEach(function(A,i){var t=e.type[i];e.bytesPerElementMap[t]=A});else{var i=e.type;e.bytesPerElementMap[i]=e.bytesPerElement}});var Q={};function D(A,e){void 0!==e.colorspaceConversion&&(Q.colorspaceConversion=A.getParameter(A.UNPACK_COLORSPACE_CONVERSION_WEBGL),A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.colorspaceConversion)),void 0!==e.premultiplyAlpha&&(Q.premultiplyAlpha=A.getParameter(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL),A.pixelStorei(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha)),void 0!==e.flipY&&(Q.flipY=A.getParameter(A.UNPACK_FLIP_Y_WEBGL),A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,e.flipY))}function M(A,e){void 0!==e.colorspaceConversion&&A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,Q.colorspaceConversion),void 0!==e.premultiplyAlpha&&A.pixelStorei(A.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Q.premultiplyAlpha),void 0!==e.flipY&&A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,Q.flipY)}function b(A){Q.unpackAlignment=A.getParameter(A.UNPACK_ALIGNMENT),t.isWebGL2(A)&&(Q.unpackRowLength=A.getParameter(A.UNPACK_ROW_LENGTH),Q.unpackImageHeight=A.getParameter(A.UNPACK_IMAGE_HEIGHT),Q.unpackSkipPixels=A.getParameter(A.UNPACK_SKIP_PIXELS),Q.unpackSkipRows=A.getParameter(A.UNPACK_SKIP_ROWS),Q.unpackSkipImages=A.getParameter(A.UNPACK_SKIP_IMAGES))}function y(A){A.pixelStorei(A.UNPACK_ALIGNMENT,Q.unpackAlignment),t.isWebGL2(A)&&(A.pixelStorei(A.UNPACK_ROW_LENGTH,Q.unpackRowLength),A.pixelStorei(A.UNPACK_IMAGE_HEIGHT,Q.unpackImageHeight),A.pixelStorei(A.UNPACK_SKIP_PIXELS,Q.unpackSkipPixels),A.pixelStorei(A.UNPACK_SKIP_ROWS,Q.unpackSkipRows),A.pixelStorei(A.UNPACK_SKIP_IMAGES,Q.unpackSkipImages))}function T(A,e,i,t){t.minMag&&(i.call(A,e,A.TEXTURE_MIN_FILTER,t.minMag),i.call(A,e,A.TEXTURE_MAG_FILTER,t.minMag)),t.min&&i.call(A,e,A.TEXTURE_MIN_FILTER,t.min),t.mag&&i.call(A,e,A.TEXTURE_MAG_FILTER,t.mag),t.wrap&&(i.call(A,e,A.TEXTURE_WRAP_S,t.wrap),i.call(A,e,A.TEXTURE_WRAP_T,t.wrap),(e===A.TEXTURE_3D||n.isSampler(A,e))&&i.call(A,e,A.TEXTURE_WRAP_R,t.wrap)),t.wrapR&&i.call(A,e,A.TEXTURE_WRAP_R,t.wrapR),t.wrapS&&i.call(A,e,A.TEXTURE_WRAP_S,t.wrapS),t.wrapT&&i.call(A,e,A.TEXTURE_WRAP_T,t.wrapT),t.minLod&&i.call(A,e,A.TEXTURE_MIN_LOD,t.minLod),t.maxLod&&i.call(A,e,A.TEXTURE_MAX_LOD,t.maxLod),t.baseLevel&&i.call(A,e,A.TEXTURE_BASE_LEVEL,t.baseLevel),t.maxLevel&&i.call(A,e,A.TEXTURE_MAX_LEVEL,t.maxLevel)}function k(A,e,i){var t=i.target||A.TEXTURE_2D;A.bindTexture(t,e),T(A,t,A.texParameteri,i)}function F(A,e,i){T(A,e,A.samplerParameteri,i)}function v(A,e){var i=A.createSampler();return F(A,i,e),i}function S(A,e,i,o,n,a,r){i=i||s.textureOptions,a=a||A.RGBA,r=r||A.UNSIGNED_BYTE;var g=i.target||A.TEXTURE_2D;if(o=o||i.width,n=n||i.height,A.bindTexture(g,e),function(A,e,i,o){if(!t.isWebGL2(A))return m(e)&&m(i);var n=E[o];if(!n)throw"unknown internal format";return n.colorRenderable&&n.textureFilterable}(A,o,n,a))A.generateMipmap(g);else{var l=function(A){var e=E[A];if(!e)throw"unknown internal format";return e.textureFilterable}(a)?A.LINEAR:A.NEAREST;A.texParameteri(g,A.TEXTURE_MIN_FILTER,l),A.texParameteri(g,A.TEXTURE_MAG_FILTER,l),A.texParameteri(g,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(g,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE)}}function N(A){return!0===A.auto||void 0===A.auto&&void 0===A.level}function R(A,e){return(e=e||{}).cubeFaceOrder||[A.TEXTURE_CUBE_MAP_POSITIVE_X,A.TEXTURE_CUBE_MAP_NEGATIVE_X,A.TEXTURE_CUBE_MAP_POSITIVE_Y,A.TEXTURE_CUBE_MAP_NEGATIVE_Y,A.TEXTURE_CUBE_MAP_POSITIVE_Z,A.TEXTURE_CUBE_MAP_NEGATIVE_Z]}function O(A,e){var i=R(A,e).map(function(A,e){return{face:A,ndx:e}});return i.sort(function(A,e){return A.face-e.face}),i}function Y(A,e,i,t){var o=(t=t||s.textureOptions).target||A.TEXTURE_2D,n=t.level||0,r=i.width,g=i.height,c=t.internalFormat||t.format||A.RGBA,u=w(c),B=t.format||u.format,d=t.type||u.type;if(D(A,t),A.bindTexture(o,e),o===A.TEXTURE_CUBE_MAP){var E,h,C=i.width,m=i.height;if(C/6===m)E=m,h=[0,0,1,0,2,0,3,0,4,0,5,0];else if(m/6===C)E=C,h=[0,0,0,1,0,2,0,3,0,4,0,5];else if(C/3==m/2)E=C/3,h=[0,0,1,0,2,0,0,1,1,1,2,1];else{if(C/2!=m/3)throw"can't figure out cube map from element: "+(i.src?i.src:i.nodeName);E=C/2,h=[0,0,1,0,0,1,1,1,0,2,1,2]}l?(l.canvas.width=E,l.canvas.height=E,r=E,g=E,O(A,t).forEach(function(e){var t=h[2*e.ndx+0]*E,o=h[2*e.ndx+1]*E;l.drawImage(i,t,o,E,E,0,0,E,E),A.texImage2D(e.face,n,c,B,d,l.canvas)}),l.canvas.width=1,l.canvas.height=1):a.default.createImageBitmap&&(r=E,g=E,O(A,t).forEach(function(s){var l=h[2*s.ndx+0]*E,u=h[2*s.ndx+1]*E;A.texImage2D(s.face,n,c,E,E,0,B,d,null),a.default.createImageBitmap(i,l,u,E,E,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(function(i){D(A,t),A.bindTexture(o,e),A.texImage2D(s.face,n,c,B,d,i),M(A,t),N(t)&&S(A,e,t,r,g,c,d)})}))}else if(o===A.TEXTURE_3D||o===A.TEXTURE_2D_ARRAY){var p=Math.min(i.width,i.height),I=Math.max(i.width,i.height),f=I/p;if(f%1!=0)throw"can not compute 3D dimensions of element";var Q=i.width===I?1:0,T=i.height===I?1:0;b(A),A.pixelStorei(A.UNPACK_ALIGNMENT,1),A.pixelStorei(A.UNPACK_ROW_LENGTH,i.width),A.pixelStorei(A.UNPACK_IMAGE_HEIGHT,0),A.pixelStorei(A.UNPACK_SKIP_IMAGES,0),A.texImage3D(o,n,c,p,p,p,0,B,d,null);for(var F=0;F<f;++F){var v=F*p*Q,R=F*p*T;A.pixelStorei(A.UNPACK_SKIP_PIXELS,v),A.pixelStorei(A.UNPACK_SKIP_ROWS,R),A.texSubImage3D(o,n,0,0,F,p,p,1,B,d,i)}y(A)}else A.texImage2D(o,n,c,B,d,i);M(A,t),N(t)&&S(A,e,t,r,g,c,d),k(A,e,t)}function U(){}function G(A){return a.default.ImageBitmap&&A instanceof a.default.ImageBitmap||a.default.ImageData&&A instanceof a.default.ImageData||a.default.HTMLElement&&A instanceof a.default.HTMLElement}function H(A,e,i){return G(A)?(setTimeout(function(){i(null,A)}),A):function(A,e,i){var t;if(i=i||U,a.default.Image){t=new a.default.Image,void 0!==(e=void 0!==e?e:s.crossOrigin)&&(t.crossOrigin=e);var o=function(){t.removeEventListener("error",r),t.removeEventListener("load",g),t=null},r=function(){var e="couldn't load image: "+A;n.error(e),i(e,t),o()},g=function(){i(null,t),o()};return t.addEventListener("error",r),t.addEventListener("load",g),t.src=A,t}if(a.default.ImageBitmap){var l,c,u=function(){i(l,c)},B={};e&&(B.mode="cors"),fetch(A,B).then(function(A){if(!A.ok)throw A;return A.blob()}).then(function(A){return a.default.createImageBitmap(A,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}).then(function(A){c=A,setTimeout(u)}).catch(function(A){l=A,setTimeout(u)}),t=null}return t}(A,e,i)}function L(A,e,i){var t=(i=i||s.textureOptions).target||A.TEXTURE_2D;if(A.bindTexture(t,e),!1!==i.color){var o=function(A){return A=A||s.textureColor,g(A)?A:new Uint8Array([255*A[0],255*A[1],255*A[2],255*A[3]])}(i.color);if(t===A.TEXTURE_CUBE_MAP)for(var n=0;n<6;++n)A.texImage2D(A.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,A.RGBA,1,1,0,A.RGBA,A.UNSIGNED_BYTE,o);else t===A.TEXTURE_3D||t===A.TEXTURE_2D_ARRAY?A.texImage3D(t,0,A.RGBA,1,1,1,0,A.RGBA,A.UNSIGNED_BYTE,o):A.texImage2D(t,0,A.RGBA,1,1,0,A.RGBA,A.UNSIGNED_BYTE,o)}}function P(A,e,i,t){return t=t||U,i=i||s.textureOptions,L(A,e,i),H((i=Object.assign({},i)).src,i.crossOrigin,function(o,n){o?t(o,e,n):(Y(A,e,n,i),t(null,e,n))})}function x(A,e,i,t){t=t||U;var o=i.src;if(6!==o.length)throw"there must be 6 urls for a cubemap";var n=i.level||0,a=i.internalFormat||i.format||A.RGBA,r=w(a),s=i.format||r.format,g=i.type||A.UNSIGNED_BYTE,l=i.target||A.TEXTURE_2D;if(l!==A.TEXTURE_CUBE_MAP)throw"target must be TEXTURE_CUBE_MAP";L(A,e,i),i=Object.assign({},i);var c,u=6,B=[],d=R(A,i);c=o.map(function(o,r){return H(o,i.crossOrigin,function(o){return function(r,d){--u,r?B.push(r):d.width!==d.height?B.push("cubemap face img is not a square: "+d.src):(D(A,i),A.bindTexture(l,e),5===u?R(A).forEach(function(e){A.texImage2D(e,n,a,s,g,d)}):A.texImage2D(o,n,a,s,g,d),M(A,i),N(i)&&A.generateMipmap(l)),0===u&&t(B.length?B:void 0,e,c)}}(d[r]))})}function _(A,e,i,t){t=t||U;var o=i.src,n=i.internalFormat||i.format||A.RGBA,a=w(n),r=i.format||a.format,s=i.type||A.UNSIGNED_BYTE,g=i.target||A.TEXTURE_2D_ARRAY;if(g!==A.TEXTURE_3D&&g!==A.TEXTURE_2D_ARRAY)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";L(A,e,i),i=Object.assign({},i);var c,u=o.length,B=[],d=i.level||0,E=i.width,h=i.height,C=o.length,m=!0;c=o.map(function(o,a){return H(o,i.crossOrigin,function(o){return function(a,w){if(--u,a)B.push(a);else{if(D(A,i),A.bindTexture(g,e),m){m=!1,E=i.width||w.width,h=i.height||w.height,A.texImage3D(g,d,n,E,h,C,0,r,s,null);for(var p=0;p<C;++p)A.texSubImage3D(g,d,0,0,p,E,h,1,r,s,w)}else{var I=w;w.width===E&&w.height===h||(I=l.canvas,l.canvas.width=E,l.canvas.height=h,l.drawImage(w,0,0,E,h)),A.texSubImage3D(g,d,0,0,o,E,h,1,r,s,I),I===l.canvas&&(l.canvas.width=0,l.canvas.height=0)}M(A,i),N(i)&&A.generateMipmap(g)}0===u&&t(B.length?B:void 0,e,c)}}(a))})}function j(A,e,i,n){var a=(n=n||s.textureOptions).target||A.TEXTURE_2D;A.bindTexture(a,e);var r=n.width,l=n.height,c=n.depth,u=n.level||0,B=n.internalFormat||n.format||A.RGBA,d=w(B),E=n.format||d.format,h=n.type||p(A,i,d.type);if(g(i))i instanceof Uint8ClampedArray&&(i=new Uint8Array(i.buffer));else{var m=o.getTypedArrayTypeForGLType(h);i=new m(i)}var f,Q=C(B,h),T=i.byteLength/Q;if(T%1)throw"length wrong size for format: "+t.glEnumToString(A,E);if(a===A.TEXTURE_3D)if(r||l||c)!r||l&&c?!l||r&&c?(f=I(A,a,r,l,T/c),r=f.width,l=f.height):(f=I(A,a,r,c,T/l),r=f.width,c=f.height):(f=I(A,a,l,c,T/r),l=f.width,c=f.height);else{var k=Math.cbrt(T);if(k%1!=0)throw"can't guess cube size of array of numElements: "+T;r=k,l=k,c=k}else f=I(A,a,r,l,T),r=f.width,l=f.height;if(b(A),A.pixelStorei(A.UNPACK_ALIGNMENT,n.unpackAlignment||1),D(A,n),a===A.TEXTURE_CUBE_MAP){var F=T/6*(Q/i.BYTES_PER_ELEMENT);O(A,n).forEach(function(e){var t=F*e.ndx,o=i.subarray(t,t+F);A.texImage2D(e.face,u,B,r,l,0,E,h,o)})}else a===A.TEXTURE_3D?A.texImage3D(a,u,B,r,l,c,0,E,h,i):A.texImage2D(a,u,B,r,l,0,E,h,i);return M(A,n),y(A),{width:r,height:l,depth:c,type:h}}function J(A,e,i){var t=i.target||A.TEXTURE_2D;A.bindTexture(t,e);var o=i.level||0,n=i.internalFormat||i.format||A.RGBA,a=w(n),r=i.format||a.format,s=i.type||a.type;if(D(A,i),t===A.TEXTURE_CUBE_MAP)for(var g=0;g<6;++g)A.texImage2D(A.TEXTURE_CUBE_MAP_POSITIVE_X+g,o,n,i.width,i.height,0,r,s,null);else t===A.TEXTURE_3D?A.texImage3D(t,o,n,i.width,i.height,i.depth,0,r,s,null):A.texImage2D(t,o,n,i.width,i.height,0,r,s,null);M(A,i)}function z(A,e,i){i=i||U,e=e||s.textureOptions;var t=A.createTexture(),o=e.target||A.TEXTURE_2D,n=e.width||1,a=e.height||1,r=e.internalFormat||A.RGBA,l=w(r),c=e.type||l.type;A.bindTexture(o,t),o===A.TEXTURE_CUBE_MAP&&(A.texParameteri(o,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(o,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE));var u=e.src;if(u)if("function"==typeof u&&(u=u(A,e)),"string"==typeof u)P(A,t,e,i);else if(g(u)||Array.isArray(u)&&("number"==typeof u[0]||Array.isArray(u[0])||g(u[0]))){var B=j(A,t,u,e);n=B.width,a=B.height,c=B.type}else if(Array.isArray(u)&&("string"==typeof u[0]||G(u[0])))o===A.TEXTURE_CUBE_MAP?x(A,t,e,i):_(A,t,e,i);else{if(!G(u))throw"unsupported src type";Y(A,t,u,e),n=u.width,a=u.height}else J(A,t,e);return N(e)&&S(A,t,e,n,a,r,c),k(A,t,e),t}},function(A,e,i){"use strict";e.__esModule=!0;var t={m4:!0,v3:!0,primitives:!0};e.primitives=e.v3=e.m4=void 0;var o=s(i(6));e.m4=o;var n=s(i(3));e.v3=n;var a=s(i(10));e.primitives=a;var r=i(11);function s(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}Object.keys(r).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=r[A]))})},function(A,e,i){"use strict";e.__esModule=!0,e.create3DFVertices=y,e.createAugmentedTypedArray=u,e.createCubeVertices=D,e.createPlaneVertices=I,e.createSphereVertices=f,e.createTruncatedConeVertices=M,e.createXYQuadVertices=p,e.createCresentVertices=T,e.createCylinderVertices=k,e.createTorusVertices=F,e.createDiscVertices=v,e.deindexVertices=function(A){var e=A.indices,i={},t=e.length;return Object.keys(A).filter(B).forEach(function(o){for(var n=A[o],a=n.numComponents,r=u(a,t,n.constructor),s=0;s<t;++s)for(var g=e[s],l=g*a,c=0;c<a;++c)r.push(n[l+c]);i[o]=r}),i},e.flattenNormals=function(A){if(A.indices)throw"can't flatten normals of indexed vertices. deindex them first";for(var e=A.normal,i=e.length,t=0;t<i;t+=9){var o=e[t+0],n=e[t+1],a=e[t+2],r=e[t+3],s=e[t+4],g=e[t+5],l=e[t+6],c=e[t+7],u=e[t+8],B=o+r+l,d=n+s+c,E=a+g+u,h=Math.sqrt(B*B+d*d+E*E);B/=h,d/=h,E/=h,e[t+0]=B,e[t+1]=d,e[t+2]=E,e[t+3]=B,e[t+4]=d,e[t+5]=E,e[t+6]=B,e[t+7]=d,e[t+8]=E}return A},e.makeRandomVertexColors=function(A,e){e=e||{};var i=A.position.numElements,t=u(4,i,Uint8Array),o=e.rand||function(A,e){return e<3?function(A){return Math.random()*A|0}(256):255};if(A.color=t,A.indices)for(var n=0;n<i;++n)t.push(o(n,0),o(n,1),o(n,2),o(n,3));else for(var a=e.vertsPerColor||3,r=i/a,s=0;s<r;++s)for(var g=[o(s,0),o(s,1),o(s,2),o(s,3)],l=0;l<a;++l)t.push(g);return A},e.reorientDirections=h,e.reorientNormals=C,e.reorientPositions=w,e.reorientVertices=m,e.concatVertices=function(A){for(var e,i={},t=function(t){var o=A[t];Object.keys(o).forEach(function(A){i[A]||(i[A]=[]),e||"indices"===A||(e=A);var t=o[A],n=l(t,A),a=g(t),r=a.length/n;i[A].push(r)})},o=0;o<A.length;++o)t(o);var n=i[e],a={};return Object.keys(i).forEach(function(e){var i=function(e){for(var i,t=0,o=0;o<A.length;++o){var n=A[o],a=n[e],r=g(a);t+=r.length,i&&!a.data||(i=a)}return{length:t,spec:i}}(e),t=Y(i.spec,i.length);!function(e,i,t){for(var o=0,n=0,a=0;a<A.length;++a){var r=A[a],s=r[e],l=g(s);"indices"===e?(O(l,t,n,o),o+=i[a]):O(l,t,n),n+=l.length}}(e,n,g(t)),a[e]=t}),a},e.duplicateVertices=function(A){var e={};return Object.keys(A).forEach(function(i){var t=A[i],o=g(t),n=Y(t,o.length);O(o,g(n),0),e[i]=n}),e},e.createDiscBuffers=e.createDiscBufferInfo=e.createTorusBuffers=e.createTorusBufferInfo=e.createCylinderBuffers=e.createCylinderBufferInfo=e.createCresentBuffers=e.createCresentBufferInfo=e.createXYQuadBuffers=e.createXYQuadBufferInfo=e.createTruncatedConeBuffers=e.createTruncatedConeBufferInfo=e.createSphereBuffers=e.createSphereBufferInfo=e.createPlaneBuffers=e.createPlaneBufferInfo=e.createCubeBuffers=e.createCubeBufferInfo=e.create3DFBuffers=e.create3DFBufferInfo=void 0;var t=s(i(7)),o=s(i(0)),n=s(i(1)),a=s(i(6)),r=s(i(3));function s(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}var g=t.getArray_,l=t.getNumComponents_;function c(A,e){var i=0;return A.push=function(){for(var e=0;e<arguments.length;++e){var t=arguments[e];if(t instanceof Array||n.isArrayBuffer(t))for(var o=0;o<t.length;++o)A[i++]=t[o];else A[i++]=t}},A.reset=function(A){i=A||0},A.numComponents=e,Object.defineProperty(A,"numElements",{get:function(){return this.length/this.numComponents|0}}),A}function u(A,e,i){return c(new(i||Float32Array)(A*e),A)}function B(A){return"indices"!==A}function d(A,e,i){for(var t=A.length,o=new Float32Array(3),n=0;n<t;n+=3)i(e,[A[n],A[n+1],A[n+2]],o),A[n]=o[0],A[n+1]=o[1],A[n+2]=o[2]}function E(A,e,i){i=i||r.create();var t=e[0],o=e[1],n=e[2];return i[0]=t*A[0]+o*A[1]+n*A[2],i[1]=t*A[4]+o*A[5]+n*A[6],i[2]=t*A[8]+o*A[9]+n*A[10],i}function h(A,e){return d(A,e,a.transformDirection),A}function C(A,e){return d(A,a.inverse(e),E),A}function w(A,e){return d(A,e,a.transformPoint),A}function m(A,e){return Object.keys(A).forEach(function(i){var t=A[i];i.indexOf("pos")>=0?w(t,e):i.indexOf("tan")>=0||i.indexOf("binorm")>=0?h(t,e):i.indexOf("norm")>=0&&C(t,e)}),A}function p(A,e,i){return A=A||2,{position:{numComponents:2,data:[(e=e||0)+-1*(A*=.5),(i=i||0)+-1*A,e+1*A,i+-1*A,e+-1*A,i+1*A,e+1*A,i+1*A]},normal:[0,0,1,0,0,1,0,0,1,0,0,1],texcoord:[0,0,1,0,0,1,1,1],indices:[0,1,2,2,1,3]}}function I(A,e,i,t,o){A=A||1,e=e||1,i=i||1,t=t||1,o=o||a.identity();for(var n=(i+1)*(t+1),r=u(3,n),s=u(3,n),g=u(2,n),l=0;l<=t;l++)for(var c=0;c<=i;c++){var B=c/i,d=l/t;r.push(A*B-.5*A,0,e*d-.5*e),s.push(0,1,0),g.push(B,d)}for(var E=i+1,h=u(3,i*t*2,Uint16Array),C=0;C<t;C++)for(var w=0;w<i;w++)h.push((C+0)*E+w,(C+1)*E+w,(C+0)*E+w+1),h.push((C+1)*E+w,(C+1)*E+w+1,(C+0)*E+w+1);return m({position:r,normal:s,texcoord:g,indices:h},o)}function f(A,e,i,t,o,n,a){if(e<=0||i<=0)throw Error("subdivisionAxis and subdivisionHeight must be > 0");t=t||0,o=o||Math.PI,n=n||0;for(var r=o-t,s=(a=a||2*Math.PI)-n,g=(e+1)*(i+1),l=u(3,g),c=u(3,g),B=u(2,g),d=0;d<=i;d++)for(var E=0;E<=e;E++){var h=E/e,C=d/i,w=s*h,m=r*C,p=Math.sin(w),I=Math.cos(w),f=Math.sin(m),Q=I*f,D=Math.cos(m),M=p*f;l.push(A*Q,A*D,A*M),c.push(Q,D,M),B.push(1-h,C)}for(var b=e+1,y=u(3,e*i*2,Uint16Array),T=0;T<e;T++)for(var k=0;k<i;k++)y.push((k+0)*b+T,(k+0)*b+T+1,(k+1)*b+T),y.push((k+1)*b+T,(k+0)*b+T+1,(k+1)*b+T+1);return{position:l,normal:c,texcoord:B,indices:y}}var Q=[[3,7,5,1],[6,2,0,4],[6,7,3,2],[0,1,5,4],[7,6,4,5],[2,3,1,0]];function D(A){for(var e=(A=A||1)/2,i=[[-e,-e,-e],[+e,-e,-e],[-e,+e,-e],[+e,+e,-e],[-e,-e,+e],[+e,-e,+e],[-e,+e,+e],[+e,+e,+e]],t=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],o=[[1,0],[0,0],[0,1],[1,1]],n=u(3,24),a=u(3,24),r=u(2,24),s=u(3,12,Uint16Array),g=0;g<6;++g){for(var l=Q[g],c=0;c<4;++c){var B=i[l[c]],d=t[g],E=o[c];n.push(B),a.push(d),r.push(E)}var h=4*g;s.push(h+0,h+1,h+2),s.push(h+0,h+2,h+3)}return{position:n,normal:a,texcoord:r,indices:s}}function M(A,e,i,t,o,n,a){if(t<3)throw Error("radialSubdivisions must be 3 or greater");if(o<1)throw Error("verticalSubdivisions must be 1 or greater");for(var r=void 0===n||n,s=void 0===a||a,g=(r?2:0)+(s?2:0),l=(t+1)*(o+1+g),c=u(3,l),B=u(3,l),d=u(2,l),E=u(3,t*(o+g)*2,Uint16Array),h=t+1,C=Math.atan2(A-e,i),w=Math.cos(C),m=Math.sin(C),p=o+(s?2:0),I=r?-2:0;I<=p;++I){var f=I/o,Q=i*f,D=void 0;I<0?(Q=0,f=1,D=A):I>o?(Q=i,f=1,D=e):D=A+I/o*(e-A),-2!==I&&I!==o+2||(D=0,f=0),Q-=i/2;for(var M=0;M<h;++M){var b=Math.sin(M*Math.PI*2/t),y=Math.cos(M*Math.PI*2/t);c.push(b*D,Q,y*D),B.push(I<0||I>o?0:b*w,I<0?-1:I>o?1:m,I<0||I>o?0:y*w),d.push(M/t,1-f)}}for(var T=0;T<o+g;++T)for(var k=0;k<t;++k)E.push(h*(T+0)+0+k,h*(T+0)+1+k,h*(T+1)+1+k),E.push(h*(T+0)+0+k,h*(T+1)+1+k,h*(T+1)+0+k);return{position:c,normal:B,texcoord:d,indices:E}}function b(A,e){e=e||[];for(var i=[],t=0;t<A.length;t+=4){var o=A[t],n=A.slice(t+1,t+4);n.push.apply(n,e);for(var a=0;a<o;++a)i.push.apply(i,n)}return i}function y(){var A=[0,0,0,0,150,0,30,0,0,0,150,0,30,150,0,30,0,0,30,0,0,30,30,0,100,0,0,30,30,0,100,30,0,100,0,0,30,60,0,30,90,0,67,60,0,30,90,0,67,90,0,67,60,0,0,0,30,30,0,30,0,150,30,0,150,30,30,0,30,30,150,30,30,0,30,100,0,30,30,30,30,30,30,30,100,0,30,100,30,30,30,60,30,67,60,30,30,90,30,30,90,30,67,60,30,67,90,30,0,0,0,100,0,0,100,0,30,0,0,0,100,0,30,0,0,30,100,0,0,100,30,0,100,30,30,100,0,0,100,30,30,100,0,30,30,30,0,30,30,30,100,30,30,30,30,0,100,30,30,100,30,0,30,30,0,30,60,30,30,30,30,30,30,0,30,60,0,30,60,30,30,60,0,67,60,30,30,60,30,30,60,0,67,60,0,67,60,30,67,60,0,67,90,30,67,60,30,67,60,0,67,90,0,67,90,30,30,90,0,30,90,30,67,90,30,30,90,0,67,90,30,67,90,0,30,90,0,30,150,30,30,90,30,30,90,0,30,150,0,30,150,30,0,150,0,0,150,30,30,150,30,0,150,0,30,150,30,30,150,0,0,0,0,0,0,30,0,150,30,0,0,0,0,150,30,0,150,0],e=b([18,0,0,1,18,0,0,-1,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,-1,0,6,-1,0,0]),i=b([18,200,70,120,18,80,70,200,6,70,200,210,6,200,200,70,6,210,100,70,6,210,160,70,6,70,180,210,6,100,70,210,6,76,210,100,6,140,210,80,6,90,130,110,6,160,160,220],[255]),t=A.length/3,o={position:u(3,t),texcoord:u(2,t),normal:u(3,t),color:u(4,t,Uint8Array),indices:u(3,t/3,Uint16Array)};o.position.push(A),o.texcoord.push([.22,.19,.22,.79,.34,.19,.22,.79,.34,.79,.34,.19,.34,.19,.34,.31,.62,.19,.34,.31,.62,.31,.62,.19,.34,.43,.34,.55,.49,.43,.34,.55,.49,.55,.49,.43,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0]),o.normal.push(e),o.color.push(i);for(var n=0;n<t;++n)o.indices.push(n);return o}function T(A,e,i,t,o,n,a){if(o<=0)throw Error("subdivisionDown must be > 0");n=n||0;var s=2,g=(a=a||1)-n,l=2*(o+1)*(2+s),c=u(3,l),B=u(3,l),d=u(2,l);function E(A,e,i){return A+(e-A)*i}function h(e,i,a,l,u,h){for(var C=0;C<=o;C++){var w=i/(s-1),m=C/o,p=2*(w-.5),I=(n+m*g)*Math.PI,f=Math.sin(I),Q=Math.cos(I),D=E(A,e,f),M=p*t,b=Q*A,y=f*D;c.push(M,b,y);var T=r.add(r.multiply([0,f,Q],a),l);B.push(T),d.push(w*u+h,m)}}for(var C=0;C<s;C++){var w=2*(C/(s-1)-.5);h(e,C,[1,1,1],[0,0,0],1,0),h(e,C,[0,0,0],[w,0,0],0,0),h(i,C,[1,1,1],[0,0,0],1,0),h(i,C,[0,0,0],[w,0,0],0,1)}var m=u(3,2*o*(2+s),Uint16Array);function p(A,e){for(var i=0;i<o;++i)m.push(A+i+0,A+i+1,e+i+0),m.push(A+i+1,e+i+1,e+i+0)}var I=o+1;return p(0*I,4*I),p(5*I,7*I),p(6*I,2*I),p(3*I,1*I),{position:c,normal:B,texcoord:d,indices:m}}function k(A,e,i,t,o,n){return M(A,A,e,i,t,o,n)}function F(A,e,i,t,o,n){if(i<3)throw Error("radialSubdivisions must be 3 or greater");if(t<3)throw Error("verticalSubdivisions must be 3 or greater");o=o||0;for(var a=(n=n||2*Math.PI)-o,r=i+1,s=t+1,g=r*s,l=u(3,g),c=u(3,g),B=u(2,g),d=u(3,i*t*2,Uint16Array),E=0;E<s;++E)for(var h=E/t,C=h*Math.PI*2,w=Math.sin(C),m=A+w*e,p=Math.cos(C),I=p*e,f=0;f<r;++f){var Q=f/i,D=o+Q*a,M=Math.sin(D),b=Math.cos(D),y=M*m,T=b*m,k=M*w,F=b*w;l.push(y,I,T),c.push(k,p,F),B.push(Q,1-h)}for(var v=0;v<t;++v)for(var S=0;S<i;++S){var N=1+S,R=1+v;d.push(r*v+S,r*R+S,r*v+N),d.push(r*R+S,r*R+N,r*v+N)}return{position:l,normal:c,texcoord:B,indices:d}}function v(A,e,i,t,o){if(e<3)throw Error("divisions must be at least 3");i=i||1,o=o||1,t=t||0;for(var n=(e+1)*(i+1),a=u(3,n),r=u(3,n),s=u(2,n),g=u(3,i*e*2,Uint16Array),l=0,c=A-t,B=e+1,d=0;d<=i;++d){for(var E=t+c*Math.pow(d/i,o),h=0;h<=e;++h){var C=2*Math.PI*h/e,w=E*Math.cos(C),m=E*Math.sin(C);if(a.push(w,0,m),r.push(0,1,0),s.push(1-h/e,d/i),d>0&&h!==e){var p=l+(h+1),I=l+h,f=l+h-B,Q=l+(h+1)-B;g.push(p,I,f),g.push(p,f,Q)}}l+=e+1}return{position:a,normal:r,texcoord:s,indices:g}}function S(A){return function(e){var i=A.apply(this,Array.prototype.slice.call(arguments,1));return t.createBuffersFromArrays(e,i)}}function N(A){return function(e){var i=A.apply(null,Array.prototype.slice.call(arguments,1));return t.createBufferInfoFromArrays(e,i)}}var R=["numComponents","size","type","normalize","stride","offset","attrib","name","attribName"];function O(A,e,i,t){t=t||0;for(var o=A.length,n=0;n<o;++n)e[i+n]=A[n]+t}function Y(A,e){var i=g(A),t=new i.constructor(e),n=t;return i.numComponents&&i.numElements&&c(t,i.numComponents),A.data&&(n={data:t},o.copyNamedProperties(R,A,n)),n}var U=N(y);e.create3DFBufferInfo=U;var G=S(y);e.create3DFBuffers=G;var H=N(D);e.createCubeBufferInfo=H;var L=S(D);e.createCubeBuffers=L;var P=N(I);e.createPlaneBufferInfo=P;var x=S(I);e.createPlaneBuffers=x;var _=N(f);e.createSphereBufferInfo=_;var j=S(f);e.createSphereBuffers=j;var J=N(M);e.createTruncatedConeBufferInfo=J;var z=S(M);e.createTruncatedConeBuffers=z;var K=N(p);e.createXYQuadBufferInfo=K;var W=S(p);e.createXYQuadBuffers=W;var V=N(T);e.createCresentBufferInfo=V;var X=S(T);e.createCresentBuffers=X;var Z=N(k);e.createCylinderBufferInfo=Z;var q=S(k);e.createCylinderBuffers=q;var $=N(F);e.createTorusBufferInfo=$;var AA=S(F);e.createTorusBuffers=AA;var eA=N(v);e.createDiscBufferInfo=eA;var iA=S(v);e.createDiscBuffers=iA},function(A,e,i){"use strict";e.__esModule=!0;var t={addExtensionsToContext:!0,getContext:!0,getWebGLContext:!0,resizeCanvasToDisplaySize:!0,setDefaults:!0};e.addExtensionsToContext=w,e.getContext=function(A,e){return function(A,e){for(var i=["webgl2","webgl","experimental-webgl"],t=null,o=0;o<i.length;++o)if(t=A.getContext(i[o],e)){d.addExtensionsToContext&&w(t);break}return t}(A,e)},e.getWebGLContext=function(A,e){return function(A,e){for(var i=["webgl","experimental-webgl"],t=null,o=0;o<i.length;++o)if(t=A.getContext(i[o],e)){d.addExtensionsToContext&&w(t);break}return t}(A,e)},e.resizeCanvasToDisplaySize=function(A,e){e=e||1,e=Math.max(0,e);var i=A.clientWidth*e|0,t=A.clientHeight*e|0;if(A.width!==i||A.height!==t)return A.width=i,A.height=t,!0;return!1},e.setDefaults=function(A){a.copyExistingProperties(A,d),o.setAttributeDefaults_(A),n.setTextureDefaults_(A)};var o=B(i(7));Object.keys(o).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=o[A]))});var n=B(i(8));Object.keys(n).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=n[A]))});var a=B(i(0)),r=B(i(4));Object.keys(r).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=r[A]))});var s=i(12);Object.keys(s).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=s[A]))});var g=i(13);Object.keys(g).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=g[A]))});var l=i(5);Object.keys(l).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=l[A]))});var c=i(1);Object.keys(c).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=c[A]))});var u=i(14);function B(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}Object.keys(u).forEach(function(A){"default"!==A&&"__esModule"!==A&&(Object.prototype.hasOwnProperty.call(t,A)||(e[A]=u[A]))});var d={addExtensionsToContext:!0};var E=/^(.*?)_/;function h(A,e){r.glEnumToString(A,0);var i=A.getExtension(e);if(i){var t={},o=E.exec(e)[1],n="_"+o;for(var s in i){var g=i[s],l="function"==typeof g,c=l?o:n,u=s;s.endsWith(c)&&(u=s.substring(0,s.length-c.length)),void 0!==A[u]?l||A[u]===g||a.warn(u,A[u],g,s):l?A[u]=function(A){return function(){return A.apply(i,arguments)}}(g):(A[u]=g,t[u]=g)}t.constructor={name:i.constructor.name},r.glEnumToString(t,0)}return i}var C=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_frag_depth","EXT_sRGB","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_depth_texture","WEBGL_draw_buffers"];function w(A){for(var e=0;e<C.length;++e)h(A,C[e])}},function(A,e,i){"use strict";e.__esModule=!0,e.drawBufferInfo=o,e.drawObjectList=function(A,e){var i=null,n=null;e.forEach(function(e){if(!1!==e.active){var a=e.programInfo,r=e.vertexArrayInfo||e.bufferInfo,s=!1,g=void 0===e.type?A.TRIANGLES:e.type;a!==i&&(i=a,A.useProgram(a.program),s=!0),(s||r!==n)&&(n&&n.vertexArrayObject&&!r.vertexArrayObject&&A.bindVertexArray(null),n=r,t.setBuffersAndAttributes(A,a,r)),t.setUniforms(a,e.uniforms),o(A,r,g,e.count,e.offset,e.instanceCount)}}),n.vertexArrayObject&&A.bindVertexArray(null)};var t=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}(i(5));function o(A,e,i,t,o,n){i=void 0===i?A.TRIANGLES:i;var a=e.indices,r=e.elementType,s=void 0===t?e.numElements:t;o=void 0===o?0:o,r||a?void 0!==n?A.drawElementsInstanced(i,s,void 0===r?A.UNSIGNED_SHORT:e.elementType,o,n):A.drawElements(i,s,void 0===r?A.UNSIGNED_SHORT:e.elementType,o):void 0!==n?A.drawArraysInstanced(i,o,s,n):A.drawArrays(i,o,s)}},function(A,e,i){"use strict";e.__esModule=!0,e.bindFramebufferInfo=function(A,e,i){i=i||A.FRAMEBUFFER,e?(A.bindFramebuffer(i,e.framebuffer),A.viewport(0,0,e.width,e.height)):(A.bindFramebuffer(i,null),A.viewport(0,0,A.drawingBufferWidth,A.drawingBufferHeight))},e.createFramebufferInfo=function(A,e,i,n){var l=A.FRAMEBUFFER,c=A.createFramebuffer();A.bindFramebuffer(l,c),i=i||A.drawingBufferWidth,n=n||A.drawingBufferHeight;var u=0,B={framebuffer:c,attachments:[],width:i,height:n};return(e=e||r).forEach(function(e){var r=e.attachment,c=e.format,d=function(A){return s[A]}(c);if(d||(d=a+u++),!r)if(function(A){return g[A]}(c))r=A.createRenderbuffer(),A.bindRenderbuffer(A.RENDERBUFFER,r),A.renderbufferStorage(A.RENDERBUFFER,c,i,n);else{var E=Object.assign({},e);E.width=i,E.height=n,void 0===E.auto&&(E.auto=!1,E.min=E.min||E.minMag||A.LINEAR,E.mag=E.mag||E.minMag||A.LINEAR,E.wrapS=E.wrapS||E.wrap||A.CLAMP_TO_EDGE,E.wrapT=E.wrapT||E.wrap||A.CLAMP_TO_EDGE),r=t.createTexture(A,E)}if(o.isRenderbuffer(A,r))A.framebufferRenderbuffer(l,d,A.RENDERBUFFER,r);else{if(!o.isTexture(A,r))throw"unknown attachment type";A.framebufferTexture2D(l,d,e.texTarget||A.TEXTURE_2D,r,e.level||0)}B.attachments.push(r)}),B},e.resizeFramebufferInfo=function(A,e,i,n,a){n=n||A.drawingBufferWidth,a=a||A.drawingBufferHeight,e.width=n,e.height=a,(i=i||r).forEach(function(i,r){var s=e.attachments[r],g=i.format;if(o.isRenderbuffer(A,s))A.bindRenderbuffer(A.RENDERBUFFER,s),A.renderbufferStorage(A.RENDERBUFFER,g,n,a);else{if(!o.isTexture(A,s))throw"unknown attachment type";t.resizeTexture(A,s,i,n,a)}})};var t=n(i(8)),o=n(i(0));function n(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}var a=36064,r=[{format:6408,type:5121,min:9729,wrap:33071},{format:34041}],s={};s[34041]=33306,s[6401]=36128,s[36168]=36128,s[6402]=36096,s[33189]=36096;var g={};g[32854]=!0,g[32855]=!0,g[36194]=!0,g[34041]=!0,g[33189]=!0,g[6401]=!0,g[36168]=!0},function(A,e,i){"use strict";e.__esModule=!0,e.createVertexArrayInfo=function(A,e,i){var o=A.createVertexArray();A.bindVertexArray(o),e.length||(e=[e]);return e.forEach(function(e){t.setBuffersAndAttributes(A,e,i)}),A.bindVertexArray(null),{numElements:i.numElements,elementType:i.elementType,vertexArrayObject:o}},e.createVAOAndSetAttributes=o,e.createVAOFromBufferInfo=function(A,e,i){return o(A,e.attribSetters||e,i.attribs,i.indices)};var t=function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var i in A)if(Object.prototype.hasOwnProperty.call(A,i)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(A,i):{};t.get||t.set?Object.defineProperty(e,i,t):e[i]=A[i]}return e.default=A,e}(i(5));function o(A,e,i,o){var n=A.createVertexArray();return A.bindVertexArray(n),t.setAttributes(e,i),o&&A.bindBuffer(A.ELEMENT_ARRAY_BUFFER,o),A.bindVertexArray(null),n}}])})},function(A,e,i){"use strict";i.d(e,"a",function(){return o}),i.d(e,"b",function(){return t}),i.d(e,"c",function(){return n}),i.d(e,"d",function(){return a});var t={sprite:null,receivedBlocks:!1},o=function(A,e){switch(void 0===A&&(A=t),e.type){case"scratch-gui/hovered-target/SET_HOVERED_SPRITE":return{sprite:e.spriteId,receivedBlocks:!1};case"scratch-gui/hovered-target/SET_RECEIVED_BLOCKS":return{sprite:A.sprite,receivedBlocks:e.receivedBlocks};default:return A}},n=function(A){return{type:"scratch-gui/hovered-target/SET_HOVERED_SPRITE",spriteId:A,meta:{throttle:30}}},a=function(A){return{type:"scratch-gui/hovered-target/SET_RECEIVED_BLOCKS",receivedBlocks:A}}},function(A,e,i){"use strict";i.d(e,"a",function(){return o}),i.d(e,"b",function(){return t}),i.d(e,"c",function(){return n});var t="",o=function(A,e){switch(void 0===A&&(A=t),e.type){case"projectTitle/SET_PROJECT_TITLE":return e.title;default:return A}},n=function(A){return{type:"projectTitle/SET_PROJECT_TITLE",title:A}}},function(A,e,i){"use strict";i.d(e,"a",function(){return n}),i.d(e,"b",function(){return o}),i.d(e,"c",function(){return a});var t="scratch-gui/restore-deletion/RESTORE_UPDATE",o={restoreFun:null,deletedItem:""},n=function(A,e){switch(void 0===A&&(A=o),e.type){case t:return Object.assign({},A,e.state);default:return A}},a=function(A){return{type:t,state:{restoreFun:A.restoreFun,deletedItem:A.deletedItem}}}},function(A,e,i){var t=i(1493),o=i(1496),n=i(548),a=i(544),r=i(1498),s=i(547),g=i(346),l=i(545);A.exports={BitmapAdapter:o,convertFonts:l,inlineSvgFonts:n,loadSvgString:a,sanitizeSvg:r,serializeSvgToString:s,SvgElement:g,SVGRenderer:t}},function(A,e,i){"use strict";var t=i(0),o=i.n(t),n=i(1),a=i.n(n),r=i(41),s=i(6),g=i(77),l=i.n(g),c=i(11),u=i.n(c),B=i(2),d=i(57),E=i(13),h=i(19),C=i(24),w=i(51),m=i.n(w),p=i(208);function I(A){"@babel/helpers - typeof";return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function f(A,e){var i="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!i){if(Array.isArray(A)||(i=function(A,e){if(!A)return;if("string"==typeof A)return Q(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Q(A,e)}(A))||e&&A&&"number"==typeof A.length){i&&(A=i);var t=0,o=function(){};return{s:o,n:function(){return t>=A.length?{done:!0}:{done:!1,value:A[t++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,r=!1;return{s:function(){i=i.call(A)},n:function(){var A=i.next();return a=A.done,A},e:function(A){r=!0,n=A},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw n}}}}function Q(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function D(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function M(A,e){return(M=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function b(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=y(A);if(e){var o=y(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===I(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function y(A){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var T=["Sans Serif","Serif","Handwriting","Marker","Curly","Pixel","Scratch"],k=i(259);function F(A){"@babel/helpers - typeof";return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var v=["locale","onSetLanguage"];function S(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function N(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function R(A,e){return(R=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function O(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Y(A);if(e){var o=Y(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===F(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function Y(A){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var U=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&R(A,e)}(t,a.a.Component);var i=O(t);function t(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i.apply(this,arguments)}return function(A,e,i){e&&N(A.prototype,e),i&&N(A,i)}(t,[{key:"componentDidUpdate",value:function(A){A.locale!==this.props.locale&&this.props.onSetLanguage(this.props.locale)}},{key:"render",value:function(){var e=this.props,i=(e.locale,e.onSetLanguage,S(e,v));return a.a.createElement(k.a,null,a.a.createElement(A,i))}}]),t}();e.propTypes={locale:o.a.string,onSetLanguage:o.a.func},e.defaultProps={onSetLanguage:function(){}};return Object(s.b)(function(A){return{locale:A.locales.locale}},function(){return{}})(e)},G=i(5),H=i.n(G),L=i(26),P=i(87),x=i(113),_=i(43);function j(A){"@babel/helpers - typeof";return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var J=["cancelFileUpload","closeFileMenu","isLoadingUpload","isShowingWithoutId","loadingState","onLoadingFinished","onLoadingStarted","onSetProjectTitle","projectChanged","requestProjectUpload","userOwnsProject"];function z(){return(z=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function K(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function W(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function V(A,e){return(V=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function X(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=q(A);if(e){var o=q(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===j(e)||"function"==typeof e))return e;return Z(A)}(this,i)}}function Z(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function q(A){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var $=Object(B.d)({loadError:{id:"gui.projectLoader.loadError",defaultMessage:"The project file that was selected failed to load."}}),AA=i(86),eA=i(42);function iA(A){"@babel/helpers - typeof";return(iA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var tA=["assetHost","intl","isLoadingProject","loadingState","onActivateTab","onError","onFetchedProjectData","onProjectUnchanged","projectHost","projectId","reduxProjectId","setProjectId","isFetchingWithId"];function oA(){return(oA=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function nA(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function aA(A,e,i,t,o,n,a){try{var r=A[n](a),s=r.value}catch(A){return void i(A)}r.done?e(s):Promise.resolve(s).then(t,o)}function rA(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function sA(A,e){return(sA=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function gA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=cA(A);if(e){var o=cA(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===iA(e)||"function"==typeof e))return e;return lA(A)}(this,i)}}function lA(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function cA(A){return(cA=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}function uA(A){"@babel/helpers - typeof";return(uA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var BA=["intl","isAnyCreatingNewState","isShowingWithoutId","onChangedProjectTitle","onUpdateProjectTitle","projectTitle","reduxProjectTitle"];function dA(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function EA(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function hA(A,e){return(hA=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function CA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=wA(A);if(e){var o=wA(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===uA(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function wA(A){return(wA=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var mA=Object(B.d)({defaultProjectTitle:{id:"gui.gui.defaultProjectTitle",defaultMessage:"Scratch Project"}});function pA(A,e){var i="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!i){if(Array.isArray(A)||(i=function(A,e){if(!A)return;if("string"==typeof A)return IA(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return IA(A,e)}(A))||e&&A&&"number"==typeof A.length){i&&(A=i);var t=0,o=function(){};return{s:o,n:function(){return t>=A.length?{done:!0}:{done:!1,value:A[t++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,r=!1;return{s:function(){i=i.call(A)},n:function(){var A=i.next();return a=A.done,A},e:function(A){r=!0,n=A},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw n}}}}function IA(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}var fA=function(A){var e,i={projectName:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",language:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",spriteCount:0,blocksCount:0,costumesCount:0,listsCount:0,scriptCount:0,soundsCount:0,variablesCount:0},t=pA(A.runtime.targets);try{for(t.s();!(e=t.n()).done;){var o=e.value;for(var n in++i.spriteCount,i.blocksCount+=Object.keys(o.sprite.blocks._blocks).length,i.costumesCount+=o.sprite.costumes_.length,i.scriptCount+=o.sprite.blocks._scripts.length,i.soundsCount+=o.sprite.sounds.length,o.variables)"list"===o.variables[n].type?++i.listsCount:++i.variablesCount}}catch(A){t.e(A)}finally{t.f()}return i};var QA=i(171),DA=i.n(QA),MA=i(158),bA=i.n(MA),yA=function(A,e,i){var t={body:e,headers:{"Content-Type":"application/json"},withCredentials:!0},o=null===A||void 0===A,n={};i.hasOwnProperty("originalId")&&(n.original_id=i.originalId),i.hasOwnProperty("isCopy")&&(n.is_copy=i.isCopy),i.hasOwnProperty("isRemix")&&(n.is_remix=i.isRemix),i.hasOwnProperty("title")&&(n.title=i.title);var a=DA.a.stringify(n);return a&&(a="?".concat(a)),o?Object.assign(t,{method:"post",url:"".concat(eA.a.projectHost,"/").concat(a)}):Object.assign(t,{method:"put",url:"".concat(eA.a.projectHost,"/").concat(A).concat(a)}),new Promise(function(e,i){bA()(t,function(t,n){if(t)return i(t);if(200!==n.statusCode)return i(n.statusCode);var a;try{a=JSON.parse(n.body)}catch(A){return i(A)}a.id=A,o&&(a.id=a["content-name"]),e(a)})})},TA=i(35),kA=i(209),FA=["autoSaveTimeoutId","autoSaveIntervalSecs","isCreatingCopy","isCreatingNew","projectChanged","isAnyCreatingNewState","isLoading","isManualUpdating","isRemixing","isShowingSaveable","isShowingWithId","isShowingWithoutId","isUpdating","loadingState","onAutoUpdateProject","onCreatedProject","onCreateProject","onProjectError","onRemixing","onSetProjectUnchanged","onSetProjectThumbnailer","onSetProjectSaver","onShowAlert","onShowCopySuccessAlert","onShowRemixSuccessAlert","onShowCreatingCopyAlert","onShowCreatingRemixAlert","onShowSaveSuccessAlert","onShowSavingAlert","onUpdatedProject","onUpdateProjectData","onUpdateProjectThumbnail","reduxProjectId","reduxProjectTitle","setAutoSaveTimeoutId"];function vA(){return(vA=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function SA(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function NA(A){"@babel/helpers - typeof";return(NA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function RA(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function OA(A,e){return(OA=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function YA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=GA(A);if(e){var o=GA(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===NA(e)||"function"==typeof e))return e;return UA(A)}(this,i)}}function UA(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function GA(A){return(GA=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var HA=i(65),LA=i(78),PA=function(A){var e=Array.isArray(A.tutorial)?A.tutorial[0]:A.tutorial;return void 0===e?null:"all"===e?e:function(A){for(var e in HA.a)if(HA.a[e].urlId===A)return LA.a.event({category:"how-to",action:"load from url",label:"".concat(e)}),e;return null}(e)},xA=i(61);function _A(A){"@babel/helpers - typeof";return(_A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var jA=["onOpenTipsLibrary","onUpdateReduxDeck"];function JA(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function zA(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function KA(A,e){return(KA=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function WA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=VA(A);if(e){var o=VA(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===_A(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function VA(A){return(VA=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var XA=i(202),ZA=i.n(XA),qA=i(156),$A=i(205),Ae=i(207),ee=i(119),ie=i(206);!function(){function A(){var A=this;return new Promise(function(e){var i=new FileReader;i.onload=function(){e(i.result)},i.readAsArrayBuffer(A)})}File.prototype.arrayBuffer=File.prototype.arrayBuffer||A,Blob.prototype.arrayBuffer=Blob.prototype.arrayBuffer||A}();var te=function(A){return new Promise(function(e){var i=new FileReader;i.readAsDataURL(A),i.onloadend=function(){e(i.result)}})};function oe(A){"@babel/helpers - typeof";return(oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var ne=["attachKeyboardEvents","projectChanged","shouldUpdateTargets","shouldUpdateProjectChanged","onBlockDragUpdate","onGreenFlag","onKeyDown","onKeyUp","onMicListeningUpdate","onMonitorsUpdate","onTargetsUpdate","onProjectChanged","onProjectRunStart","onProjectRunStop","onProjectSaved","onRuntimeStarted","onTurboModeOff","onTurboModeOn","onShowExtensionAlert"];function ae(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function re(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function se(A,e){return(se=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ge(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=ce(A);if(e){var o=ce(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===oe(e)||"function"==typeof e))return e;return le(A)}(this,i)}}function le(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function ce(A){return(ce=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ue=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&se(A,e)}(t,a.a.Component);var i=ge(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(le(e),["handleKeyDown","handleKeyUp","handleProjectChanged","handleTargetsUpdate","handleProjectRunStart"]),e.props.vm.on("targetsUpdate",e.handleTargetsUpdate),e.props.vm.on("MONITORS_UPDATE",e.props.onMonitorsUpdate),e.props.vm.on("BLOCK_DRAG_UPDATE",e.props.onBlockDragUpdate),e.props.vm.on("TURBO_MODE_ON",e.props.onTurboModeOn),e.props.vm.on("TURBO_MODE_OFF",e.props.onTurboModeOff),e.props.vm.on("PROJECT_RUN_START",e.handleProjectRunStart),e.props.vm.on("PROJECT_RUN_STOP",e.props.onProjectRunStop),e.props.vm.on("PROJECT_CHANGED",e.handleProjectChanged),e.props.vm.on("RUNTIME_STARTED",e.props.onRuntimeStarted),e.props.vm.on("PROJECT_START",e.props.onGreenFlag),e.props.vm.on("PERIPHERAL_CONNECTION_LOST_ERROR",e.props.onShowExtensionAlert),e.props.vm.on("MIC_LISTENING",e.props.onMicListeningUpdate),e.autoSaveProject=ZA()(e.autoSaveProject.bind(le(e)),1e3),e}return function(A,e,i){e&&re(A.prototype,e),i&&re(A,i)}(t,[{key:"componentDidMount",value:function(){this.props.attachKeyboardEvents&&(document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)),this.props.vm.postIOData("userData",{username:this.props.username})}},{key:"componentDidUpdate",value:function(A){A.username!==this.props.username&&this.props.vm.postIOData("userData",{username:this.props.username}),this.props.shouldUpdateTargets&&!A.shouldUpdateTargets&&this.props.vm.emitTargetsUpdate(!1)}},{key:"componentWillUnmount",value:function(){this.props.vm.removeListener("PERIPHERAL_CONNECTION_LOST_ERROR",this.props.onShowExtensionAlert),this.props.attachKeyboardEvents&&(document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp))}},{key:"handleProjectRunStart",value:function(){this.props.onProjectRunStart()}},{key:"handleProjectChanged",value:function(){this.props.shouldUpdateProjectChanged&&!this.props.projectChanged&&this.props.onProjectChanged(),this.autoSaveProject()}},{key:"autoSaveProject",value:function(){console.log('Saving project to "__autosave"'),this.props.vm.saveProjectSb3().then(function(A){te(A).then(function(A){try{mv2Interface.saveScratchFile("__autosave",A)}catch(A){console.error("Failed to auto save project",A.message)}})})}},{key:"handleTargetsUpdate",value:function(A){this.props.shouldUpdateTargets&&this.props.onTargetsUpdate(A)}},{key:"handleKeyDown",value:function(A){if(A.target===document||A.target===document.body){var e=A.key&&"Dead"!==A.key?A.key:A.keyCode;this.props.vm.postIOData("keyboard",{key:e,isDown:!0}),(32===A.keyCode||A.keyCode>=37&&A.keyCode<=40)&&A.preventDefault()}}},{key:"handleKeyUp",value:function(A){var e=A.key&&"Dead"!==A.key?A.key:A.keyCode;this.props.vm.postIOData("keyboard",{key:e,isDown:!1}),A.target!==document&&A.target!==document.body&&A.preventDefault()}},{key:"render",value:function(){var e=this.props,i=(e.attachKeyboardEvents,e.projectChanged,e.shouldUpdateTargets,e.shouldUpdateProjectChanged,e.onBlockDragUpdate,e.onGreenFlag,e.onKeyDown,e.onKeyUp,e.onMicListeningUpdate,e.onMonitorsUpdate,e.onTargetsUpdate,e.onProjectChanged,e.onProjectRunStart,e.onProjectRunStop,e.onProjectSaved,e.onRuntimeStarted,e.onTurboModeOff,e.onTurboModeOn,e.onShowExtensionAlert,ae(e,ne));return a.a.createElement(A,i)}}]),t}();e.propTypes={attachKeyboardEvents:o.a.bool,onBlockDragUpdate:o.a.func.isRequired,onGreenFlag:o.a.func,onKeyDown:o.a.func,onKeyUp:o.a.func,onMicListeningUpdate:o.a.func.isRequired,onMonitorsUpdate:o.a.func.isRequired,onProjectChanged:o.a.func.isRequired,onProjectRunStart:o.a.func.isRequired,onProjectRunStop:o.a.func.isRequired,onProjectSaved:o.a.func.isRequired,onRuntimeStarted:o.a.func.isRequired,onShowExtensionAlert:o.a.func.isRequired,onTargetsUpdate:o.a.func.isRequired,onTurboModeOff:o.a.func.isRequired,onTurboModeOn:o.a.func.isRequired,projectChanged:o.a.bool,shouldUpdateTargets:o.a.bool,shouldUpdateProjectChanged:o.a.bool,username:o.a.string,vm:o.a.instanceOf(u.a).isRequired},e.defaultProps={attachKeyboardEvents:!0,onGreenFlag:function(){return{}}};return Object(s.b)(function(A){return{projectChanged:A.scratchGui.projectChanged,shouldUpdateTargets:!A.scratchGui.mode.isFullScreen&&!A.scratchGui.mode.isPlayerOnly&&!A.scratchGui.modals.soundRecorder,shouldUpdateProjectChanged:!A.scratchGui.mode.isFullScreen&&!A.scratchGui.mode.isPlayerOnly,vm:A.scratchGui.vm,username:A.session&&A.session.session&&A.session.session.user?A.session.session.user.username:""}},function(A){return{onTargetsUpdate:function(e){A(Object(qA.d)(e.targetList,e.editingTarget))},onMonitorsUpdate:function(e){A(Object(Ae.c)(e))},onBlockDragUpdate:function(e){A(Object($A.c)(e))},onProjectRunStart:function(){return A(Object(ee.b)(!0))},onProjectRunStop:function(){return A(Object(ee.b)(!1))},onProjectChanged:function(){return A(Object(AA.c)())},onProjectSaved:function(){return A(Object(AA.d)())},onRuntimeStarted:function(){return A(Object(ee.c)(!0))},onTurboModeOn:function(){return A(Object(ee.d)(!0))},onTurboModeOff:function(){return A(Object(ee.d)(!1))},onShowExtensionAlert:function(e){A(Object(TA.g)(e))},onMicListeningUpdate:function(e){A(Object(ie.c)(e))}}})(e)},Be=i(274),de=i.n(Be);function Ee(A){"@babel/helpers - typeof";return(Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var he=["fontsLoaded","loadingState","locale","messages","isStarted","onError","onLoadedProject","onSetProjectUnchanged","projectData","isLoadingWithId","vm"];function Ce(){return(Ce=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function we(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function me(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function pe(A,e){return(pe=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Ie(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Qe(A);if(e){var o=Qe(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ee(e)||"function"==typeof e))return e;return fe(A)}(this,i)}}function fe(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Qe(A){return(Qe=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var De=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&pe(A,e)}(t,a.a.Component);var i=Ie(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(fe(e),["loadProject"]),e}return function(A,e,i){e&&me(A.prototype,e),i&&me(A,i)}(t,[{key:"componentDidMount",value:function(){this.props.vm.initialized||(this.audioEngine=new de.a,this.props.vm.attachAudioEngine(this.audioEngine),this.props.vm.setCompatibilityMode(!0),this.props.vm.initialized=!0,this.props.vm.setLocale(this.props.locale,this.props.messages)),this.props.isPlayerOnly||this.props.isStarted||this.props.vm.start()}},{key:"componentDidUpdate",value:function(A){!this.props.isLoadingWithId||!this.props.fontsLoaded||A.isLoadingWithId&&A.fontsLoaded||this.loadProject(),this.props.isPlayerOnly||this.props.isStarted||this.props.vm.start()}},{key:"loadProject",value:function(){var A=this;return this.props.vm.loadProject(this.props.projectData).then(function(){A.props.onLoadedProject(A.props.loadingState,A.props.canSave),setTimeout(function(){return A.props.onSetProjectUnchanged()}),A.props.isStarted||setTimeout(function(){return A.props.vm.renderer.draw()})}).catch(function(e){A.props.onError(e)})}},{key:"render",value:function(){var e=this.props,i=(e.fontsLoaded,e.loadingState,e.locale,e.messages,e.isStarted,e.onError,e.onLoadedProject,e.onSetProjectUnchanged,e.projectData,e.isLoadingWithId),t=e.vm,o=we(e,he);return a.a.createElement(A,Ce({isLoading:i,vm:t},o))}}]),t}();e.propTypes={canSave:o.a.bool,cloudHost:o.a.string,fontsLoaded:o.a.bool,isLoadingWithId:o.a.bool,isPlayerOnly:o.a.bool,isStarted:o.a.bool,loadingState:o.a.oneOf(E.a),locale:o.a.string,messages:o.a.objectOf(o.a.string),onError:o.a.func,onLoadedProject:o.a.func,onSetProjectUnchanged:o.a.func,projectData:o.a.oneOfType([o.a.object,o.a.string]),projectId:o.a.oneOfType([o.a.string,o.a.number]),username:o.a.string,vm:o.a.instanceOf(u.a).isRequired};return Object(s.b)(function(A){var e=A.scratchGui.projectState.loadingState;return{fontsLoaded:A.scratchGui.fontsLoaded,isLoadingWithId:Object(E.p)(e),locale:A.locales.locale,messages:A.locales.messages,projectData:A.scratchGui.projectState.projectData,projectId:A.scratchGui.projectState.projectId,loadingState:e,isPlayerOnly:A.scratchGui.mode.isPlayerOnly,isStarted:A.scratchGui.vmStatus.started}},function(A){return{onError:function(e){return A(Object(E.z)(e))},onLoadedProject:function(e,i){return A(Object(E.y)(e,i,!0))},onSetProjectUnchanged:function(){return A(Object(AA.d)())}}},function(A,e,i){return Object.assign({},A,e,i)})(e)},Me=i(362),be=i.n(Me);function ye(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var Te=function(){function A(e,i,t,o){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.vm=i,this.username=t,this.projectId=o,this.cloudHost=e,this.connectionAttempts=0,this.queuedData=[],this.openConnection(),this.sendCloudData=be()(this._sendCloudData,100)}return function(A,e,i){e&&ye(A.prototype,e),i&&ye(A,i)}(A,[{key:"openConnection",value:function(){this.connectionAttempts+=1;try{this.connection=new WebSocket(("http:"===location.protocol?"ws://":"wss://")+this.cloudHost)}catch(A){return L.a.warn("Websocket support is not available in this browser",A),void(this.connection=null)}this.connection.onerror=this.onError.bind(this),this.connection.onmessage=this.onMessage.bind(this),this.connection.onopen=this.onOpen.bind(this),this.connection.onclose=this.onClose.bind(this)}},{key:"onError",value:function(A){L.a.error("Websocket connection error: ".concat(JSON.stringify(A)))}},{key:"onMessage",value:function(A){var e=this;A.data.split("\n").forEach(function(A){if(A){var i=e.parseMessage(JSON.parse(A));e.vm.postIOData("cloud",i)}})}},{key:"onOpen",value:function(){var A=this;this.connectionAttempts=1,this.writeToServer("handshake"),L.a.info("Successfully connected to clouddata server."),this.queuedData.forEach(function(e){A.sendCloudData(e)}),this.queuedData=[]}},{key:"onClose",value:function(){L.a.info("Closed connection to websocket");var A=this.randomizeDuration(this.exponentialTimeout());this.setTimeout(this.openConnection.bind(this),A)}},{key:"exponentialTimeout",value:function(){return 1e3*(Math.pow(2,Math.min(this.connectionAttempts,5))-1)}},{key:"randomizeDuration",value:function(A){return Math.random()*A}},{key:"setTimeout",value:function(A,e){L.a.info("Reconnecting in ".concat((e/1e3).toFixed(1),"s, attempt ").concat(this.connectionAttempts)),this._connectionTimeout=window.setTimeout(A,e)}},{key:"parseMessage",value:function(A){var e={};switch(A.method){case"set":e.varUpdate={name:A.name,value:A.value}}return e}},{key:"writeToServer",value:function(A,e,i,t){var o={};o.method=A,o.user=this.username,o.project_id=this.projectId,e&&(o.name=e),t&&(o.new_name=t),void 0!==i&&null!==i&&(o.value=i);var n=JSON.stringify(o);this.connection&&this.connection.readyState===WebSocket.OPEN?this.sendCloudData(n):"create"!==o.method&&"delete"!==o.method&&"rename"!==o.method||this.queuedData.push(n)}},{key:"_sendCloudData",value:function(A){this.connection.send("".concat(A,"\n"))}},{key:"createVariable",value:function(A,e){this.writeToServer("create",A,e)}},{key:"updateVariable",value:function(A,e){this.writeToServer("set",A,e)}},{key:"renameVariable",value:function(A,e){this.writeToServer("rename",A,null,e)}},{key:"deleteVariable",value:function(A){this.writeToServer("delete",A)}},{key:"requestCloseConnection",value:function(){this.connection&&this.connection.readyState!==WebSocket.CLOSING&&this.connection.readyState!==WebSocket.CLOSED&&(L.a.info("Request close cloud connection without reconnecting"),this.connection.onclose=function(){},this.connection.onerror=function(){},this.connection.close()),this.clear()}},{key:"clear",value:function(){this.connection=null,this.vm=null,this.username=null,this.projectId=null,this._connectionTimeout&&(clearTimeout(this._connectionTimeout),this._connectionTimeout=null),this.connectionAttempts=0}}]),A}();function ke(A){"@babel/helpers - typeof";return(ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var Fe=["canModifyCloudData","cloudHost","projectId","username","hasCloudPermission","isShowingWithId","onShowCloudInfo","vm"];function ve(){return(ve=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Se(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Ne(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Re(A,e){return(Re=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Oe(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Ue(A);if(e){var o=Ue(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ke(e)||"function"==typeof e))return e;return Ye(A)}(this,i)}}function Ye(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Ue(A){return(Ue=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ge=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Re(A,e)}(t,a.a.Component);var i=Oe(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=i.call(this,A)).cloudProvider=null,H()(Ye(e),["handleCloudDataUpdate"]),e.props.vm.on("HAS_CLOUD_DATA_UPDATE",e.handleCloudDataUpdate),e}return function(A,e,i){e&&Ne(A.prototype,e),i&&Ne(A,i)}(t,[{key:"componentDidMount",value:function(){this.shouldConnect(this.props)&&this.connectToCloud()}},{key:"componentDidUpdate",value:function(A){this.shouldConnect(this.props)&&!this.shouldConnect(A)&&this.connectToCloud(),this.shouldDisconnect(this.props,A)&&this.disconnectFromCloud()}},{key:"componentWillUnmount",value:function(){this.disconnectFromCloud()}},{key:"canUseCloud",value:function(A){return!!(A.cloudHost&&A.username&&A.vm&&A.projectId&&A.hasCloudPermission)}},{key:"shouldConnect",value:function(A){return!this.isConnected()&&this.canUseCloud(A)&&A.isShowingWithId&&A.vm.runtime.hasCloudData()&&A.canModifyCloudData}},{key:"shouldDisconnect",value:function(A,e){return this.isConnected()&&(!this.canUseCloud(A)||!A.vm.runtime.hasCloudData()||A.projectId!==e.projectId||A.username!==e.username||!A.canModifyCloudData)}},{key:"isConnected",value:function(){return this.cloudProvider&&!!this.cloudProvider.connection}},{key:"connectToCloud",value:function(){this.cloudProvider=new Te(this.props.cloudHost,this.props.vm,this.props.username,this.props.projectId),this.props.vm.setCloudProvider(this.cloudProvider)}},{key:"disconnectFromCloud",value:function(){this.cloudProvider&&(this.cloudProvider.requestCloseConnection(),this.cloudProvider=null,this.props.vm.setCloudProvider(null))}},{key:"handleCloudDataUpdate",value:function(A){this.isConnected()&&!A?this.disconnectFromCloud():this.shouldConnect(this.props)&&(this.props.onShowCloudInfo(),this.connectToCloud())}},{key:"render",value:function(){var e=this.props,i=(e.canModifyCloudData,e.cloudHost,e.projectId,e.username,e.hasCloudPermission,e.isShowingWithId,e.onShowCloudInfo,e.vm),t=Se(e,Fe);return a.a.createElement(A,ve({canUseCloud:this.canUseCloud(this.props),vm:i},t))}}]),t}();e.propTypes={canModifyCloudData:o.a.bool.isRequired,cloudHost:o.a.string,hasCloudPermission:o.a.bool,isShowingWithId:o.a.bool.isRequired,onShowCloudInfo:o.a.func,projectId:o.a.oneOfType([o.a.string,o.a.number]),username:o.a.string,vm:o.a.instanceOf(u.a).isRequired},e.defaultProps={cloudHost:null,hasCloudPermission:!1,onShowCloudInfo:function(){},username:null};return Object(s.b)(function(A,e){var i=A.scratchGui.projectState.loadingState;return{isShowingWithId:Object(E.t)(i),projectId:A.scratchGui.projectState.projectId,canModifyCloudData:!A.scratchGui.mode.hasEverEnteredEditor||e.canSave}},function(A){return{onShowCloudInfo:function(){return Object(TA.f)(A,"cloudInfo")}}},function(A,e,i){return Object.assign({},A,e,i)})(e)},He=i(4),Le=i.n(He),Pe=i(157),xe=i.n(Pe);function _e(A){return A.type&&"Tab"===A.type.tabsRole}function je(A){return A.type&&"TabPanel"===A.type.tabsRole}function Je(A){return A.type&&"TabList"===A.type.tabsRole}function ze(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Ke(A,e){return n.Children.map(A,function(A){return null===A?null:function(A){return _e(A)||Je(A)||je(A)}(A)?e(A):A.props&&A.props.children&&"object"==typeof A.props.children?Object(n.cloneElement)(A,function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{},t=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(i).filter(function(A){return Object.getOwnPropertyDescriptor(i,A).enumerable}))),t.forEach(function(e){ze(A,e,i[e])})}return A}({},A.props,{children:Ke(A.props.children,e)})):A})}function We(A,e){return n.Children.forEach(A,function(A){null!==A&&(_e(A)||je(A)?e(A):A.props&&A.props.children&&"object"==typeof A.props.children&&(Je(A)&&e(A),We(A.props.children,e)))})}function Ve(A,e,i){var t,o=0,n=0,a=!1,r=[];return We(A[e],function(A){Je(A)&&(A.props&&A.props.children&&"object"==typeof A.props.children&&We(A.props.children,function(A){return r.push(A)}),a&&(t=new Error("Found multiple 'TabList' components inside 'Tabs'. Only one is allowed.")),a=!0),_e(A)?(a&&-1!==r.indexOf(A)||(t=new Error("Found a 'Tab' component outside of the 'TabList' component. 'Tab' components have to be inside the 'TabList' component.")),o++):je(A)&&n++}),t||o===n||(t=new Error("There should be an equal number of 'Tab' and 'TabPanel' in `"+i+"`. Received "+o+" 'Tab' and "+n+" 'TabPanel'.")),t}var Xe,Ze=0;function qe(){return"react-tabs-"+Ze++}function $e(A){var e=0;return We(A,function(A){_e(A)&&e++}),e}function Ai(){return(Ai=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function ei(A){return"getAttribute"in A&&"tab"===A.getAttribute("role")}function ii(A){return"true"===A.getAttribute("aria-disabled")}try{Xe=!("undefined"==typeof window||!window.document||!window.document.activeElement)}catch(A){Xe=!1}var ti=function(A){function e(){for(var e,i=arguments.length,t=new Array(i),o=0;o<i;o++)t[o]=arguments[o];return(e=A.call.apply(A,[this].concat(t))||this).tabNodes=[],e.handleKeyDown=function(A){if(e.isTabFromContainer(A.target)){var i=e.props.selectedIndex,t=!1,o=!1;32!==A.keyCode&&13!==A.keyCode||(t=!0,o=!1,e.handleClick(A)),37===A.keyCode||38===A.keyCode?(i=e.getPrevTab(i),t=!0,o=!0):39===A.keyCode||40===A.keyCode?(i=e.getNextTab(i),t=!0,o=!0):35===A.keyCode?(i=e.getLastTab(),t=!0,o=!0):36===A.keyCode&&(i=e.getFirstTab(),t=!0,o=!0),t&&A.preventDefault(),o&&e.setSelected(i,A)}},e.handleClick=function(A){var i=A.target;do{if(e.isTabFromContainer(i)){if(ii(i))return;var t=[].slice.call(i.parentNode.children).filter(ei).indexOf(i);return void e.setSelected(t,A)}}while(null!==(i=i.parentNode))},e}!function(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,A.__proto__=e}(e,A);var i=e.prototype;return i.setSelected=function(A,e){if(!(A<0||A>=this.getTabsCount())){var i=this.props;(0,i.onSelect)(A,i.selectedIndex,e)}},i.getNextTab=function(A){for(var e=this.getTabsCount(),i=A+1;i<e;i++)if(!ii(this.getTab(i)))return i;for(var t=0;t<A;t++)if(!ii(this.getTab(t)))return t;return A},i.getPrevTab=function(A){for(var e=A;e--;)if(!ii(this.getTab(e)))return e;for(e=this.getTabsCount();e-- >A;)if(!ii(this.getTab(e)))return e;return A},i.getFirstTab=function(){for(var A=this.getTabsCount(),e=0;e<A;e++)if(!ii(this.getTab(e)))return e;return null},i.getLastTab=function(){for(var A=this.getTabsCount();A--;)if(!ii(this.getTab(A)))return A;return null},i.getTabsCount=function(){return $e(this.props.children)},i.getPanelsCount=function(){return function(A){var e=0;return We(A,function(A){je(A)&&e++}),e}(this.props.children)},i.getTab=function(A){return this.tabNodes["tabs-"+A]},i.getChildren=function(){var A=this,e=0,i=this.props,t=i.children,o=i.disabledTabClassName,r=i.focus,s=i.forceRenderTabPanel,g=i.selectedIndex,l=i.selectedTabClassName,c=i.selectedTabPanelClassName;this.tabIds=this.tabIds||[],this.panelIds=this.panelIds||[];for(var u=this.tabIds.length-this.getTabsCount();u++<0;)this.tabIds.push(qe()),this.panelIds.push(qe());return Ke(t,function(i){var t=i;if(Je(i)){var u=0,B=!1;Xe&&(B=a.a.Children.toArray(i.props.children).filter(_e).some(function(e,i){return document.activeElement===A.getTab(i)})),t=Object(n.cloneElement)(i,{children:Ke(i.props.children,function(e){var i="tabs-"+u,t=g===u,a={tabRef:function(e){A.tabNodes[i]=e},id:A.tabIds[u],panelId:A.panelIds[u],selected:t,focus:t&&(r||B)};return l&&(a.selectedClassName=l),o&&(a.disabledClassName=o),u++,Object(n.cloneElement)(e,a)})})}else if(je(i)){var d={id:A.panelIds[e],tabId:A.tabIds[e],selected:g===e};s&&(d.forceRender=s),c&&(d.selectedClassName=c),e++,t=Object(n.cloneElement)(i,d)}return t})},i.isTabFromContainer=function(A){if(!ei(A))return!1;var e=A.parentElement;do{if(e===this.node)return!0;if(e.getAttribute("data-tabs"))break;e=e.parentElement}while(e);return!1},i.render=function(){var A=this,e=this.props,i=(e.children,e.className),t=(e.disabledTabClassName,e.domRef),o=(e.focus,e.forceRenderTabPanel,e.onSelect,e.selectedIndex,e.selectedTabClassName,e.selectedTabPanelClassName,function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(e,["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName"]));return a.a.createElement("div",Ai({},o,{className:Le()(i),onClick:this.handleClick,onKeyDown:this.handleKeyDown,ref:function(e){A.node=e,t&&t(e)},"data-tabs":!0}),this.getChildren())},e}(n.Component);ti.defaultProps={className:"react-tabs",focus:!1},ti.propTypes={children:Ve,className:o.a.oneOfType([o.a.string,o.a.array,o.a.object]),disabledTabClassName:o.a.string,domRef:o.a.func,focus:o.a.bool,forceRenderTabPanel:o.a.bool,onSelect:o.a.func.isRequired,selectedIndex:o.a.number.isRequired,selectedTabClassName:o.a.string,selectedTabPanelClassName:o.a.string};var oi=function(A){function e(i){var t;return(t=A.call(this,i)||this).handleSelected=function(A,i,o){var n=t.props.onSelect;if("function"!=typeof n||!1!==n(A,i,o)){var a={focus:"keydown"===o.type};e.inUncontrolledMode(t.props)&&(a.selectedIndex=A),t.setState(a)}},t.state=e.copyPropsToState(t.props,{},i.defaultFocus),t}!function(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,A.__proto__=e}(e,A);var i=e.prototype;return i.componentWillReceiveProps=function(A){if(e.inUncontrolledMode(A)!==e.inUncontrolledMode(this.props))throw new Error("Switching between controlled mode (by using `selectedIndex`) and uncontrolled mode is not supported in `Tabs`.\nFor more information about controlled and uncontrolled mode of react-tabs see the README.");this.setState(function(i){return e.copyPropsToState(A,i)})},e.inUncontrolledMode=function(A){return null===A.selectedIndex},e.copyPropsToState=function(A,i,t){void 0===t&&(t=!1);var o={focus:t};if(e.inUncontrolledMode(A)){var n=$e(A.children)-1,a=null;a=null!=i.selectedIndex?Math.min(i.selectedIndex,n):A.defaultIndex||0,o.selectedIndex=a}return o},i.render=function(){var A=this.props,e=A.children,i=(A.defaultIndex,A.defaultFocus,function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,["children","defaultIndex","defaultFocus"])),t=this.state,o=t.focus,n=t.selectedIndex;return i.focus=o,i.onSelect=this.handleSelected,null!=n&&(i.selectedIndex=n),a.a.createElement(ti,i,e)},e}(n.Component);function ni(){return(ni=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}oi.defaultProps={defaultFocus:!1,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null},oi.propTypes={children:Ve,className:o.a.oneOfType([o.a.string,o.a.array,o.a.object]),defaultFocus:o.a.bool,defaultIndex:o.a.number,disabledTabClassName:o.a.string,domRef:o.a.func,forceRenderTabPanel:o.a.bool,onSelect:function(A,e,i,t,o){var n=A[e],a=o||e,r=null;return n&&"function"!=typeof n?r=new Error("Invalid "+t+" `"+a+"` of type `"+typeof n+"` supplied to `"+i+"`, expected `function`."):null!=A.selectedIndex&&null==n&&(r=new Error("The "+t+" `"+a+"` is marked as required in `"+i+"`, but its value is `undefined` or `null`.\n`onSelect` is required when `selectedIndex` is also set. Not doing so will make the tabs not do anything, as `selectedIndex` indicates that you want to handle the selected tab yourself.\nIf you only want to set the inital tab replace `selectedIndex` with `defaultIndex`.")),r},selectedIndex:function(A,e,i,t,o){var n=A[e],a=o||e,r=null;if(null!=n&&"number"!=typeof n)r=new Error("Invalid "+t+" `"+a+"` of type `"+typeof n+"` supplied to `"+i+"`, expected `number`.");else if(null!=A.defaultIndex&&null!=n)return new Error("The "+t+" `"+a+"` cannot be used together with `defaultIndex` in `"+i+"`.\nEither remove `"+a+"` to let `"+i+"` handle the selected tab internally or remove `defaultIndex` to handle it yourself.");return r},selectedTabClassName:o.a.string,selectedTabPanelClassName:o.a.string},oi.tabsRole="Tabs";var ai=function(A){function e(){return A.apply(this,arguments)||this}return function(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,A.__proto__=e}(e,A),e.prototype.render=function(){var A=this.props,e=A.children,i=A.className,t=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,["children","className"]);return a.a.createElement("ul",ni({},t,{className:Le()(i),role:"tablist"}),e)},e}(n.Component);function ri(){return(ri=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}ai.defaultProps={className:"react-tabs__tab-list"},ai.propTypes={children:o.a.oneOfType([o.a.object,o.a.array]),className:o.a.oneOfType([o.a.string,o.a.array,o.a.object])},ai.tabsRole="TabList";var si=function(A){function e(){return A.apply(this,arguments)||this}!function(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,A.__proto__=e}(e,A);var i=e.prototype;return i.componentDidMount=function(){this.checkFocus()},i.componentDidUpdate=function(){this.checkFocus()},i.checkFocus=function(){var A=this.props,e=A.selected,i=A.focus;e&&i&&this.node.focus()},i.render=function(){var A,e=this,i=this.props,t=i.children,o=i.className,n=i.disabled,r=i.disabledClassName,s=(i.focus,i.id),g=i.panelId,l=i.selected,c=i.selectedClassName,u=i.tabIndex,B=i.tabRef,d=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(i,["children","className","disabled","disabledClassName","focus","id","panelId","selected","selectedClassName","tabIndex","tabRef"]);return a.a.createElement("li",ri({},d,{className:Le()(o,(A={},A[c]=l,A[r]=n,A)),ref:function(A){e.node=A,B&&B(A)},role:"tab",id:s,"aria-selected":l?"true":"false","aria-disabled":n?"true":"false","aria-controls":g,tabIndex:u||(l?"0":null)}),t)},e}(n.Component);function gi(){return(gi=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}si.defaultProps={className:"react-tabs__tab",disabledClassName:"react-tabs__tab--disabled",focus:!1,id:null,panelId:null,selected:!1,selectedClassName:"react-tabs__tab--selected"},si.propTypes={children:o.a.oneOfType([o.a.array,o.a.object,o.a.string]),className:o.a.oneOfType([o.a.string,o.a.array,o.a.object]),disabled:o.a.bool,tabIndex:o.a.string,disabledClassName:o.a.string,focus:o.a.bool,id:o.a.string,panelId:o.a.string,selected:o.a.bool,selectedClassName:o.a.string,tabRef:o.a.func},si.tabsRole="Tab";var li=function(A){function e(){return A.apply(this,arguments)||this}return function(A,e){A.prototype=Object.create(e.prototype),A.prototype.constructor=A,A.__proto__=e}(e,A),e.prototype.render=function(){var A,e=this.props,i=e.children,t=e.className,o=e.forceRender,n=e.id,r=e.selected,s=e.selectedClassName,g=e.tabId,l=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(e,["children","className","forceRender","id","selected","selectedClassName","tabId"]);return a.a.createElement("div",gi({},l,{className:Le()(t,(A={},A[s]=r,A)),role:"tabpanel",id:n,"aria-labelledby":g}),o||r?i:null)},e}(n.Component);li.defaultProps={className:"react-tabs__tab-panel",forceRender:!1,selectedClassName:"react-tabs__tab-panel--selected"},li.propTypes={children:o.a.node,className:o.a.oneOfType([o.a.string,o.a.array,o.a.object]),forceRender:o.a.bool,id:o.a.string,selected:o.a.bool,selectedClassName:o.a.string,tabId:o.a.string},li.tabsRole="TabPanel";var ci=i(182),ui=i.n(ci),Bi=i(275),di=i.n(Bi),Ei=i(292),hi=i(7),Ci=i(112),wi=i(204),mi=i(115),pi=function(){var A,e;return function(i){if(A===i.assetId)return e;if(A=i.assetId,i.assetType===eA.a.AssetType.ImageVector){var t=i.decodeText();if(t.match('font-family(?!="none")')){var o=Object(mi.inlineSvgFonts)(t);e="data:image/svg+xml;utf8,".concat(encodeURIComponent(o))}else e=i.encodeDataURI()}else e=i.encodeDataURI();return e}}(),Ii=function(A){return A.touches&&A.touches[0]?{x:A.touches[0].clientX,y:A.touches[0].clientY}:A.changedTouches&&A.changedTouches[0]?{x:A.changedTouches[0].clientX,y:A.changedTouches[0].clientY}:{x:A.clientX,y:A.clientY}};function fi(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var Qi=function(){function A(e){var i=e.onDrag,t=void 0===i?function(){}:i,o=e.onDragEnd,n=void 0===o?function(){}:o,a=e.touchDragAngle,r=void 0===a?70:a,s=e.distanceThreshold,g=void 0===s?3:s;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this._onDrag=t,this._onDragEnd=n,this._touchDragAngle=r,this._distanceThreshold=g,this._initialOffset=null,this._gestureState=A.STATE_UNIDENTIFIED,H()(this,["start","gestureInProgress","reset","_handleMove","_handleEnd"])}return function(A,e,i){e&&fi(A.prototype,e),i&&fi(A,i)}(A,[{key:"start",value:function(A){this._initialOffset=Ii(A),this._bindListeners()}},{key:"gestureInProgress",value:function(){return this._gestureState!==A.STATE_UNIDENTIFIED}},{key:"reset",value:function(){this._unbindListeners(),this._initialOffset=null,this._gestureState=A.STATE_UNIDENTIFIED}},{key:"_bindListeners",value:function(){window.addEventListener("mouseup",this._handleEnd),window.addEventListener("mousemove",this._handleMove),window.addEventListener("touchend",this._handleEnd),window.addEventListener("touchmove",this._handleMove,{passive:!1})}},{key:"_unbindListeners",value:function(){window.removeEventListener("mouseup",this._handleEnd),window.removeEventListener("mousemove",this._handleMove),window.removeEventListener("touchend",this._handleEnd),window.removeEventListener("touchmove",this._handleMove,{passive:!1})}},{key:"_handleMove",value:function(e){if(!this._isScroll()){var i=Ii(e);if(!this.gestureInProgress()){var t=i.x-this._initialOffset.x,o=i.y-this._initialOffset.y;if(Math.sqrt(t*t+o*o)<this._distanceThreshold)return;if("touchmove"===e.type){var n=Math.atan2(o,t)/Math.PI*180;(n=Math.abs(n))>90&&(n=180-n),n>this._touchDragAngle?this._gestureState=A.STATE_SCROLL:this._gestureState=A.STATE_DRAG}else this._gestureState=A.STATE_DRAG}this._isDrag()&&(this._onDrag(i,this._initialOffset),e.preventDefault())}}},{key:"_handleEnd",value:function(){this.reset(),this._onDragEnd()}},{key:"_isDrag",value:function(){return this._gestureState===A.STATE_DRAG}},{key:"_isScroll",value:function(){return this._gestureState===A.STATE_SCROLL}}],[{key:"STATE_UNIDENTIFIED",get:function(){return"unidentified"}},{key:"STATE_SCROLL",get:function(){return"scroll"}},{key:"STATE_DRAG",get:function(){return"drag"}}]),A}(),Di=i(302),Mi=i.n(Di),bi=i(761),yi=i.n(bi),Ti=function(A){return a.a.createElement("div",{"aria-label":"Delete",className:Le()(Mi.a.deleteButton,A.className),role:"button",tabIndex:A.tabIndex,onClick:A.onClick},a.a.createElement("div",{className:Mi.a.deleteButtonVisible},a.a.createElement("img",{className:Mi.a.deleteIcon,src:yi.a})))};Ti.propTypes={className:o.a.string,onClick:o.a.func.isRequired,tabIndex:o.a.number},Ti.defaultProps={tabIndex:0};var ki=Ti,Fi=i(96),vi=i.n(Fi),Si=i(54),Ni=i.n(Si);function Ri(A){for(var e=arguments.length,i=Array(e>1?e-1:0),t=1;t<e;t++)i[t-1]=arguments[t];return"function"==typeof A&&A.apply(void 0,i)}function Oi(A,e){return Object.prototype.hasOwnProperty.call(A,e)}var Yi="react-contextmenu",Ui="react-contextmenu--visible",Gi="react-contextmenu-wrapper",Hi="react-contextmenu-item",Li="react-contextmenu-item--active",Pi="react-contextmenu-item--disabled",xi="react-contextmenu-item--divider",_i="react-contextmenu-item--selected",ji="react-contextmenu-submenu",Ji={},zi=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),Ki="REACT_CONTEXTMENU_SHOW",Wi="REACT_CONTEXTMENU_HIDE";function Vi(A,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,t=void 0;"function"==typeof window.CustomEvent?t=new window.CustomEvent(A,{detail:e}):(t=document.createEvent("CustomEvent")).initCustomEvent(A,!1,!0,e),i&&(i.dispatchEvent(t),Ni()(Ji,e))}function Xi(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];Vi(Ki,Ni()({},A,{type:Ki}),e)}function Zi(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];Vi(Wi,Ni()({},A,{type:Wi}),e)}var qi=new function A(){var e=this;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.handleShowEvent=function(A){for(var i in e.callbacks)Oi(e.callbacks,i)&&e.callbacks[i].show(A)},this.handleHideEvent=function(A){for(var i in e.callbacks)Oi(e.callbacks,i)&&e.callbacks[i].hide(A)},this.register=function(A,i){var t=Math.random().toString(36).substring(7);return e.callbacks[t]={show:A,hide:i},t},this.unregister=function(A){A&&e.callbacks[A]&&delete e.callbacks[A]},this.callbacks={},zi&&(window.addEventListener(Ki,this.handleShowEvent),window.addEventListener(Wi,this.handleHideEvent))},$i=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A},At=function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}return function(e,i,t){return i&&A(e.prototype,i),t&&A(e,t),e}}();function et(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function it(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}var tt=function(A){function e(){var A,i,t;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var o=arguments.length,n=Array(o),a=0;a<o;a++)n[a]=arguments[a];return i=t=it(this,(A=e.__proto__||Object.getPrototypeOf(e)).call.apply(A,[this].concat(n))),t.handleClick=function(A){A.preventDefault(),t.props.disabled||t.props.divider||(Ri(t.props.onClick,A,Ni()({},t.props.data,Ji.data),Ji.target),t.props.preventClose||Zi())},it(t,i)}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,n["Component"]),At(e,[{key:"render",value:function(){var A,e=this,i=this.props,t=i.disabled,o=i.divider,n=i.children,r=i.attributes,s=i.selected,g=Le()(Hi,r.className,(et(A={},Le()(Pi,r.disabledClassName),t),et(A,Le()(xi,r.dividerClassName),o),et(A,Le()(_i,r.selectedClassName),s),A));return a.a.createElement("div",$i({},r,{className:g,role:"menuitem",tabIndex:"-1","aria-disabled":t?"true":"false","aria-orientation":o?"horizontal":null,ref:function(A){e.ref=A},onMouseMove:this.props.onMouseMove,onMouseLeave:this.props.onMouseLeave,onTouchEnd:this.handleClick,onClick:this.handleClick}),o?null:n)}}]),e}();tt.propTypes={children:o.a.node,attributes:o.a.object,data:o.a.object,disabled:o.a.bool,divider:o.a.bool,preventClose:o.a.bool,onClick:o.a.func,selected:o.a.bool,onMouseMove:o.a.func,onMouseLeave:o.a.func},tt.defaultProps={disabled:!1,data:{},divider:!1,attributes:{},preventClose:!1,onClick:function(){return null},children:null,selected:!1,onMouseMove:function(){return null},onMouseLeave:function(){return null}};var ot=tt;var nt=function(A){function e(A){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,A));return at.call(i),i.seletedItemRef=null,i.state={selectedItem:null,forceSubMenuOpen:!1},i}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,n["Component"]),e}();nt.propTypes={children:o.a.node.isRequired};var at=function(){var A=this;this.handleKeyNavigation=function(e){if(!1!==A.state.isVisible)switch(e.keyCode){case 37:case 27:e.preventDefault(),A.hideMenu(e);break;case 38:e.preventDefault(),A.selectChildren(!0);break;case 40:e.preventDefault(),A.selectChildren(!1);break;case 39:A.tryToOpenSubMenu(e);break;case 13:e.preventDefault(),A.tryToOpenSubMenu(e);var i=A.seletedItemRef&&A.seletedItemRef.props&&A.seletedItemRef.props.disabled;A.seletedItemRef&&A.seletedItemRef.ref instanceof HTMLElement&&!i?A.seletedItemRef.ref.click():A.hideMenu(e)}},this.handleForceClose=function(){A.setState({forceSubMenuOpen:!1})},this.tryToOpenSubMenu=function(e){A.state.selectedItem&&A.state.selectedItem.type===A.getSubMenuType()&&(e.preventDefault(),A.setState({forceSubMenuOpen:!0}))},this.selectChildren=function(e){var i=A.state.selectedItem,t=[];a.a.Children.forEach(A.props.children,function e(i){i&&([ot,A.getSubMenuType()].indexOf(i.type)<0?a.a.Children.forEach(i.props.children,e):i.props.divider||t.push(i))});var o=t.indexOf(i);o<0?A.setState({selectedItem:e?t[t.length-1]:t[0],forceSubMenuOpen:!1}):e?A.setState({selectedItem:t[o-1<0?t.length-1:o-1],forceSubMenuOpen:!1}):A.setState({selectedItem:t[o+1<t.length?o+1:0],forceSubMenuOpen:!1})},this.onChildMouseMove=function(e){A.state.selectedItem!==e&&A.setState({selectedItem:e,forceSubMenuOpen:!1})},this.onChildMouseLeave=function(){A.setState({selectedItem:null,forceSubMenuOpen:!1})},this.renderChildren=function(e){return a.a.Children.map(e,function(e){var i={};return a.a.isValidElement(e)?[ot,A.getSubMenuType()].indexOf(e.type)<0?(i.children=A.renderChildren(e.props.children),a.a.cloneElement(e,i)):(i.onMouseLeave=A.onChildMouseLeave.bind(A),e.type===A.getSubMenuType()&&(i.forceOpen=A.state.forceSubMenuOpen&&A.state.selectedItem===e,i.forceClose=A.handleForceClose,i.parentKeyNavigationHandler=A.handleKeyNavigation),e.props.divider||A.state.selectedItem!==e?(i.onMouseMove=function(){return A.onChildMouseMove(e)},a.a.cloneElement(e,i)):(i.selected=!0,i.ref=function(e){A.seletedItemRef=e},a.a.cloneElement(e,i))):e})}},rt=nt,st=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A},gt=function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}return function(e,i,t){return i&&A(e.prototype,i),t&&A(e,t),e}}();function lt(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var ct=function(A){function e(A){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,A));return i.getMenuPosition=function(){var A=window,e=A.innerWidth,t=A.innerHeight,o=i.subMenu.getBoundingClientRect(),n={};return o.bottom>t?n.bottom=0:n.top=0,o.right<e?n.left="100%":n.right="100%",n},i.getRTLMenuPosition=function(){var A=window.innerHeight,e=i.subMenu.getBoundingClientRect(),t={};return e.bottom>A?t.bottom=0:t.top=0,e.left<0?t.left="100%":t.right="100%",t},i.hideMenu=function(A){A.detail&&A.detail.id&&i.menu&&A.detail.id!==i.menu.id||(i.props.forceOpen&&i.props.forceClose(),i.setState({visible:!1,selectedItem:null}),i.unregisterHandlers())},i.handleClick=function(A){A.preventDefault(),i.props.disabled||Ri(i.props.onClick,A,Ni()({},i.props.data,Ji.data),Ji.target)},i.handleMouseEnter=function(){i.closetimer&&clearTimeout(i.closetimer),i.props.disabled||i.state.visible||(i.opentimer=setTimeout(function(){return i.setState({visible:!0,selectedItem:null})},i.props.hoverDelay))},i.handleMouseLeave=function(){i.opentimer&&clearTimeout(i.opentimer),i.state.visible&&(i.closetimer=setTimeout(function(){return i.setState({visible:!1,selectedItem:null})},i.props.hoverDelay))},i.menuRef=function(A){i.menu=A},i.subMenuRef=function(A){i.subMenu=A},i.registerHandlers=function(){document.removeEventListener("keydown",i.props.parentKeyNavigationHandler),document.addEventListener("keydown",i.handleKeyNavigation)},i.unregisterHandlers=function(A){document.removeEventListener("keydown",i.handleKeyNavigation),A||document.addEventListener("keydown",i.props.parentKeyNavigationHandler)},i.state=Ni()({},i.state,{visible:!1}),i}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,rt),gt(e,[{key:"componentDidMount",value:function(){this.listenId=qi.register(function(){},this.hideMenu)}},{key:"getSubMenuType",value:function(){return e}},{key:"shouldComponentUpdate",value:function(A,e){return this.isVisibilityChange=!(this.state.visible===e.visible&&this.props.forceOpen===A.forceOpen||this.state.visible&&A.forceOpen||this.props.forceOpen&&e.visible),!0}},{key:"componentDidUpdate",value:function(){var A=this;if(this.isVisibilityChange)if(this.props.forceOpen||this.state.visible){(window.requestAnimationFrame||setTimeout)(function(){var e=A.props.rtl?A.getRTLMenuPosition():A.getMenuPosition();A.subMenu.style.removeProperty("top"),A.subMenu.style.removeProperty("bottom"),A.subMenu.style.removeProperty("left"),A.subMenu.style.removeProperty("right"),Oi(e,"top")&&(A.subMenu.style.top=e.top),Oi(e,"left")&&(A.subMenu.style.left=e.left),Oi(e,"bottom")&&(A.subMenu.style.bottom=e.bottom),Oi(e,"right")&&(A.subMenu.style.right=e.right),A.subMenu.classList.add(Ui),A.registerHandlers(),A.setState({selectedItem:null})})}else{this.subMenu.addEventListener("transitionend",function e(){A.subMenu.removeEventListener("transitionend",e),A.subMenu.style.removeProperty("bottom"),A.subMenu.style.removeProperty("right"),A.subMenu.style.top=0,A.subMenu.style.left="100%",A.unregisterHandlers()}),this.subMenu.classList.remove(Ui)}}},{key:"componentWillUnmount",value:function(){this.listenId&&qi.unregister(this.listenId),this.opentimer&&clearTimeout(this.opentimer),this.closetimer&&clearTimeout(this.closetimer),this.unregisterHandlers(!0)}},{key:"render",value:function(){var A,e=this.props,i=e.children,t=e.attributes,o=e.disabled,n=e.title,r=e.selected,s=this.state.visible,g={ref:this.menuRef,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,className:Le()(Hi,ji,t.listClassName),style:{position:"relative"}},l={className:Le()(Hi,t.className,(A={},lt(A,Le()(Pi,t.disabledClassName),o),lt(A,Le()(Li,t.visibleClassName),s),lt(A,Le()(_i,t.selectedClassName),r),A)),onMouseMove:this.props.onMouseMove,onMouseOut:this.props.onMouseOut,onClick:this.handleClick},c={ref:this.subMenuRef,style:{position:"absolute",transition:"opacity 1ms",top:0,left:"100%"},className:Le()(Yi,this.props.className)};return a.a.createElement("nav",st({},g,{role:"menuitem",tabIndex:"-1","aria-haspopup":"true"}),a.a.createElement("div",st({},t,l),n),a.a.createElement("nav",st({},c,{role:"menu",tabIndex:"-1"}),this.renderChildren(i)))}}]),e}();ct.propTypes={children:o.a.node.isRequired,attributes:o.a.object,title:o.a.node.isRequired,className:o.a.string,disabled:o.a.bool,hoverDelay:o.a.number,rtl:o.a.bool,selected:o.a.bool,onMouseMove:o.a.func,onMouseOut:o.a.func,forceOpen:o.a.bool,forceClose:o.a.func,parentKeyNavigationHandler:o.a.func},ct.defaultProps={disabled:!1,hoverDelay:500,attributes:{},className:"",rtl:!1,selected:!1,onMouseMove:function(){return null},onMouseOut:function(){return null},forceOpen:!1,forceClose:function(){return null},parentKeyNavigationHandler:function(){return null}};var ut=ct,Bt=function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}return function(e,i,t){return i&&A(e.prototype,i),t&&A(e,t),e}}();var dt=function(A){function e(A){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,A));return i.registerHandlers=function(){document.addEventListener("mousedown",i.handleOutsideClick),document.addEventListener("touchstart",i.handleOutsideClick),document.addEventListener("scroll",i.handleHide),document.addEventListener("contextmenu",i.handleHide),document.addEventListener("keydown",i.handleKeyNavigation),window.addEventListener("resize",i.handleHide)},i.unregisterHandlers=function(){document.removeEventListener("mousedown",i.handleOutsideClick),document.removeEventListener("touchstart",i.handleOutsideClick),document.removeEventListener("scroll",i.handleHide),document.removeEventListener("contextmenu",i.handleHide),document.removeEventListener("keydown",i.handleKeyNavigation),window.removeEventListener("resize",i.handleHide)},i.handleShow=function(A){if(A.detail.id===i.props.id&&!i.state.isVisible){var e=A.detail.position,t=e.x,o=e.y;i.setState({isVisible:!0,x:t,y:o}),i.registerHandlers(),Ri(i.props.onShow,A)}},i.handleHide=function(A){!i.state.isVisible||A.detail&&A.detail.id&&A.detail.id!==i.props.id||(i.unregisterHandlers(),i.setState({isVisible:!1,selectedItem:null,forceSubMenuOpen:!1}),Ri(i.props.onHide,A))},i.handleOutsideClick=function(A){i.menu.contains(A.target)||Zi()},i.handleMouseLeave=function(A){A.preventDefault(),Ri(i.props.onMouseLeave,A,Ni()({},i.props.data,Ji.data),Ji.target),i.props.hideOnLeave&&Zi()},i.handleContextMenu=function(A){i.handleHide(A)},i.hideMenu=function(A){27!==A.keyCode&&13!==A.keyCode||Zi()},i.getMenuPosition=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t={top:e,left:A};if(!i.menu)return t;var o=window,n=o.innerWidth,a=o.innerHeight,r=i.menu.getBoundingClientRect();return e+r.height>a&&(t.top-=r.height),A+r.width>n&&(t.left-=r.width),t.top<0&&(t.top=r.height<a?(a-r.height)/2:0),t.left<0&&(t.left=r.width<n?(n-r.width)/2:0),t},i.menuRef=function(A){i.menu=A},i.state=Ni()({},i.state,{x:0,y:0,isVisible:!1}),i}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,rt),Bt(e,[{key:"getSubMenuType",value:function(){return ut}},{key:"componentDidMount",value:function(){this.listenId=qi.register(this.handleShow,this.handleHide)}},{key:"componentDidUpdate",value:function(){var A=this;if(this.state.isVisible){var e=window.requestAnimationFrame||setTimeout;e(function(){var i=A.state,t=i.x,o=i.y,n=A.getMenuPosition(t,o),a=n.top,r=n.left;e(function(){A.menu&&(A.menu.style.top=a+"px",A.menu.style.left=r+"px",A.menu.style.opacity=1,A.menu.style.pointerEvents="auto")})})}else{if(!this.menu)return;this.menu.style.opacity=0,this.menu.style.pointerEvents="none"}}},{key:"componentWillUnmount",value:function(){this.listenId&&qi.unregister(this.listenId),this.unregisterHandlers()}},{key:"render",value:function(){var A=this.props,e=A.children,i=A.className,t=A.style,o=this.state.isVisible,n=Ni()({},t,{position:"fixed",opacity:0,pointerEvents:"none"}),r=Le()(Yi,i,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},Ui,o));return a.a.createElement("nav",{role:"menu",tabIndex:"-1",ref:this.menuRef,style:n,className:r,onContextMenu:this.handleContextMenu,onMouseLeave:this.handleMouseLeave},this.renderChildren(e))}}]),e}();dt.propTypes={id:o.a.string.isRequired,children:o.a.node.isRequired,data:o.a.object,className:o.a.string,hideOnLeave:o.a.bool,onHide:o.a.func,onMouseLeave:o.a.func,onShow:o.a.func,style:o.a.object},dt.defaultProps={className:"",data:{},hideOnLeave:!1,onHide:function(){return null},onMouseLeave:function(){return null},onShow:function(){return null},style:{}};var Et=dt,ht=function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}return function(e,i,t){return i&&A(e.prototype,i),t&&A(e,t),e}}();function Ct(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}var wt=function(A){function e(){var A,i,t;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var o=arguments.length,n=Array(o),a=0;a<o;a++)n[a]=arguments[a];return i=t=Ct(this,(A=e.__proto__||Object.getPrototypeOf(e)).call.apply(A,[this].concat(n))),t.touchHandled=!1,t.handleMouseDown=function(A){t.props.holdToDisplay>=0&&0===A.button&&(A.persist(),A.stopPropagation(),t.mouseDownTimeoutId=setTimeout(function(){return t.handleContextClick(A)},t.props.holdToDisplay)),Ri(t.props.attributes.onMouseDown,A)},t.handleMouseUp=function(A){0===A.button&&clearTimeout(t.mouseDownTimeoutId),Ri(t.props.attributes.onMouseUp,A)},t.handleMouseOut=function(A){0===A.button&&clearTimeout(t.mouseDownTimeoutId),Ri(t.props.attributes.onMouseOut,A)},t.handleTouchstart=function(A){t.touchHandled=!1,t.props.holdToDisplay>=0&&(A.persist(),A.stopPropagation(),t.touchstartTimeoutId=setTimeout(function(){t.handleContextClick(A),t.touchHandled=!0},t.props.holdToDisplay)),Ri(t.props.attributes.onTouchStart,A)},t.handleTouchEnd=function(A){t.touchHandled&&A.preventDefault(),clearTimeout(t.touchstartTimeoutId),Ri(t.props.attributes.onTouchEnd,A)},t.handleContextMenu=function(A){t.handleContextClick(A),Ri(t.props.attributes.onContextMenu,A)},t.handleContextClick=function(A){if(!t.props.disable){A.preventDefault(),A.stopPropagation();var e=A.clientX||A.touches&&A.touches[0].pageX,i=A.clientY||A.touches&&A.touches[0].pageY;t.props.posX&&(e-=t.props.posX),t.props.posY&&(i-=t.props.posY),Zi();var o=Ri(t.props.collect,t.props),n={position:{x:e,y:i},target:t.elem,id:t.props.id,data:o};o&&"function"==typeof o.then?o.then(function(A){n.data=A,Xi(n)}):Xi(n)}},t.elemRef=function(A){t.elem=A},Ct(t,i)}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,n["Component"]),ht(e,[{key:"render",value:function(){var A=this.props,e=A.renderTag,i=A.attributes,t=A.children,o=Ni()({},i,{className:Le()(Gi,i.className),onContextMenu:this.handleContextMenu,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onTouchStart:this.handleTouchstart,onTouchEnd:this.handleTouchEnd,onMouseOut:this.handleMouseOut,ref:this.elemRef});return a.a.createElement(e,o,t)}}]),e}();wt.propTypes={id:o.a.string.isRequired,children:o.a.node.isRequired,attributes:o.a.object,collect:o.a.func,disable:o.a.bool,holdToDisplay:o.a.number,posX:o.a.number,posY:o.a.number,renderTag:o.a.oneOfType([o.a.node,o.a.func])},wt.defaultProps={attributes:{},collect:function(){return null},disable:!1,holdToDisplay:1e3,renderTag:"div",posX:0,posY:0};var mt=wt;Object.assign,function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}}();[].concat(function(A){if(Array.isArray(A)){for(var e=0,i=Array(A.length);e<A.length;e++)i[e]=A[e];return i}return Array.from(A)}(Object.keys(mt.propTypes)),["children"]);var pt=i(146),It=i.n(pt);function ft(){return(ft=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}var Qt=function(A){return a.a.createElement(Et,ft({},A,{className:It.a.contextMenu}))},Dt=function(A){return a.a.createElement(ot,ft({},A,{attributes:{className:It.a.menuItem}}))},Mt=function(A){return a.a.createElement(ot,ft({},A,{attributes:{className:Le()(It.a.menuItem,It.a.menuItemBordered)}}))},bt=function(A){return a.a.createElement(ot,ft({},A,{attributes:{className:Le()(It.a.menuItem,It.a.menuItemBordered,It.a.menuItemDanger)}}))};var yt=0,Tt=function(A){return a.a.createElement(mt,{attributes:{className:Le()(A.className,vi.a.spriteSelectorItem,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},vi.a.isSelected,A.selected)),onClick:A.onClick,onMouseEnter:A.onMouseEnter,onMouseLeave:A.onMouseLeave,onMouseDown:A.onMouseDown,onTouchStart:A.onMouseDown},disable:A.preventContextMenu,id:"".concat(A.name,"-").concat(yt),ref:A.componentRef},void 0===A.number?null:a.a.createElement("div",{className:vi.a.number},A.number),A.costumeURL?a.a.createElement("div",{className:vi.a.spriteImageOuter},a.a.createElement("div",{className:vi.a.spriteImageInner},a.a.createElement("img",{className:vi.a.spriteImage,draggable:!1,src:A.costumeURL}))):null,a.a.createElement("div",{className:vi.a.spriteInfo},a.a.createElement("div",{className:vi.a.spriteName},A.name),A.details?a.a.createElement("div",{className:vi.a.spriteDetails},A.details):null),A.selected&&A.onDeleteButtonClick?a.a.createElement(ki,{className:vi.a.deleteButton,onClick:A.onDeleteButtonClick}):null,A.onDuplicateButtonClick||A.onDeleteButtonClick||A.onExportButtonClick?a.a.createElement(Qt,{id:"".concat(A.name,"-").concat(yt++)},A.onDuplicateButtonClick?a.a.createElement(Dt,{onClick:A.onDuplicateButtonClick},a.a.createElement(B.a,{defaultMessage:"duplicate",id:"gui.spriteSelectorItem.contextMenuDuplicate"})):null,A.onExportButtonClick?a.a.createElement(Dt,{onClick:A.onExportButtonClick},a.a.createElement(B.a,{defaultMessage:"export",id:"gui.spriteSelectorItem.contextMenuExport"})):null,A.onDeleteButtonClick?a.a.createElement(bt,{onClick:A.onDeleteButtonClick},a.a.createElement(B.a,{defaultMessage:"delete",id:"gui.spriteSelectorItem.contextMenuDelete"})):null):null)};Tt.propTypes={className:o.a.string,componentRef:o.a.func,costumeURL:o.a.string,details:o.a.string,name:o.a.string.isRequired,number:o.a.number,onClick:o.a.func,onDeleteButtonClick:o.a.func,onDuplicateButtonClick:o.a.func,onExportButtonClick:o.a.func,onMouseDown:o.a.func,onMouseEnter:o.a.func,onMouseLeave:o.a.func,preventContextMenu:o.a.bool,selected:o.a.bool.isRequired};var kt=Tt;function Ft(A){"@babel/helpers - typeof";return(Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var vt=["asset","id","index","onClick","onDeleteButtonClick","onDuplicateButtonClick","onExportButtonClick","dragPayload","receivedBlocks","costumeURL","vm"];function St(){return(St=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Nt(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Rt(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Ot(A,e){return(Ot=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Yt(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Gt(A);if(e){var o=Gt(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ft(e)||"function"==typeof e))return e;return Ut(A)}(this,i)}}function Ut(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Gt(A){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ht=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Ot(A,e)}(i,a.a.PureComponent);var e=Yt(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Ut(t),["getCostumeData","setRef","handleClick","handleDelete","handleDuplicate","handleExport","handleMouseEnter","handleMouseLeave","handleMouseDown","handleDragEnd","handleDrag","handleTouchEnd"]),t.dragRecognizer=new Qi({onDrag:t.handleDrag,onDragEnd:t.handleDragEnd}),t}return function(A,e,i){e&&Rt(A.prototype,e),i&&Rt(A,i)}(i,[{key:"componentDidMount",value:function(){document.addEventListener("touchend",this.handleTouchEnd)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("touchend",this.handleTouchEnd),this.dragRecognizer.reset()}},{key:"getCostumeData",value:function(){return this.props.costumeURL?this.props.costumeURL:this.props.asset?pi(this.props.asset):null}},{key:"handleDragEnd",value:function(){var A=this;this.props.dragging&&this.props.onDrag({img:null,currentOffset:null,dragging:!1,dragType:null,index:null}),setTimeout(function(){A.noClick=!1})}},{key:"handleDrag",value:function(A){this.props.onDrag({img:this.getCostumeData(),currentOffset:A,dragging:!0,dragType:this.props.dragType,index:this.props.index,payload:this.props.dragPayload}),this.noClick=!0}},{key:"handleTouchEnd",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=this.ref.getBoundingClientRect(),n=o.top,a=o.left,r=o.bottom,s=o.right;i>=a&&i<=s&&t>=n&&t<=r&&this.handleMouseEnter()}},{key:"handleMouseDown",value:function(A){this.dragRecognizer.start(A)}},{key:"handleClick",value:function(A){A.preventDefault(),this.noClick||this.props.onClick(this.props.id)}},{key:"handleDelete",value:function(A){A.stopPropagation(),this.props.onDeleteButtonClick(this.props.id)}},{key:"handleDuplicate",value:function(A){A.stopPropagation(),this.props.onDuplicateButtonClick(this.props.id)}},{key:"handleExport",value:function(A){A.stopPropagation(),this.props.onExportButtonClick(this.props.id)}},{key:"handleMouseLeave",value:function(){this.props.dispatchSetHoveredSprite(null)}},{key:"handleMouseEnter",value:function(){this.props.dispatchSetHoveredSprite(this.props.id)}},{key:"setRef",value:function(A){this.ref=A&&A.elem}},{key:"render",value:function(){var A=this.props,e=(A.asset,A.id,A.index,A.onClick,A.onDeleteButtonClick),i=A.onDuplicateButtonClick,t=A.onExportButtonClick,o=(A.dragPayload,A.receivedBlocks,A.costumeURL,A.vm,Nt(A,vt));return a.a.createElement(kt,St({componentRef:this.setRef,costumeURL:this.getCostumeData(),preventContextMenu:this.dragRecognizer.gestureInProgress(),onClick:this.handleClick,onDeleteButtonClick:e?this.handleDelete:null,onDuplicateButtonClick:i?this.handleDuplicate:null,onExportButtonClick:t?this.handleExport:null,onMouseDown:this.handleMouseDown,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},o))}}]),i}();Ht.propTypes={asset:o.a.instanceOf(eA.a.Asset),costumeURL:o.a.string,dispatchSetHoveredSprite:o.a.func.isRequired,dragPayload:o.a.oneOfType([o.a.string,o.a.number]),dragType:o.a.string,dragging:o.a.bool,id:o.a.oneOfType([o.a.string,o.a.number]),index:o.a.number,name:o.a.string,onClick:o.a.func,onDeleteButtonClick:o.a.func,onDrag:o.a.func.isRequired,onDuplicateButtonClick:o.a.func,onExportButtonClick:o.a.func,receivedBlocks:o.a.bool.isRequired,selected:o.a.bool,vm:o.a.instanceOf(u.a).isRequired};var Lt=Object(s.b)(function(A,e){var i=e.id;return{dragging:A.scratchGui.assetDrag.dragging,receivedBlocks:A.scratchGui.hoveredTarget.receivedBlocks&&A.scratchGui.hoveredTarget.sprite===i,vm:A.scratchGui.vm}},function(A){return{dispatchSetHoveredSprite:function(e){A(Object(Ci.c)(e))},onDrag:function(e){return A(Object(wi.c)(e))}}})(Ht),Pt=i(223),xt=i.n(Pt),_t=i(62),jt=i.n(_t);function Jt(A){"@babel/helpers - typeof";return(Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function zt(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Kt(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Wt(A,e){return(Wt=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Vt(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Zt(A);if(e){var o=Zt(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Jt(e)||"function"==typeof e))return e;return Xt(A)}(this,i)}}function Xt(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Zt(A){return(Zt=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var qt=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Wt(A,e)}(i,a.a.Component);var e=Vt(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Xt(t),["clickDelayer","handleClosePopover","handleToggleOpenState","handleTouchStart","handleTouchOutside","setButtonRef","setContainerRef"]),t.state={isOpen:!1,forceHide:!1},t.mainTooltipId="tooltip-".concat(Math.random()),t}return function(A,e,i){e&&Kt(A.prototype,e),i&&Kt(A,i)}(i,[{key:"componentDidMount",value:function(){this.buttonRef.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("touchstart",this.handleTouchOutside)}},{key:"shouldComponentUpdate",value:function(A,e){return e.isOpen!==this.state.isOpen||e.forceHide!==this.state.forceHide||A.title!==this.props.title}},{key:"componentWillUnmount",value:function(){this.buttonRef.removeEventListener("touchstart",this.handleTouchStart),document.removeEventListener("touchstart",this.handleTouchOutside)}},{key:"handleClosePopover",value:function(){var A=this;this.closeTimeoutId=setTimeout(function(){A.setState({isOpen:!1}),A.closeTimeoutId=null},300)}},{key:"handleToggleOpenState",value:function(){this.closeTimeoutId?(clearTimeout(this.closeTimeoutId),this.closeTimeoutId=null):this.state.isOpen||this.setState({isOpen:!0,forceHide:!1})}},{key:"handleTouchOutside",value:function(A){this.state.isOpen&&!this.containerRef.contains(A.target)&&(this.setState({isOpen:!1}),xt.a.hide())}},{key:"clickDelayer",value:function(A){var e=this;return function(i){xt.a.hide(),A&&A(i),e.buttonRef.blur(),e.setState({forceHide:!0,isOpen:!1},function(){setTimeout(function(){return e.setState({forceHide:!1})})})}}},{key:"handleTouchStart",value:function(A){this.state.isOpen||(A.preventDefault(),this.handleToggleOpenState())}},{key:"setButtonRef",value:function(A){this.buttonRef=A}},{key:"setContainerRef",value:function(A){this.containerRef=A}},{key:"render",value:function(){var A,e=this,i=this.props,t=i.className,o=i.img,n=i.title,r=i.moreButtons,s=i.tooltipPlace,g=i.onClick;return a.a.createElement("div",{className:Le()(jt.a.menuContainer,t,(A={},zt(A,jt.a.expanded,this.state.isOpen),zt(A,jt.a.forceHidden,this.state.forceHide),A)),ref:this.setContainerRef,onMouseEnter:this.handleToggleOpenState,onMouseLeave:this.handleClosePopover},a.a.createElement("button",{"aria-label":n,className:Le()(jt.a.button,jt.a.mainButton),"data-for":this.mainTooltipId,"data-tip":n,ref:this.setButtonRef,onClick:this.clickDelayer(g)},a.a.createElement("img",{className:jt.a.mainIcon,draggable:!1,src:o})),a.a.createElement(xt.a,{className:jt.a.tooltip,effect:"solid",id:this.mainTooltipId,place:s||"left"}),a.a.createElement("div",{className:jt.a.moreButtonsOuter},a.a.createElement("div",{className:jt.a.moreButtons},(r||[]).map(function(A,i){var t=A.img,o=A.title,n=A.onClick,r=A.fileAccept,g=A.fileChange,l=A.fileInput,c=A.fileMultiple,u=!n,B=l,d="".concat(e.mainTooltipId,"-").concat(o);return a.a.createElement("div",{key:"".concat(d,"-").concat(i)},a.a.createElement("button",{"aria-label":o,className:Le()(jt.a.button,jt.a.moreButton,zt({},jt.a.comingSoon,u)),"data-for":d,"data-tip":o,onClick:B?n:e.clickDelayer(n)},a.a.createElement("img",{className:jt.a.moreIcon,draggable:!1,src:t}),B?a.a.createElement("input",{accept:r,className:jt.a.fileInput,multiple:c,ref:l,type:"file",onChange:g}):null),a.a.createElement(xt.a,{className:Le()(jt.a.tooltip,zt({},jt.a.comingSoonTooltip,u)),effect:"solid",id:d,place:s||"left"}))}))))}}]),i}();qt.propTypes={className:o.a.string,img:o.a.string,moreButtons:o.a.arrayOf(o.a.shape({img:o.a.string,title:o.a.node.isRequired,onClick:o.a.func,fileAccept:o.a.string,fileChange:o.a.func,fileInput:o.a.func,fileMultiple:o.a.bool})),onClick:o.a.func.isRequired,title:o.a.node.isRequired,tooltipPlace:o.a.string};var $t=qt;function Ao(A){"@babel/helpers - typeof";return(Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function eo(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function io(A,e){return(io=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function to(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=no(A);if(e){var o=no(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ao(e)||"function"==typeof e))return e;return oo(A)}(this,i)}}function oo(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function no(A){return(no=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ao=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&io(A,e)}(i,a.a.Component);var e=to(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(oo(t),["setRef"]),t}return function(A,e,i){e&&eo(A.prototype,e),i&&eo(A,i)}(i,[{key:"componentDidMount",value:function(){this.props.onAddSortable(this.ref)}},{key:"componentWillUnmount",value:function(){this.props.onRemoveSortable(this.ref)}},{key:"setRef",value:function(A){this.ref=A}},{key:"render",value:function(){return a.a.createElement("div",{className:this.props.className,ref:this.setRef,style:{order:this.props.index}},this.props.children)}}]),i}();ao.propTypes={children:o.a.node.isRequired,className:o.a.string,index:o.a.number.isRequired,onAddSortable:o.a.func.isRequired,onRemoveSortable:o.a.func.isRequired};var ro=ao;function so(A){"@babel/helpers - typeof";return(so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function go(){return(go=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function lo(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function co(A,e){return(co=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function uo(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Eo(A);if(e){var o=Eo(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===so(e)||"function"==typeof e))return e;return Bo(A)}(this,i)}}function Bo(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Eo(A){return(Eo=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ho=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&co(A,e)}(t,a.a.Component);var i=uo(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(Bo(e),["setRef","handleAddSortable","handleRemoveSortable"]),e.sortableRefs=[],e.boxes=null,e.ref=null,e.containerBox=null,e}return function(A,e,i){e&&lo(A.prototype,e),i&&lo(A,i)}(t,[{key:"componentWillReceiveProps",value:function(A){var e=this;if(A.dragInfo.dragging&&!this.props.dragInfo.dragging){if(this.boxes=this.sortableRefs.map(function(A){return A&&A.getBoundingClientRect()}),this.boxes.sort(function(A,i){return A.top===i.top?(A.left-i.left)*(e.props.isRtl?-1:1):A.top-i.top}),!this.ref)throw new Error("The containerRef must be assigned to the sortable area");this.containerBox=this.ref.getBoundingClientRect()}else if(!A.dragInfo.dragging&&this.props.dragInfo.dragging){var i=this.getMouseOverIndex();null!==i&&this.props.onDrop(Object.assign({},this.props.dragInfo,{newIndex:i}))}}},{key:"handleAddSortable",value:function(A){this.sortableRefs.push(A)}},{key:"handleRemoveSortable",value:function(A){var e=this.sortableRefs.indexOf(A);this.sortableRefs=this.sortableRefs.slice(0,e).concat(this.sortableRefs.slice(e+1))}},{key:"getOrdering",value:function(A,e,i){var t=Array(this.props.items.length).fill(0).map(function(A,e){return e}),o=function(A){return"number"==typeof A&&!isNaN(A)};return o(e)&&o(i)&&(t=t.slice(0,e).concat(t.slice(e+1))).splice(i,0,e),t}},{key:"getMouseOverIndex",value:function(){var A=null;if(this.props.dragInfo.currentOffset){var e=this.props.dragInfo.currentOffset,i=e.x,t=e.y,o=this.containerBox,n=o.top,a=o.left,r=o.bottom,s=o.right;i>=a&&i<=s&&t>=n&&t<=r&&(A=0===this.boxes.length?0:function(A,e,i){var t=A.x,o=A.y;if(0===e.length)return null;for(var n=null,a=Math.min.apply(null,e.map(function(A){return A.left})),r=Math.max.apply(null,e.map(function(A){return A.right})),s=Math.min.apply(null,e.map(function(A){return A.top})),g=Math.max.apply(null,e.map(function(A){return A.bottom})),l=0;l<e.length;l++){var c=e[l],u=c.left===a?-1/0:c.left,B=c.right===r?1/0:c.right,d=c.top===s?-1/0:c.top,E=c.bottom===g?1/0:c.bottom;if(l===e.length-1&&(i?u=-1/0:B=1/0),t>=u&&t<=B&&o>=d&&o<=E){n=l;break}}return n}(this.props.dragInfo.currentOffset,this.boxes,this.props.isRtl))}return A}},{key:"setRef",value:function(A){this.ref=A}},{key:"render",value:function(){var e=this.props,i=e.dragInfo,t=i.index,o=i.dragType,n=e.items,r=this.getMouseOverIndex(),s=this.getOrdering(n,t,r);return a.a.createElement(A,go({containerRef:this.setRef,draggingIndex:t,draggingType:o,mouseOverIndex:r,ordering:s,onAddSortable:this.handleAddSortable,onRemoveSortable:this.handleRemoveSortable},this.props))}}]),t}();e.propTypes={dragInfo:o.a.shape({currentOffset:o.a.shape({x:o.a.number,y:o.a.number}),dragType:o.a.string,dragging:o.a.bool,index:o.a.number}),items:o.a.arrayOf(o.a.shape({url:o.a.string,name:o.a.string.isRequired})),onClose:o.a.func,onDrop:o.a.func,isRtl:o.a.bool};return Object(s.b)(function(A){return{dragInfo:A.scratchGui.assetDrag,isRtl:A.locales.isRtl}},function(){return{}})(e)},Co=i(21),wo=i(183),mo=i.n(wo);var po=function(A){var e=A.buttons,i=A.containerRef,t=A.dragType,o=A.isRtl,n=A.items,r=A.selectedItemIndex,s=A.draggingIndex,g=A.draggingType,l=A.ordering,c=A.onAddSortable,u=A.onRemoveSortable,B=A.onDeleteClick,d=A.onDuplicateClick,E=A.onExportClick,h=A.onItemClick,C=g===t,w=null;if(e.length>0){var m=e[0],p=m.img,I=m.title,f=m.onClick,Q=e.slice(1);w=a.a.createElement(hi.a,{className:mo.a.newButtons},a.a.createElement($t,{img:p,moreButtons:Q,title:I,tooltipPlace:o?"left":"right",onClick:f}))}return a.a.createElement(hi.a,{className:mo.a.wrapper,componentRef:i},a.a.createElement(hi.a,{className:mo.a.listArea},n.map(function(A,e){return a.a.createElement(ro,{id:A.name,index:C?l.indexOf(e):e,key:A.name,onAddSortable:c,onRemoveSortable:u},a.a.createElement(Lt,{asset:A.asset,className:Le()(mo.a.listItem,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},mo.a.placeholder,C&&e===s)),costumeURL:A.url,details:A.details,dragPayload:A.dragPayload,dragType:t,id:e,index:e,name:A.name,number:e+1,selected:e===r,onClick:h,onDeleteButtonClick:B,onDuplicateButtonClick:d,onExportButtonClick:E}))})),w)};po.propTypes={buttons:o.a.arrayOf(o.a.shape({title:o.a.string.isRequired,img:o.a.string.isRequired,onClick:o.a.func})),containerRef:o.a.func,dragType:o.a.oneOf(Object.keys(Co.a)),draggingIndex:o.a.number,draggingType:o.a.oneOf(Object.keys(Co.a)),isRtl:o.a.bool,items:o.a.arrayOf(o.a.shape({url:o.a.string,name:o.a.string.isRequired})),onAddSortable:o.a.func,onDeleteClick:o.a.func,onDuplicateClick:o.a.func,onExportClick:o.a.func,onItemClick:o.a.func.isRequired,onRemoveSortable:o.a.func,ordering:o.a.arrayOf(o.a.number),selectedItemIndex:o.a.number.isRequired};var Io=ho(po),fo=i(303),Qo=i.n(fo);function Do(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function Mo(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function bo(){return(bo=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}var yo=function(A){return a.a.createElement(hi.a,{className:Qo.a.wrapper},a.a.createElement(Io,bo({className:Qo.a.selector},A)),a.a.createElement(hi.a,{className:Qo.a.detailArea},A.children))};yo.propTypes=function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Do(Object(i),!0).forEach(function(e){Mo(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):Do(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({},Io.propTypes);var To=yo,ko=i(203);function Fo(A){"@babel/helpers - typeof";return(Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var vo=["selectedCostumeIndex","vm"];function So(){return(So=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function No(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Ro(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Oo(A,e){return(Oo=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Yo(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Go(A);if(e){var o=Go(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Fo(e)||"function"==typeof e))return e;return Uo(A)}(this,i)}}function Uo(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Go(A){return(Go=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ho=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Oo(A,e)}(i,a.a.Component);var e=Yo(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Uo(t),["handleUpdateImage","handleUpdateName"]),t}return function(A,e,i){e&&Ro(A.prototype,e),i&&Ro(A,i)}(i,[{key:"shouldComponentUpdate",value:function(A){return this.props.imageId!==A.imageId||this.props.rtl!==A.rtl||this.props.name!==A.name}},{key:"handleUpdateName",value:function(A){this.props.vm.renameCostume(this.props.selectedCostumeIndex,A)}},{key:"handleUpdateImage",value:function(A,e,i,t){A?this.props.vm.updateSvg(this.props.selectedCostumeIndex,e,i,t):this.props.vm.updateBitmap(this.props.selectedCostumeIndex,e,i,t,2)}},{key:"render",value:function(){if(!this.props.imageId)return null;var A=this.props,e=A.selectedCostumeIndex,i=A.vm,t=No(A,vo);return a.a.createElement(ko.default,So({},t,{image:i.getCostume(e),onUpdateImage:this.handleUpdateImage,onUpdateName:this.handleUpdateName,fontInlineFn:mi.inlineSvgFonts}))}}]),i}();Ho.propTypes={imageFormat:o.a.string.isRequired,imageId:o.a.string.isRequired,name:o.a.string,rotationCenterX:o.a.number,rotationCenterY:o.a.number,rtl:o.a.bool,selectedCostumeIndex:o.a.number.isRequired,vm:o.a.instanceOf(u.a)};var Lo=Object(s.b)(function(A,e){var i=e.selectedCostumeIndex,t=A.scratchGui.vm.editingTarget.id,o=A.scratchGui.vm.editingTarget.sprite,n=i<o.costumes.length?i:o.costumes.length-1,a=A.scratchGui.vm.editingTarget.sprite.costumes[n];return{name:a&&a.name,rotationCenterX:a&&a.rotationCenterX,rotationCenterY:a&&a.rotationCenterY,imageFormat:a&&a.dataFormat,imageId:t&&"".concat(t).concat(a.skinId),rtl:A.locales.isRtl,selectedCostumeIndex:n,vm:A.scratchGui.vm,zoomLevelId:t}})(Ho),Po=function(A){A.x=Math.floor(200*Math.random()-100),A.y=Math.floor(100*Math.random()-50)},xo=i(762),_o=function(A,e,i){!function t(o,n){if(o!==n.length){var a=n[o],r=new FileReader;r.onload=function(){var A=a.type,i=function(A){return A.split(".",1)[0]}(a.name);e(r.result,A,i,o,n.length),t(o+1,n)},r.onerror=i,r.readAsArrayBuffer(a)}else A.value=null}(0,A.files)},jo=function(A,e,i,t){var o=A.createAsset(e,i,t,null,!0);return{name:null,dataFormat:i,asset:o,md5:"".concat(o.assetId,".").concat(i),assetId:o.assetId}},Jo=function A(e,i,t,o){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},a=null,r=null;switch(i){case"image/svg+xml":e=mi.sanitizeSvg.sanitizeByteStream(e),a=t.DataFormat.SVG,r=t.AssetType.ImageVector;break;case"image/jpeg":a=t.DataFormat.JPG,r=t.AssetType.ImageBitmap;break;case"image/bmp":return void function(A){return new Promise(function(e){var i=A instanceof String?A:window.URL.createObjectURL(new Blob([A],{type:"image/bmp"})),t=document.createElement("canvas"),o=t.getContext("2d"),n=document.createElement("img");n.addEventListener("load",function(){t.width=n.naturalWidth,t.height=n.naturalHeight,o.drawImage(n,0,0);var A=t.toDataURL("image/png");window.URL.revokeObjectURL(i),e(A)}),n.setAttribute("src",i)})}(e).then(function(e){A(e,"image/png",t,o)});case"image/png":a=t.DataFormat.PNG,r=t.AssetType.ImageBitmap;break;case"image/gif":var s=[];return void function(A,e){var i=document.createElement("canvas"),t=i.getContext("2d"),o=new xo.GifReader(new Uint8Array(A)),n=o.numFrames();i.width=o.width,i.height=o.height;var a=t.createImageData(i.width,i.height),r=t.createImageData(i.width,i.height);!function A(s){var g=[];o.decodeAndBlitFrameRGBA(s,g);for(var l=o.frameInfo(s),c=l.x,u=l.y,B=l.width,d=l.height,E=l.disposal,h=0;h<d;h++)for(var C=0;C<B;C++){var w=4*(c+u*i.width)+4*(C+h*i.width);g[w+3]&&(a.data[w+0]=g[w+0],a.data[w+1]=g[w+1],a.data[w+2]=g[w+2],a.data[w+3]=g[w+3])}t.clearRect(0,0,i.width,i.height),t.putImageData(a,0,0);var m=i.toDataURL();switch(E){case 2:t.clearRect(c,u,B,d),a=t.getImageData(0,0,i.width,i.height);break;case 3:(a=t.createImageData(i.width,i.height)).data.set(r.data);break;default:r=t.getImageData(0,0,i.width,i.height)}e(s,m,n),s<n-1&&setTimeout(function(){A(s+1)})}(0)}(e,function(e,i,a){A(i,"image/png",t,function(A){s=s.concat(A),e===a-1&&o(s)},n)});default:return void n("Encountered unexpected file type: ".concat(i))}var g=new mi.BitmapAdapter,l=function(A){var e=jo(t,r,a,A);o([e])};a===t.DataFormat.SVG?l(new Uint8Array(e)):g.importBitmap(e,i).then(l).catch(n)},zo=function(A){return{name:A,md5:"cd21514d0531fdffb22204e0ec5ed84a.svg",rotationCenterX:0,rotationCenterY:0,bitmapResolution:1,skinId:null}},Ko=function(A,e){var i=document.createElement("a");if(document.body.appendChild(i),navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(e,A);else if("download"in HTMLAnchorElement.prototype){var t=window.URL.createObjectURL(e);i.href=t,i.download=A,i.type=e.type,i.click(),window.setTimeout(function(){document.body.removeChild(i),window.URL.revokeObjectURL(t)},1e3)}else{var o=window.open("","_blank"),n=new FileReader;n.onloadend=function(){o.location.href=n.result,o=null},n.readAsDataURL(e)}},Wo=i(114),Vo=i(763),Xo=i.n(Vo),Zo=i(764),qo=i.n(Zo),$o=i(135),An=i.n($o),en=i(174),tn=i.n(en),on=i(136),nn=i.n(on),an=i(137),rn=i.n(an),sn=i(216),gn=i(142);function ln(A){"@babel/helpers - typeof";return(ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function cn(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function un(A,e){return(un=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Bn(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=En(A);if(e){var o=En(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ln(e)||"function"==typeof e))return e;return dn(A)}(this,i)}}function dn(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function En(A){return(En=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}function hn(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function Cn(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?hn(Object(i),!0).forEach(function(e){wn(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):hn(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function wn(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var mn=Object(B.d)({addLibraryBackdropMsg:{id:"gui.costumeTab.addBackdropFromLibrary",defaultMessage:"Choose a Backdrop"},addLibraryCostumeMsg:{id:"gui.costumeTab.addCostumeFromLibrary",defaultMessage:"Choose a Costume"},addBlankCostumeMsg:{id:"gui.costumeTab.addBlankCostume",defaultMessage:"Paint"},addSurpriseCostumeMsg:{id:"gui.costumeTab.addSurpriseCostume",defaultMessage:"Surprise"},addFileBackdropMsg:{id:"gui.costumeTab.addFileBackdrop",defaultMessage:"Upload Backdrop"},addFileCostumeMsg:{id:"gui.costumeTab.addFileCostume",defaultMessage:"Upload Costume"}});mn=Cn(Cn({},mn),P.a);var pn=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&un(A,e)}(i,a.a.Component);var e=Bn(i);function i(A){var t;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(dn(t),["handleSelectCostume","handleDeleteCostume","handleDuplicateCostume","handleExportCostume","handleNewCostume","handleNewBlankCostume","handleSurpriseCostume","handleSurpriseBackdrop","handleFileUploadClick","handleCostumeUpload","handleDrop","setFileInput"]);var o=A.editingTarget,n=A.sprites,a=A.stage,r=o&&n[o]?n[o]:a;return r&&r.currentCostume?t.state={selectedCostumeIndex:r.currentCostume}:t.state={selectedCostumeIndex:0},t}return function(A,e,i){e&&cn(A.prototype,e),i&&cn(A,i)}(i,[{key:"componentWillReceiveProps",value:function(A){var e=A.editingTarget,i=A.sprites,t=A.stage,o=e&&i[e]?i[e]:t;o&&o.costumes&&(this.props.editingTarget===e?(this.props.sprites[e]?this.props.sprites[e]:this.props.stage).costumeCount!==o.costumeCount&&this.setState({selectedCostumeIndex:o.currentCostume}):this.setState({selectedCostumeIndex:o.currentCostume}))}},{key:"handleSelectCostume",value:function(A){this.props.vm.editingTarget.setCostume(A),this.setState({selectedCostumeIndex:A})}},{key:"handleDeleteCostume",value:function(A){var e=this.props.vm.deleteCostume(A);this.props.dispatchUpdateRestore({restoreFun:e,deletedItem:"Costume"})}},{key:"handleDuplicateCostume",value:function(A){this.props.vm.duplicateCostume(A)}},{key:"handleExportCostume",value:function(A){var e=this.props.vm.editingTarget.sprite.costumes[A],i=new Blob([e.asset.data],{type:e.asset.assetType.contentType});Ko("".concat(e.name,".").concat(e.asset.dataFormat),i)}},{key:"handleNewCostume",value:function(A,e,i){var t=this,o=Array.isArray(A)?A:[A];return Promise.all(o.map(function(A){return e?t.props.vm.addCostumeFromLibrary(A.md5,A):t.props.vm.addCostume(A.md5,A,i)}))}},{key:"handleNewBlankCostume",value:function(){var A=this.props.vm.editingTarget.isStage?this.props.intl.formatMessage(mn.backdrop,{index:1}):this.props.intl.formatMessage(mn.costume,{index:1});this.handleNewCostume(zo(A))}},{key:"handleSurpriseCostume",value:function(){var A=sn[Math.floor(Math.random()*sn.length)],e={name:A.name,md5:A.md5ext,rotationCenterX:A.rotationCenterX,rotationCenterY:A.rotationCenterY,bitmapResolution:A.bitmapResolution,skinId:null};this.handleNewCostume(e,!0)}},{key:"handleSurpriseBackdrop",value:function(){var A=gn[Math.floor(Math.random()*gn.length)],e={name:A.name,md5:A.md5ext,rotationCenterX:A.rotationCenterX,rotationCenterY:A.rotationCenterY,bitmapResolution:A.bitmapResolution,skinId:null};this.handleNewCostume(e)}},{key:"handleCostumeUpload",value:function(A){var e=this,i=this.props.vm.runtime.storage,t=this.props.vm.editingTarget.id;this.props.onShowImporting(),_o(A.target,function(A,o,n,a,r){Jo(A,o,i,function(A){A.forEach(function(A,e){A.name="".concat(n).concat(e?e+1:"")}),e.handleNewCostume(A,!1,t).then(function(){a===r-1&&e.props.onCloseImporting()})},e.props.onCloseImporting)},this.props.onCloseImporting)}},{key:"handleFileUploadClick",value:function(){this.fileInput.click()}},{key:"handleDrop",value:function(A){if(A.dragType===Co.a.COSTUME){var e=this.props.vm.editingTarget.sprite,i=e.costumes[this.state.selectedCostumeIndex];this.props.vm.reorderCostume(this.props.vm.editingTarget.id,A.index,A.newIndex),this.setState({selectedCostumeIndex:e.costumes.indexOf(i)})}else A.dragType===Co.a.BACKPACK_COSTUME?this.props.vm.addCostume(A.payload.body,{name:A.payload.name}):A.dragType===Co.a.BACKPACK_SOUND&&(this.props.onActivateSoundsTab(),this.props.vm.addSound({md5:A.payload.body,name:A.payload.name}))}},{key:"setFileInput",value:function(A){this.fileInput=A}},{key:"formatCostumeDetails",value:function(A,e){var i=e||1;return"".concat(Math.ceil(A[0]/i)," x ").concat(Math.ceil(A[1]/i))}},{key:"render",value:function(){var A=this,e=this.props,i=(e.dispatchUpdateRestore,e.intl),t=e.isRtl,o=e.onNewLibraryBackdropClick,n=e.onNewLibraryCostumeClick,r=e.vm;if(!r.editingTarget)return null;var s=r.editingTarget.isStage,g=r.editingTarget.sprite,l=s?mn.addLibraryBackdropMsg:mn.addLibraryCostumeMsg,c=s?mn.addFileBackdropMsg:mn.addFileCostumeMsg,u=s?this.handleSurpriseBackdrop:this.handleSurpriseCostume,B=s?o:n,d=s?Xo.a:qo.a,E=g.costumes?g.costumes.map(function(e){return{name:e.name,asset:e.asset,details:e.size?A.formatCostumeDetails(e.size,e.bitmapResolution):null,dragPayload:e}}):[];return a.a.createElement(To,{buttons:[{title:i.formatMessage(l),img:d,onClick:B},{title:i.formatMessage(c),img:An.a,onClick:this.handleFileUploadClick,fileAccept:".svg, .png, .bmp, .jpg, .jpeg, .gif",fileChange:this.handleCostumeUpload,fileInput:this.setFileInput,fileMultiple:!0},{title:i.formatMessage(mn.addSurpriseCostumeMsg),img:nn.a,onClick:u},{title:i.formatMessage(mn.addBlankCostumeMsg),img:tn.a,onClick:this.handleNewBlankCostume},{title:i.formatMessage(l),img:rn.a,onClick:B}],dragType:Co.a.COSTUME,isRtl:t,items:E,selectedItemIndex:this.state.selectedCostumeIndex,onDeleteClick:g&&g.costumes&&g.costumes.length>1?this.handleDeleteCostume:null,onDrop:this.handleDrop,onDuplicateClick:this.handleDuplicateCostume,onExportClick:this.handleExportCostume,onItemClick:this.handleSelectCostume},g.costumes?a.a.createElement(Lo,{selectedCostumeIndex:this.state.selectedCostumeIndex}):null)}}]),i}();pn.propTypes={dispatchUpdateRestore:o.a.func,editingTarget:o.a.string,intl:B.f,isRtl:o.a.bool,onActivateSoundsTab:o.a.func.isRequired,onCloseImporting:o.a.func.isRequired,onNewLibraryBackdropClick:o.a.func.isRequired,onNewLibraryCostumeClick:o.a.func.isRequired,onShowImporting:o.a.func.isRequired,sprites:o.a.shape({id:o.a.shape({costumes:o.a.arrayOf(o.a.shape({url:o.a.string,name:o.a.string.isRequired,skinId:o.a.number}))})}),stage:o.a.shape({sounds:o.a.arrayOf(o.a.shape({name:o.a.string.isRequired}))}),vm:o.a.instanceOf(u.a)};var In=Object(d.a)("Costume Tab")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,isRtl:A.locales.isRtl,sprites:A.scratchGui.targets.sprites,stage:A.scratchGui.targets.stage,dragging:A.scratchGui.assetDrag.dragging}},function(A){return{onActivateSoundsTab:function(){return A(Object(h.e)(h.d))},onNewLibraryBackdropClick:function(e){e.preventDefault(),A(Object(C.m)())},onNewLibraryCostumeClick:function(e){e.preventDefault(),A(Object(C.o)())},dispatchUpdateRestore:function(e){A(Object(Wo.c)(e))},onCloseImporting:function(){return A(Object(TA.c)("importingAsset"))},onShowImporting:function(){return A(Object(TA.h)("importingAsset"))}}})(pn))),fn=i(281),Qn=Object(B.d)({all:{id:"gui.libraryTags.all",defaultMessage:"All"},animals:{id:"gui.libraryTags.animals",defaultMessage:"Animals"},dance:{id:"gui.libraryTags.dance",defaultMessage:"Dance"},effects:{id:"gui.libraryTags.effects",defaultMessage:"Effects"},fantasy:{id:"gui.libraryTags.fantasy",defaultMessage:"Fantasy"},fashion:{id:"gui.libraryTags.fashion",defaultMessage:"Fashion"},food:{id:"gui.libraryTags.food",defaultMessage:"Food"},indoors:{id:"gui.libraryTags.indoors",defaultMessage:"Indoors"},loops:{id:"gui.libraryTags.loops",defaultMessage:"Loops"},music:{id:"gui.libraryTags.music",defaultMessage:"Music"},notes:{id:"gui.libraryTags.notes",defaultMessage:"Notes"},outdoors:{id:"gui.libraryTags.outdoors",defaultMessage:"Outdoors"},patterns:{id:"gui.libraryTags.patterns",defaultMessage:"Patterns"},people:{id:"gui.libraryTags.people",defaultMessage:"People"},percussion:{id:"gui.libraryTags.percussion",defaultMessage:"Percussion"},space:{id:"gui.libraryTags.space",defaultMessage:"Space"},sports:{id:"gui.libraryTags.sports",defaultMessage:"Sports"},underwater:{id:"gui.libraryTags.underwater",defaultMessage:"Underwater"},voice:{id:"gui.libraryTags.voice",defaultMessage:"Voice"},wacky:{id:"gui.libraryTags.wacky",defaultMessage:"Wacky"},animation:{id:"gui.libraryTags.animation",defaultMessage:"Animation"},art:{id:"gui.libraryTags.art",defaultMessage:"Art"},games:{id:"gui.libraryTags.games",defaultMessage:"Games"},stories:{id:"gui.libraryTags.stories",defaultMessage:"Stories"},letters:{id:"gui.libraryTags.letters",defaultMessage:"Letters"}}),Dn=[{tag:"animals",intlLabel:Qn.animals},{tag:"people",intlLabel:Qn.people},{tag:"fantasy",intlLabel:Qn.fantasy},{tag:"dance",intlLabel:Qn.dance},{tag:"music",intlLabel:Qn.music},{tag:"sports",intlLabel:Qn.sports},{tag:"food",intlLabel:Qn.food},{tag:"fashion",intlLabel:Qn.fashion},{tag:"letters",intlLabel:Qn.letters}],Mn=i(84);function bn(A){"@babel/helpers - typeof";return(bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function yn(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Tn(A,e){return(Tn=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function kn(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=vn(A);if(e){var o=vn(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===bn(e)||"function"==typeof e))return e;return Fn(A)}(this,i)}}function Fn(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function vn(A){return(vn=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Sn=Object(B.d)({libraryTitle:{id:"gui.spriteLibrary.chooseASprite",defaultMessage:"Choose a Sprite"}}),Nn=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Tn(A,e)}(i,a.a.PureComponent);var e=kn(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Fn(t),["handleItemSelect"]),t}return function(A,e,i){e&&yn(A.prototype,e),i&&yn(A,i)}(i,[{key:"handleItemSelect",value:function(A){var e=this;Po(A),this.props.vm.addSprite(JSON.stringify(A)).then(function(){e.props.onActivateBlocksTab()})}},{key:"render",value:function(){return a.a.createElement(Mn.a,{data:fn,id:"spriteLibrary",tags:Dn,title:this.props.intl.formatMessage(Sn.libraryTitle),onItemSelected:this.handleItemSelect,onRequestClose:this.props.onRequestClose})}}]),i}();Nn.propTypes={intl:B.f.isRequired,onActivateBlocksTab:o.a.func.isRequired,onRequestClose:o.a.func,vm:o.a.instanceOf(u.a).isRequired};var Rn=Object(B.e)(Nn),On=i(224),Yn=i.n(On),Un=function(A){return a.a.createElement("label",{className:A.above?Yn.a.inputGroupColumn:Yn.a.inputGroup},a.a.createElement("span",{className:A.secondary?Yn.a.inputLabelSecondary:Yn.a.inputLabel},A.text),A.children)};Un.propTypes={above:o.a.bool,children:o.a.node,secondary:o.a.bool,text:o.a.oneOfType([o.a.string,o.a.node]).isRequired},Un.defaultProps={above:!1,secondary:!1};var Gn=Un,Hn=i(372),Ln=i.n(Hn),Pn=["small"];function xn(){return(xn=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function _n(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var jn=function(A){var e=A.small,i=_n(A,Pn);return a.a.createElement("input",xn({},i,{className:Le()(Ln.a.inputForm,A.className,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},Ln.a.inputSmall,e))}))};jn.propTypes={className:o.a.string,small:o.a.bool},jn.defaultProps={small:!1};var Jn=jn;function zn(A){"@babel/helpers - typeof";return(zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Kn(){return(Kn=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Wn(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Vn(A,e){return(Vn=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Xn(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=qn(A);if(e){var o=qn(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===zn(e)||"function"==typeof e))return e;return Zn(A)}(this,i)}}function Zn(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function qn(A){return(qn=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var $n=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Vn(A,e)}(t,a.a.Component);var i=Xn(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(Zn(e),["handleChange","handleKeyPress","handleFlush"]),e.state={value:null},e}return function(A,e,i){e&&Wn(A.prototype,e),i&&Wn(A,i)}(t,[{key:"handleKeyPress",value:function(A){"Enter"===A.key&&(this.handleFlush(),A.target.blur())}},{key:"handleFlush",value:function(){var A="number"==typeof this.props.value,e=!A||!isNaN(this.state.value);null!==this.state.value&&e&&this.props.onSubmit(A?Number(this.state.value):this.state.value),this.setState({value:null})}},{key:"handleChange",value:function(A){this.setState({value:A.target.value})}},{key:"render",value:function(){var e=null===this.state.value?this.props.value:this.state.value;return a.a.createElement(A,Kn({},this.props,{value:e,onBlur:this.handleFlush,onChange:this.handleChange,onKeyPress:this.handleKeyPress}))}}]),t}();return e.propTypes={onSubmit:o.a.func.isRequired,value:o.a.oneOfType([o.a.string,o.a.number])},e},Aa=i(173),ea=i.n(Aa),ia=i(163),ta=i.n(ia),oa=i(765),na=i.n(oa),aa=i(766),ra=i.n(aa);function sa(A){"@babel/helpers - typeof";return(sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function ga(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function la(A,e){return(la=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ca(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Ba(A);if(e){var o=Ba(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===sa(e)||"function"==typeof e))return e;return ua(A)}(this,i)}}function ua(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Ba(A){return(Ba=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var da=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&la(A,e)}(i,a.a.Component);var e=ca(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(ua(t),["handleMouseDown","handleMouseMove","containerRef","handleRef","unbindMouseEvents"]),t}return function(A,e,i){e&&ga(A.prototype,e),i&&ga(A,i)}(i,[{key:"componentDidMount",value:function(){this.handleElement.addEventListener("mousedown",this.handleMouseDown),this.handleElement.addEventListener("touchstart",this.handleMouseDown)}},{key:"componentWillUnmount",value:function(){this.unbindMouseEvents(),this.handleElement.removeEventListener("mousedown",this.handleMouseDown),this.handleElement.removeEventListener("touchstart",this.handleMouseDown)}},{key:"directionToMouseEvent",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=this.containerElement.getBoundingClientRect(),n=o.top+o.height/2,a=o.left+o.width/2;return Math.atan2(t-n,i-a)*(180/Math.PI)+90}},{key:"gaugePath",value:function(A,e){var i=e*(Math.PI/180),t=[];return t.push("M ".concat(A," 0")),t.push("L ".concat(A," ").concat(A)),t.push("L ".concat(A+A*Math.sin(i)," ").concat(A-A*Math.cos(i))),t.push("A ".concat(A," ").concat(A," 0 0 ").concat(e<0?1:0," ").concat(A," 0")),t.push("Z"),t.join(" ")}},{key:"handleMouseMove",value:function(A){this.props.onChange(this.directionToMouseEvent(A)+this.directionOffset),A.preventDefault()}},{key:"unbindMouseEvents",value:function(){window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.unbindMouseEvents),window.removeEventListener("touchmove",this.handleMouseMove),window.removeEventListener("touchend",this.unbindMouseEvents)}},{key:"handleMouseDown",value:function(A){this.directionOffset=this.props.direction-this.directionToMouseEvent(A),window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.unbindMouseEvents),window.addEventListener("touchmove",this.handleMouseMove),window.addEventListener("touchend",this.unbindMouseEvents),A.preventDefault()}},{key:"containerRef",value:function(A){this.containerElement=A}},{key:"handleRef",value:function(A){this.handleElement=A}},{key:"render",value:function(){var A=this.props,e=A.direction,i=A.radius;return a.a.createElement("div",{className:ta.a.container},a.a.createElement("div",{className:ta.a.dialContainer,ref:this.containerRef,style:{width:"".concat(2*i,"px"),height:"".concat(2*i,"px")}},a.a.createElement("img",{className:ta.a.dialFace,draggable:!1,src:na.a}),a.a.createElement("svg",{className:ta.a.gauge,height:2*i,width:2*i},a.a.createElement("path",{className:ta.a.gaugePath,d:this.gaugePath(i,e)})),a.a.createElement("img",{className:ta.a.dialHandle,draggable:!1,ref:this.handleRef,src:ra.a,style:{top:"".concat(i-i*Math.cos(e*(Math.PI/180)),"px"),left:"".concat(i+i*Math.sin(e*(Math.PI/180)),"px"),transform:"rotate(".concat(e,"deg)")}})))}}]),i}();da.propTypes={direction:o.a.number,onChange:o.a.func.isRequired,radius:o.a.number},da.defaultProps={direction:90,radius:56};var Ea=da,ha=i(147),Ca=i.n(ha),wa=i(767),ma=i.n(wa),pa=i(768),Ia=i.n(pa),fa=i(769),Qa=i.n(fa);function Da(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var Ma=$n(Jn),ba=a.a.createElement(B.a,{defaultMessage:"Direction",id:"gui.SpriteInfo.direction"}),ya="all around",Ta="left-right",ka="don't rotate",Fa=Object(B.d)({allAround:{id:"gui.directionPicker.rotationStyles.allAround",defaultMessage:"All Around"},leftRight:{id:"gui.directionPicker.rotationStyles.leftRight",defaultMessage:"Left/Right"},dontRotate:{id:"gui.directionPicker.rotationStyles.dontRotate",defaultMessage:"Do not rotate"}}),va=function(A){return a.a.createElement(Gn,{secondary:!0,above:A.labelAbove,text:ba},a.a.createElement(ea.a,{body:a.a.createElement("div",null,a.a.createElement(Ea,{direction:A.direction,onChange:A.onChangeDirection}),a.a.createElement("div",{className:Ca.a.buttonRow},a.a.createElement("button",{className:Le()(Ca.a.iconButton,Da({},Ca.a.active,A.rotationStyle===ya)),title:A.intl.formatMessage(Fa.allAround),onClick:A.onClickAllAround},a.a.createElement("img",{draggable:!1,src:ma.a})),a.a.createElement("button",{className:Le()(Ca.a.iconButton,Da({},Ca.a.active,A.rotationStyle===Ta)),title:A.intl.formatMessage(Fa.leftRight),onClick:A.onClickLeftRight},a.a.createElement("img",{draggable:!1,src:Ia.a})),a.a.createElement("button",{className:Le()(Ca.a.iconButton,Da({},Ca.a.active,A.rotationStyle===ka)),title:A.intl.formatMessage(Fa.dontRotate),onClick:A.onClickDontRotate},a.a.createElement("img",{draggable:!1,src:Qa.a})))),isOpen:A.popoverOpen,preferPlace:"above",onOuterAction:A.onClosePopover},a.a.createElement(Ma,{small:!0,disabled:A.disabled,label:ba,tabIndex:"0",type:"text",value:A.disabled?"":A.direction,onFocus:A.onOpenPopover,onSubmit:A.onChangeDirection})))};va.propTypes={direction:o.a.number,disabled:o.a.bool.isRequired,intl:B.f,labelAbove:o.a.bool,onChangeDirection:o.a.func.isRequired,onClickAllAround:o.a.func.isRequired,onClickDontRotate:o.a.func.isRequired,onClickLeftRight:o.a.func.isRequired,onClosePopover:o.a.func.isRequired,onOpenPopover:o.a.func.isRequired,popoverOpen:o.a.bool.isRequired,rotationStyle:o.a.string},va.defaultProps={labelAbove:!1};var Sa=Object(B.e)(va);function Na(A){"@babel/helpers - typeof";return(Na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Ra(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Oa(A,e){return(Oa=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Ya(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Ga(A);if(e){var o=Ga(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Na(e)||"function"==typeof e))return e;return Ua(A)}(this,i)}}function Ua(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Ga(A){return(Ga=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ha=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Oa(A,e)}(i,a.a.Component);var e=Ya(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Ua(t),["handleOpenPopover","handleClosePopover","handleClickLeftRight","handleClickDontRotate","handleClickAllAround"]),t.state={popoverOpen:!1},t}return function(A,e,i){e&&Ra(A.prototype,e),i&&Ra(A,i)}(i,[{key:"handleOpenPopover",value:function(){this.setState({popoverOpen:!0})}},{key:"handleClosePopover",value:function(){this.setState({popoverOpen:!1})}},{key:"handleClickAllAround",value:function(){this.props.onChangeRotationStyle(ya)}},{key:"handleClickLeftRight",value:function(){this.props.onChangeRotationStyle(Ta)}},{key:"handleClickDontRotate",value:function(){this.props.onChangeRotationStyle(ka)}},{key:"render",value:function(){return a.a.createElement(Sa,{direction:this.props.direction,disabled:this.props.disabled,labelAbove:this.props.labelAbove,popoverOpen:this.state.popoverOpen&&!this.props.disabled,rotationStyle:this.props.rotationStyle,onChangeDirection:this.props.onChangeDirection,onClickAllAround:this.handleClickAllAround,onClickDontRotate:this.handleClickDontRotate,onClickLeftRight:this.handleClickLeftRight,onClosePopover:this.handleClosePopover,onOpenPopover:this.handleOpenPopover})}}]),i}();Ha.propTypes={direction:o.a.number,disabled:o.a.bool,labelAbove:o.a.bool,onChangeDirection:o.a.func,onChangeRotationStyle:o.a.func,rotationStyle:o.a.string};var La=Ha,Pa=i(16),xa=["ab","ca","de","el","it","ja","ja-Hira","ko","hu","ru","vi"],_a=i(23),ja=i.n(_a),Ja=i(770),za=i.n(Ja),Ka=i(771),Wa=i.n(Ka),Va=i(772),Xa=i.n(Va),Za=i(773),qa=i.n(Za);function $a(A){"@babel/helpers - typeof";return($a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Ar(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function er(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function ir(A,e){return(ir=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function tr(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=or(A);if(e){var o=or(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===$a(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function or(A){return(or=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var nr=$n(Jn),ar=Object(B.d)({spritePlaceholder:{id:"gui.SpriteInfo.spritePlaceholder",defaultMessage:"Name"}}),rr=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&ir(A,e)}(i,a.a.Component);var e=tr(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&er(A.prototype,e),i&&er(A,i)}(i,[{key:"shouldComponentUpdate",value:function(A){return this.props.rotationStyle!==A.rotationStyle||this.props.disabled!==A.disabled||this.props.name!==A.name||this.props.stageSize!==A.stageSize||this.props.visible!==A.visible||Math.round(this.props.direction)!==Math.round(A.direction)||Math.round(this.props.size)!==Math.round(A.size)||Math.round(this.props.x)!==Math.round(A.x)||Math.round(this.props.y)!==Math.round(A.y)}},{key:"render",value:function(){var A,e,i=this.props.stageSize,t=a.a.createElement(B.a,{defaultMessage:"Sprite",id:"gui.SpriteInfo.sprite"}),o=a.a.createElement(B.a,{defaultMessage:"Show",id:"gui.SpriteInfo.show"}),n=a.a.createElement(B.a,{defaultMessage:"Size",id:"gui.SpriteInfo.size"}),r=function(A){return-1!==xa.indexOf(A)}(this.props.intl.locale),s=a.a.createElement(nr,{className:Le()(ja.a.spriteInput,Ar({},ja.a.columnInput,r)),disabled:this.props.disabled,placeholder:this.props.intl.formatMessage(ar.spritePlaceholder),tabIndex:"0",type:"text",value:this.props.disabled?"":this.props.name,onSubmit:this.props.onChangeName}),g=a.a.createElement("div",{className:ja.a.group},i===Pa.c.large?a.a.createElement("div",{className:ja.a.iconWrapper},a.a.createElement("img",{"aria-hidden":"true",className:Le()(ja.a.xIcon,ja.a.icon),src:za.a})):null,a.a.createElement(Gn,{text:"x"},a.a.createElement(nr,{small:!0,disabled:this.props.disabled,placeholder:"x",tabIndex:"0",type:"text",value:this.props.disabled?"":Math.round(this.props.x),onSubmit:this.props.onChangeX}))),l=a.a.createElement("div",{className:ja.a.group},i===Pa.c.large?a.a.createElement("div",{className:ja.a.iconWrapper},a.a.createElement("img",{"aria-hidden":"true",className:Le()(ja.a.yIcon,ja.a.icon),src:Wa.a})):null,a.a.createElement(Gn,{text:"y"},a.a.createElement(nr,{small:!0,disabled:this.props.disabled,placeholder:"y",tabIndex:"0",type:"text",value:this.props.disabled?"":Math.round(this.props.y),onSubmit:this.props.onChangeY})));return i===Pa.c.small?a.a.createElement(hi.a,{className:ja.a.spriteInfo},a.a.createElement("div",{className:Le()(ja.a.row,ja.a.rowPrimary)},a.a.createElement("div",{className:ja.a.group},s)),a.a.createElement("div",{className:Le()(ja.a.row,ja.a.rowSecondary)},g,l)):a.a.createElement(hi.a,{className:ja.a.spriteInfo},a.a.createElement("div",{className:Le()(ja.a.row,ja.a.rowPrimary)},a.a.createElement("div",{className:ja.a.group},a.a.createElement(Gn,{above:r,text:t},s)),g,l),a.a.createElement("div",{className:Le()(ja.a.row,ja.a.rowSecondary)},a.a.createElement("div",{className:r?ja.a.column:ja.a.group},i===Pa.c.large?a.a.createElement(Gn,{secondary:!0,text:o}):null,a.a.createElement("div",{className:ja.a.radioWrapper},a.a.createElement("div",{className:Le()(ja.a.radio,ja.a.radioFirst,ja.a.iconWrapper,(A={},Ar(A,ja.a.isActive,this.props.visible&&!this.props.disabled),Ar(A,ja.a.isDisabled,this.props.disabled),A)),tabIndex:"0",onClick:this.props.onClickVisible,onKeyPress:this.props.onPressVisible},a.a.createElement("img",{className:ja.a.icon,src:Xa.a})),a.a.createElement("div",{className:Le()(ja.a.radio,ja.a.radioLast,ja.a.iconWrapper,(e={},Ar(e,ja.a.isActive,!this.props.visible&&!this.props.disabled),Ar(e,ja.a.isDisabled,this.props.disabled),e)),tabIndex:"0",onClick:this.props.onClickNotVisible,onKeyPress:this.props.onPressNotVisible},a.a.createElement("img",{className:ja.a.icon,src:qa.a})))),a.a.createElement("div",{className:Le()(ja.a.group,ja.a.largerInput)},a.a.createElement(Gn,{secondary:!0,above:r,text:n},a.a.createElement(nr,{small:!0,disabled:this.props.disabled,label:n,tabIndex:"0",type:"text",value:this.props.disabled?"":Math.round(this.props.size),onSubmit:this.props.onChangeSize}))),a.a.createElement("div",{className:Le()(ja.a.group,ja.a.largerInput)},a.a.createElement(La,{direction:Math.round(this.props.direction),disabled:this.props.disabled,labelAbove:r,rotationStyle:this.props.rotationStyle,onChangeDirection:this.props.onChangeDirection,onChangeRotationStyle:this.props.onChangeRotationStyle}))))}}]),i}();rr.propTypes={direction:o.a.oneOfType([o.a.string,o.a.number]),disabled:o.a.bool,intl:B.f,name:o.a.string,onChangeDirection:o.a.func,onChangeName:o.a.func,onChangeRotationStyle:o.a.func,onChangeSize:o.a.func,onChangeX:o.a.func,onChangeY:o.a.func,onClickNotVisible:o.a.func,onClickVisible:o.a.func,onPressNotVisible:o.a.func,onPressVisible:o.a.func,rotationStyle:o.a.string,size:o.a.oneOfType([o.a.string,o.a.number]),stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,visible:o.a.bool,x:o.a.oneOfType([o.a.string,o.a.number]),y:o.a.oneOfType([o.a.string,o.a.number])};var sr=Object(B.e)(rr);function gr(A){"@babel/helpers - typeof";return(gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function lr(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function cr(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?lr(Object(i),!0).forEach(function(e){ur(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):lr(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function ur(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Br(){return(Br=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function dr(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Er(A,e){return(Er=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function hr(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=wr(A);if(e){var o=wr(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===gr(e)||"function"==typeof e))return e;return Cr(A)}(this,i)}}function Cr(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function wr(A){return(wr=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var mr=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Er(A,e)}(i,a.a.Component);var e=hr(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Cr(t),["handleClickVisible","handleClickNotVisible","handlePressVisible","handlePressNotVisible"]),t}return function(A,e,i){e&&dr(A.prototype,e),i&&dr(A,i)}(i,[{key:"handleClickVisible",value:function(A){A.preventDefault(),this.props.onChangeVisibility(!0)}},{key:"handleClickNotVisible",value:function(A){A.preventDefault(),this.props.onChangeVisibility(!1)}},{key:"handlePressVisible",value:function(A){" "!==A.key&&"Enter"!==A.key||(A.preventDefault(),this.props.onChangeVisibility(!0))}},{key:"handlePressNotVisible",value:function(A){" "!==A.key&&"Enter"!==A.key||(A.preventDefault(),this.props.onChangeVisibility(!1))}},{key:"render",value:function(){return a.a.createElement(sr,Br({},this.props,{onClickNotVisible:this.handleClickNotVisible,onClickVisible:this.handleClickVisible,onPressNotVisible:this.handlePressNotVisible,onPressVisible:this.handlePressVisible}))}}]),i}();mr.propTypes=cr(cr({},sr.propTypes),{},{onChangeDirection:o.a.func,onChangeName:o.a.func,onChangeSize:o.a.func,onChangeVisibility:o.a.func,onChangeX:o.a.func,onChangeY:o.a.func,x:o.a.number,y:o.a.number});var pr=mr;function Ir(A){"@babel/helpers - typeof";return(Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function fr(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Qr(A,e){return(Qr=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Dr(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Mr(A);if(e){var o=Mr(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ir(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function Mr(A){return(Mr=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var br=function(A,e){return function(i){return function(t){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Qr(A,e)}(n,a.a.Component);var o=Dr(n);function n(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),o.apply(this,arguments)}return function(A,e,i){e&&fr(A.prototype,e),i&&fr(A,i)}(n,[{key:"shouldComponentUpdate",value:function(i){for(var t in i)if(t!==A&&this.props[t]!==i[t])return!0;return i[A]!==this._lastRenderedValue&&Date.now()-this._lastRenderTime>e}},{key:"render",value:function(){return this._lastRenderTime=Date.now(),this._lastRenderedValue=this.props[A],a.a.createElement(i,this.props)}}]),n}()}},yr=i(88),Tr=i.n(yr);function kr(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var Fr=br("asset",500)(Lt),vr=function(A){var e=A.containerRef,i=A.editingTarget,t=A.draggingIndex,o=A.draggingType,n=A.hoveredTarget,r=A.onDeleteSprite,s=A.onDuplicateSprite,g=A.onExportSprite,l=A.onSelectSprite,c=A.onAddSortable,u=A.onRemoveSortable,B=A.ordering,d=A.raised,E=A.selectedId,h=A.items,C=o===Co.a.SPRITE;return a.a.createElement(hi.a,{className:Le()(Tr.a.scrollWrapper,kr({},Tr.a.scrollWrapperDragging,o===Co.a.BACKPACK_SPRITE)),componentRef:e},a.a.createElement(hi.a,{className:Tr.a.itemsWrapper},h.map(function(A,e){var h,w=n.sprite===A.id&&A.id!==i&&n.receivedBlocks,m=!w&&d&&A.id!==i;return m=m||[Co.a.COSTUME,Co.a.SOUND,Co.a.BACKPACK_COSTUME,Co.a.BACKPACK_SOUND,Co.a.BACKPACK_CODE].includes(o),a.a.createElement(ro,{className:Le()(Tr.a.spriteWrapper,kr({},Tr.a.placeholder,C&&e===t)),index:C?B.indexOf(e):e,key:A.name,onAddSortable:c,onRemoveSortable:u},a.a.createElement(Fr,{asset:A.costume&&A.costume.asset,className:Le()(Tr.a.sprite,(h={},kr(h,Tr.a.raised,m),kr(h,Tr.a.receivedBlocks,w),h)),dragPayload:A.id,dragType:Co.a.SPRITE,id:A.id,index:e,key:A.id,name:A.name,selected:A.id===E,onClick:l,onDeleteButtonClick:r,onDuplicateButtonClick:s,onExportButtonClick:g}))})))};vr.propTypes={containerRef:o.a.func,draggingIndex:o.a.number,draggingType:o.a.oneOf(Object.keys(Co.a)),editingTarget:o.a.string,hoveredTarget:o.a.shape({hoveredSprite:o.a.string,receivedBlocks:o.a.bool,sprite:o.a.string}),items:o.a.arrayOf(o.a.shape({costume:o.a.shape({url:o.a.string,name:o.a.string.isRequired,bitmapResolution:o.a.number.isRequired,rotationCenterX:o.a.number.isRequired,rotationCenterY:o.a.number.isRequired}),name:o.a.string.isRequired,order:o.a.number.isRequired})),onAddSortable:o.a.func,onDeleteSprite:o.a.func,onDuplicateSprite:o.a.func,onExportSprite:o.a.func,onRemoveSortable:o.a.func,onSelectSprite:o.a.func,ordering:o.a.arrayOf(o.a.number),raised:o.a.bool,selectedId:o.a.string};var Sr=ho(vr),Nr=i(72),Rr=i(279),Or=i.n(Rr),Yr=["editingTarget","hoveredTarget","intl","onChangeSpriteDirection","onChangeSpriteName","onChangeSpriteRotationStyle","onChangeSpriteSize","onChangeSpriteVisibility","onChangeSpriteX","onChangeSpriteY","onDrop","onDeleteSprite","onDuplicateSprite","onExportSprite","onFileUploadClick","onNewSpriteClick","onPaintSpriteClick","onSelectSprite","onSpriteUpload","onSurpriseSpriteClick","raised","selectedId","spriteFileInput","sprites","stageSize"];function Ur(){return(Ur=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Gr(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var Hr=Object(B.d)({addSpriteFromLibrary:{id:"gui.spriteSelector.addSpriteFromLibrary",defaultMessage:"Choose a Sprite"},addSpriteFromPaint:{id:"gui.spriteSelector.addSpriteFromPaint",defaultMessage:"Paint"},addSpriteFromSurprise:{id:"gui.spriteSelector.addSpriteFromSurprise",defaultMessage:"Surprise"},addSpriteFromFile:{id:"gui.spriteSelector.addSpriteFromFile",defaultMessage:"Upload Sprite"}}),Lr=function(A){var e=A.editingTarget,i=A.hoveredTarget,t=A.intl,o=A.onChangeSpriteDirection,n=A.onChangeSpriteName,r=A.onChangeSpriteRotationStyle,s=A.onChangeSpriteSize,g=A.onChangeSpriteVisibility,l=A.onChangeSpriteX,c=A.onChangeSpriteY,u=A.onDrop,B=A.onDeleteSprite,d=A.onDuplicateSprite,E=A.onExportSprite,h=A.onFileUploadClick,C=A.onNewSpriteClick,w=A.onPaintSpriteClick,m=A.onSelectSprite,p=A.onSpriteUpload,I=A.onSurpriseSpriteClick,f=A.raised,Q=A.selectedId,D=A.spriteFileInput,M=A.sprites,b=A.stageSize,y=Gr(A,Yr),T=M[Q],k=!1;return void 0===T&&(T={},k=!0),a.a.createElement(hi.a,Ur({className:Tr.a.spriteSelector},y),a.a.createElement(pr,{direction:T.direction,disabled:k,name:T.name,rotationStyle:T.rotationStyle,size:T.size,stageSize:b,visible:T.visible,x:T.x,y:T.y,onChangeDirection:o,onChangeName:n,onChangeRotationStyle:r,onChangeSize:s,onChangeVisibility:g,onChangeX:l,onChangeY:c}),a.a.createElement(Sr,{editingTarget:e,hoveredTarget:i,items:Object.keys(M).map(function(A){return M[A]}),raised:f,selectedId:Q,onDeleteSprite:B,onDrop:u,onDuplicateSprite:d,onExportSprite:E,onSelectSprite:m}),a.a.createElement($t,{className:Tr.a.addButton,img:Or.a,moreButtons:[{title:t.formatMessage(Hr.addSpriteFromFile),img:An.a,onClick:h,fileAccept:".svg, .png, .bmp, .jpg, .jpeg, .sprite2, .sprite3, .gif",fileChange:p,fileInput:D,fileMultiple:!0},{title:t.formatMessage(Hr.addSpriteFromSurprise),img:nn.a,onClick:I},{title:t.formatMessage(Hr.addSpriteFromPaint),img:tn.a,onClick:w},{title:t.formatMessage(Hr.addSpriteFromLibrary),img:rn.a,onClick:C}],title:t.formatMessage(Hr.addSpriteFromLibrary),tooltipPlace:Object(Nr.b)(t.locale)?"right":"left",onClick:C}))};Lr.propTypes={editingTarget:o.a.string,hoveredTarget:o.a.shape({hoveredSprite:o.a.string,receivedBlocks:o.a.bool}),intl:B.f.isRequired,onChangeSpriteDirection:o.a.func,onChangeSpriteName:o.a.func,onChangeSpriteRotationStyle:o.a.func,onChangeSpriteSize:o.a.func,onChangeSpriteVisibility:o.a.func,onChangeSpriteX:o.a.func,onChangeSpriteY:o.a.func,onDeleteSprite:o.a.func,onDrop:o.a.func,onDuplicateSprite:o.a.func,onExportSprite:o.a.func,onFileUploadClick:o.a.func,onNewSpriteClick:o.a.func,onPaintSpriteClick:o.a.func,onSelectSprite:o.a.func,onSpriteUpload:o.a.func,onSurpriseSpriteClick:o.a.func,raised:o.a.bool,selectedId:o.a.string,spriteFileInput:o.a.func,sprites:o.a.shape({id:o.a.shape({costume:o.a.shape({url:o.a.string,name:o.a.string.isRequired,bitmapResolution:o.a.number.isRequired,rotationCenterX:o.a.number.isRequired,rotationCenterY:o.a.number.isRequired}),name:o.a.string.isRequired,order:o.a.number.isRequired})}),stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired};var Pr=Object(B.e)(Lr),xr=i(280),_r=(i(774),i(775),i(12),i(776),function(A,e){return new Promise(function(i,t){bA()({uri:e,responseType:A},function(A,e){return A||200!==e.statusCode?t(new Error(e.status)):i(e.body)})})}),jr=_r.bind(null,"json"),Jr=_r.bind(null,"arraybuffer"),zr=i(97),Kr=i.n(zr),Wr=i(777),Vr=i.n(Wr),Xr=["backdropCount","containerRef","dragOver","fileInputRef","intl","selected","raised","receivedBlocks","url","onBackdropFileUploadClick","onBackdropFileUpload","onClick","onMouseEnter","onMouseLeave","onNewBackdropClick","onSurpriseBackdropClick","onEmptyBackdropClick"];function Zr(){return(Zr=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function qr(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function $r(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var As=Object(B.d)({addBackdropFromLibrary:{id:"gui.spriteSelector.addBackdropFromLibrary",defaultMessage:"Choose a Backdrop"},addBackdropFromPaint:{id:"gui.stageSelector.addBackdropFromPaint",defaultMessage:"Paint"},addBackdropFromSurprise:{id:"gui.stageSelector.addBackdropFromSurprise",defaultMessage:"Surprise"},addBackdropFromFile:{id:"gui.stageSelector.addBackdropFromFile",defaultMessage:"Upload Backdrop"}}),es=function(A){var e,i=A.backdropCount,t=A.containerRef,o=A.dragOver,n=A.fileInputRef,r=A.intl,s=A.selected,g=A.raised,l=A.receivedBlocks,c=A.url,u=A.onBackdropFileUploadClick,d=A.onBackdropFileUpload,E=A.onClick,h=A.onMouseEnter,C=A.onMouseLeave,w=A.onNewBackdropClick,m=A.onSurpriseBackdropClick,p=A.onEmptyBackdropClick,I=$r(A,Xr);return a.a.createElement(hi.a,Zr({className:Le()(Kr.a.stageSelector,(e={},qr(e,Kr.a.isSelected,s),qr(e,Kr.a.raised,g||o),qr(e,Kr.a.receivedBlocks,l),e)),componentRef:t,onClick:E,onMouseEnter:h,onMouseLeave:C},I),a.a.createElement("div",{className:Kr.a.header},a.a.createElement("div",{className:Kr.a.headerTitle},a.a.createElement(B.a,{defaultMessage:"Stage",id:"gui.stageSelector.stage"}))),c?a.a.createElement("img",{className:Kr.a.costumeCanvas,src:c}):null,a.a.createElement("div",{className:Kr.a.label},a.a.createElement(B.a,{defaultMessage:"Backdrops",id:"gui.stageSelector.backdrops"})),a.a.createElement("div",{className:Kr.a.count},i),a.a.createElement($t,{className:Kr.a.addButton,img:Vr.a,moreButtons:[{title:r.formatMessage(As.addBackdropFromFile),img:An.a,onClick:u,fileAccept:".svg, .png, .bmp, .jpg, .jpeg, .gif",fileChange:d,fileInput:n,fileMultiple:!0},{title:r.formatMessage(As.addBackdropFromSurprise),img:nn.a,onClick:m},{title:r.formatMessage(As.addBackdropFromPaint),img:tn.a,onClick:p},{title:r.formatMessage(As.addBackdropFromLibrary),img:rn.a,onClick:w}],title:r.formatMessage(As.addBackdropFromLibrary),tooltipPlace:Object(Nr.b)(r.locale)?"right":"left",onClick:w}))};es.propTypes={backdropCount:o.a.number.isRequired,containerRef:o.a.func,dragOver:o.a.bool,fileInputRef:o.a.func,intl:B.f.isRequired,onBackdropFileUpload:o.a.func,onBackdropFileUploadClick:o.a.func,onClick:o.a.func,onEmptyBackdropClick:o.a.func,onMouseEnter:o.a.func,onMouseLeave:o.a.func,onNewBackdropClick:o.a.func,onSurpriseBackdropClick:o.a.func,raised:o.a.bool.isRequired,receivedBlocks:o.a.bool.isRequired,selected:o.a.bool.isRequired,url:o.a.string};var is=Object(B.e)(es);function ts(A){"@babel/helpers - typeof";return(ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function os(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function ns(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?os(Object(i),!0).forEach(function(e){as(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):os(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function as(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function rs(){return(rs=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function ss(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function gs(A,e){return(gs=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ls(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=us(A);if(e){var o=us(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ts(e)||"function"==typeof e))return e;return cs(A)}(this,i)}}function cs(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function us(A){return(us=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Bs=[Co.a.COSTUME,Co.a.SOUND,Co.a.BACKPACK_COSTUME,Co.a.BACKPACK_SOUND,Co.a.BACKPACK_CODE],ds=Object(xr.a)(Bs)(br("url",500)(is)),Es=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&gs(A,e)}(i,a.a.Component);var e=ls(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(cs(t),["handleClick","handleNewBackdrop","handleSurpriseBackdrop","handleEmptyBackdrop","addBackdropFromLibraryItem","handleFileUploadClick","handleBackdropUpload","handleMouseEnter","handleMouseLeave","handleTouchEnd","handleDrop","setFileInput","setRef"]),t}return function(A,e,i){e&&ss(A.prototype,e),i&&ss(A,i)}(i,[{key:"componentDidMount",value:function(){document.addEventListener("touchend",this.handleTouchEnd)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("touchend",this.handleTouchEnd)}},{key:"handleTouchEnd",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=this.ref.getBoundingClientRect(),n=o.top,a=o.left,r=o.bottom,s=o.right;i>=a&&i<=s&&t>=n&&t<=r&&this.handleMouseEnter()}},{key:"addBackdropFromLibraryItem",value:function(A){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i={name:A.name,md5:A.md5ext,rotationCenterX:A.rotationCenterX,rotationCenterY:A.rotationCenterY,bitmapResolution:A.bitmapResolution,skinId:null};this.handleNewBackdrop(i,e)}},{key:"handleClick",value:function(){this.props.onSelect(this.props.id)}},{key:"handleNewBackdrop",value:function(A){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=Array.isArray(A)?A:[A];return Promise.all(t.map(function(A){return e.props.vm.addBackdrop(A.md5,A)})).then(function(){if(i)return e.props.onActivateTab(h.b)})}},{key:"handleSurpriseBackdrop",value:function(A){A.stopPropagation();var e=gn[Math.floor(Math.random()*gn.length)];this.addBackdropFromLibraryItem(e,!1)}},{key:"handleEmptyBackdrop",value:function(A){A.stopPropagation(),this.props.vm.setEditingTarget(this.props.id),this.handleNewBackdrop(zo(this.props.intl.formatMessage(P.a.backdrop,{index:1})))}},{key:"handleBackdropUpload",value:function(A){var e=this,i=this.props.vm.runtime.storage;this.props.onShowImporting(),_o(A.target,function(A,t,o,n,a){Jo(A,t,i,function(A){e.props.vm.setEditingTarget(e.props.id),A.forEach(function(A,e){A.name="".concat(o).concat(e?e+1:"")}),e.handleNewBackdrop(A).then(function(){n===a-1&&e.props.onCloseImporting()})},e.props.onCloseImporting)},this.props.onCloseImporting)}},{key:"handleFileUploadClick",value:function(A){A.stopPropagation(),this.fileInput.click()}},{key:"handleMouseEnter",value:function(){this.props.dispatchSetHoveredSprite(this.props.id)}},{key:"handleMouseLeave",value:function(){this.props.dispatchSetHoveredSprite(null)}},{key:"handleDrop",value:function(A){var e=this;A.dragType===Co.a.COSTUME?this.props.vm.shareCostumeToTarget(A.index,this.props.id):A.dragType===Co.a.SOUND?this.props.vm.shareSoundToTarget(A.index,this.props.id):A.dragType===Co.a.BACKPACK_COSTUME?this.props.vm.addCostume(A.payload.body,{name:A.payload.name},this.props.id):A.dragType===Co.a.BACKPACK_SOUND?this.props.vm.addSound({md5:A.payload.body,name:A.payload.name},this.props.id):A.dragType===Co.a.BACKPACK_CODE&&jr(A.payload.bodyUrl).then(function(A){e.props.vm.shareBlocksToTarget(A,e.props.id),e.props.vm.refreshWorkspace()})}},{key:"setFileInput",value:function(A){this.fileInput=A}},{key:"setRef",value:function(A){this.ref=A}},{key:"render",value:function(){var A=m()(this.props,["asset","dispatchSetHoveredSprite","id","intl","onActivateTab","onSelect","onShowImporting","onCloseImporting"]);return a.a.createElement(ds,rs({componentRef:this.setRef,fileInputRef:this.setFileInput,onBackdropFileUpload:this.handleBackdropUpload,onBackdropFileUploadClick:this.handleFileUploadClick,onClick:this.handleClick,onDrop:this.handleDrop,onEmptyBackdropClick:this.handleEmptyBackdrop,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onSurpriseBackdropClick:this.handleSurpriseBackdrop},A))}}]),i}();Es.propTypes=ns(ns({},is.propTypes),{},{id:o.a.string,intl:B.f.isRequired,onCloseImporting:o.a.func,onSelect:o.a.func,onShowImporting:o.a.func});var hs=Object(B.e)(Object(s.b)(function(A,e){var i=e.asset,t=e.id;return{url:i&&i.encodeDataURI(),vm:A.scratchGui.vm,receivedBlocks:A.scratchGui.hoveredTarget.receivedBlocks&&A.scratchGui.hoveredTarget.sprite===t,raised:A.scratchGui.blockDrag}},function(A){return{onNewBackdropClick:function(e){e.stopPropagation(),A(Object(C.m)())},onActivateTab:function(e){A(Object(h.e)(e))},dispatchSetHoveredSprite:function(e){A(Object(Ci.c)(e))},onCloseImporting:function(){return A(Object(TA.c)("importingAsset"))},onShowImporting:function(){return A(Object(TA.h)("importingAsset"))}}})(Es)),Cs=i(373),ws=i.n(Cs),ms=["editingTarget","fileInputRef","hoveredTarget","spriteLibraryVisible","onActivateBlocksTab","onChangeSpriteDirection","onChangeSpriteName","onChangeSpriteRotationStyle","onChangeSpriteSize","onChangeSpriteVisibility","onChangeSpriteX","onChangeSpriteY","onDeleteSprite","onDrop","onDuplicateSprite","onExportSprite","onFileUploadClick","onNewSpriteClick","onPaintSpriteClick","onRequestCloseSpriteLibrary","onSelectSprite","onSpriteUpload","onSurpriseSpriteClick","raiseSprites","stage","stageSize","sprites","vm"];function ps(){return(ps=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Is(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var fs=function(A){var e=A.editingTarget,i=A.fileInputRef,t=A.hoveredTarget,o=A.spriteLibraryVisible,n=A.onActivateBlocksTab,r=A.onChangeSpriteDirection,s=A.onChangeSpriteName,g=A.onChangeSpriteRotationStyle,l=A.onChangeSpriteSize,c=A.onChangeSpriteVisibility,u=A.onChangeSpriteX,B=A.onChangeSpriteY,d=A.onDeleteSprite,E=A.onDrop,h=A.onDuplicateSprite,C=A.onExportSprite,w=A.onFileUploadClick,m=A.onNewSpriteClick,p=A.onPaintSpriteClick,I=A.onRequestCloseSpriteLibrary,f=A.onSelectSprite,Q=A.onSpriteUpload,D=A.onSurpriseSpriteClick,M=A.raiseSprites,b=A.stage,y=A.stageSize,T=A.sprites,k=A.vm,F=Is(A,ms);return a.a.createElement("div",ps({className:ws.a.targetPane},F),a.a.createElement(Pr,{editingTarget:e,hoveredTarget:t,raised:M,selectedId:e,spriteFileInput:i,sprites:T,stageSize:y,onChangeSpriteDirection:r,onChangeSpriteName:s,onChangeSpriteRotationStyle:g,onChangeSpriteSize:l,onChangeSpriteVisibility:c,onChangeSpriteX:u,onChangeSpriteY:B,onDeleteSprite:d,onDrop:E,onDuplicateSprite:h,onExportSprite:C,onFileUploadClick:w,onNewSpriteClick:m,onPaintSpriteClick:p,onSelectSprite:f,onSpriteUpload:Q,onSurpriseSpriteClick:D}),a.a.createElement("div",{className:ws.a.stageSelectorWrapper},b.id&&a.a.createElement(hs,{asset:b.costume&&b.costume.asset,backdropCount:b.costumeCount,id:b.id,selected:b.id===e,onSelect:f}),a.a.createElement("div",null,o?a.a.createElement(Rn,{vm:k,onActivateBlocksTab:n,onRequestClose:I}):null)))},Qs=o.a.shape({costume:o.a.shape({asset:o.a.object,url:o.a.string,name:o.a.string.isRequired,bitmapResolution:o.a.number,rotationCenterX:o.a.number,rotationCenterY:o.a.number}),costumeCount:o.a.number,direction:o.a.number,id:o.a.string,name:o.a.string,order:o.a.number,size:o.a.number,visibility:o.a.bool,x:o.a.number,y:o.a.number});fs.propTypes={editingTarget:o.a.string,extensionLibraryVisible:o.a.bool,fileInputRef:o.a.func,hoveredTarget:o.a.shape({hoveredSprite:o.a.string,receivedBlocks:o.a.bool}),onActivateBlocksTab:o.a.func.isRequired,onChangeSpriteDirection:o.a.func,onChangeSpriteName:o.a.func,onChangeSpriteRotationStyle:o.a.func,onChangeSpriteSize:o.a.func,onChangeSpriteVisibility:o.a.func,onChangeSpriteX:o.a.func,onChangeSpriteY:o.a.func,onDeleteSprite:o.a.func,onDrop:o.a.func,onDuplicateSprite:o.a.func,onExportSprite:o.a.func,onFileUploadClick:o.a.func,onNewSpriteClick:o.a.func,onPaintSpriteClick:o.a.func,onRequestCloseExtensionLibrary:o.a.func,onRequestCloseSpriteLibrary:o.a.func,onSelectSprite:o.a.func,onSpriteUpload:o.a.func,onSurpriseSpriteClick:o.a.func,raiseSprites:o.a.bool,spriteLibraryVisible:o.a.bool,sprites:o.a.objectOf(Qs),stage:Qs,stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,vm:o.a.instanceOf(u.a)};var Ds=fs;function Ms(A){"@babel/helpers - typeof";return(Ms="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var bs=["dispatchUpdateRestore","isRtl","onActivateTab","onCloseImporting","onHighlightTarget","onReceivedBlocks","onShowImporting","workspaceMetrics"];function ys(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function Ts(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function ks(){return(ks=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Fs(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function vs(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Ss(A,e){return(Ss=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Ns(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Os(A);if(e){var o=Os(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ms(e)||"function"==typeof e))return e;return Rs(A)}(this,i)}}function Rs(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Os(A){return(Os=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ys=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Ss(A,e)}(i,a.a.Component);var e=Ns(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Rs(t),["handleActivateBlocksTab","handleBlockDragEnd","handleChangeSpriteRotationStyle","handleChangeSpriteDirection","handleChangeSpriteName","handleChangeSpriteSize","handleChangeSpriteVisibility","handleChangeSpriteX","handleChangeSpriteY","handleDeleteSprite","handleDrop","handleDuplicateSprite","handleExportSprite","handleNewSprite","handleSelectSprite","handleSurpriseSpriteClick","handlePaintSpriteClick","handleFileUploadClick","handleSpriteUpload","setFileInput"]),t}return function(A,e,i){e&&vs(A.prototype,e),i&&vs(A,i)}(i,[{key:"componentDidMount",value:function(){this.props.vm.addListener("BLOCK_DRAG_END",this.handleBlockDragEnd)}},{key:"componentWillUnmount",value:function(){this.props.vm.removeListener("BLOCK_DRAG_END",this.handleBlockDragEnd)}},{key:"handleChangeSpriteDirection",value:function(A){this.props.vm.postSpriteInfo({direction:A})}},{key:"handleChangeSpriteRotationStyle",value:function(A){this.props.vm.postSpriteInfo({rotationStyle:A})}},{key:"handleChangeSpriteName",value:function(A){this.props.vm.renameSprite(this.props.editingTarget,A)}},{key:"handleChangeSpriteSize",value:function(A){this.props.vm.postSpriteInfo({size:A})}},{key:"handleChangeSpriteVisibility",value:function(A){this.props.vm.postSpriteInfo({visible:A})}},{key:"handleChangeSpriteX",value:function(A){this.props.vm.postSpriteInfo({x:A})}},{key:"handleChangeSpriteY",value:function(A){this.props.vm.postSpriteInfo({y:A})}},{key:"handleDeleteSprite",value:function(A){var e=this,i=this.props.vm.deleteSprite(A);this.props.dispatchUpdateRestore({restoreFun:function(){return i().then(e.handleActivateBlocksTab)},deletedItem:"Sprite"})}},{key:"handleDuplicateSprite",value:function(A){this.props.vm.duplicateSprite(A)}},{key:"handleExportSprite",value:function(A){var e=this.props.vm.runtime.getTargetById(A).getName(),i=document.createElement("a");document.body.appendChild(i),this.props.vm.exportSprite(A).then(function(A){Ko("".concat(e,".sprite3"),A)})}},{key:"handleSelectSprite",value:function(A){this.props.vm.setEditingTarget(A),this.props.stage&&A!==this.props.stage.id&&this.props.onHighlightTarget(A)}},{key:"handleSurpriseSpriteClick",value:function(){var A=fn.filter(function(A){return-1===A.tags.indexOf("letters")&&-1===A.tags.indexOf("numbers")}),e=A[Math.floor(Math.random()*A.length)];Po(e),this.props.vm.addSprite(JSON.stringify(e)).then(this.handleActivateBlocksTab)}},{key:"handlePaintSpriteClick",value:function(){var A=this,e=this.props.intl.formatMessage,i=function(A,e,i){return{objName:A,sounds:[{soundName:e,soundID:-1,md5:"83a9787d4cb6f3b7632b4ddfebf74367.wav",sampleCount:258,rate:11025,format:""}],costumes:[{costumeName:i,baseLayerID:-1,baseLayerMD5:"cd21514d0531fdffb22204e0ec5ed84a.svg",bitmapResolution:1,rotationCenterX:0,rotationCenterY:0}],currentCostumeIndex:0,scratchX:36,scratchY:28,scale:1,direction:90,rotationStyle:"normal",isDraggable:!1,visible:!0,spriteInfo:{}}}(e(P.a.sprite,{index:1}),e(P.a.pop),e(P.a.costume,{index:1}));this.props.vm.addSprite(JSON.stringify(i)).then(function(){setTimeout(function(){A.props.onActivateTab(h.b)})})}},{key:"handleActivateBlocksTab",value:function(){this.props.onActivateTab(h.a)}},{key:"handleNewSprite",value:function(A){return this.props.vm.addSprite(A).then(this.handleActivateBlocksTab)}},{key:"handleFileUploadClick",value:function(){this.fileInput.click()}},{key:"handleSpriteUpload",value:function(A){var e=this,i=this.props.vm.runtime.storage;this.props.onShowImporting(),_o(A.target,function(A,t,o,n,a){!function(A,e,i,t,o){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(){};switch(e){case"":case"application/zip":return void o(new Uint8Array(A));case"image/svg+xml":case"image/png":case"image/bmp":case"image/jpeg":case"image/gif":return void Jo(A,e,t,function(A){A.forEach(function(A,e){A.name="".concat(i).concat(e?e+1:"")});var e={name:i,isStage:!1,x:0,y:0,visible:!0,size:100,rotationStyle:"all around",direction:90,draggable:!1,currentCostume:0,blocks:{},variables:{},costumes:A,sounds:[]};Po(e),o(JSON.stringify(e))},n);default:n("Encountered unexpected file type: ".concat(e))}}(A,t,o,i,function(A){e.handleNewSprite(A).then(function(){n===a-1&&e.props.onCloseImporting()}).catch(e.props.onCloseImporting)},e.props.onCloseImporting)},this.props.onCloseImporting)}},{key:"setFileInput",value:function(A){this.fileInput=A}},{key:"handleBlockDragEnd",value:function(A){this.props.hoveredTarget.sprite&&this.props.hoveredTarget.sprite!==this.props.editingTarget&&(this.shareBlocks(A,this.props.hoveredTarget.sprite,this.props.editingTarget),this.props.onReceivedBlocks(!0))}},{key:"shareBlocks",value:function(A,e,i){var t=A.find(function(A){return A.topLevel});if(t){var o,n=this.props.workspaceMetrics.targets[e]?this.props.workspaceMetrics.targets[e]:{scrollX:0,scrollY:0,scale:Pa.a},a=n.scrollX,r=n.scrollY,s=n.scale,g=30-r;o=this.props.isRtl?a+30:30-a,t.x=o/s,t.y=g/s}return this.props.vm.shareBlocksToTarget(A,e,i)}},{key:"handleDrop",value:function(A){var e=this,i=this.props.hoveredTarget.sprite;A.dragType===Co.a.SPRITE?this.props.vm.reorderTarget(A.index+1,A.newIndex+1):A.dragType===Co.a.BACKPACK_SPRITE?Jr(A.payload.bodyUrl).then(function(A){return e.props.vm.addSprite(A)}):i&&(A.dragType===Co.a.COSTUME?this.props.vm.shareCostumeToTarget(A.index,i):i&&A.dragType===Co.a.SOUND?this.props.vm.shareSoundToTarget(A.index,i):A.dragType===Co.a.BACKPACK_COSTUME?this.props.vm.addCostume(A.payload.body,{name:A.payload.name},i):A.dragType===Co.a.BACKPACK_SOUND?this.props.vm.addSound({md5:A.payload.body,name:A.payload.name},i):A.dragType===Co.a.BACKPACK_CODE&&jr(A.payload.bodyUrl).then(function(A){return e.shareBlocks(A,i)}).then(function(){return e.props.vm.refreshWorkspace()}))}},{key:"render",value:function(){var A=this.props,e=(A.dispatchUpdateRestore,A.isRtl,A.onActivateTab,A.onCloseImporting,A.onHighlightTarget,A.onReceivedBlocks,A.onShowImporting,A.workspaceMetrics,Fs(A,bs));return a.a.createElement(Ds,ks({},e,{fileInputRef:this.setFileInput,onActivateBlocksTab:this.handleActivateBlocksTab,onChangeSpriteDirection:this.handleChangeSpriteDirection,onChangeSpriteName:this.handleChangeSpriteName,onChangeSpriteRotationStyle:this.handleChangeSpriteRotationStyle,onChangeSpriteSize:this.handleChangeSpriteSize,onChangeSpriteVisibility:this.handleChangeSpriteVisibility,onChangeSpriteX:this.handleChangeSpriteX,onChangeSpriteY:this.handleChangeSpriteY,onDeleteSprite:this.handleDeleteSprite,onDrop:this.handleDrop,onDuplicateSprite:this.handleDuplicateSprite,onExportSprite:this.handleExportSprite,onFileUploadClick:this.handleFileUploadClick,onPaintSpriteClick:this.handlePaintSpriteClick,onSelectSprite:this.handleSelectSprite,onSpriteUpload:this.handleSpriteUpload,onSurpriseSpriteClick:this.handleSurpriseSpriteClick}))}}]),i}(),Us=Ds.propTypes,Gs=(Us.onSelectSprite,Us.onActivateBlocksTab,Fs(Us,["onSelectSprite","onActivateBlocksTab"]));Ys.propTypes=function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ys(Object(i),!0).forEach(function(e){Ts(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):ys(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({intl:B.f.isRequired,onCloseImporting:o.a.func,onShowImporting:o.a.func},Gs);var Hs=Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,hoveredTarget:A.scratchGui.hoveredTarget,isRtl:A.locales.isRtl,spriteLibraryVisible:A.scratchGui.modals.spriteLibrary,sprites:A.scratchGui.targets.sprites,stage:A.scratchGui.targets.stage,raiseSprites:A.scratchGui.blockDrag,workspaceMetrics:A.scratchGui.workspaceMetrics}},function(A){return{onNewSpriteClick:function(e){e.preventDefault(),A(Object(C.t)())},onRequestCloseSpriteLibrary:function(){A(Object(C.h)())},onActivateTab:function(e){A(Object(h.e)(e))},onReceivedBlocks:function(e){A(Object(Ci.d)(e))},dispatchUpdateRestore:function(e){A(Object(Wo.c)(e))},onHighlightTarget:function(e){A(Object(qA.b)(e))},onCloseImporting:function(){return A(Object(TA.c)("importingAsset"))},onShowImporting:function(){return A(Object(TA.h)("importingAsset"))}}})(Ys)),Ls=i(778),Ps=i.n(Ls),xs=i(779),_s=i.n(xs),js=i(780),Js=i.n(js),zs=i(781),Ks=i.n(zs),Ws=i(282),Vs=i.n(Ws),Xs=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.55;if(0===A.length)return 0;for(var i=0,t=0;t<A.length;t++){var o=A[t];i+=Math.pow(o,2)}var n=Math.sqrt(i/A.length)/e;return Math.sqrt(n)},Zs=function(A){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,i=A.length,t=[],o=0;o<i;o+=e){var n=Math.min(i,o+e);t.push(Xs(A.slice(o,n)))}return t},qs=function(A,e,i,t,o){Vs.a.encode({sampleRate:i,channelData:[e]}).then(function(n){var a={format:"",dataFormat:"wav",rate:i,sampleCount:e.length},r=A.runtime.storage;a.asset=r.createAsset(r.AssetType.Sound,r.DataFormat.WAV,new Uint8Array(n),null,!0),a.assetId=a.asset.assetId,a.md5="".concat(a.assetId,".").concat(a.dataFormat),a.name=t,A.addSound(a).then(function(){o&&o()})})},$s=i(164),Ag=i.n($s),eg=function(A){var e=A.level,i=A.width,t=A.height,o=(t-50)/19,n=((19-Math.floor(19*e))*(o+2.5)+1.25)/t;return a.a.createElement("div",{className:Ag.a.maskContainer,style:{height:"".concat(t,"px")}},a.a.createElement("svg",{className:Ag.a.container,height:t,width:i},Array(19).fill(0).map(function(A,e){return a.a.createElement("rect",{className:e<11?Ag.a.green:e<16?Ag.a.yellow:Ag.a.red,height:o,key:e,rx:3,ry:3,width:i-2,x:1,y:t-(2.5+o)*(e+1)})})),a.a.createElement("div",{className:Ag.a.mask,style:{transform:"scaleY(".concat(n,")")}}))};eg.propTypes={height:o.a.number,level:o.a.number,width:o.a.number};var ig=eg,tg=i(374),og=i.n(tg);function ng(A){"@babel/helpers - typeof";return(ng="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function ag(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var i=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null==i)return;var t,o,n=[],a=!0,r=!1;try{for(i=i.call(A);!(a=(t=i.next()).done)&&(n.push(t.value),!e||n.length!==e);a=!0);}catch(A){r=!0,o=A}finally{try{a||null==i.return||i.return()}finally{if(r)throw o}}return n}(A,e)||sg(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rg(A){return function(A){if(Array.isArray(A))return gg(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||sg(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sg(A,e){if(A){if("string"==typeof A)return gg(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);return"Object"===i&&A.constructor&&(i=A.constructor.name),"Map"===i||"Set"===i?Array.from(A):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?gg(A,e):void 0}}function gg(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function lg(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function cg(A,e){return(cg=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ug(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Bg(A);if(e){var o=Bg(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ng(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function Bg(A){return(Bg=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var dg=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&cg(A,e)}(i,a.a.PureComponent);var e=ug(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&lg(A.prototype,e),i&&lg(A,i)}(i,[{key:"render",value:function(){var A=this.props,e=A.width,i=A.height,t=A.data,o=Math.ceil(t.length/e),n=1===o?t.slice(0):t.filter(function(A,e){return e%o==0});1===n.length&&n.push(n[0]);var r=n.length-1,s=[].concat(rg(n.map(function(A,t){return[e*(t/r),i*A/2]})),rg(n.reverse().map(function(A,t){return[e*(1-t/r),-i*A/2]}))),g=s.map(function(A,e){var i=ag(A,2),t=i[0],o=i[1],n=ag(s[e<s.length-1?e+1:0],2),a=n[0],r=n[1];return"Q".concat(t," ").concat(o," ").concat((t+a)/2," ").concat((o+r)/2)});return a.a.createElement("svg",{className:og.a.container,viewBox:"0 0 ".concat(e," ").concat(i)},a.a.createElement("g",{transform:"scale(1, -1) translate(0, -".concat(i/2,")")},a.a.createElement("path",{className:og.a.waveformPath,d:"M0 0".concat(g.join(" "),"Z"),strokeLinejoin:"round",strokeWidth:1})))}}]),i}();dg.propTypes={data:o.a.arrayOf(o.a.number),height:o.a.number,width:o.a.number};var Eg=dg,hg=i(38),Cg=i.n(hg),wg=i(782),mg=i.n(wg),pg=Object(B.d)({beginRecord:{id:"gui.recordingStep.beginRecord",defaultMessage:"Begin recording by clicking the button below"},permission:{id:"gui.recordingStep.permission",defaultMessage:"{arrow}We need your permission to use your microphone"},stop:{id:"gui.recordingStep.stop",defaultMessage:"Stop recording"},record:{id:"gui.recordingStep.record",defaultMessage:"Record"}}),Ig=function(A){return a.a.createElement(hi.a,null,a.a.createElement(hi.a,{className:Cg.a.visualizationContainer},a.a.createElement(hi.a,{className:Cg.a.meterContainer},a.a.createElement(ig,{height:172,level:A.level,width:20})),a.a.createElement(hi.a,{className:Cg.a.waveformContainer},A.levels?a.a.createElement(Eg,{data:A.levels,height:150,level:0,width:440}):a.a.createElement("span",{className:Cg.a.helpText},A.listening?A.intl.formatMessage(pg.beginRecord):A.intl.formatMessage(pg.permission,{arrow:A.isRtl?"↗️ ":"↖️ "})))),a.a.createElement(hi.a,{className:Cg.a.mainButtonRow},a.a.createElement("button",{className:Cg.a.mainButton,disabled:!A.listening,onClick:A.recording?A.onStopRecording:A.onRecord},A.recording?a.a.createElement("img",{draggable:!1,src:mg.a}):a.a.createElement("svg",{className:Cg.a.recordButton,height:"52",width:"52"},a.a.createElement("circle",{className:Cg.a.recordButtonCircle,cx:"26",cy:"26",r:"25"}),a.a.createElement("circle",{className:Cg.a.recordButtonCircleOutline,cx:"26",cy:"26",r:27+5*A.level})),a.a.createElement("div",{className:Cg.a.helpText},a.a.createElement("span",{className:Cg.a.recordingText},A.recording?A.intl.formatMessage(pg.stop):A.intl.formatMessage(pg.record))))))};Ig.propTypes={intl:B.f.isRequired,isRtl:o.a.bool,level:o.a.number,levels:o.a.arrayOf(o.a.number),listening:o.a.bool,onRecord:o.a.func.isRequired,onStopRecording:o.a.func.isRequired,recording:o.a.bool};var fg,Qg=Object(B.e)(Ig),Dg=(i(1527),i(283)),Mg=i.n(Dg),bg=i(363),yg=i.n(bg),Tg=i(215);if(!i.n(Tg).a.msie){var kg=void 0===document.ontouchstart?"mousedown":"touchstart";document.addEventListener(kg,function A(){document.removeEventListener(kg,A),fg=new(window.AudioContext||window.webkitAudioContext),yg()(fg)})}var Fg=function(){return fg};function vg(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var Sg=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=new Fg,this.bufferLength=8192,this.userMediaStream=null,this.mediaStreamSource=null,this.sourceNode=null,this.scriptProcessorNode=null,this.recordedSamples=0,this.recording=!1,this.started=!1,this.buffers=[],this.disposed=!1}return function(A,e,i){e&&vg(A.prototype,e),i&&vg(A,i)}(A,[{key:"startListening",value:function(A,e,i){var t=this;try{Mg()({audio:!0}).then(function(i){t.disposed||(t.started=!0,A(),t.attachUserMediaStream(i,e))}).catch(function(A){t.disposed||i(A)})}catch(A){this.disposed||i(A)}}},{key:"startRecording",value:function(){this.recording=!0}},{key:"attachUserMediaStream",value:function(A,e){var i=this;this.userMediaStream=A,this.mediaStreamSource=this.audioContext.createMediaStreamSource(A),this.sourceNode=this.audioContext.createGain(),this.scriptProcessorNode=this.audioContext.createScriptProcessor(this.bufferLength,1,1),this.scriptProcessorNode.onaudioprocess=function(A){i.recording&&!i.disposed&&i.buffers.push(new Float32Array(A.inputBuffer.getChannelData(0)))},this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=2048;var t=this.analyserNode.frequencyBinCount,o=new Float32Array(t);requestAnimationFrame(function A(){i.disposed||(i.analyserNode.getFloatTimeDomainData(o),e(Xs(o)),requestAnimationFrame(A))}),this.mediaStreamSource.connect(this.sourceNode),this.sourceNode.connect(this.analyserNode),this.analyserNode.connect(this.scriptProcessorNode),this.scriptProcessorNode.connect(this.audioContext.destination)}},{key:"stop",value:function(){for(var A=new Float32Array(this.buffers.length*this.bufferLength),e=0,i=0;i<this.buffers.length;i++){var t=this.buffers[i];A.set(t,e),e+=t.length}for(var o=Zs(A),n=Math.max.apply(null,o)/8,a=null,r=null,s=0;s<o.length;s++)o[s]>n&&(null===a&&(a=s+1),r=s+1);var g=Math.max(2,a-2)/this.buffers.length,l=Math.min(this.buffers.length-2,r+2)/this.buffers.length;return g>=l&&(g=0,l=1),{levels:o,samples:A,sampleRate:this.audioContext.sampleRate,trimStart:g,trimEnd:l}}},{key:"dispose",value:function(){this.started&&(this.scriptProcessorNode.onaudioprocess=null,this.scriptProcessorNode.disconnect(),this.analyserNode.disconnect(),this.sourceNode.disconnect(),this.mediaStreamSource.disconnect(),this.userMediaStream.getAudioTracks()[0].stop()),this.disposed=!0}}]),A}();function Ng(A){"@babel/helpers - typeof";return(Ng="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var Rg=["onRecord","onStopRecording"];function Og(){return(Og=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Yg(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Ug(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Gg(A,e){return(Gg=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Hg(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Pg(A);if(e){var o=Pg(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ng(e)||"function"==typeof e))return e;return Lg(A)}(this,i)}}function Lg(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Pg(A){return(Pg=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var xg=Object(B.d)({alertMsg:{id:"gui.recordingStep.alertMsg",defaultMessage:"Could not start recording"}}),_g=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Gg(A,e)}(i,a.a.Component);var e=Hg(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Lg(t),["handleRecord","handleStopRecording","handleStarted","handleLevelUpdate","handleRecordingError"]),t.state={listening:!1,level:0,levels:null},t}return function(A,e,i){e&&Ug(A.prototype,e),i&&Ug(A,i)}(i,[{key:"componentDidMount",value:function(){this.audioRecorder=new Sg,this.audioRecorder.startListening(this.handleStarted,this.handleLevelUpdate,this.handleRecordingError)}},{key:"componentWillUnmount",value:function(){this.audioRecorder.dispose()}},{key:"handleStarted",value:function(){this.setState({listening:!0})}},{key:"handleRecordingError",value:function(){alert(this.props.intl.formatMessage(xg.alertMsg))}},{key:"handleLevelUpdate",value:function(A){this.setState({level:A,levels:this.props.recording?(this.state.levels||[]).concat([A]):this.state.levels})}},{key:"handleRecord",value:function(){this.audioRecorder.startRecording(),this.props.onRecord()}},{key:"handleStopRecording",value:function(){var A=this.audioRecorder.stop(),e=A.samples,i=A.sampleRate,t=A.levels,o=A.trimStart,n=A.trimEnd;this.props.onStopRecording(e,i,t,o,n)}},{key:"render",value:function(){var A=this.props,e=(A.onRecord,A.onStopRecording,Yg(A,Rg));return a.a.createElement(Qg,Og({level:this.state.level,levels:this.state.levels,listening:this.state.listening,onRecord:this.handleRecord,onStopRecording:this.handleStopRecording},e))}}]),i}();_g.propTypes={intl:B.f.isRequired,onRecord:o.a.func.isRequired,onStopRecording:o.a.func.isRequired,recording:o.a.bool};var jg=Object(B.e)(_g),Jg=i(32),zg=i.n(Jg),Kg=i(375),Wg=i.n(Kg),Vg=function(A){return a.a.createElement(hi.a,{className:Le()(zg.a.trimLine,A.handleStyle),onMouseDown:A.onMouseDown,onTouchStart:A.onMouseDown},a.a.createElement(hi.a,{className:Le()(zg.a.trimHandle,zg.a.topTrimHandle)},a.a.createElement("img",{src:Wg.a,draggable:!1})),a.a.createElement(hi.a,{className:Le()(zg.a.trimHandle,zg.a.bottomTrimHandle)},a.a.createElement("img",{src:Wg.a,draggable:!1})))};Vg.propTypes={handleStyle:o.a.string,onMouseDown:o.a.func};var Xg=Vg,Zg=function(A){return a.a.createElement("div",{className:zg.a.playheadContainer},a.a.createElement("div",{className:Le()(zg.a.playhead),style:{transform:"translateX(".concat(100*A.playbackPosition,"%)")}}))};Zg.propTypes={playbackPosition:o.a.number};var qg=Zg,$g=function(A){return a.a.createElement("div",{className:Le()(zg.a.absolute,zg.a.trimmer),ref:A.containerRef},null===A.trimStart?null:a.a.createElement(hi.a,{className:Le()(zg.a.absolute,zg.a.trimBackground,zg.a.startTrimBackground),style:{width:"".concat(100*A.trimStart,"%")},onMouseDown:A.onTrimStartMouseDown,onTouchStart:A.onTrimStartMouseDown},a.a.createElement(hi.a,{className:Le()(zg.a.absolute,zg.a.trimBackgroundMask)}),a.a.createElement(Xg,{handleStyle:zg.a.leftHandle})),A.playhead?a.a.createElement(qg,{playbackPosition:A.playhead}):null,null===A.trimEnd?null:a.a.createElement(hi.a,{className:Le()(zg.a.absolute,zg.a.trimBackground,zg.a.endTrimBackground),style:{left:"".concat(100*A.trimEnd,"%"),width:"".concat(100-100*A.trimEnd,"%")},onMouseDown:A.onTrimEndMouseDown,onTouchStart:A.onTrimEndMouseDown},a.a.createElement(hi.a,{className:Le()(zg.a.absolute,zg.a.trimBackgroundMask)}),a.a.createElement(Xg,{handleStyle:zg.a.rightHandle})))};$g.propTypes={containerRef:o.a.func,onTrimEndMouseDown:o.a.func.isRequired,onTrimStartMouseDown:o.a.func.isRequired,playhead:o.a.number,trimEnd:o.a.number,trimStart:o.a.number};var Al=$g;function el(A){"@babel/helpers - typeof";return(el="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function il(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function tl(A,e){return(tl=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ol(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=al(A);if(e){var o=al(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===el(e)||"function"==typeof e))return e;return nl(A)}(this,i)}}function nl(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function al(A){return(al=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var rl=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&tl(A,e)}(i,a.a.Component);var e=ol(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(nl(t),["handleTrimStartMouseDown","handleTrimEndMouseDown","handleTrimStartMouseMove","handleTrimEndMouseMove","storeRef"]),t.trimStartDragRecognizer=new Qi({onDrag:t.handleTrimStartMouseMove,touchDragAngle:90,distanceThreshold:0}),t.trimEndDragRecognizer=new Qi({onDrag:t.handleTrimEndMouseMove,touchDragAngle:90,distanceThreshold:0}),t}return function(A,e,i){e&&il(A.prototype,e),i&&il(A,i)}(i,[{key:"handleTrimStartMouseMove",value:function(A,e){var i=(A.x-e.x)/this.containerSize,t=Math.max(0,Math.min(this.props.trimEnd-.01,this.initialTrim+i));this.props.onSetTrimStart(t)}},{key:"handleTrimEndMouseMove",value:function(A,e){var i=(A.x-e.x)/this.containerSize,t=Math.min(1,Math.max(this.props.trimStart+.01,this.initialTrim+i));this.props.onSetTrimEnd(t)}},{key:"handleTrimStartMouseDown",value:function(A){this.containerSize=this.containerElement.getBoundingClientRect().width,this.trimStartDragRecognizer.start(A),this.initialTrim=this.props.trimStart}},{key:"handleTrimEndMouseDown",value:function(A){this.containerSize=this.containerElement.getBoundingClientRect().width,this.trimEndDragRecognizer.start(A),this.initialTrim=this.props.trimEnd}},{key:"storeRef",value:function(A){this.containerElement=A}},{key:"render",value:function(){return a.a.createElement(Al,{containerRef:this.storeRef,playhead:this.props.playhead,trimEnd:this.props.trimEnd,trimStart:this.props.trimStart,onTrimEndMouseDown:this.handleTrimEndMouseDown,onTrimStartMouseDown:this.handleTrimStartMouseDown})}}]),i}();rl.propTypes={onSetTrimEnd:o.a.func,onSetTrimStart:o.a.func,playhead:o.a.number,trimEnd:o.a.number,trimStart:o.a.number};var sl=rl,gl=i(783),ll=i.n(gl),cl=i(784),ul=i.n(cl),Bl=i(785),dl=i.n(Bl),El=Object(B.d)({stopMsg:{id:"gui.playbackStep.stopMsg",defaultMessage:"Stop"},playMsg:{id:"gui.playbackStep.playMsg",defaultMessage:"Play"},loadingMsg:{id:"gui.playbackStep.loadingMsg",defaultMessage:"Loading..."},saveMsg:{id:"gui.playbackStep.saveMsg",defaultMessage:"Save"},reRecordMsg:{id:"gui.playbackStep.reRecordMsg",defaultMessage:"Re-record"}}),hl=function(A){return a.a.createElement(hi.a,null,a.a.createElement(hi.a,{className:Cg.a.visualizationContainer},a.a.createElement(hi.a,{className:Cg.a.meterContainer},a.a.createElement(ig,{height:172,level:0,width:20})),a.a.createElement(hi.a,{className:Cg.a.waveformContainer},a.a.createElement(Eg,{data:A.levels,height:150,level:0,width:480}),a.a.createElement(sl,{playhead:A.playhead,trimEnd:A.trimEnd,trimStart:A.trimStart,onSetTrimEnd:A.onSetTrimEnd,onSetTrimStart:A.onSetTrimStart}))),a.a.createElement(hi.a,{className:Cg.a.mainButtonRow},a.a.createElement("button",{className:Cg.a.mainButton,onClick:A.playing?A.onStopPlaying:A.onPlay},a.a.createElement("img",{draggable:!1,src:A.playing?ul.a:dl.a}),a.a.createElement("div",{className:Cg.a.helpText},a.a.createElement("span",{className:Cg.a.playingText},A.playing?A.intl.formatMessage(El.stopMsg):A.intl.formatMessage(El.playMsg))))),a.a.createElement(hi.a,{className:Cg.a.buttonRow},a.a.createElement("button",{className:Cg.a.rerecordButton,onClick:A.onBack},a.a.createElement("img",{draggable:!1,src:ll.a}),A.intl.formatMessage(El.reRecordMsg)),a.a.createElement("button",{className:Cg.a.okButton,disabled:A.encoding,onClick:A.onSubmit},A.encoding?A.intl.formatMessage(El.loadingMsg):A.intl.formatMessage(El.saveMsg))))};hl.propTypes={encoding:o.a.bool.isRequired,intl:B.f.isRequired,levels:o.a.arrayOf(o.a.number).isRequired,onBack:o.a.func.isRequired,onPlay:o.a.func.isRequired,onSetTrimEnd:o.a.func.isRequired,onSetTrimStart:o.a.func.isRequired,onStopPlaying:o.a.func.isRequired,onSubmit:o.a.func.isRequired,playhead:o.a.number,playing:o.a.bool.isRequired,trimEnd:o.a.number.isRequired,trimStart:o.a.number.isRequired};var Cl=Object(B.e)(hl);function wl(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var ml=function(){function A(e,i){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=new Fg,this.buffer=this.audioContext.createBuffer(1,e.length,i),this.buffer.getChannelData(0).set(e),this.source=null,this.startTime=null,this.updateCallback=null,this.trimStart=null,this.trimEnd=null}return function(A,e,i){e&&wl(A.prototype,e),i&&wl(A,i)}(A,[{key:"play",value:function(A,e,i,t){this.updateCallback=i,this.trimStart=A,this.trimEnd=e,this.startTime=Date.now();var o=this.buffer.duration*A,n=this.buffer.duration*e-o;this.source=this.audioContext.createBufferSource(),this.source.onended=t,this.source.buffer=this.buffer,this.source.connect(this.audioContext.destination),this.source.start(0,o,n),this.update()}},{key:"update",value:function(){var A=(Date.now()-this.startTime)/1e3/this.buffer.duration;A+this.trimStart<this.trimEnd&&this.source.onended?(requestAnimationFrame(this.update.bind(this)),this.updateCallback(A+this.trimStart)):this.updateCallback=null}},{key:"stop",value:function(){if(this.source){this.source.onended=null;try{this.source.stop()}catch(A){console.log("Caught error while stopping buffer source node.")}}}}]),A}();function pl(A){"@babel/helpers - typeof";return(pl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var Il=["sampleRate","onPlay","onStopPlaying","onSetPlayhead"];function fl(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function Ql(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Dl(){return(Dl=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Ml(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function bl(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function yl(A,e){return(yl=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Tl(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Fl(A);if(e){var o=Fl(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===pl(e)||"function"==typeof e))return e;return kl(A)}(this,i)}}function kl(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Fl(A){return(Fl=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var vl=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&yl(A,e)}(i,a.a.Component);var e=Tl(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(kl(t),["handlePlay","handleStopPlaying"]),t}return function(A,e,i){e&&bl(A.prototype,e),i&&bl(A,i)}(i,[{key:"componentDidMount",value:function(){this.audioBufferPlayer=new ml(this.props.samples,this.props.sampleRate)}},{key:"componentWillUnmount",value:function(){this.audioBufferPlayer.stop()}},{key:"handlePlay",value:function(){this.audioBufferPlayer.play(this.props.trimStart,this.props.trimEnd,this.props.onSetPlayhead,this.props.onStopPlaying),this.props.onPlay()}},{key:"handleStopPlaying",value:function(){this.audioBufferPlayer.stop(),this.props.onStopPlaying()}},{key:"render",value:function(){var A=this.props,e=(A.sampleRate,A.onPlay,A.onStopPlaying,A.onSetPlayhead,Ml(A,Il));return a.a.createElement(Cl,Dl({onPlay:this.handlePlay,onStopPlaying:this.handleStopPlaying},e))}}]),i}();vl.propTypes=function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?fl(Object(i),!0).forEach(function(e){Ql(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):fl(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({sampleRate:o.a.number.isRequired,samples:o.a.instanceOf(Float32Array).isRequired},Cl.propTypes);var Sl=vl,Nl=i(85),Rl=Object(B.d)({title:{id:"gui.recordModal.title",defaultMessage:"Record Sound"}}),Ol=function(A){return a.a.createElement(Nl.a,{className:Cg.a.modalContent,contentLabel:A.intl.formatMessage(Rl.title),onRequestClose:A.onCancel},a.a.createElement(hi.a,{className:Cg.a.body},A.samples?a.a.createElement(Sl,{encoding:A.encoding,levels:A.levels,playhead:A.playhead,playing:A.playing,sampleRate:A.sampleRate,samples:A.samples,trimEnd:A.trimEnd,trimStart:A.trimStart,onBack:A.onBack,onPlay:A.onPlay,onSetPlayhead:A.onSetPlayhead,onSetTrimEnd:A.onSetTrimEnd,onSetTrimStart:A.onSetTrimStart,onStopPlaying:A.onStopPlaying,onSubmit:A.onSubmit}):a.a.createElement(jg,{recording:A.recording,onRecord:A.onRecord,onStopRecording:A.onStopRecording})))};Ol.propTypes={encoding:o.a.bool.isRequired,intl:B.f.isRequired,levels:o.a.arrayOf(o.a.number),onBack:o.a.func.isRequired,onCancel:o.a.func.isRequired,onPlay:o.a.func.isRequired,onRecord:o.a.func.isRequired,onSetPlayhead:o.a.func.isRequired,onSetTrimEnd:o.a.func.isRequired,onSetTrimStart:o.a.func.isRequired,onStopPlaying:o.a.func.isRequired,onStopRecording:o.a.func.isRequired,onSubmit:o.a.func.isRequired,playhead:o.a.number,playing:o.a.bool,recording:o.a.bool,sampleRate:o.a.number,samples:o.a.instanceOf(Float32Array),trimEnd:o.a.number.isRequired,trimStart:o.a.number.isRequired};var Yl=Object(B.e)(Ol);function Ul(A){"@babel/helpers - typeof";return(Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Gl(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Hl(A,e){return(Hl=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Ll(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=xl(A);if(e){var o=xl(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ul(e)||"function"==typeof e))return e;return Pl(A)}(this,i)}}function Pl(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function xl(A){return(xl=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var _l=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Hl(A,e)}(i,a.a.Component);var e=Ll(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Pl(t),["handleRecord","handleStopRecording","handlePlay","handleStopPlaying","handleBack","handleSubmit","handleCancel","handleSetPlayhead","handleSetTrimStart","handleSetTrimEnd"]),t.state={samples:null,encoding:!1,levels:null,playhead:null,playing:!1,recording:!1,sampleRate:null,trimStart:0,trimEnd:1},t}return function(A,e,i){e&&Gl(A.prototype,e),i&&Gl(A,i)}(i,[{key:"handleRecord",value:function(){this.setState({recording:!0})}},{key:"handleStopRecording",value:function(A,e,i,t,o){A.length>0&&this.setState({samples:A,sampleRate:e,levels:i,trimStart:t,trimEnd:o,recording:!1})}},{key:"handlePlay",value:function(){this.setState({playing:!0})}},{key:"handleStopPlaying",value:function(){this.setState({playing:!1,playhead:null})}},{key:"handleBack",value:function(){this.setState({playing:!1,samples:null})}},{key:"handleSetTrimEnd",value:function(A){this.setState({trimEnd:A})}},{key:"handleSetTrimStart",value:function(A){this.setState({trimStart:A})}},{key:"handleSetPlayhead",value:function(A){this.setState({playhead:A})}},{key:"handleSubmit",value:function(){var A=this;this.setState({encoding:!0},function(){var e=A.state.samples.length,i=Math.floor(A.state.trimStart*e),t=Math.floor(A.state.trimEnd*e),o=A.state.samples.slice(i,t);qs(A.props.vm,o,A.state.sampleRate,"recording1",function(){A.props.onClose(),A.props.onNewSound()})})}},{key:"handleCancel",value:function(){this.props.onClose()}},{key:"render",value:function(){return a.a.createElement(Yl,{encoding:this.state.encoding,levels:this.state.levels,playhead:this.state.playhead,playing:this.state.playing,recording:this.state.recording,sampleRate:this.state.sampleRate,samples:this.state.samples,trimEnd:this.state.trimEnd,trimStart:this.state.trimStart,onBack:this.handleBack,onCancel:this.handleCancel,onPlay:this.handlePlay,onRecord:this.handleRecord,onSetPlayhead:this.handleSetPlayhead,onSetTrimEnd:this.handleSetTrimEnd,onSetTrimStart:this.handleSetTrimStart,onStopPlaying:this.handleStopPlaying,onStopRecording:this.handleStopRecording,onSubmit:this.handleSubmit})}}]),i}();_l.propTypes={onClose:o.a.func,onNewSound:o.a.func,vm:o.a.instanceOf(u.a)};var jl=Object(s.b)(function(A){return{vm:A.scratchGui.vm}},function(A){return{onClose:function(){A(Object(C.g)())}}})(_l);function Jl(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var zl=function(){function A(e,i,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=e,this.input=this.audioContext.createGain(),this.output=this.audioContext.createGain(),this.effectInput=this.audioContext.createGain(),this.effectInput.gain.value=0,this.effectInput.gain.setValueAtTime(.75,i),this.effectInput.gain.setValueAtTime(0,t),this.delay=this.audioContext.createDelay(1),this.delay.delayTime.value=A.DELAY_TIME,this.decay=this.audioContext.createGain(),this.decay.gain.value=.3,this.compressor=this.audioContext.createDynamicsCompressor(),this.compressor.threshold.value=-5,this.compressor.knee.value=15,this.compressor.ratio.value=12,this.compressor.attack.value=0,this.compressor.release.value=.25,this.input.connect(this.effectInput),this.effectInput.connect(this.delay),this.delay.connect(this.compressor),this.input.connect(this.compressor),this.delay.connect(this.decay),this.decay.connect(this.delay),this.compressor.connect(this.output)}return function(A,e,i){e&&Jl(A.prototype,e),i&&Jl(A,i)}(A,null,[{key:"DELAY_TIME",get:function(){return.25}},{key:"TAIL_SECONDS",get:function(){return.75}}]),A}();var Kl=function A(e,i,t){var o=this;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=e,this.input=this.audioContext.createGain(),this.output=this.audioContext.createGain(),this.passthrough=this.audioContext.createGain(),this.effectInput=this.audioContext.createGain(),this.passthrough.gain.value=1,this.effectInput.gain.value=0,this.passthrough.gain.setValueAtTime(0,i),this.passthrough.gain.setValueAtTime(1,t),this.effectInput.gain.setValueAtTime(1,i),this.effectInput.gain.setValueAtTime(0,t);var n=function(){for(var A=o.audioContext.createWaveShaper(),e=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.4,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.65;return A<=e?0:A<=i?t*(Math.pow(A-e,2)/(2*i-2*e)):t*A-t*i+t*(Math.pow(A-e,2)/(2*i-2*e))},i=new Float32Array(1024),t=0;t<1024;t++){var n=t/1024*2-1;i[t]=e(n)}return A.curve=i,A},a=this.audioContext.createOscillator();a.frequency.value=50,a.start(0);var r=this.audioContext.createGain();r.gain.value=.5;var s=this.audioContext.createGain();s.gain.value=-1;var g=this.audioContext.createGain();g.gain.value=-1;var l=n(this.audioContext),c=n(this.audioContext),u=this.audioContext.createGain();u.gain.value=-1;var B=this.audioContext.createGain();B.gain.value=-1;var d=n(this.audioContext),E=n(this.audioContext),h=this.audioContext.createDynamicsCompressor();h.threshold.value=-5,h.knee.value=15,h.ratio.value=12,h.attack.value=0,h.release.value=.25;var C=this.audioContext.createBiquadFilter();C.type="highpass",C.frequency.value=1e3,C.gain.value=1.25,this.input.connect(this.effectInput),this.input.connect(this.passthrough),this.passthrough.connect(this.output),this.effectInput.connect(B),this.effectInput.connect(E),B.connect(d),a.connect(r),r.connect(s),r.connect(B),r.connect(E),s.connect(g),s.connect(c),g.connect(l),l.connect(u),c.connect(u),u.connect(h),d.connect(h),E.connect(h),this.effectInput.connect(C),C.connect(h),h.connect(this.output)};var Wl=function A(e,i,t,o){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=e,this.input=this.audioContext.createGain(),this.output=this.audioContext.createGain(),this.gain=this.audioContext.createGain(),this.rampLength=.01,this.gain.gain.setValueAtTime(1,Math.max(0,t-this.rampLength)),this.gain.gain.exponentialRampToValueAtTime(i,t),this.gain.gain.setValueAtTime(i,o),this.gain.gain.exponentialRampToValueAtTime(1,o+this.rampLength),this.input.connect(this.gain),this.gain.connect(this.output)};var Vl=function A(e,i,t,o){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=e,this.input=this.audioContext.createGain(),this.output=this.audioContext.createGain(),this.gain=this.audioContext.createGain(),this.gain.gain.setValueAtTime(1,0),i?(this.gain.gain.setValueAtTime(0,t),this.gain.gain.linearRampToValueAtTime(1,o)):(this.gain.gain.setValueAtTime(1,t),this.gain.gain.linearRampToValueAtTime(0,o)),this.gain.gain.setValueAtTime(1,o),this.input.connect(this.gain),this.gain.connect(this.output)};var Xl=function A(e,i,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.audioContext=e,this.input=this.audioContext.createGain(),this.output=this.audioContext.createGain(),this.gain=this.audioContext.createGain(),this.rampLength=.001,this.gain.gain.setValueAtTime(1,Math.max(0,i-this.rampLength)),this.gain.gain.linearRampToValueAtTime(0,i),this.gain.gain.setValueAtTime(0,t),this.gain.gain.linearRampToValueAtTime(1,t+this.rampLength),this.input.connect(this.gain),this.gain.connect(this.output)};function Zl(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var ql={ROBOT:"robot",REVERSE:"reverse",LOUDER:"higher",SOFTER:"lower",FASTER:"faster",SLOWER:"slower",ECHO:"echo",FADEIN:"fade in",FADEOUT:"fade out",MUTE:"mute"},$l=function(){function A(e,i,t,o){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.trimStartSeconds=t*e.length/e.sampleRate,this.trimEndSeconds=o*e.length/e.sampleRate,this.adjustedTrimStartSeconds=this.trimStartSeconds,this.adjustedTrimEndSeconds=this.trimEndSeconds;var n=Math.pow(2,4/12),a=e.length,r=Math.floor((this.trimEndSeconds-this.trimStartSeconds)*e.sampleRate),s=r,g=a-r;switch(this.playbackRate=1,i){case ql.ECHO:a=Math.max(a,Math.floor((this.trimEndSeconds+zl.TAIL_SECONDS)*e.sampleRate));break;case ql.FASTER:this.playbackRate=n,a=g+(s=Math.floor(r/this.playbackRate));break;case ql.SLOWER:this.playbackRate=1/n,a=g+(s=Math.floor(r/this.playbackRate))}var l=a/e.sampleRate;if(this.adjustedTrimEndSeconds=this.trimStartSeconds+s/e.sampleRate,this.adjustedTrimStart=this.adjustedTrimStartSeconds/l,this.adjustedTrimEnd=this.adjustedTrimEndSeconds/l,window.OfflineAudioContext)this.audioContext=new window.OfflineAudioContext(1,a,e.sampleRate);else{var c=44100/e.sampleRate;this.audioContext=new window.webkitOfflineAudioContext(1,c*a,44100)}if(i===ql.REVERSE){for(var u=e.getChannelData(0),B=this.audioContext.createBuffer(1,e.length,e.sampleRate),d=B.getChannelData(0),E=e.length,h=Math.floor(this.trimStartSeconds*e.sampleRate),C=Math.floor(this.trimEndSeconds*e.sampleRate),w=0,m=0;m<E;m++)m>=h&&m<C?(d[m]=u[C-w-1],w++):d[m]=u[m];this.buffer=B}else this.buffer=e;this.source=this.audioContext.createBufferSource(),this.source.buffer=this.buffer,this.name=i}return function(A,e,i){e&&Zl(A.prototype,e),i&&Zl(A,i)}(A,[{key:"process",value:function(A){var e,i,t=this;switch(this.name){case ql.FASTER:case ql.SLOWER:this.source.playbackRate.setValueAtTime(this.playbackRate,this.adjustedTrimStartSeconds),this.source.playbackRate.setValueAtTime(1,this.adjustedTrimEndSeconds);break;case ql.LOUDER:var o=new Wl(this.audioContext,1.25,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=o.input,i=o.output;break;case ql.SOFTER:var n=new Wl(this.audioContext,.75,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=n.input,i=n.output;break;case ql.ECHO:var a=new zl(this.audioContext,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=a.input,i=a.output;break;case ql.ROBOT:var r=new Kl(this.audioContext,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=r.input,i=r.output;break;case ql.FADEIN:var s=new Vl(this.audioContext,!0,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=s.input,i=s.output;break;case ql.FADEOUT:var g=new Vl(this.audioContext,!1,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=g.input,i=g.output;break;case ql.MUTE:var l=new Xl(this.audioContext,this.adjustedTrimStartSeconds,this.adjustedTrimEndSeconds);e=l.input,i=l.output}e&&i?(this.source.connect(e),i.connect(this.audioContext.destination)):this.source.connect(this.audioContext.destination),this.source.start(),this.audioContext.startRendering(),this.audioContext.oncomplete=function(e){var i=e.renderedBuffer;A(i,t.adjustedTrimStart,t.adjustedTrimEnd)}}}],[{key:"effectTypes",get:function(){return ql}}]),A}(),Ac=function(A){return a.a.createElement("div",{className:Le()(zg.a.absolute,zg.a.selector),ref:A.containerRef,onMouseDown:A.onNewSelectionMouseDown,onTouchStart:A.onNewSelectionMouseDown},null===A.trimStart?null:a.a.createElement(hi.a,{className:Le()(zg.a.absolute),style:{left:"".concat(100*A.trimStart,"%"),width:"".concat(100*(A.trimEnd-A.trimStart),"%")}},a.a.createElement(hi.a,{className:Le()(zg.a.absolute,zg.a.selectionBackground)}),a.a.createElement(Xg,{handleStyle:zg.a.leftHandle,onMouseDown:A.onTrimStartMouseDown}),a.a.createElement(Xg,{handleStyle:zg.a.rightHandle,onMouseDown:A.onTrimEndMouseDown})),A.playhead?a.a.createElement(qg,{playbackPosition:A.playhead}):null)};Ac.propTypes={containerRef:o.a.func,onNewSelectionMouseDown:o.a.func.isRequired,onTrimEndMouseDown:o.a.func.isRequired,onTrimStartMouseDown:o.a.func.isRequired,playhead:o.a.number,trimEnd:o.a.number,trimStart:o.a.number};var ec=Ac;function ic(A){"@babel/helpers - typeof";return(ic="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function tc(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function oc(A,e){return(oc=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function nc(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=rc(A);if(e){var o=rc(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ic(e)||"function"==typeof e))return e;return ac(A)}(this,i)}}function ac(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function rc(A){return(rc=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var sc=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&oc(A,e)}(i,a.a.Component);var e=nc(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(ac(t),["handleNewSelectionMouseDown","handleTrimStartMouseDown","handleTrimEndMouseDown","handleTrimStartMouseMove","handleTrimEndMouseMove","handleTrimStartMouseUp","handleTrimEndMouseUp","storeRef"]),t.state={trimStart:A.trimStart,trimEnd:A.trimEnd},t.clickStartTime=0,t.trimStartDragRecognizer=new Qi({onDrag:t.handleTrimStartMouseMove,onDragEnd:t.handleTrimStartMouseUp,touchDragAngle:90,distanceThreshold:0}),t.trimEndDragRecognizer=new Qi({onDrag:t.handleTrimEndMouseMove,onDragEnd:t.handleTrimEndMouseUp,touchDragAngle:90,distanceThreshold:0}),t}return function(A,e,i){e&&tc(A.prototype,e),i&&tc(A,i)}(i,[{key:"componentWillReceiveProps",value:function(A){var e=this.props,i=e.trimStart,t=e.trimEnd;A.trimStart===i&&A.trimEnd===t||this.setState({trimStart:A.trimStart,trimEnd:A.trimEnd})}},{key:"clearSelection",value:function(){this.props.onSetTrim(null,null)}},{key:"handleNewSelectionMouseDown",value:function(A){var e=this.containerElement.getBoundingClientRect(),i=e.width,t=e.left;this.initialTrimEnd=(Ii(A).x-t)/i,this.initialTrimStart=this.initialTrimEnd,this.props.onSetTrim(this.initialTrimStart,this.initialTrimEnd),this.clickStartTime=Date.now(),this.containerSize=i,this.trimEndDragRecognizer.start(A),A.preventDefault()}},{key:"handleTrimStartMouseMove",value:function(A,e){var i=(A.x-e.x)/this.containerSize,t=Math.max(0,Math.min(1,this.initialTrimStart+i));t>this.initialTrimEnd?this.setState({trimStart:this.initialTrimEnd,trimEnd:t}):this.setState({trimStart:t,trimEnd:this.initialTrimEnd})}},{key:"handleTrimEndMouseMove",value:function(A,e){var i=(A.x-e.x)/this.containerSize,t=Math.min(1,Math.max(0,this.initialTrimEnd+i));t<this.initialTrimStart?this.setState({trimStart:t,trimEnd:this.initialTrimStart}):this.setState({trimStart:this.initialTrimStart,trimEnd:t})}},{key:"handleTrimStartMouseUp",value:function(){this.props.onSetTrim(this.state.trimStart,this.state.trimEnd)}},{key:"handleTrimEndMouseUp",value:function(){var A=Date.now()-this.clickStartTime<500,e=this.state.trimEnd-this.state.trimStart<.01;A&&e?this.clearSelection():this.props.onSetTrim(this.state.trimStart,this.state.trimEnd)}},{key:"handleTrimStartMouseDown",value:function(A){this.containerSize=this.containerElement.getBoundingClientRect().width,this.trimStartDragRecognizer.start(A),this.initialTrimStart=this.props.trimStart,this.initialTrimEnd=this.props.trimEnd,A.stopPropagation(),A.preventDefault()}},{key:"handleTrimEndMouseDown",value:function(A){this.containerSize=this.containerElement.getBoundingClientRect().width,this.trimEndDragRecognizer.start(A),this.initialTrimEnd=this.props.trimEnd,this.initialTrimStart=this.props.trimStart,A.stopPropagation(),A.preventDefault()}},{key:"storeRef",value:function(A){this.containerElement=A}},{key:"render",value:function(){return a.a.createElement(ec,{containerRef:this.storeRef,playhead:this.props.playhead,trimEnd:this.state.trimEnd,trimStart:this.state.trimStart,onNewSelectionMouseDown:this.handleNewSelectionMouseDown,onTrimEndMouseDown:this.handleTrimEndMouseDown,onTrimStartMouseDown:this.handleTrimStartMouseDown})}}]),i}();sc.propTypes={onSetTrim:o.a.func,playhead:o.a.number,trimEnd:o.a.number,trimStart:o.a.number};var gc=sc,lc=i(225),cc=i.n(lc),uc=function(A){var e=A.img,i=A.disabled,t=A.className,o=A.title,n=A.onClick;return a.a.createElement("div",{className:Le()(cc.a.container,t,i?cc.a.disabled:null),role:"button",onClick:i?null:n},a.a.createElement("img",{className:cc.a.icon,draggable:!1,src:e}),a.a.createElement("div",{className:cc.a.title},o))};uc.propTypes={className:o.a.string,disabled:o.a.bool,img:o.a.string,onClick:o.a.func.isRequired,title:o.a.node.isRequired};var Bc=uc,dc=i(30),Ec=i.n(dc),hc=i(786),Cc=i.n(hc),wc=i(787),mc=i.n(wc),pc=i(788),Ic=i.n(pc),fc=i(789),Qc=i.n(fc),Dc=i(790),Mc=i.n(Dc),bc=i(791),yc=i.n(bc),Tc=i(792),kc=i.n(Tc),Fc=i(793),vc=i.n(Fc),Sc=i(794),Nc=i.n(Sc),Rc=i(795),Oc=i.n(Rc),Yc=i(796),Uc=i.n(Yc),Gc=i(797),Hc=i.n(Gc),Lc=i(798),Pc=i.n(Lc),xc=i(799),_c=i.n(xc),jc=i(800),Jc=i.n(jc),zc=i(801),Kc=i.n(zc),Wc=i(802),Vc=i.n(Wc),Xc=$n(Jn),Zc=Object(B.d)({sound:{id:"gui.soundEditor.sound",defaultMessage:"Sound"},play:{id:"gui.soundEditor.play",defaultMessage:"Play"},stop:{id:"gui.soundEditor.stop",defaultMessage:"Stop"},copy:{id:"gui.soundEditor.copy",defaultMessage:"Copy"},paste:{id:"gui.soundEditor.paste",defaultMessage:"Paste"},copyToNew:{id:"gui.soundEditor.copyToNew",defaultMessage:"Copy to New"},delete:{id:"gui.soundEditor.delete",defaultMessage:"Delete"},save:{id:"gui.soundEditor.save",defaultMessage:"Save"},undo:{id:"gui.soundEditor.undo",defaultMessage:"Undo"},redo:{id:"gui.soundEditor.redo",defaultMessage:"Redo"},faster:{id:"gui.soundEditor.faster",defaultMessage:"Faster"},slower:{id:"gui.soundEditor.slower",defaultMessage:"Slower"},echo:{id:"gui.soundEditor.echo",defaultMessage:"Echo"},robot:{id:"gui.soundEditor.robot",defaultMessage:"Robot"},louder:{id:"gui.soundEditor.louder",defaultMessage:"Louder"},softer:{id:"gui.soundEditor.softer",defaultMessage:"Softer"},reverse:{id:"gui.soundEditor.reverse",defaultMessage:"Reverse"},fadeOut:{id:"gui.soundEditor.fadeOut",defaultMessage:"Fade out"},fadeIn:{id:"gui.soundEditor.fadeIn",defaultMessage:"Fade in"},mute:{id:"gui.soundEditor.mute",defaultMessage:"Mute"}}),qc=function(A){return a.a.createElement("div",{className:Ec.a.editorContainer,ref:A.setRef,onMouseDown:A.onContainerClick},a.a.createElement("div",{className:Ec.a.row},a.a.createElement("div",{className:Ec.a.inputGroup},a.a.createElement(Gn,{text:A.intl.formatMessage(Zc.sound)},a.a.createElement(Xc,{tabIndex:"1",type:"text",value:A.name,onSubmit:A.onChangeName})),a.a.createElement("div",{className:Ec.a.buttonGroup},a.a.createElement("button",{className:Ec.a.button,disabled:!A.canUndo,title:A.intl.formatMessage(Zc.undo),onClick:A.onUndo},a.a.createElement("img",{className:Ec.a.undoIcon,draggable:!1,src:Qc.a})),a.a.createElement("button",{className:Ec.a.button,disabled:!A.canRedo,title:A.intl.formatMessage(Zc.redo),onClick:A.onRedo},a.a.createElement("img",{className:Ec.a.redoIcon,draggable:!1,src:Ic.a})))),a.a.createElement("div",{className:Ec.a.inputGroup},a.a.createElement(Bc,{className:Ec.a.toolButton,img:Jc.a,title:A.intl.formatMessage(Zc.copy),onClick:A.onCopy}),a.a.createElement(Bc,{className:Ec.a.toolButton,disabled:!1===A.canPaste,img:Kc.a,title:A.intl.formatMessage(Zc.paste),onClick:A.onPaste}),a.a.createElement(Bc,{className:Le()(Ec.a.toolButton,Ec.a.flipInRtl),img:Vc.a,title:A.intl.formatMessage(Zc.copyToNew),onClick:A.onCopyToNew})),a.a.createElement(Bc,{className:Ec.a.toolButton,disabled:null===A.trimStart,img:_c.a,title:A.intl.formatMessage(Zc.delete),onClick:A.onDelete})),a.a.createElement("div",{className:Ec.a.row},a.a.createElement("div",{className:Ec.a.waveformContainer},a.a.createElement(Eg,{data:A.chunkLevels,height:160,width:600}),a.a.createElement(gc,{playhead:A.playhead,trimEnd:A.trimEnd,trimStart:A.trimStart,onPlay:A.onPlay,onSetTrim:A.onSetTrim,onStop:A.onStop}))),a.a.createElement("div",{className:Le()(Ec.a.row,Ec.a.rowReverse)},a.a.createElement("div",{className:Ec.a.inputGroup},A.playhead?a.a.createElement("button",{className:Le()(Ec.a.roundButton,Ec.a.stopButtonn),title:A.intl.formatMessage(Zc.stop),onClick:A.onStop},a.a.createElement("img",{draggable:!1,src:mc.a})):a.a.createElement("button",{className:Le()(Ec.a.roundButton,Ec.a.playButton),title:A.intl.formatMessage(Zc.play),onClick:A.onPlay},a.a.createElement("img",{draggable:!1,src:Cc.a}))),a.a.createElement(Bc,{className:Ec.a.effectButton,img:Mc.a,title:a.a.createElement(B.a,Zc.faster),onClick:A.onFaster}),a.a.createElement(Bc,{className:Ec.a.effectButton,img:yc.a,title:a.a.createElement(B.a,Zc.slower),onClick:A.onSlower}),a.a.createElement(Bc,{disabled:A.tooLoud,className:Le()(Ec.a.effectButton,Ec.a.flipInRtl),img:kc.a,title:a.a.createElement(B.a,Zc.louder),onClick:A.onLouder}),a.a.createElement(Bc,{className:Le()(Ec.a.effectButton,Ec.a.flipInRtl),img:vc.a,title:a.a.createElement(B.a,Zc.softer),onClick:A.onSofter}),a.a.createElement(Bc,{className:Le()(Ec.a.effectButton,Ec.a.flipInRtl),img:Pc.a,title:a.a.createElement(B.a,Zc.mute),onClick:A.onMute}),a.a.createElement(Bc,{className:Ec.a.effectButton,img:Hc.a,title:a.a.createElement(B.a,Zc.fadeIn),onClick:A.onFadeIn}),a.a.createElement(Bc,{className:Ec.a.effectButton,img:Uc.a,title:a.a.createElement(B.a,Zc.fadeOut),onClick:A.onFadeOut}),a.a.createElement(Bc,{className:Ec.a.effectButton,img:Oc.a,title:a.a.createElement(B.a,Zc.reverse),onClick:A.onReverse}),a.a.createElement(Bc,{className:Ec.a.effectButton,img:Nc.a,title:a.a.createElement(B.a,Zc.robot),onClick:A.onRobot})))};qc.propTypes={canPaste:o.a.bool.isRequired,canRedo:o.a.bool.isRequired,canUndo:o.a.bool.isRequired,chunkLevels:o.a.arrayOf(o.a.number).isRequired,intl:B.f,name:o.a.string.isRequired,onChangeName:o.a.func.isRequired,onContainerClick:o.a.func.isRequired,onCopy:o.a.func.isRequired,onCopyToNew:o.a.func.isRequired,onDelete:o.a.func,onEcho:o.a.func.isRequired,onFadeIn:o.a.func.isRequired,onFadeOut:o.a.func.isRequired,onFaster:o.a.func.isRequired,onLouder:o.a.func.isRequired,onMute:o.a.func.isRequired,onPaste:o.a.func.isRequired,onPlay:o.a.func.isRequired,onRedo:o.a.func.isRequired,onReverse:o.a.func.isRequired,onRobot:o.a.func.isRequired,onSetTrim:o.a.func,onSlower:o.a.func.isRequired,onSofter:o.a.func.isRequired,onStop:o.a.func.isRequired,onUndo:o.a.func.isRequired,playhead:o.a.number,setRef:o.a.func,tooLoud:o.a.bool.isRequired,trimEnd:o.a.number,trimStart:o.a.number};var $c=Object(B.e)(qc);function Au(A){"@babel/helpers - typeof";return(Au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function eu(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function iu(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?eu(Object(i),!0).forEach(function(e){tu(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):eu(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function tu(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function ou(A){return function(A){if(Array.isArray(A))return nu(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||function(A,e){if(!A)return;if("string"==typeof A)return nu(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return nu(A,e)}(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nu(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function au(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function ru(A,e){return(ru=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function su(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=lu(A);if(e){var o=lu(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Au(e)||"function"==typeof e))return e;return gu(A)}(this,i)}}function gu(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function lu(A){return(lu=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var cu=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&ru(A,e)}(i,a.a.Component);var e=su(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(gu(t),["copy","copyCurrentBuffer","handleCopyToNew","handleStoppedPlaying","handleChangeName","handlePlay","handleStopPlaying","handleUpdatePlayhead","handleDelete","handleUpdateTrim","handleEffect","handleUndo","handleRedo","submitNewSamples","handleCopy","handlePaste","paste","handleKeyPress","handleContainerClick","setRef","resampleBufferToRate"]),t.state={copyBuffer:null,chunkLevels:Zs(t.props.samples),playhead:null,trimStart:null,trimEnd:null},t.redoStack=[],t.undoStack=[],t.ref=null,t}return function(A,e,i){e&&au(A.prototype,e),i&&au(A,i)}(i,[{key:"componentDidMount",value:function(){this.audioBufferPlayer=new ml(this.props.samples,this.props.sampleRate),document.addEventListener("keydown",this.handleKeyPress)}},{key:"componentWillReceiveProps",value:function(A){A.soundId!==this.props.soundId&&(this.redoStack=[],this.undoStack=[],this.resetState(A.samples,A.sampleRate),this.setState({trimStart:null,trimEnd:null}))}},{key:"componentWillUnmount",value:function(){this.audioBufferPlayer.stop(),document.removeEventListener("keydown",this.handleKeyPress)}},{key:"handleKeyPress",value:function(A){A.target instanceof HTMLInputElement||this.props.isFullScreen||(" "===A.key&&(A.preventDefault(),this.state.playhead?this.handleStopPlaying():this.handlePlay()),"Delete"!==A.key&&"Backspace"!==A.key||(A.preventDefault(),A.shiftKey?this.handleDeleteInverse():this.handleDelete()),"Escape"===A.key&&(A.preventDefault(),this.handleUpdateTrim(null,null)),(A.metaKey||A.ctrlKey)&&(A.shiftKey&&"z"===A.key.toLowerCase()?(A.preventDefault(),this.redoStack.length>0&&this.handleRedo()):"z"===A.key?this.undoStack.length>0&&(A.preventDefault(),this.handleUndo()):"c"===A.key?(A.preventDefault(),this.handleCopy()):"v"===A.key?(A.preventDefault(),this.handlePaste()):"a"===A.key&&(A.preventDefault(),this.handleUpdateTrim(0,1))))}},{key:"resetState",value:function(A,e){this.audioBufferPlayer.stop(),this.audioBufferPlayer=new ml(A,e),this.setState({chunkLevels:Zs(A),playhead:null})}},{key:"submitNewSamples",value:function(A,e,i){var t=this;return function(A,e){var i=A.samples,t=A.sampleRate,o=i.length/t;return 2*i.length<1e7?Promise.resolve({samples:i,sampleRate:t}):22050*o*2<1e7?e({samples:i,sampleRate:t},22050):Promise.reject(new Error("Sound too large to save, refusing to edit"))}({samples:A,sampleRate:e},this.resampleBufferToRate).then(function(A){var e=A.samples,o=A.sampleRate;return Vs.a.encode({sampleRate:o,channelData:[e]}).then(function(A){return i||(t.redoStack=[],t.undoStack.length>=99&&t.undoStack.shift(),t.undoStack.push(t.getUndoItem())),t.resetState(e,o),t.props.vm.updateSoundBuffer(t.props.soundIndex,t.audioBufferPlayer.buffer,new Uint8Array(A)),!0})}).catch(function(A){return L.a.error("Encountered error while trying to encode sound update: ".concat(A.message)),!1})}},{key:"handlePlay",value:function(){this.audioBufferPlayer.stop(),this.audioBufferPlayer.play(this.state.trimStart||0,this.state.trimEnd||1,this.handleUpdatePlayhead,this.handleStoppedPlaying)}},{key:"handleStopPlaying",value:function(){this.audioBufferPlayer.stop(),this.handleStoppedPlaying()}},{key:"handleStoppedPlaying",value:function(){this.setState({playhead:null})}},{key:"handleUpdatePlayhead",value:function(A){this.setState({playhead:A})}},{key:"handleChangeName",value:function(A){this.props.vm.renameSound(this.props.soundIndex,A)}},{key:"handleDelete",value:function(){var A,e=this,i=this.copyCurrentBuffer(),t=i.samples,o=i.sampleRate,n=t.length,a=Math.floor(this.state.trimStart*n),r=Math.floor(this.state.trimEnd*n),s=t.slice(0,a),g=t.slice(r,n),l=s.length+g.length;0===l?A=new Float32Array(1):((A=new Float32Array(l)).set(s,0),A.set(g,s.length)),this.submitNewSamples(A,o).then(function(){e.setState({trimStart:null,trimEnd:null})})}},{key:"handleDeleteInverse",value:function(){var A=this,e=this.copyCurrentBuffer(),i=e.samples,t=e.sampleRate,o=i.length,n=Math.floor(this.state.trimStart*o),a=Math.floor(this.state.trimEnd*o),r=i.slice(n,a);0===r.length&&(r=new Float32Array(1)),this.submitNewSamples(r,t).then(function(e){e&&A.setState({trimStart:null,trimEnd:null})})}},{key:"handleUpdateTrim",value:function(A,e){this.setState({trimStart:A,trimEnd:e}),this.handleStopPlaying()}},{key:"effectFactory",value:function(A){var e=this;return function(){return e.handleEffect(A)}}},{key:"copyCurrentBuffer",value:function(){return{samples:this.audioBufferPlayer.buffer.getChannelData(0),sampleRate:this.audioBufferPlayer.buffer.sampleRate}}},{key:"handleEffect",value:function(A){var e=this,i=null===this.state.trimStart?0:this.state.trimStart,t=null===this.state.trimEnd?1:this.state.trimEnd;this.audioBufferPlayer.buffer.length<2||new $l(this.audioBufferPlayer.buffer,A,i,t).process(function(A,i,t){var o=A.getChannelData(0),n=A.sampleRate;e.submitNewSamples(o,n).then(function(A){A&&(null===e.state.trimStart?e.handlePlay():e.setState({trimStart:i,trimEnd:t},e.handlePlay))})})}},{key:"tooLoud",value:function(){var A=this.state.chunkLevels.length,e=null===this.state.trimStart?0:Math.floor(this.state.trimStart*A),i=null===this.state.trimEnd?A-1:Math.ceil(this.state.trimEnd*A),t=this.state.chunkLevels.slice(e,i);return Math.max.apply(Math,ou(t))>1.2}},{key:"getUndoItem",value:function(){return iu(iu({},this.copyCurrentBuffer()),{},{trimStart:this.state.trimStart,trimEnd:this.state.trimEnd})}},{key:"handleUndo",value:function(){var A=this;this.redoStack.push(this.getUndoItem());var e=this.undoStack.pop(),i=e.samples,t=e.sampleRate,o=e.trimStart,n=e.trimEnd;if(i)return this.submitNewSamples(i,t,!0).then(function(e){e&&A.setState({trimStart:o,trimEnd:n},A.handlePlay)})}},{key:"handleRedo",value:function(){var A=this,e=this.redoStack.pop(),i=e.samples,t=e.sampleRate,o=e.trimStart,n=e.trimEnd;if(i)return this.undoStack.push(this.getUndoItem()),this.submitNewSamples(i,t,!0).then(function(e){e&&A.setState({trimStart:o,trimEnd:n},A.handlePlay)})}},{key:"handleCopy",value:function(){this.copy()}},{key:"copy",value:function(A){var e=null===this.state.trimStart?0:this.state.trimStart,i=null===this.state.trimEnd?1:this.state.trimEnd,t=this.copyCurrentBuffer(),o=e*t.samples.length,n=i*t.samples.length;t.samples=t.samples.slice(o,n),this.setState({copyBuffer:t},A)}},{key:"handleCopyToNew",value:function(){var A=this;this.copy(function(){qs(A.props.vm,A.state.copyBuffer.samples,A.state.copyBuffer.sampleRate,A.props.name)})}},{key:"resampleBufferToRate",value:function(A,e){return new Promise(function(i,t){var o,n=e/A.sampleRate*A.samples.length;try{window.OfflineAudioContext?o=new window.OfflineAudioContext(1,n,e):window.webkitOfflineAudioContext&&(o=new window.webkitOfflineAudioContext(1,n,e))}catch(o){return e===A.sampleRate/2?i(function(A){for(var e=Math.floor(A.samples.length/2),i=new Float32Array(e),t=0;t<e;t++)i[t]=A.samples[2*t];return{samples:i,sampleRate:A.sampleRate/2}}(A)):t(new Error("Could not resample"))}var a=o.createBufferSource(),r=o.createBuffer(1,A.samples.length,A.sampleRate);r.getChannelData(0).set(A.samples),a.buffer=r,a.connect(o.destination),a.start(),o.startRendering(),o.oncomplete=function(A){var t=A.renderedBuffer;i({samples:t.getChannelData(0),sampleRate:e})}})}},{key:"paste",value:function(){var A=this,e=this.copyCurrentBuffer().samples;if(null===this.state.trimStart){var i=e.length+this.state.copyBuffer.samples.length,t=new Float32Array(i);t.set(e,0),t.set(this.state.copyBuffer.samples,e.length),this.submitNewSamples(t,this.props.sampleRate,!1).then(function(e){e&&A.handlePlay()})}else{var o=this.state.trimStart*e.length,n=this.state.trimEnd*e.length,a=e.slice(0,o),r=e.slice(n),s=a.length+this.state.copyBuffer.samples.length+r.length,g=new Float32Array(s);g.set(a,0),g.set(this.state.copyBuffer.samples,a.length),g.set(r,a.length+this.state.copyBuffer.samples.length);var l=o/this.props.sampleRate,c=l+this.state.copyBuffer.samples.length/this.state.copyBuffer.sampleRate,u=g.length/this.state.copyBuffer.sampleRate,B=l/u,d=c/u;this.submitNewSamples(g,this.props.sampleRate,!1).then(function(e){e&&A.setState({trimStart:B,trimEnd:d},A.handlePlay)})}}},{key:"handlePaste",value:function(){var A=this;this.state.copyBuffer&&(this.state.copyBuffer.sampleRate===this.props.sampleRate?this.paste():this.resampleBufferToRate(this.state.copyBuffer,this.props.sampleRate).then(function(e){A.setState({copyBuffer:e},A.paste)}))}},{key:"setRef",value:function(A){this.ref=A}},{key:"handleContainerClick",value:function(A){A.target===this.ref&&null!==this.state.trimStart&&this.handleUpdateTrim(null,null)}},{key:"render",value:function(){var A=$l.effectTypes;return a.a.createElement($c,{canPaste:null!==this.state.copyBuffer,canRedo:this.redoStack.length>0,canUndo:this.undoStack.length>0,chunkLevels:this.state.chunkLevels,name:this.props.name,playhead:this.state.playhead,setRef:this.setRef,tooLoud:this.tooLoud(),trimEnd:this.state.trimEnd,trimStart:this.state.trimStart,onChangeName:this.handleChangeName,onContainerClick:this.handleContainerClick,onCopy:this.handleCopy,onCopyToNew:this.handleCopyToNew,onDelete:this.handleDelete,onEcho:this.effectFactory(A.ECHO),onFadeIn:this.effectFactory(A.FADEIN),onFadeOut:this.effectFactory(A.FADEOUT),onFaster:this.effectFactory(A.FASTER),onLouder:this.effectFactory(A.LOUDER),onMute:this.effectFactory(A.MUTE),onPaste:this.handlePaste,onPlay:this.handlePlay,onRedo:this.handleRedo,onReverse:this.effectFactory(A.REVERSE),onRobot:this.effectFactory(A.ROBOT),onSetTrim:this.handleUpdateTrim,onSlower:this.effectFactory(A.SLOWER),onSofter:this.effectFactory(A.SOFTER),onStop:this.handleStopPlaying,onUndo:this.handleUndo})}}]),i}();cu.propTypes={isFullScreen:o.a.bool,name:o.a.string.isRequired,sampleRate:o.a.number,samples:o.a.instanceOf(Float32Array),soundId:o.a.string,soundIndex:o.a.number,vm:o.a.instanceOf(u.a).isRequired};var uu=Object(s.b)(function(A,e){var i=e.soundIndex,t=A.scratchGui.vm.editingTarget.sprite,o=i<t.sounds.length?i:t.sounds.length-1,n=A.scratchGui.vm.editingTarget.sprite.sounds[o],a=A.scratchGui.vm.getSoundBuffer(o);return{soundId:n.soundId,sampleRate:a.sampleRate,samples:a.getChannelData(0),isFullScreen:A.scratchGui.mode.isFullScreen,name:n.name,vm:A.scratchGui.vm}})(cu),Bu=i(803),du=i.n(Bu),Eu=i(804),hu=i.n(Eu),Cu=i(217),wu=[{tag:"animals",intlLabel:Qn.animals},{tag:"effects",intlLabel:Qn.effects},{tag:"loops",intlLabel:Qn.loops},{tag:"notes",intlLabel:Qn.notes},{tag:"percussion",intlLabel:Qn.percussion},{tag:"space",intlLabel:Qn.space},{tag:"sports",intlLabel:Qn.sports},{tag:"voice",intlLabel:Qn.voice},{tag:"wacky",intlLabel:Qn.wacky}];function mu(A){"@babel/helpers - typeof";return(mu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var pu=["md5ext"];function Iu(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function fu(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Qu(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Du(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Mu(A,e){return(Mu=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function bu(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Tu(A);if(e){var o=Tu(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===mu(e)||"function"==typeof e))return e;return yu(A)}(this,i)}}function yu(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Tu(A){return(Tu=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ku=Object(B.d)({libraryTitle:{id:"gui.soundLibrary.chooseASound",defaultMessage:"Choose a Sound"}}),Fu=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Mu(A,e)}(i,a.a.PureComponent);var e=bu(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(yu(t),["handleItemSelected","handleItemMouseEnter","handleItemMouseLeave","onStop","setStopHandler"]),t.audioEngine=null,t.playingSoundPromise=null,t.handleStop=null,t}return function(A,e,i){e&&Du(A.prototype,e),i&&Du(A,i)}(i,[{key:"componentDidMount",value:function(){this.audioEngine=new de.a,this.playingSoundPromise=null}},{key:"componentWillUnmount",value:function(){this.stopPlayingSound()}},{key:"onStop",value:function(){var A=this;null!==this.playingSoundPromise&&(this.playingSoundPromise.then(function(e){return e&&e.removeListener("stop",A.onStop)}),this.handleStop&&this.handleStop())}},{key:"setStopHandler",value:function(A){this.handleStop=A}},{key:"stopPlayingSound",value:function(){var A=this;null!==this.playingSoundPromise&&(this.playingSoundPromise.then(function(e){return e&&e.removeListener("stop",A.onStop)}),this.playingSoundPromise.isPlaying?this.playingSoundPromise.then(function(A){A.stop()}):this.playingSoundPromise.then(function(A){A&&A.stopImmediately()}),this.playingSoundPromise=null)}},{key:"handleItemMouseEnter",value:function(A){var e=this,i=A._md5,t=i.split(".")[0],o=this.props.vm;this.stopPlayingSound(),this.playingSoundPromise=o.runtime.storage.load(o.runtime.storage.AssetType.Sound,t).then(function(t){if(t){var o={md5:i,name:A.name,format:A.format,data:t.data};return e.audioEngine.decodeSoundPlayer(o).then(function(A){if(A.buffer.duration<.001)throw new Error("Sound is not fetched properly -- there might be a problem with the internet connection.");return A.connect(e.audioEngine),A.play(),A.addListener("stop",e.onStop),null!==e.playingSoundPromise&&(e.playingSoundPromise.isPlaying=!0),A}).catch(function(A){console.warn(A),mv2Interface.send_REST("notification/warn-message/This sound requires internet. Please select a pre-loaded sound.")})}}).catch(function(A){mv2Interface.send_REST("notification/warn-message/This sound requires internet. Please select a pre-loaded sound.")})}},{key:"handleItemMouseLeave",value:function(){this.stopPlayingSound()}},{key:"handleItemSelected",value:function(A){var e=this,i={format:A.format,md5:A._md5,rate:A.rate,sampleCount:A.sampleCount,name:A.name};this.props.vm.addSound(i).then(function(){e.props.onNewSound()})}},{key:"render",value:function(){var A=this,e=Cu.map(function(e){var i=e.md5ext,t=Qu(e,pu);return function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Iu(Object(i),!0).forEach(function(e){fu(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):Iu(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({_md5:i,rawURL:A.props.isRtl?hu.a:du.a},t)});return a.a.createElement(Mn.a,{showPlayButton:!0,data:e,id:"soundLibrary",setStopHandler:this.setStopHandler,tags:wu,title:this.props.intl.formatMessage(ku.libraryTitle),onItemMouseEnter:this.handleItemMouseEnter,onItemMouseLeave:this.handleItemMouseLeave,onItemSelected:this.handleItemSelected,onRequestClose:this.props.onRequestClose})}}]),i}();Fu.propTypes={intl:B.f.isRequired,isRtl:o.a.bool,onNewSound:o.a.func.isRequired,onRequestClose:o.a.func,vm:o.a.instanceOf(u.a).isRequired};var vu=Object(B.e)(Object(s.b)(function(A){return{isRtl:A.locales.isRtl}},function(){return{}})(Fu));function Su(A){"@babel/helpers - typeof";return(Su="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Nu(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Ru(A,e){return(Ru=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Ou(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Uu(A);if(e){var o=Uu(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Su(e)||"function"==typeof e))return e;return Yu(A)}(this,i)}}function Yu(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Uu(A){return(Uu=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Gu=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Ru(A,e)}(i,a.a.Component);var e=Ou(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Yu(t),["handleSelectSound","handleDeleteSound","handleDuplicateSound","handleExportSound","handleNewSound","handleSurpriseSound","handleFileUploadClick","handleSoundUpload","handleDrop","setFileInput"]),t.state={selectedSoundIndex:0},t}return function(A,e,i){e&&Nu(A.prototype,e),i&&Nu(A,i)}(i,[{key:"componentWillReceiveProps",value:function(A){var e=A.editingTarget,i=A.sprites,t=A.stage,o=e&&i[e]?i[e]:t;o&&o.sounds&&(this.props.editingTarget!==e?this.setState({selectedSoundIndex:0}):this.state.selectedSoundIndex>o.sounds.length-1&&this.setState({selectedSoundIndex:Math.max(o.sounds.length-1,0)}))}},{key:"handleSelectSound",value:function(A){this.setState({selectedSoundIndex:A})}},{key:"handleDeleteSound",value:function(A){var e=this.props.vm.deleteSound(A);A>=this.state.selectedSoundIndex&&this.setState({selectedSoundIndex:Math.max(0,A-1)}),this.props.dispatchUpdateRestore({restoreFun:e,deletedItem:"Sound"})}},{key:"handleExportSound",value:function(A){var e=this.props.vm.editingTarget.sprite.sounds[A],i=new Blob([e.asset.data],{type:e.asset.assetType.contentType});Ko("".concat(e.name,".").concat(e.asset.dataFormat),i)}},{key:"handleDuplicateSound",value:function(A){var e=this;this.props.vm.duplicateSound(A).then(function(){e.setState({selectedSoundIndex:A+1})})}},{key:"handleNewSound",value:function(){if(!this.props.vm.editingTarget)return null;var A=this.props.vm.editingTarget.sprite,e=A.sounds?A.sounds:[];this.setState({selectedSoundIndex:Math.max(e.length-1,0)})}},{key:"handleSurpriseSound",value:function(){var A=this,e=Cu[Math.floor(Math.random()*Cu.length)],i={format:e.dataFormat,md5:e.md5ext,rate:e.rate,sampleCount:e.sampleCount,name:e.name};this.props.vm.addSound(i).then(function(){A.handleNewSound()})}},{key:"handleFileUploadClick",value:function(){this.fileInput.click()}},{key:"handleSoundUpload",value:function(A){var e=this,i=this.props.vm.runtime.storage,t=this.props.vm.editingTarget.id;this.props.onShowImporting(),_o(A.target,function(A,o,n,a,r){!function(A,e,i,t,o){var n;switch(e){case"audio/mp3":case"audio/mpeg":n=i.DataFormat.MP3;break;case"audio/wav":case"audio/wave":case"audio/x-wav":case"audio/x-pn-wav":n=i.DataFormat.WAV;break;default:return void o("Encountered unexpected file type: ".concat(e))}t(jo(i,i.AssetType.Sound,n,new Uint8Array(A)))}(A,o,i,function(A){A.name=n,e.props.vm.addSound(A,t).then(function(){e.handleNewSound(),a===r-1&&e.props.onCloseImporting()})},e.props.onCloseImporting)},this.props.onCloseImporting)}},{key:"handleDrop",value:function(A){if(A.dragType===Co.a.SOUND){var e=this.props.vm.editingTarget.sprite,i=e.sounds[this.state.selectedSoundIndex];this.props.vm.reorderSound(this.props.vm.editingTarget.id,A.index,A.newIndex),this.setState({selectedSoundIndex:e.sounds.indexOf(i)})}else A.dragType===Co.a.BACKPACK_COSTUME?(this.props.onActivateCostumesTab(),this.props.vm.addCostume(A.payload.body,{name:A.payload.name})):A.dragType===Co.a.BACKPACK_SOUND&&this.props.vm.addSound({md5:A.payload.body,name:A.payload.name}).then(this.handleNewSound)}},{key:"setFileInput",value:function(A){this.fileInput=A}},{key:"render",value:function(){var A=this.props,e=(A.dispatchUpdateRestore,A.intl),i=A.isRtl,t=A.vm,o=A.onNewSoundFromLibraryClick,n=A.onNewSoundFromRecordingClick;if(!t.editingTarget)return null;var r=t.editingTarget.sprite,s=r.sounds?r.sounds.map(function(A){return{url:i?_s.a:Ps.a,name:A.name,details:(A.sampleCount/A.rate).toFixed(2),dragPayload:A}}):[],g=Object(B.d)({fileUploadSound:{id:"gui.soundTab.fileUploadSound",defaultMessage:"Upload Sound"},surpriseSound:{id:"gui.soundTab.surpriseSound",defaultMessage:"Surprise"},recordSound:{id:"gui.soundTab.recordSound",defaultMessage:"Record"},addSound:{id:"gui.soundTab.addSoundFromLibrary",defaultMessage:"Choose a Sound"}});return a.a.createElement(To,{buttons:[{title:e.formatMessage(g.addSound),img:Js.a,onClick:o},{title:e.formatMessage(g.fileUploadSound),img:An.a,onClick:this.handleFileUploadClick,fileAccept:".wav, .mp3",fileChange:this.handleSoundUpload,fileInput:this.setFileInput,fileMultiple:!0},{title:e.formatMessage(g.surpriseSound),img:nn.a,onClick:this.handleSurpriseSound},{title:e.formatMessage(g.recordSound),img:Ks.a,onClick:n},{title:e.formatMessage(g.addSound),img:rn.a,onClick:o}],dragType:Co.a.SOUND,isRtl:i,items:s,selectedItemIndex:this.state.selectedSoundIndex,onDeleteClick:this.handleDeleteSound,onDrop:this.handleDrop,onDuplicateClick:this.handleDuplicateSound,onExportClick:this.handleExportSound,onItemClick:this.handleSelectSound},r.sounds&&r.sounds[this.state.selectedSoundIndex]?a.a.createElement(uu,{soundIndex:this.state.selectedSoundIndex}):null,this.props.soundRecorderVisible?a.a.createElement(jl,{onNewSound:this.handleNewSound}):null,this.props.soundLibraryVisible?a.a.createElement(vu,{vm:this.props.vm,onNewSound:this.handleNewSound,onRequestClose:this.props.onRequestCloseSoundLibrary}):null)}}]),i}();Gu.propTypes={dispatchUpdateRestore:o.a.func,editingTarget:o.a.string,intl:B.f,isRtl:o.a.bool,onActivateCostumesTab:o.a.func.isRequired,onCloseImporting:o.a.func.isRequired,onNewSoundFromLibraryClick:o.a.func.isRequired,onNewSoundFromRecordingClick:o.a.func.isRequired,onRequestCloseSoundLibrary:o.a.func.isRequired,onShowImporting:o.a.func.isRequired,soundLibraryVisible:o.a.bool,soundRecorderVisible:o.a.bool,sprites:o.a.shape({id:o.a.shape({sounds:o.a.arrayOf(o.a.shape({name:o.a.string.isRequired}))})}),stage:o.a.shape({sounds:o.a.arrayOf(o.a.shape({name:o.a.string.isRequired}))}),vm:o.a.instanceOf(u.a).isRequired};var Hu=Object(d.a)("Sound Tab")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,isRtl:A.locales.isRtl,sprites:A.scratchGui.targets.sprites,stage:A.scratchGui.targets.stage,soundLibraryVisible:A.scratchGui.modals.soundLibrary,soundRecorderVisible:A.scratchGui.modals.soundRecorder}},function(A){return{onActivateCostumesTab:function(){return A(Object(h.e)(h.b))},onNewSoundFromLibraryClick:function(e){e.preventDefault(),A(Object(C.r)())},onNewSoundFromRecordingClick:function(){A(Object(C.s)())},onRequestCloseSoundLibrary:function(){A(Object(C.f)())},dispatchUpdateRestore:function(e){A(Object(Wo.c)(e))},onCloseImporting:function(){return A(Object(TA.c)("importingAsset"))},onShowImporting:function(){return A(Object(TA.h)("importingAsset"))}}})(Gu))),Lu=i(55),Pu=i.n(Lu),xu=i(47),_u=i(69),ju=i.n(_u);function Ju(A){"@babel/helpers - typeof";return(Ju="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function zu(A){return function(A){if(Array.isArray(A))return Ku(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||function(A,e){if(!A)return;if("string"==typeof A)return Ku(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ku(A,e)}(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ku(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function Wu(A,e,i,t,o,n,a){try{var r=A[n](a),s=r.value}catch(A){return void i(A)}r.done?e(s):Promise.resolve(s).then(t,o)}function Vu(A){return function(){var e=this,i=arguments;return new Promise(function(t,o){var n=A.apply(e,i);function a(A){Wu(n,t,o,a,r,"next",A)}function r(A){Wu(n,t,o,a,r,"throw",A)}a(void 0)})}}function Xu(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Zu(A,e){return(Zu=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function qu(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=AB(A);if(e){var o=AB(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ju(e)||"function"==typeof e))return e;return $u(A)}(this,i)}}function $u(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function AB(A){return(AB=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var eB=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Zu(A,e)}(i,a.a.Component);var e=qu(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={saveFileName:"",fileNames:[],isValidFileName:!1},t.setSaveFileName=t.setSaveFileName.bind($u(t)),t.saveFile=t.saveFile.bind($u(t)),t.loadFile=t.loadFile.bind($u(t)),t.deleteFile=t.deleteFile.bind($u(t)),t.getCurrentFiles(),t}return function(A,e,i){e&&Xu(A.prototype,e),i&&Xu(A,i)}(i,[{key:"getCurrentFiles",value:function(){var A=Vu(function*(){var A=(yield mv2Interface.listSavedScratchFiles()).fileNames.map(function(A){return decodeURIComponent(A)}).filter(function(A){return"__autosave"!==A});this.setState({fileNames:A})});return function(){return A.apply(this,arguments)}}()},{key:"setSaveFileName",value:function(A){var e=A.length>0&&A.length<30;this.setState({saveFileName:A,isValidFileName:e})}},{key:"saveFile",value:function(){var A=Vu(function*(A){var e=this.state.fileNames,i=encodeURIComponent(A);if(!e.includes(i)||window.confirm('Are you sure you want to overwrite "'.concat(A,'"?'))){var t=yield this.props.saveProjectSb3(),o=yield te(t);try{if(yield mv2Interface.saveScratchFile(i,o),alert("Project Saved."),this.props.onProjectTelemetryEvent){var n=fA(this.props.vm,this.props.projectTitle,this.props.locale);this.props.onProjectTelemetryEvent("projectDidSave",n)}var a=[A].concat(zu(e.filter(function(e){return e!==A})));this.setState({fileNames:a})}catch(A){alert("Failed to save project: ".concat(A.message))}}});return function(e){return A.apply(this,arguments)}}()},{key:"loadFile",value:function(){var A=Vu(function*(A){var e=this,i=this.props.vm;if(!i.editingTarget)return null;try{var t=yield mv2Interface.loadScratchFile(encodeURIComponent(A)),o=yield(yield fetch(t.contents)).arrayBuffer();i.loadProject(o),alert("Loaded Project"),window.setTimeout(function(){return e.props.onActivateBlocksTab()})}catch(A){alert("Failed to load project: ".concat(A.message))}});return function(e){return A.apply(this,arguments)}}()},{key:"deleteFile",value:function(){var A=Vu(function*(A){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.state.fileNames;if(!e||window.confirm('Are you sure you want to delete "'.concat(A,'"?')))try{yield mv2Interface.deleteScratchFile(encodeURIComponent(A));var t=i.filter(function(e){return e!==A});this.setState({fileNames:t})}catch(A){alert("Failed to delete project: ".concat(A.message))}});return function(e){return A.apply(this,arguments)}}()},{key:"render",value:function(){var A=this,e=this.state,i=e.saveFileName,t=e.isValidFileName,o=e.fileNames;return a.a.createElement("div",{className:ju.a.mainContent},a.a.createElement("div",{className:ju.a.block},a.a.createElement("div",{className:ju.a.saveHeaderContainer},a.a.createElement("div",{className:ju.a.newSaveTitleContainer},"Create a new save file:"),a.a.createElement(Jn,{placeholder:"Type what you would like to name your new save file here...",style:{flex:1,marginLeft:10},type:"text",value:i,onChange:function(e){return A.setSaveFileName(e.currentTarget.value)}}),a.a.createElement(xu.a,{style:{marginLeft:10,marginRight:5,opacity:t?1:.2},className:ju.a.button,disabled:!t,onClick:function(){return A.saveFile(i)}},"Save"))),o.length>0&&a.a.createElement("div",{className:[ju.a.block,ju.a["block-100"]].join(" ")},a.a.createElement("div",{className:ju.a.savedFilesContainer},a.a.createElement("div",{className:ju.a.savedFilesTitle},"Your Saved Files:"),a.a.createElement("div",{className:ju.a.saveList},o.sort().map(function(e,i){return a.a.createElement("div",{key:e,className:ju.a.row},a.a.createElement("div",{style:{flex:2}},e),a.a.createElement("div",{style:{display:"flex",flexDirection:"row"}},a.a.createElement(xu.a,{className:ju.a.button,style:{marginLeft:10},onClick:function(){return A.deleteFile(e)}},"Delete"),a.a.createElement(xu.a,{className:ju.a.button,style:{marginLeft:10},onClick:function(){return A.loadFile(e)}},"Load"),a.a.createElement(xu.a,{className:ju.a.button,style:{marginLeft:10},onClick:function(){return A.saveFile(e)}},"Save")))})))))}}]),i}();eB.propTypes={onActivateBlocksTab:o.a.func,saveProjectSb3:o.a.func,editingTarget:o.a.string,locale:o.a.string.isRequired,onProjectTelemetryEvent:o.a.func,projectTitle:o.a.string,vm:o.a.instanceOf(u.a).isRequired,onConfirmNewProject:o.a.func};var iB=Object(d.a)("Save / Load")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,locale:A.locales.locale,saveProjectSb3:A.scratchGui.vm.saveProjectSb3.bind(A.scratchGui.vm)}},function(A){return{onActivateBlocksTab:function(){return A(Object(h.e)(h.a))},onConfirmNewProject:function(){return A(Object(E.C)(!1))}}})(eB))),tB=i(66),oB=i.n(tB),nB=i(805),aB=i.n(nB);function rB(A){"@babel/helpers - typeof";return(rB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function sB(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function gB(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?sB(Object(i),!0).forEach(function(e){lB(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):sB(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function lB(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function cB(A,e,i,t,o,n,a){try{var r=A[n](a),s=r.value}catch(A){return void i(A)}r.done?e(s):Promise.resolve(s).then(t,o)}function uB(A){return function(){var e=this,i=arguments;return new Promise(function(t,o){var n=A.apply(e,i);function a(A){cB(n,t,o,a,r,"next",A)}function r(A){cB(n,t,o,a,r,"throw",A)}a(void 0)})}}function BB(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function dB(A,e){return(dB=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function EB(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=CB(A);if(e){var o=CB(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===rB(e)||"function"==typeof e))return e;return hB(A)}(this,i)}}function hB(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function CB(A){return(CB=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var wB=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&dB(A,e)}(i,a.a.Component);var e=EB(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={loadFileName:"",isValidFileName:!1,isLoading:!1,savedProjectId:"",copyToCPText:"Copy to Clipboard"},t.setloadFileName=t.setloadFileName.bind(hB(t)),t.saveFile=t.saveFile.bind(hB(t)),t.loadFile=t.loadFile.bind(hB(t)),t.copyTextToClipboard=t.copyTextToClipboard.bind(hB(t)),t.fallbackCopyTextToClipboard=t.fallbackCopyTextToClipboard.bind(hB(t)),t}return function(A,e,i){e&&BB(A.prototype,e),i&&BB(A,i)}(i,[{key:"setloadFileName",value:function(A){var e=A.length>0&&A.length<130;this.setState({loadFileName:A,isValidFileName:e})}},{key:"saveFile",value:function(){var A=uB(function*(){this.setState(function(A){return gB(gB({},A),{},{isLoading:!0})});var A=yield this.props.saveProjectSb3(),e=yield te(A);try{var i=yield mv2Interface.saveCloudScratchFile(e);this.setState({savedProjectId:i}),alert("Successfully saved project!")}catch(A){alert("Failed to save project: ".concat(A.message))}this.setState(function(A){return gB(gB({},A),{},{isLoading:!1})})});return function(){return A.apply(this,arguments)}}()},{key:"loadFile",value:function(){var A=uB(function*(A){var e=this,i=this.props.vm;if(!i.editingTarget)return null;var t=A;this.validURL(A)&&(A.includes("http")||(A="https://"+A),t=new URL(A).searchParams.get("p")||"");this.setState(function(A){return gB(gB({},A),{},{isLoading:!0})});try{var o=yield mv2Interface.loadCloudScratchFile(t);if(!o)throw new Error("Couldn't find project with id: "+t);var n=yield(yield fetch(o)).arrayBuffer();i.loadProject(n),alert("Loaded Project"),window.setTimeout(function(){return e.props.onActivateBlocksTab()})}catch(A){alert("Failed to load project: ".concat(A.message))}this.setState(function(A){return gB(gB({},A),{},{isLoading:!1})})});return function(e){return A.apply(this,arguments)}}()},{key:"fallbackCopyTextToClipboard",value:function(A){var e=this,i=document.createElement("textarea");i.value=A,i.style.top="0",i.style.left="0",i.style.position="fixed",document.body.appendChild(i),i.focus(),i.select();try{var t=document.execCommand("copy")?"successful":"unsuccessful";setTimeout(function(){e.setState({copyToCPText:"Copy to Clipboard"})},3e3),this.setState({copyToCPText:"Copied!"}),console.log("Fallback: Copying text command was "+t)}catch(A){console.error("Fallback: Oops, unable to copy",A)}document.body.removeChild(i)}},{key:"copyTextToClipboard",value:function(A){var e=this;navigator.clipboard?navigator.clipboard.writeText(A).then(function(){setTimeout(function(){e.setState({copyToCPText:"Copy to Clipboard"})},3e3),e.setState({copyToCPText:"Copied!"}),console.log("Async: Copying to clipboard was successful!")},function(A){console.error("Async: Could not copy text: ",A)}):this.fallbackCopyTextToClipboard(A)}},{key:"validURL",value:function(A){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(A)}},{key:"render",value:function(){var A=this,e=this.state,i=e.loadFileName,t=e.isValidFileName;return a.a.createElement("div",{className:oB.a.mainContent},a.a.createElement("div",{className:oB.a.block},a.a.createElement("div",{className:oB.a.loadProjectContainer},a.a.createElement("div",{className:oB.a.loadProjectTitle},"Load a Cloud save:"),a.a.createElement(Jn,{style:{flex:1,marginLeft:10},type:"text",placeholder:"Type the name of the cloud save file you would like to load here...",value:i,onChange:function(e){return A.setloadFileName(e.currentTarget.value)}}),a.a.createElement(xu.a,{style:{marginLeft:10,marginRight:5,opacity:t?1:.2},className:oB.a.button,disabled:!t,onClick:function(){return A.loadFile(i)}},"Load")),a.a.createElement("div",{className:oB.a.loadProjectContainer,style:{marginTop:"1rem"}},a.a.createElement("div",{className:oB.a.loadProjectTitle},"Create a new Cloud Save file:"),a.a.createElement(xu.a,{style:{marginLeft:10,marginRight:5,opacity:this.state.isLoading?.2:1},disabled:this.state.isLoading,className:oB.a.button,onClick:function(){return A.saveFile()}},"Save"),a.a.createElement(Jn,{style:{flex:1,marginLeft:10},type:"text",placeholder:"Your autogenerated Save File Code is:",value:this.state.savedProjectId,editable:"false"}),a.a.createElement(xu.a,{iconSrc:aB.a,style:{marginLeft:10,marginRight:5,opacity:this.state.savedProjectId?1:.2},className:oB.a.button,disabled:!this.state.savedProjectId,onClick:function(){return A.copyTextToClipboard(A.state.savedProjectId)}},this.state.copyToCPText))),this.state.isLoading&&a.a.createElement("div",{className:oB.a.ldsSpinner},a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null)),a.a.createElement("div",{className:[oB.a.block,oB.a["block-100"]].join(" "),style:{marginTop:"2rem"}},a.a.createElement("div",{className:oB.a.tipsContainer},a.a.createElement("div",{className:oB.a.tipsTitle},"Tips for Cloud Saving:"),a.a.createElement("ul",{className:oB.a.tipsList},a.a.createElement("li",null,"Make sure to write down or record the auto-generated code that is provided each time you save a new file. You will need this to load it in the future."),a.a.createElement("li",null,"Although the Marty the Robot app will continue to auto-save files to the local space storage, there is no auto-save function for cloud save files. Please manually re-save your file each time, if you wish them to be available for download over cloud storage."),a.a.createElement("li",null,"Each time you re-save a file to cloud storage, you will be provided with a NEW SAVE FILE CODE. Please take a note of this.")))))}}]),i}();wB.propTypes={onActivateBlocksTab:o.a.func,saveProjectSb3:o.a.func,editingTarget:o.a.string,locale:o.a.string.isRequired,onProjectTelemetryEvent:o.a.func,projectTitle:o.a.string,vm:o.a.instanceOf(u.a).isRequired,onConfirmNewProject:o.a.func};var mB=Object(d.a)("Save / Load")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,locale:A.locales.locale,saveProjectSb3:A.scratchGui.vm.saveProjectSb3.bind(A.scratchGui.vm)}},function(A){return{onActivateBlocksTab:function(){return A(Object(h.e)(h.a))},onConfirmNewProject:function(){return A(Object(E.C)(!1))}}})(wB))),pB=i(98),IB=i.n(pB);function fB(A){"@babel/helpers - typeof";return(fB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function QB(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function DB(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?QB(Object(i),!0).forEach(function(e){MB(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):QB(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}function MB(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function bB(A,e,i,t,o,n,a){try{var r=A[n](a),s=r.value}catch(A){return void i(A)}r.done?e(s):Promise.resolve(s).then(t,o)}function yB(A){return function(){var e=this,i=arguments;return new Promise(function(t,o){var n=A.apply(e,i);function a(A){bB(n,t,o,a,r,"next",A)}function r(A){bB(n,t,o,a,r,"throw",A)}a(void 0)})}}function TB(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function kB(A,e){return(kB=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function FB(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=SB(A);if(e){var o=SB(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===fB(e)||"function"==typeof e))return e;return vB(A)}(this,i)}}function vB(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function SB(A){return(SB=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var NB=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&kB(A,e)}(i,a.a.Component);var e=FB(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={isLoading:!1},t.saveFile=t.saveFile.bind(vB(t)),t.loadFile=t.loadFile.bind(vB(t)),t}return function(A,e,i){e&&TB(A.prototype,e),i&&TB(A,i)}(i,[{key:"saveFile",value:function(){var A=yB(function*(){this.setState(function(A){return DB(DB({},A),{},{isLoading:!0})});var A=yield this.props.saveProjectSb3(),e=yield te(A);try{var i="sb-".concat(function(){for(var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=i.length,o=0;o<A;o++)e+=i.charAt(Math.floor(Math.random()*t));return e}(5),".sb3");yield mv2Interface.saveScratchFileOnDevice(i,e),mv2Interface.send_REST("notification/info-message/File ".concat(i," Saved!"))}catch(A){mv2Interface.send_REST("notification/error-message/Couldn't save file."),console.log("Couldn't save file",A)}this.setState(function(A){return DB(DB({},A),{},{isLoading:!1})})});return function(){return A.apply(this,arguments)}}()},{key:"loadFile",value:function(){var A=yB(function*(A){var e=this,i=this.props.vm;if(!i.editingTarget)return null;this.setState(function(A){return DB(DB({},A),{},{isLoading:!0})});try{var t,o=A.target.value,n=A.target.files[0];if(!o)throw new Error("Couldn't find project with id: "+o);if(!!window.ReactNativeWebView){var a=yield n.text();t=yield(yield fetch(a)).arrayBuffer()}else t=yield n.arrayBuffer();i.loadProject(t),mv2Interface.send_REST("notification/info-message/Project loaded!"),window.setTimeout(function(){return e.props.onActivateBlocksTab()})}catch(A){mv2Interface.send_REST("notification/error-message/Failed to load project: ".concat(A.message))}this.setState(function(A){return DB(DB({},A),{},{isLoading:!1})})});return function(e){return A.apply(this,arguments)}}()},{key:"render",value:function(){var A=this;return a.a.createElement("div",{className:IB.a.mainContent},a.a.createElement("div",{className:IB.a.block},a.a.createElement("div",{className:IB.a.saveProjectContainer},a.a.createElement("div",{className:IB.a.button,onClick:function(){return A.saveFile()}},a.a.createElement("p",{className:IB.a.buttonTitle},"Save to file"))),a.a.createElement("div",{className:IB.a.loadProjectContainer},a.a.createElement("div",{className:IB.a.button},a.a.createElement("input",{type:"file",id:"file-upload",name:"file-upload",className:IB.a.loadInput,onChange:this.loadFile}),a.a.createElement("label",{htmlFor:"file-upload",className:IB.a.buttonTitle},"Load from file")))),this.state.isLoading&&a.a.createElement("div",{className:IB.a.ldsSpinner},a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null),a.a.createElement("div",null)))}}]),i}();NB.propTypes={onActivateBlocksTab:o.a.func,saveProjectSb3:o.a.func,editingTarget:o.a.string,locale:o.a.string.isRequired,onProjectTelemetryEvent:o.a.func,projectTitle:o.a.string,vm:o.a.instanceOf(u.a).isRequired,onConfirmNewProject:o.a.func};var RB=Object(d.a)("Save / Load")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,locale:A.locales.locale,saveProjectSb3:A.scratchGui.vm.saveProjectSb3.bind(A.scratchGui.vm)}},function(A){return{onActivateBlocksTab:function(){return A(Object(h.e)(h.a))},onConfirmNewProject:function(){return A(Object(E.C)(!1))}}})(NB)));function OB(A){"@babel/helpers - typeof";return(OB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function YB(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function UB(A,e){return(UB=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function GB(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=HB(A);if(e){var o=HB(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===OB(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function HB(A){return(HB=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var LB=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&UB(A,e)}(i,a.a.Component);var e=GB(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={currentTab:"local-storage"},t}return function(A,e,i){e&&YB(A.prototype,e),i&&YB(A,i)}(i,[{key:"render",value:function(){var A,e=this,i=this.state.currentTab;return"local-storage"===i?A=a.a.createElement(iB,this.props):"cloud-storage"===i?A=a.a.createElement(mB,this.props):"portable-file-storage"===i&&(A=a.a.createElement(RB,this.props)),a.a.createElement("div",{className:Pu.a.mainContainer},a.a.createElement("div",{className:Pu.a.header},a.a.createElement("div",{className:"local-storage"===this.state.currentTab?[Pu.a.button,Pu.a.buttonSelected].join(" "):Pu.a.button,onClick:function(){return e.setState({currentTab:"local-storage"})}},a.a.createElement("p",{className:Pu.a.buttonTitle},"In the App"),a.a.createElement("p",{className:Pu.a.buttonSubtitle},"Local Storage")),a.a.createElement("div",{className:"cloud-storage"===this.state.currentTab?[Pu.a.button,Pu.a.buttonSelected].join(" "):Pu.a.button,onClick:function(){return e.setState({currentTab:"cloud-storage"})}},a.a.createElement("p",{className:Pu.a.buttonTitle},"In the Cloud"),a.a.createElement("p",{className:Pu.a.buttonSubtitle},"Cloud Storage")),a.a.createElement("div",{className:"portable-file-storage"===this.state.currentTab?[Pu.a.button,Pu.a.buttonSelected].join(" "):Pu.a.button,onClick:function(){return e.setState({currentTab:"portable-file-storage"})}},a.a.createElement("p",{className:Pu.a.buttonTitle},"Portable"),a.a.createElement("p",{className:Pu.a.buttonSubtitle},"File Storage"))),a.a.createElement("div",{className:Pu.a.content},A))}}]),i}();LB.propTypes={onActivateBlocksTab:o.a.func,saveProjectSb3:o.a.func,editingTarget:o.a.string,locale:o.a.string.isRequired,onProjectTelemetryEvent:o.a.func,projectTitle:o.a.string,vm:o.a.instanceOf(u.a).isRequired,onConfirmNewProject:o.a.func};var PB=Object(d.a)("Save / Load")(Object(B.e)(Object(s.b)(function(A){return{editingTarget:A.scratchGui.targets.editingTarget,locale:A.locales.locale,saveProjectSb3:A.scratchGui.vm.saveProjectSb3.bind(A.scratchGui.vm)}},function(A){return{onActivateBlocksTab:function(){return A(Object(h.e)(h.a))},onConfirmNewProject:function(){return A(Object(E.C)(!1))}}})(LB))),xB=function(A){return a.a.createElement(PB,A)},_B=i(117),jB=i(60),JB=i(139),zB=12,KB=44,WB=function(A,e){var i={heightDefault:Pa.e.standardStageHeight,widthDefault:Pa.e.standardStageWidth,height:0,width:0,scale:0};return e?(i.height=window.innerHeight-KB-zB,i.width=i.height+i.height/3,i.width>window.innerWidth&&(i.width=window.innerWidth,i.height=.75*i.width),i.scale=i.width/i.widthDefault):(i.scale=Pa.b[A],i.height=i.scale*i.heightDefault,i.width=i.scale*i.widthDefault),i.height=Math.round(i.height),i.width=Math.round(i.width),i},VB=function(A){var e=A.width,i=A.height,t=e/A.widthDefault,o=i/A.heightDefault;if(1!==t||1!==o)return{transform:"scale(".concat(t,",").concat(o,")")}},XB=i(809),ZB=i.n(XB),qB=i(810),$B=i.n(qB),Ad=i(285),ed=i.n(Ad),id=i(89),td=i.n(id),od=Object(B.d)({largeStageSizeMessage:{id:"gui.stageHeader.stageSizeLarge",defaultMessage:"Switch to large stage"},smallStageSizeMessage:{id:"gui.stageHeader.stageSizeSmall",defaultMessage:"Switch to small stage"},fullStageSizeMessage:{id:"gui.stageHeader.stageSizeFull",defaultMessage:"Enter full screen mode"},unFullStageSizeMessage:{id:"gui.stageHeader.stageSizeUnFull",defaultMessage:"Exit full screen mode"},fullscreenControl:{id:"gui.stageHeader.fullscreenControl",defaultMessage:"Full Screen Control"}}),nd=function(A){var e=A.isFullScreen,i=A.isPlayerOnly,t=A.onKeyPress,o=A.onSetStageFull,n=A.onSetStageUnFull,r=A.showBranding,s=A.vm,g=null;if(e){var l=WB(null,!0),c=r?a.a.createElement("div",{className:td.a.embedScratchLogo},a.a.createElement("a",{href:"https://scratch.mit.edu",rel:"noopener noreferrer",target:"_blank"},a.a.createElement("img",{alt:"Scratch",src:ed.a}))):a.a.createElement(xu.a,{className:td.a.stageButton,onClick:n,onKeyPress:t},a.a.createElement("img",{alt:A.intl.formatMessage(od.unFullStageSizeMessage),className:td.a.stageButtonIcon,draggable:!1,src:$B.a,title:A.intl.formatMessage(od.fullscreenControl)}));g=a.a.createElement(hi.a,{className:td.a.stageHeaderWrapperOverlay},a.a.createElement(hi.a,{className:td.a.stageMenuWrapper,style:{width:l.width}},a.a.createElement(JB.a,{vm:s}),c))}else{var u=i?[]:a.a.createElement("div",{className:td.a.stageSizeToggleGroup});g=a.a.createElement(hi.a,{className:td.a.stageHeaderWrapper},a.a.createElement(hi.a,{className:td.a.stageMenuWrapper},a.a.createElement("div",{className:td.a.stageSizeRow},u,a.a.createElement("div",null,a.a.createElement(xu.a,{className:td.a.stageButton,onClick:o},a.a.createElement("img",{alt:A.intl.formatMessage(od.fullStageSizeMessage),className:td.a.stageButtonIcon,draggable:!1,src:ZB.a,title:A.intl.formatMessage(od.fullscreenControl)}))))))}return g};nd.propTypes={intl:B.f,isFullScreen:o.a.bool.isRequired,isPlayerOnly:o.a.bool.isRequired,onKeyPress:o.a.func.isRequired,onSetStageFull:o.a.func.isRequired,onSetStageLarge:o.a.func.isRequired,onSetStageSmall:o.a.func.isRequired,onSetStageUnFull:o.a.func.isRequired,showBranding:o.a.bool.isRequired,stageSizeMode:o.a.oneOf(Object.keys(Pa.d)),vm:o.a.instanceOf(u.a).isRequired},nd.defaultProps={stageSizeMode:Pa.d.large};var ad=Object(B.e)(Object(s.b)(function(A){return{stageSizeMode:A.scratchGui.stageSize.stageSize}})(nd));function rd(A){"@babel/helpers - typeof";return(rd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function sd(){return(sd=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function gd(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function ld(A,e){return(ld=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function cd(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Bd(A);if(e){var o=Bd(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===rd(e)||"function"==typeof e))return e;return ud(A)}(this,i)}}function ud(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Bd(A){return(Bd=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var dd=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&ld(A,e)}(i,a.a.Component);var e=cd(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(ud(t),["handleKeyPress"]),t}return function(A,e,i){e&&gd(A.prototype,e),i&&gd(A,i)}(i,[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyPress)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyPress)}},{key:"handleKeyPress",value:function(A){"Escape"===A.key&&this.props.isFullScreen&&this.props.onSetStageUnFull(!1)}},{key:"render",value:function(){var A=sd({},this.props);return a.a.createElement(ad,sd({},A,{onKeyPress:this.handleKeyPress}))}}]),i}();dd.propTypes={isFullScreen:o.a.bool,isPlayerOnly:o.a.bool,onSetStageUnFull:o.a.func.isRequired,showBranding:o.a.bool,stageSizeMode:o.a.oneOf(Object.keys(Pa.d)),vm:o.a.instanceOf(u.a).isRequired};var Ed=Object(s.b)(function(A){return{stageSizeMode:A.scratchGui.stageSize.stageSize,showBranding:A.scratchGui.mode.showBranding,isFullScreen:A.scratchGui.mode.isFullScreen,isPlayerOnly:A.scratchGui.mode.isPlayerOnly}},function(A){return{onSetStageLarge:function(){return A(Object(_B.b)(Pa.d.large))},onSetStageSmall:function(){return A(Object(_B.b)(Pa.d.small))},onSetStageFull:function(){return A(Object(jB.c)(!0))},onSetStageUnFull:function(){return A(Object(jB.c)(!1))}}})(dd),hd=[];function Cd(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var i=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null==i)return;var t,o,n=[],a=!0,r=!1;try{for(i=i.call(A);!(a=(t=i.next()).done)&&(n.push(t.value),!e||n.length!==e);a=!0);}catch(A){r=!0,o=A}finally{try{a||null==i.return||i.return()}finally{if(r)throw o}}return n}(A,e)||function(A,e){if(!A)return;if("string"==typeof A)return wd(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return wd(A,e)}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wd(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function md(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var pd=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.mirror=!0,this._frameCacheTimeout=16,this._video=null,this._track=null,this._workspace=[]}return function(A,e,i){e&&md(A.prototype,e),i&&md(A,i)}(A,[{key:"video",get:function(){return this._video}},{key:"enableVideo",value:function(){return this.enabled=!0,this._setupVideo()}},{key:"disableVideo",value:function(){var A=this;this.enabled=!1,this._singleSetup&&this._singleSetup.then(this._teardown.bind(this)).catch(function(e){return A.onError(e)})}},{key:"_teardown",value:function(){if(!1===this.enabled){var A=(hd.pop(),!(hd.length>0));this._singleSetup=null,this._video=null,this._track&&A&&this._track.stop(),this._track=null}}},{key:"getFrame",value:function(e){var i=e.dimensions,t=void 0===i?A.DIMENSIONS:i,o=e.mirror,n=void 0===o?this.mirror:o,a=e.format,r=void 0===a?A.FORMAT_IMAGE_DATA:a,s=e.cacheTimeout,g=void 0===s?this._frameCacheTimeout:s;if(!this.videoReady)return null;var l=Cd(t,2),c=l[0],u=l[1],B=this._getWorkspace({dimensions:t,mirror:Boolean(n)}),d=this._video,E=d.videoWidth,h=d.videoHeight,C=B.canvas,w=B.context,m=B.lastUpdate,p=B.cacheData,I=Date.now();m+g<I&&(n&&(w.scale(-1,1),w.translate(-1*c,0)),w.drawImage(this._video,0,0,E,h,0,0,c,u),w.setTransform(1,0,0,1,0,0),B.lastUpdate=I),p[r]||(p[r]={lastUpdate:0});var f=p[r];return f.lastUpdate+g<I&&(r===A.FORMAT_IMAGE_DATA?f.lastData=w.getImageData(0,0,c,u):r===A.FORMAT_CANVAS?(f.lastUpdate=1/0,f.lastData=C):(L.a.error("video io error - unimplemented format ".concat(r)),f.lastUpdate=1/0,f.lastData=null),f.lastUpdate=Math.max(B.lastUpdate,f.lastUpdate)),f.lastData}},{key:"onError",value:function(A){L.a.error("Unhandled video io device error",A)}},{key:"_setupVideo",value:function(){var A=this;return this._singleSetup?this._singleSetup:(this._singleSetup=function(A){var e;return 0===hd.length?(e=Mg()({audio:!1,video:A}),hd.push(e)):hd.length>0&&(e=hd[0],hd.push(!0)),e}({width:{min:480,ideal:640},height:{min:360,ideal:480}}).then(function(e){A._video=document.createElement("video");try{A._video.srcObject=e}catch(i){A._video.src=window.URL.createObjectURL(e)}return A._video.play(),A._track=e.getTracks()[0],A}).catch(function(e){A._singleSetup=null,A.onError(e)}),this._singleSetup)}},{key:"videoReady",get:function(){if(!this.enabled)return!1;if(!this._video)return!1;if(!this._track)return!1;var A=this._video,e=A.videoWidth,i=A.videoHeight;return"number"==typeof e&&"number"==typeof i&&(0!==e&&0!==i)}},{key:"_getWorkspace",value:function(A){var e=A.dimensions,i=A.mirror,t=this._workspace.find(function(A){return A.dimensions.join("-")===e.join("-")&&A.mirror===i});return t||((t={dimensions:e,mirror:i,canvas:document.createElement("canvas"),lastUpdate:0,cacheData:{}}).canvas.width=e[0],t.canvas.height=e[1],t.context=t.canvas.getContext("2d"),this._workspace.push(t)),t}}],[{key:"FORMAT_IMAGE_DATA",get:function(){return"image-data"}},{key:"FORMAT_CANVAS",get:function(){return"canvas"}},{key:"DIMENSIONS",get:function(){return[480,360]}},{key:"ORDER",get:function(){return 1}}]),A}(),Id=i(811),fd=i.n(Id),Qd=i(172),Dd=i.n(Qd);function Md(A){"@babel/helpers - typeof";return(Md="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function bd(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function yd(A,e){return(yd=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Td(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Fd(A);if(e){var o=Fd(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Md(e)||"function"==typeof e))return e;return kd(A)}(this,i)}}function kd(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Fd(A){return(Fd=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var vd=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&yd(A,e)}(i,a.a.Component);var e=Td(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).setContainer=t.setContainer.bind(kd(t)),t}return function(A,e,i){e&&bd(A.prototype,e),i&&bd(A,i)}(i,[{key:"componentDidMount",value:function(){this.container.appendChild(this.props.domElement)}},{key:"componentWillUnmount",value:function(){this.container.removeChild(this.props.domElement)}},{key:"setContainer",value:function(A){this.container=A}},{key:"render",value:function(){return Object.assign(this.props.domElement,m()(this.props,["domElement","children","style"])),this.props.style&&(this.props.domElement.style.cssText=fd.a.string(this.props.style)),a.a.createElement("div",{ref:this.setContainer})}}]),i}();vd.propTypes={domElement:o.a.instanceOf(Element).isRequired,style:Dd.a};var Sd=vd,Nd=i(812),Rd=i.n(Nd);function Od(A){"@babel/helpers - typeof";return(Od="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var Yd=["colorInfo"];function Ud(){return(Ud=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Gd(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Hd(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Ld(A,e){return(Ld=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Pd(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=_d(A);if(e){var o=_d(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Od(e)||"function"==typeof e))return e;return xd(A)}(this,i)}}function xd(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function _d(A){return(_d=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var jd=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Ld(A,e)}(i,a.a.Component);var e=Pd(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(xd(t),["setCanvas"]),t}return function(A,e,i){e&&Hd(A.prototype,e),i&&Hd(A,i)}(i,[{key:"componentDidUpdate",value:function(){this.draw()}},{key:"draw",value:function(){var A=this.canvas.getContext("2d"),e=this.props.colorInfo,i=e.color,t=e.data,o=e.width,n=e.height;this.canvas.width=3*o,this.canvas.height=3*n;var a=document.createElement("canvas");a.width=o,a.height=n;var r=a.getContext("2d"),s=r.createImageData(o,n);s.data.set(t),r.putImageData(s,0,0),A.save(),A.scale(3,3),A.drawImage(a,0,0,o,n),A.lineWidth=1/3,A.strokeStyle="black",A.fillStyle="rgba(".concat(i.r,", ").concat(i.g,", ").concat(i.b,", ").concat(i.a,")"),A.beginPath(),A.rect(o/2-1,n/2-1,2,2),A.fill(),A.stroke(),A.strokeStyle="rgba(".concat(i.r,", ").concat(i.g,", ").concat(i.b,", ").concat(i.a,")"),A.lineWidth=5,A.beginPath(),A.moveTo(o,n/2),A.arc(o/2,n/2,o/2,0,2*Math.PI),A.stroke(),A.restore()}},{key:"setCanvas",value:function(A){this.canvas=A}},{key:"render",value:function(){var A=this.props,e=A.colorInfo,i=Gd(A,Yd);return a.a.createElement(hi.a,Ud({},i,{className:Rd.a.colorPicker,componentRef:this.setCanvas,element:"canvas",height:e.height,style:{top:e.y-3*e.height/2,left:e.x-3*e.width/2,width:3*e.width,height:3*e.height},width:e.width}))}}]),i}();jd.propTypes={colorInfo:o.a.shape({color:o.a.shape({r:o.a.number,g:o.a.number,b:o.a.number,a:o.a.number}),data:o.a.instanceOf(Uint8Array),width:o.a.number,height:o.a.number,x:o.a.number,y:o.a.number})};var Jd=jd;function zd(A){"@babel/helpers - typeof";return(zd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Kd(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var i=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null==i)return;var t,o,n=[],a=!0,r=!1;try{for(i=i.call(A);!(a=(t=i.next()).done)&&(n.push(t.value),!e||n.length!==e);a=!0);}catch(A){r=!0,o=A}finally{try{a||null==i.return||i.return()}finally{if(r)throw o}}return n}(A,e)||function(A,e){if(!A)return;if("string"==typeof A)return Wd(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Wd(A,e)}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wd(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function Vd(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Xd(A,e){return(Xd=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Zd(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=$d(A);if(e){var o=$d(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===zd(e)||"function"==typeof e))return e;return qd(A)}(this,i)}}function qd(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function $d(A){return($d=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var AE=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Xd(A,e)}(i,a.a.Component);var e=Zd(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(qd(t),["getPageCoords"]),t}return function(A,e,i){e&&Vd(A.prototype,e),i&&Vd(A,i)}(i,[{key:"getPageCoords",value:function(A,e){var i=this.props,t=i.stageWidth,o=i.stageHeight,n=i.vm.renderer.getNativeSize();return[t/n[0]*A+t/2,-o/n[1]*e+o/2]}},{key:"render",value:function(){var A=this.props,e=A.className,i=A.highlightedTargetId,t=A.highlightedTargetTime,o=A.vm;if(!(i&&o&&o.renderer&&o.runtime.getTargetById(i)))return null;var n=o.runtime.getTargetById(i),r=o.renderer.getBounds(n.drawableID),s=Kd(this.getPageCoords(r.left,r.top),2),g=s[0],l=s[1],c=Kd(this.getPageCoords(r.right,r.bottom),2),u=c[0],B=c[1];return a.a.createElement("div",{className:e,key:t,style:{position:"absolute",top:"".concat(l-2,"px"),left:"".concat(g-2,"px"),width:"".concat(u-g+4,"px"),height:"".concat(B-l+4,"px")}})}}]),i}();AE.propTypes={className:o.a.string,highlightedTargetId:o.a.string,highlightedTargetTime:o.a.number,stageHeight:o.a.number,stageWidth:o.a.number,vm:o.a.instanceOf(u.a)};var eE=Object(s.b)(function(A){return{highlightedTargetTime:A.scratchGui.targets.highlightedTargetTime,highlightedTargetId:A.scratchGui.targets.highlightedTargetId,vm:A.scratchGui.vm}},function(){return{}})(AE),iE=i(284),tE=i.n(iE);function oE(A){"@babel/helpers - typeof";return(oE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function nE(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function aE(A,e){return(aE=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function rE(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=gE(A);if(e){var o=gE(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===oE(e)||"function"==typeof e))return e;return sE(A)}(this,i)}}function sE(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function gE(A){return(gE=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var lE=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&aE(A,e)}(i,a.a.Component);var e=rE(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(sE(t),["handleClick"]),t}return function(A,e,i){e&&nE(A.prototype,e),i&&nE(A,i)}(i,[{key:"handleClick",value:function(){this.props.vm.start(),this.props.vm.greenFlag()}},{key:"render",value:function(){return a.a.createElement(hi.a,{className:this.props.wrapperClass,onClick:this.handleClick},a.a.createElement("div",{className:this.props.className},a.a.createElement("img",{draggable:!1,src:tE.a})))}}]),i}();lE.propTypes={className:o.a.string,vm:o.a.instanceOf(u.a),wrapperClass:o.a.string};var cE=Object(s.b)(function(A){return{vm:A.scratchGui.vm}},function(){return{}})(lE),uE=i(184),BE=i.n(uE),dE=i(813),EE=i.n(dE),hE=function(A){var e=A.answer,i=A.className,t=A.question,o=A.onChange,n=A.onClick,r=A.onKeyPress;return a.a.createElement("div",{className:i},a.a.createElement("div",{className:BE.a.questionContainer},t?a.a.createElement("div",{className:BE.a.questionLabel},t):null,a.a.createElement("div",{className:BE.a.questionInput},a.a.createElement(Jn,{autoFocus:!0,value:e,onChange:o,onKeyPress:r}),a.a.createElement("button",{className:BE.a.questionSubmitButton,onClick:n},a.a.createElement("img",{className:BE.a.questionSubmitButtonIcon,draggable:!1,src:EE.a})))))};hE.propTypes={answer:o.a.string,className:o.a.string,onChange:o.a.func.isRequired,onClick:o.a.func.isRequired,onKeyPress:o.a.func.isRequired,question:o.a.string};var CE=hE;function wE(A){"@babel/helpers - typeof";return(wE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function mE(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function pE(A,e){return(pE=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function IE(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=QE(A);if(e){var o=QE(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===wE(e)||"function"==typeof e))return e;return fE(A)}(this,i)}}function fE(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function QE(A){return(QE=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var DE=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&pE(A,e)}(i,a.a.Component);var e=IE(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(fE(t),["handleChange","handleKeyPress","handleSubmit"]),t.state={answer:""},t}return function(A,e,i){e&&mE(A.prototype,e),i&&mE(A,i)}(i,[{key:"handleChange",value:function(A){this.setState({answer:A.target.value})}},{key:"handleKeyPress",value:function(A){"Enter"===A.key&&this.handleSubmit()}},{key:"handleSubmit",value:function(){this.props.onQuestionAnswered(this.state.answer)}},{key:"render",value:function(){return a.a.createElement(CE,{answer:this.state.answer,question:this.props.question,onChange:this.handleChange,onClick:this.handleSubmit,onKeyPress:this.handleKeyPress})}}]),i}();DE.propTypes={onQuestionAnswered:o.a.func.isRequired,question:o.a.string};var ME=DE,bE=i(814),yE=i.n(bE),TE=i(815),kE=i.n(TE),FE=function(A){return a.a.createElement("div",{className:A.className,style:VB(A.stageSize)},a.a.createElement("img",{className:yE.a.micImg,src:kE.a}))};FE.propTypes={className:o.a.string,stageSize:o.a.shape({width:o.a.number,height:o.a.number,widthDefault:o.a.number,heightDefault:o.a.number}).isRequired};var vE=FE,SE=i(67),NE=i.n(SE),RE=["canvas","dragRef","isColorPicking","isFullScreen","isStarted","colorInfo","micIndicator","question","stageSize","onDeactivateColorPicker","onDoubleClick","onQuestionAnswered"];function OE(){return(OE=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function YE(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function UE(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var GE=function(A){var e,i=A.canvas,t=A.dragRef,o=A.isColorPicking,n=A.isFullScreen,r=A.isStarted,s=A.colorInfo,g=A.micIndicator,l=A.question,c=A.stageSize,u=A.onDeactivateColorPicker,B=A.onDoubleClick,d=A.onQuestionAnswered,E=UE(A,RE),h=WB(c,n);return a.a.createElement("div",null,a.a.createElement(hi.a,{className:Le()((e={},YE(e,NE.a.stageWrapper,!n),YE(e,NE.a.stageWrapperOverlay,n),YE(e,NE.a.withColorPicker,!n&&o),e)),style:{minHeight:h.height,minWidth:h.width},onDoubleClick:B},a.a.createElement(hi.a,{className:Le()(NE.a.stage,YE({},NE.a.stageOverlayContent,n)),style:{height:h.height,width:h.width}},a.a.createElement(Sd,OE({domElement:i,style:{height:h.height,width:h.width}},E))),a.a.createElement(hi.a,{className:NE.a.frameWrapper},a.a.createElement(eE,{className:NE.a.frame,stageHeight:h.height,stageWidth:h.width})),r?null:a.a.createElement(cE,{className:NE.a.greenFlagOverlay,wrapperClass:NE.a.greenFlagOverlayWrapper}),o&&s?a.a.createElement(hi.a,{className:NE.a.colorPickerWrapper},a.a.createElement(Jd,{colorInfo:s})):null,a.a.createElement("div",{className:NE.a.stageBottomWrapper,style:{width:h.width,height:h.height,left:"50%",marginLeft:-.5*h.width}},g?a.a.createElement(vE,{className:NE.a.micIndicator,stageSize:h}):null,null===l?null:a.a.createElement("div",{className:NE.a.questionWrapper,style:{width:h.width}},a.a.createElement(ME,{question:l,onQuestionAnswered:d}))),a.a.createElement("canvas",{className:NE.a.draggingSprite,height:0,ref:t,width:0})),o?a.a.createElement(hi.a,{className:NE.a.colorPickerBackground,onClick:u}):null)};GE.propTypes={canvas:o.a.instanceOf(Element).isRequired,colorInfo:Jd.propTypes.colorInfo,dragRef:o.a.func,isColorPicking:o.a.bool,isFullScreen:o.a.bool.isRequired,isStarted:o.a.bool,micIndicator:o.a.bool,onDeactivateColorPicker:o.a.func,onDoubleClick:o.a.func,onQuestionAnswered:o.a.func,question:o.a.string,stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,useEditorDragStyle:o.a.bool},GE.defaultProps={dragRef:function(){}};var HE=GE,LE=i(140);function PE(A){"@babel/helpers - typeof";return(PE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var xE=["vm","onActivateColorPicker"];function _E(){return(_E=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function jE(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function JE(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var i=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null==i)return;var t,o,n=[],a=!0,r=!1;try{for(i=i.call(A);!(a=(t=i.next()).done)&&(n.push(t.value),!e||n.length!==e);a=!0);}catch(A){r=!0,o=A}finally{try{a||null==i.return||i.return()}finally{if(r)throw o}}return n}(A,e)||KE(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zE(A){return function(A){if(Array.isArray(A))return WE(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||KE(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function KE(A,e){if(A){if("string"==typeof A)return WE(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);return"Object"===i&&A.constructor&&(i=A.constructor.name),"Map"===i||"Set"===i?Array.from(A):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?WE(A,e):void 0}}function WE(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function VE(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function XE(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function ZE(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function qE(A,e){return(qE=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function $E(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=eh(A);if(e){var o=eh(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===PE(e)||"function"==typeof e))return e;return Ah(A)}(this,i)}}function Ah(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function eh(A){return(eh=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ih=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&qE(A,e)}(i,a.a.Component);var e=$E(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Ah(t),["attachMouseEvents","cancelMouseDownTimeout","detachMouseEvents","handleDoubleClick","handleQuestionAnswered","onMouseUp","onMouseMove","onMouseDown","onStartDrag","onStopDrag","onWheel","updateRect","questionListener","setDragCanvas","clearDragCanvas","drawDragCanvas","positionDragCanvas"]),t.state={mouseDownTimeoutId:null,mouseDownPosition:null,isDragging:!1,dragOffset:null,dragId:null,colorInfo:null,question:null},t.props.vm.renderer?(t.renderer=t.props.vm.renderer,t.canvas=t.renderer.canvas):(t.canvas=document.createElement("canvas"),t.renderer=new di.a(t.canvas),t.props.vm.attachRenderer(t.renderer),t.props.vm.setVideoProvider(new pd),t.props.vm.renderer.draw()),t.props.vm.attachV2BitmapAdapter(new mi.BitmapAdapter),t}return function(A,e,i){e&&ZE(A.prototype,e),i&&ZE(A,i)}(i,[{key:"componentDidMount",value:function(){this.attachRectEvents(),this.attachMouseEvents(this.canvas),this.updateRect(),this.props.vm.runtime.addListener("QUESTION",this.questionListener)}},{key:"shouldComponentUpdate",value:function(A,e){return this.props.stageSize!==A.stageSize||this.props.isColorPicking!==A.isColorPicking||this.state.colorInfo!==e.colorInfo||this.props.isFullScreen!==A.isFullScreen||this.state.question!==e.question||this.props.micIndicator!==A.micIndicator||this.props.isStarted!==A.isStarted}},{key:"componentDidUpdate",value:function(A){this.props.isColorPicking&&!A.isColorPicking?this.startColorPickingLoop():!this.props.isColorPicking&&A.isColorPicking&&this.stopColorPickingLoop(),this.updateRect(),this.renderer.resize(this.rect.width,this.rect.height)}},{key:"componentWillUnmount",value:function(){this.detachMouseEvents(this.canvas),this.detachRectEvents(),this.stopColorPickingLoop(),this.props.vm.runtime.removeListener("QUESTION",this.questionListener)}},{key:"questionListener",value:function(A){this.setState({question:A})}},{key:"handleQuestionAnswered",value:function(A){var e=this;this.setState({question:null},function(){e.props.vm.runtime.emit("ANSWER",A)})}},{key:"startColorPickingLoop",value:function(){var A=this;this.intervalId=setInterval(function(){"number"==typeof A.pickX&&A.setState({colorInfo:A.getColorInfo(A.pickX,A.pickY)})},30)}},{key:"stopColorPickingLoop",value:function(){clearInterval(this.intervalId)}},{key:"attachMouseEvents",value:function(A){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("touchmove",this.onMouseMove),document.addEventListener("touchend",this.onMouseUp),A.addEventListener("mousedown",this.onMouseDown),A.addEventListener("touchstart",this.onMouseDown),A.addEventListener("wheel",this.onWheel)}},{key:"detachMouseEvents",value:function(A){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("touchmove",this.onMouseMove),document.removeEventListener("touchend",this.onMouseUp),A.removeEventListener("mousedown",this.onMouseDown),A.removeEventListener("touchstart",this.onMouseDown),A.removeEventListener("wheel",this.onWheel)}},{key:"attachRectEvents",value:function(){window.addEventListener("resize",this.updateRect),window.addEventListener("scroll",this.updateRect)}},{key:"detachRectEvents",value:function(){window.removeEventListener("resize",this.updateRect),window.removeEventListener("scroll",this.updateRect)}},{key:"updateRect",value:function(){this.rect=this.canvas.getBoundingClientRect()}},{key:"getScratchCoords",value:function(A,e){var i=this.renderer.getNativeSize();return[i[0]/this.rect.width*(A-this.rect.width/2),i[1]/this.rect.height*(e-this.rect.height/2)]}},{key:"getColorInfo",value:function(A,e){return function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?VE(Object(i),!0).forEach(function(e){XE(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):VE(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({x:A,y:e},this.renderer.extractColor(A,e,20))}},{key:"handleDoubleClick",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=[i-this.rect.left,t-this.rect.top],n=this.renderer.pick(o[0],o[1]);if(null!==n){var a=this.props.vm.getTargetIdForDrawableId(n);null!==a&&this.props.vm.setEditingTarget(a)}}},{key:"onMouseMove",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=[i-this.rect.left,t-this.rect.top];(this.props.isColorPicking&&(this.pickX=o[0],this.pickY=o[1]),this.state.mouseDown&&!this.state.isDragging)&&(Math.sqrt(Math.pow(o[0]-this.state.mouseDownPosition[0],2)+Math.pow(o[1]-this.state.mouseDownPosition[1],2))>3&&(this.cancelMouseDownTimeout(),this.onStartDrag.apply(this,zE(this.state.mouseDownPosition))));if(this.state.mouseDown&&this.state.isDragging)if(this.props.useEditorDragStyle)this.positionDragCanvas(o[0],o[1]);else{var n=this.getScratchCoords(o[0],o[1]);this.props.vm.postSpriteInfo({x:n[0]+this.state.dragOffset[0],y:-(n[1]+this.state.dragOffset[1]),force:!0})}var a={x:o[0],y:o[1],canvasWidth:this.rect.width,canvasHeight:this.rect.height};this.props.vm.postIOData("mouse",a)}},{key:"onMouseUp",value:function(A){var e=Ii(A),i=e.x,t=e.y,o=[i-this.rect.left,t-this.rect.top];this.cancelMouseDownTimeout(),this.setState({mouseDown:!1,mouseDownPosition:null});var n={isDown:!1,x:i-this.rect.left,y:t-this.rect.top,canvasWidth:this.rect.width,canvasHeight:this.rect.height,wasDragged:this.state.isDragging};if(this.state.isDragging&&this.onStopDrag(o[0],o[1]),this.props.vm.postIOData("mouse",n),this.props.isColorPicking&&o[0]>0&&o[0]<this.rect.width&&o[1]>0&&o[1]<this.rect.height){var a=this.state.colorInfo.color,r=a.r,s=a.g,g=a.b,l=function(A){var e=A.toString(16);return 1===e.length?"0".concat(e):e},c="#".concat(l(r)).concat(l(s)).concat(l(g));this.props.onDeactivateColorPicker(c),this.setState({colorInfo:null}),this.pickX=null,this.pickY=null}}},{key:"onMouseDown",value:function(A){this.updateRect();var e=Ii(A),i=e.x,t=e.y,o=[i-this.rect.left,t-this.rect.top];if(this.props.isColorPicking)this.pickX=o[0],this.pickY=o[1],this.setState({colorInfo:this.getColorInfo(this.pickX,this.pickY)});else{(0===A.button||window.TouchEvent&&A instanceof TouchEvent)&&this.setState({mouseDown:!0,mouseDownPosition:o,mouseDownTimeoutId:setTimeout(this.onStartDrag.bind(this,o[0],o[1]),400)});var n={isDown:!0,x:o[0],y:o[1],canvasWidth:this.rect.width,canvasHeight:this.rect.height};this.props.vm.postIOData("mouse",n),A.preventDefault&&(A.preventDefault(),document.activeElement&&document.activeElement.blur&&document.activeElement.blur())}}},{key:"onWheel",value:function(A){var e={deltaX:A.deltaX,deltaY:A.deltaY};this.props.vm.postIOData("mouseWheel",e)}},{key:"cancelMouseDownTimeout",value:function(){null!==this.state.mouseDownTimeoutId&&clearTimeout(this.state.mouseDownTimeoutId),this.setState({mouseDownTimeoutId:null})}},{key:"drawDragCanvas",value:function(A,e,i){var t=A.imageData,o=A.x,n=A.y,a=A.width,r=A.height;this.dragCanvas.width=t.width,this.dragCanvas.height=t.height,this.dragCanvas.style.width="".concat(a,"px"),this.dragCanvas.style.height="".concat(r,"px"),this.dragCanvas.getContext("2d").putImageData(t,0,0),this.dragCanvas.style.left="".concat(o-e,"px"),this.dragCanvas.style.top="".concat(n-i,"px"),this.dragCanvas.style.display="block"}},{key:"clearDragCanvas",value:function(){this.dragCanvas.width=this.dragCanvas.height=0,this.dragCanvas.style.display="none"}},{key:"positionDragCanvas",value:function(A,e){this.dragCanvas.style.transform="translate(".concat(A,"px, ").concat(e,"px)")}},{key:"onStartDrag",value:function(A,e){if(!this.state.dragId){var i=this.renderer.pick(A,e);if(null!==i){var t=this.props.vm.getTargetIdForDrawableId(i);if(null!==t){var o=this.props.vm.runtime.getTargetById(t);if(this.props.useEditorDragStyle||o.draggable){o.goToFront();var n=JE(this.getScratchCoords(A,e),2),a=n[0],r=n[1],s=o.x-a,g=-(o.y+r);if(this.props.vm.startDrag(t),this.setState({isDragging:!0,dragId:t,dragOffset:[s,g]}),this.props.useEditorDragStyle){var l=this.renderer.extractDrawableScreenSpace(i);this.drawDragCanvas(l,A,e),this.positionDragCanvas(A,e),this.props.vm.postSpriteInfo({visible:!1}),this.props.vm.renderer.draw()}}}}}}},{key:"onStopDrag",value:function(A,e){var i=this,t=this.state.dragId,o=function(){i.props.vm.stopDrag(t),i.setState({isDragging:!1,dragOffset:null,dragId:null})};if(this.props.useEditorDragStyle){var n={visible:!0};if(A>0&&A<this.rect.width&&e>0&&e<this.rect.height){var a=this.getScratchCoords(A,e);n.x=a[0]+this.state.dragOffset[0],n.y=-(a[1]+this.state.dragOffset[1]),n.force=!0}this.props.vm.postSpriteInfo(n),this.clearDragCanvas(),o(),this.props.vm.renderer.draw()}else o()}},{key:"setDragCanvas",value:function(A){this.dragCanvas=A}},{key:"render",value:function(){var A=this.props,e=(A.vm,A.onActivateColorPicker,jE(A,xE));return a.a.createElement(HE,_E({canvas:this.canvas,colorInfo:this.state.colorInfo,dragRef:this.setDragCanvas,question:this.state.question,onDoubleClick:this.handleDoubleClick,onQuestionAnswered:this.handleQuestionAnswered},e))}}]),i}();ih.propTypes={isColorPicking:o.a.bool,isFullScreen:o.a.bool.isRequired,isStarted:o.a.bool,micIndicator:o.a.bool,onActivateColorPicker:o.a.func,onDeactivateColorPicker:o.a.func,stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,useEditorDragStyle:o.a.bool,vm:o.a.instanceOf(u.a).isRequired},ih.defaultProps={useEditorDragStyle:!0};var th=Object(s.b)(function(A){return{isColorPicking:A.scratchGui.colorPicker.active,isFullScreen:A.scratchGui.mode.isFullScreen,isStarted:A.scratchGui.vmStatus.started,micIndicator:A.scratchGui.micIndicator,useEditorDragStyle:!(A.scratchGui.mode.isFullScreen||A.scratchGui.mode.isPlayerOnly)}},function(A){return{onActivateColorPicker:function(){return A(Object(LE.a)())},onDeactivateColorPicker:function(e){return A(Object(LE.c)(e))}}})(ih),oh=i(90),nh=i.n(oh),ah=i(816),rh=i.n(ah),sh=i(817),gh=i.n(sh),lh=i(818),ch=i.n(lh);function uh(A){"@babel/helpers - typeof";return(uh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Bh(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function dh(A,e){return(dh=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Eh(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=hh(A);if(e){var o=hh(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===uh(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function hh(A){return(hh=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Ch=[{message:a.a.createElement(B.a,{defaultMessage:"Creating blocks …",id:"gui.loader.message1"}),weight:50},{message:a.a.createElement(B.a,{defaultMessage:"Loading sprites …",id:"gui.loader.message2"}),weight:50},{message:a.a.createElement(B.a,{defaultMessage:"Loading sounds …",id:"gui.loader.message3"}),weight:50},{message:a.a.createElement(B.a,{defaultMessage:"Loading extensions …",id:"gui.loader.message4"}),weight:50},{message:a.a.createElement(B.a,{defaultMessage:"Creating blocks …",id:"gui.loader.message1"}),weight:20},{message:a.a.createElement(B.a,{defaultMessage:"Herding cats …",id:"gui.loader.message5"}),weight:1},{message:a.a.createElement(B.a,{defaultMessage:"Transmitting nanos …",id:"gui.loader.message6"}),weight:1},{message:a.a.createElement(B.a,{defaultMessage:"Inflating gobos …",id:"gui.loader.message7"}),weight:1},{message:a.a.createElement(B.a,{defaultMessage:"Preparing emojis …",id:"gui.loader.message8"}),weight:1}],wh={"gui.loader.headline":a.a.createElement(B.a,{defaultMessage:"Loading Project",id:"gui.loader.headline"}),"gui.loader.creating":a.a.createElement(B.a,{defaultMessage:"Creating Project",id:"gui.loader.creating"})},mh=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&dh(A,e)}(i,a.a.Component);var e=Eh(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={messageNumber:t.chooseRandomMessage()},t}return function(A,e,i){e&&Bh(A.prototype,e),i&&Bh(A,i)}(i,[{key:"componentDidMount",value:function(){var A=this;this.intervalId=setInterval(function(){A.setState({messageNumber:A.chooseRandomMessage()})},5e3)}},{key:"componentWillUnmount",value:function(){clearInterval(this.intervalId)}},{key:"chooseRandomMessage",value:function(){for(var A,e=Ch.reduce(function(A,e){return A+e.weight},0)*Math.random(),i=0;i<Ch.length;i++)if((e-=Ch[i].weight)<=0){A=i;break}return A}},{key:"render",value:function(){return a.a.createElement("div",{className:Le()(nh.a.background,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},nh.a.fullscreen,this.props.isFullScreen))},a.a.createElement("div",{className:nh.a.container},a.a.createElement("div",{className:nh.a.blockAnimation},a.a.createElement("img",{className:nh.a.topBlock,src:rh.a}),a.a.createElement("img",{className:nh.a.middleBlock,src:gh.a}),a.a.createElement("img",{className:nh.a.bottomBlock,src:ch.a})),a.a.createElement("div",{className:nh.a.title},wh[this.props.messageId]),a.a.createElement("div",{className:nh.a.messageContainerOuter},a.a.createElement("div",{className:nh.a.messageContainerInner,style:{transform:"translate(0, -".concat(25*this.state.messageNumber,"px)")}},Ch.map(function(A,e){return a.a.createElement("div",{className:nh.a.message,key:e},A.message)})))))}}]),i}();mh.propTypes={isFullScreen:o.a.bool,messageId:o.a.string},mh.defaultProps={isFullScreen:!1,messageId:"gui.loader.headline"};var ph=mh,Ih=i(226),fh=i.n(Ih);var Qh=function(A){var e=A.isFullScreen,i=A.isRtl,t=A.isRendererSupported,o=A.loading,n=A.stageSize,r=A.vm;return a.a.createElement(hi.a,{className:Le()(fh.a.stageWrapper,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},fh.a.fullScreen,e)),dir:i?"rtl":"ltr"},a.a.createElement(hi.a,{className:fh.a.stageMenuWrapper},a.a.createElement(Ed,{stageSize:n,vm:r})),a.a.createElement(hi.a,{className:fh.a.stageCanvasWrapper},t?a.a.createElement(th,{stageSize:n,vm:r}):null),o?a.a.createElement(ph,{isFullScreen:e}):null)};Qh.propTypes={isFullScreen:o.a.bool,isRendererSupported:o.a.bool.isRequired,isRtl:o.a.bool.isRequired,loading:o.a.bool,stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,vm:o.a.instanceOf(u.a).isRequired};var Dh=Qh,Mh=function(A){return a.a.createElement(Dh,A)};Mh.propTypes={isRendererSupported:o.a.bool.isRequired,stageSize:o.a.oneOf(Object.keys(Pa.c)).isRequired,vm:o.a.instanceOf(u.a).isRequired};var bh=Mh;function yh(A){"@babel/helpers - typeof";return(yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Th(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function kh(A,e){return(kh=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Fh(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Sh(A);if(e){var o=Sh(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===yh(e)||"function"==typeof e))return e;return vh(A)}(this,i)}}function vh(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Sh(A){return(Sh=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Nh=Object(B.d)({libraryTitle:{id:"gui.costumeLibrary.chooseACostume",defaultMessage:"Choose a Costume"}}),Rh=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&kh(A,e)}(i,a.a.PureComponent);var e=Fh(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(vh(t),["handleItemSelected"]),t}return function(A,e,i){e&&Th(A.prototype,e),i&&Th(A,i)}(i,[{key:"handleItemSelected",value:function(A){var e={name:A.name,rotationCenterX:A.rotationCenterX,rotationCenterY:A.rotationCenterY,bitmapResolution:A.bitmapResolution,skinId:null};this.props.vm.addCostumeFromLibrary(A.md5ext,e)}},{key:"render",value:function(){return a.a.createElement(Mn.a,{data:sn,id:"costumeLibrary",tags:Dn,title:this.props.intl.formatMessage(Nh.libraryTitle),onItemSelected:this.handleItemSelected,onRequestClose:this.props.onRequestClose})}}]),i}();Rh.propTypes={intl:B.f.isRequired,onRequestClose:o.a.func,vm:o.a.instanceOf(u.a).isRequired};var Oh=Object(B.e)(Rh),Yh=[{tag:"fantasy",intlLabel:Qn.fantasy},{tag:"music",intlLabel:Qn.music},{tag:"sports",intlLabel:Qn.sports},{tag:"outdoors",intlLabel:Qn.outdoors},{tag:"indoors",intlLabel:Qn.indoors},{tag:"space",intlLabel:Qn.space},{tag:"underwater",intlLabel:Qn.underwater},{tag:"patterns",intlLabel:Qn.patterns}];function Uh(A){"@babel/helpers - typeof";return(Uh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Gh(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Hh(A,e){return(Hh=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Lh(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=xh(A);if(e){var o=xh(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Uh(e)||"function"==typeof e))return e;return Ph(A)}(this,i)}}function Ph(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function xh(A){return(xh=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var _h=Object(B.d)({libraryTitle:{id:"gui.costumeLibrary.chooseABackdrop",defaultMessage:"Choose a Backdrop"}}),jh=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Hh(A,e)}(i,a.a.Component);var e=Lh(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Ph(t),["handleItemSelect"]),t}return function(A,e,i){e&&Gh(A.prototype,e),i&&Gh(A,i)}(i,[{key:"handleItemSelect",value:function(A){var e={name:A.name,rotationCenterX:A.rotationCenterX,rotationCenterY:A.rotationCenterY,bitmapResolution:A.bitmapResolution,skinId:null};this.props.vm.addBackdrop(A.md5ext,e)}},{key:"render",value:function(){return a.a.createElement(Mn.a,{data:gn,id:"backdropLibrary",tags:Yh,title:this.props.intl.formatMessage(_h.libraryTitle),onItemSelected:this.handleItemSelect,onRequestClose:this.props.onRequestClose})}}]),i}();jh.propTypes={intl:B.f.isRequired,onRequestClose:o.a.func,vm:o.a.instanceOf(u.a).isRequired};var Jh=Object(B.e)(jh),zh=i(819),Kh=i.n(zh),Wh=function(A){return a.a.createElement("img",{className:Kh.a.spriteImage,src:A.costumeURL})};Wh.propTypes={costumeURL:o.a.string};var Vh=Wh;function Xh(A){"@babel/helpers - typeof";return(Xh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Zh(){return(Zh=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function qh(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function $h(A,e){return($h=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function AC(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=iC(A);if(e){var o=iC(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Xh(e)||"function"==typeof e))return e;return eC(A)}(this,i)}}function eC(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function iC(A){return(iC=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var tC=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&$h(A,e)}(i,a.a.Component);var e=AC(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(eC(t),["getCostumeData"]),t}return function(A,e,i){e&&qh(A.prototype,e),i&&qh(A,i)}(i,[{key:"getCostumeData",value:function(){return this.props.asset?pi(this.props.asset):null}},{key:"render",value:function(){var A=m()(this.props,["asset","vm"]);return a.a.createElement(Vh,Zh({costumeURL:this.getCostumeData()},A))}}]),i}();tC.propTypes={asset:o.a.instanceOf(eA.a.Asset),vm:o.a.instanceOf(u.a).isRequired};var oC=Object(s.b)(function(A){var e,i=A.scratchGui.targets,t=i.editingTarget;t&&(i.stage.id===t?e=i.stage.costume.asset:i.sprites.hasOwnProperty(t)&&(e=i.sprites[t].costume.asset));return{vm:A.scratchGui.vm,asset:e}})(br("asset",500)(tC)),nC=i(94),aC=i(820),rC=i.n(aC),sC=["el","en","bg","ja","zh-cn","zh-tw","de","nl","cs","ru","es","fr"],gC=Object.keys(Nr.a).filter(function(A){return!sC.includes(A)}),lC=function(A){var e=A.currentLocale,i=A.label,t=A.onChange;return a.a.createElement("select",{"aria-label":i,className:rC.a.languageSelect,value:e,onChange:t},Object.keys(Nr.a).filter(function(A){return!gC.includes(A)}).map(function(A){return a.a.createElement("option",{key:A,value:A},Nr.a[A].name)}))};lC.propTypes={currentLocale:o.a.string,label:o.a.string,onChange:o.a.func};var cC=lC;function uC(A){"@babel/helpers - typeof";return(uC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var BC=["onChangeLanguage","messagesByLocale","children"];function dC(){return(dC=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function EC(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function hC(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function CC(A,e){return(CC=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function wC(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=pC(A);if(e){var o=pC(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===uC(e)||"function"==typeof e))return e;return mC(A)}(this,i)}}function mC(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function pC(A){return(pC=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var IC=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&CC(A,e)}(i,a.a.Component);var e=wC(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(mC(t),["handleChange"]),document.documentElement.lang=A.currentLocale,t}return function(A,e,i){e&&hC(A.prototype,e),i&&hC(A,i)}(i,[{key:"handleChange",value:function(A){var e=A.target.value;this.props.messagesByLocale[e]&&(this.props.onChangeLanguage(e),document.documentElement.lang=e)}},{key:"render",value:function(){var A=this.props,e=(A.onChangeLanguage,A.messagesByLocale,A.children),i=EC(A,BC);return a.a.createElement(cC,dC({onChange:this.handleChange},i),e)}}]),i}();IC.propTypes={children:o.a.node,currentLocale:o.a.string.isRequired,messagesByLocale:o.a.object,onChangeLanguage:o.a.func.isRequired};var fC=Object(s.b)(function(A){return{currentLocale:A.locales.locale,messagesByLocale:A.locales.messagesByLocale}},function(A){return{onChangeLanguage:function(e){A(Object(nC.d)(e)),A(Object(_.e)())}}})(IC),QC=i(821),DC=i.n(QC),MC=i(121),bC=i.n(MC),yC=i(822),TC=i.n(yC),kC=(i(83),i(133));Object(B.d)({mode:{id:"gui.menuBar.modeMenu",defaultMessage:"Mode"},normal:{id:"gui.menuBar.normalMode",defaultMessage:"Normal mode"},cat:{id:"gui.menuBar.caturdayMode",defaultMessage:"Caturday mode"},"90s":{id:"gui.menuBar.1990sMode",defaultMessage:"90s mode"},old:{id:"gui.menuBar.oldTimeyMode",defaultMessage:"Old timey mode"},prehistoric:{id:"gui.menuBar.prehistoricMode",defaultMessage:"Prehistoric mode"}}),nC.a,kC.default,ko.ScratchPaintReducer;function FC(A){"@babel/helpers - typeof";return(FC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var vC=["projectChanged"];function SC(){return(SC=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function NC(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function RC(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function OC(A,e){return(OC=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function YC(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=GC(A);if(e){var o=GC(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===FC(e)||"function"==typeof e))return e;return UC(A)}(this,i)}}function UC(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function GC(A){return(GC=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var HC=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&OC(A,e)}(t,a.a.PureComponent);var i=YC(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(UC(e),["confirmReadyToReplaceProject","shouldSaveBeforeTransition"]),e}return function(A,e,i){e&&RC(A.prototype,e),i&&RC(A,i)}(t,[{key:"confirmReadyToReplaceProject",value:function(A){var e=!0;return this.props.projectChanged&&!this.props.canCreateNew&&(e=this.props.confirmWithMessage(A)),e}},{key:"shouldSaveBeforeTransition",value:function(){return this.props.canSave&&this.props.projectChanged}},{key:"render",value:function(){var e=this.props,i=(e.projectChanged,NC(e,vC));return a.a.createElement(A,SC({confirmReadyToReplaceProject:this.confirmReadyToReplaceProject,shouldSaveBeforeTransition:this.shouldSaveBeforeTransition},i))}}]),t}();e.propTypes={canCreateNew:o.a.bool,canSave:o.a.bool,confirmWithMessage:o.a.func,projectChanged:o.a.bool},e.defaultProps={confirmWithMessage:function(A){return confirm(A)}};return Object(s.b)(function(A){return{projectChanged:A.scratchGui.projectChanged}},function(){return{}},function(A,e,i){return Object.assign({},A,e,i)})(e)};function LC(A){"@babel/helpers - typeof";return(LC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function PC(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function xC(A,e){return(xC=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function _C(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=JC(A);if(e){var o=JC(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===LC(e)||"function"==typeof e))return e;return jC(A)}(this,i)}}function jC(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function JC(A){return(JC=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var zC=Object(B.d)({language:{id:"gui.menuBar.LanguageSelector",defaultMessage:"language selector"}}),KC=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&xC(A,e)}(i,a.a.Component);var e=_C(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(jC(t),["handleLanguageMouseUp"]),t}return function(A,e,i){e&&PC(A.prototype,e),i&&PC(A,i)}(i,[{key:"handleLanguageMouseUp",value:function(A){this.props.languageMenuOpen||this.props.onClickLanguage(A)}},{key:"render",value:function(){return a.a.createElement(hi.a,{className:Le()(this.props.className,bC.a.menuBar)},a.a.createElement("div",{className:bC.a.mainMenu},a.a.createElement("div",{className:bC.a.fileGroup},this.props.canChangeLanguage&&a.a.createElement("div",{className:Le()(bC.a.menuBarItem,bC.a.hoverable,bC.a.languageMenu)},a.a.createElement("div",null,a.a.createElement("img",{className:bC.a.languageIcon,src:DC.a}),a.a.createElement("img",{className:bC.a.languageCaret,src:TC.a})),a.a.createElement(fC,{label:this.props.intl.formatMessage(zC.language)})))))}}]),i}();fC.propTypes={accountMenuOpen:o.a.bool,authorId:o.a.oneOfType([o.a.string,o.a.bool]),authorThumbnailUrl:o.a.string,authorUsername:o.a.oneOfType([o.a.string,o.a.bool]),autoUpdateProject:o.a.func,canChangeLanguage:o.a.bool,canCreateCopy:o.a.bool,canCreateNew:o.a.bool,canEditTitle:o.a.bool,canManageFiles:o.a.bool,canRemix:o.a.bool,canSave:o.a.bool,canShare:o.a.bool,className:o.a.string,confirmReadyToReplaceProject:o.a.func,editMenuOpen:o.a.bool,enableCommunity:o.a.bool,fileMenuOpen:o.a.bool,intl:B.f,isRtl:o.a.bool,isShared:o.a.bool,isShowingProject:o.a.bool,isUpdating:o.a.bool,languageMenuOpen:o.a.bool,loginMenuOpen:o.a.bool,logo:o.a.string,onClickAccount:o.a.func,onClickEdit:o.a.func,onClickFile:o.a.func,onClickLanguage:o.a.func,onClickLogin:o.a.func,onClickLogo:o.a.func,onClickNew:o.a.func,onClickRemix:o.a.func,onClickSave:o.a.func,onClickSaveAsCopy:o.a.func,onLogOut:o.a.func,onOpenRegistration:o.a.func,onOpenTipLibrary:o.a.func,onProjectTelemetryEvent:o.a.func,onRequestCloseAccount:o.a.func,onRequestCloseEdit:o.a.func,onRequestCloseFile:o.a.func,onRequestCloseLanguage:o.a.func,onRequestCloseLogin:o.a.func,onSeeCommunity:o.a.func,onShare:o.a.func,onToggleLoginOpen:o.a.func,projectTitle:o.a.string,renderLogin:o.a.func,sessionExists:o.a.bool,shouldSaveBeforeTransition:o.a.func,showComingSoon:o.a.bool,userOwnsProject:o.a.bool,username:o.a.string};var WC=Object(r.d)(B.e,HC,Object(s.b)(function(A,e){var i=A.scratchGui.projectState.loadingState,t=A.session&&A.session.session&&A.session.session.user;return{accountMenuOpen:Object(_.a)(A),fileMenuOpen:Object(_.i)(A),editMenuOpen:Object(_.h)(A),isRtl:A.locales.isRtl,isUpdating:Object(E.v)(i),isShowingProject:Object(E.s)(i),languageMenuOpen:Object(_.j)(A),locale:A.locales.locale,loginMenuOpen:Object(_.k)(A),projectTitle:A.scratchGui.projectTitle,sessionExists:A.session&&void 0!==A.session.session,username:t?t.username:null,userOwnsProject:e.authorUsername&&t&&e.authorUsername===t.username,vm:A.scratchGui.vm}},function(A){return{autoUpdateProject:function(){return A(Object(E.b)())},onOpenTipLibrary:function(){return A(Object(C.u)())},onClickAccount:function(){return A(Object(_.m)())},onRequestCloseAccount:function(){return A(Object(_.b)())},onClickFile:function(){return A(Object(_.o)())},onRequestCloseFile:function(){return A(Object(_.d)())},onClickEdit:function(){return A(Object(_.n)())},onRequestCloseEdit:function(){return A(Object(_.c)())},onClickLanguage:function(){return A(Object(_.p)())},onRequestCloseLanguage:function(){return A(Object(_.e)())},onClickLogin:function(){return A(Object(_.q)())},onRequestCloseLogin:function(){return A(Object(_.f)())},onClickNew:function(e){return A(Object(E.C)(e))},onClickRemix:function(){return A(Object(E.B)())},onClickSave:function(){return A(Object(E.w)())},onClickSaveAsCopy:function(){return A(Object(E.E)())},onSeeCommunity:function(){return A(Object(jB.d)(!0))}}}))(KC),VC=i(107),XC=i.n(VC),ZC=["intl"];function qC(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function $C(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function Aw(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var ew=Object(B.d)({label:{id:"gui.webglModal.label",defaultMessage:"Your Browser Does Not Support WebGL"}}),iw=function(A){var e=A.intl,i=Aw(A,ZC);return a.a.createElement(l.a,{isOpen:!0,className:XC.a.modalContent,contentLabel:e.formatMessage(function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?qC(Object(i),!0).forEach(function(e){$C(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):qC(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({},ew.label)),overlayClassName:XC.a.modalOverlay,onRequestClose:i.onBack},a.a.createElement("div",{dir:i.isRtl?"rtl":"ltr"},a.a.createElement(hi.a,{className:XC.a.illustration}),a.a.createElement(hi.a,{className:XC.a.body},a.a.createElement("h2",null,a.a.createElement(B.a,ew.label)),a.a.createElement("p",null,a.a.createElement(B.a,{defaultMessage:"Unfortunately it looks like your browser or computer {webGlLink}. This technology is needed for Scratch 3.0 to run.",id:"gui.webglModal.description",values:{webGlLink:a.a.createElement("a",{className:XC.a.faqLink,href:"https://get.webgl.org/"},a.a.createElement(B.a,{defaultMessage:"does not support WebGL",id:"gui.webglModal.webgllink"}))}})),a.a.createElement(hi.a,{className:XC.a.buttonRow},a.a.createElement("button",{className:XC.a.backButton,onClick:i.onBack},a.a.createElement(B.a,{defaultMessage:"Back",id:"gui.webglModal.back"}))),a.a.createElement("div",{className:XC.a.faqLinkText},a.a.createElement(B.a,{defaultMessage:"To learn more, go to the {previewFaqLink}.",id:"gui.webglModal.previewfaq",values:{previewFaqLink:a.a.createElement("a",{className:XC.a.faqLink,href:"//scratch.mit.edu/3faq"},a.a.createElement(B.a,{defaultMessage:"FAQ",id:"gui.webglModal.previewfaqlinktext"}))}})))))};iw.propTypes={intl:B.f.isRequired,isRtl:o.a.bool,onBack:o.a.func.isRequired};var tw=Object(B.e)(iw);function ow(A){"@babel/helpers - typeof";return(ow="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function nw(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function aw(A,e){return(aw=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function rw(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=sw(A);if(e){var o=sw(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===ow(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function sw(A){return(sw=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var gw=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&aw(A,e)}(i,a.a.Component);var e=rw(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&nw(A.prototype,e),i&&nw(A,i)}(i,[{key:"handleCancel",value:function(){window.history.back()}},{key:"render",value:function(){return a.a.createElement(tw,{isRtl:this.props.isRtl,onBack:this.handleCancel})}}]),i}();gw.propTypes={isRtl:o.a.bool};var lw,cw=gw,uw=[{tag:"animation",intlLabel:Qn.animation},{tag:"art",intlLabel:Qn.art},{tag:"music",intlLabel:Qn.music},{tag:"games",intlLabel:Qn.games},{tag:"stories",intlLabel:Qn.stories}],Bw=function(){return lw},dw=function(){return!Bw()};function Ew(A){"@babel/helpers - typeof";return(Ew="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function hw(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Cw(A,e){return(Cw=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ww(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=pw(A);if(e){var o=pw(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Ew(e)||"function"==typeof e))return e;return mw(A)}(this,i)}}function mw(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function pw(A){return(pw=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Iw=Object(B.d)({tipsLibraryTitle:{id:"gui.tipsLibrary.tutorials",defaultMessage:"Choose a Tutorial"}}),fw=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Cw(A,e)}(i,a.a.PureComponent);var e=ww(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(mw(t),["handleItemSelect"]),t}return function(A,e,i){e&&hw(A.prototype,e),i&&hw(A,i)}(i,[{key:"handleItemSelect",value:function(A){if(LA.a.event({category:"library",action:"Select How-to",label:A.id}),A.requiredProjectId&&A.requiredProjectId!==this.props.projectId){var e="/projects/".concat(A.requiredProjectId,"/editor?tutorial=").concat(A.urlId);return window.open(window.location.origin+e,"_blank")}this.props.onActivateDeck(A.id)}},{key:"render",value:function(){var A=Object.keys(HA.a).filter(function(A){if(dw())return!0;var e=HA.a[A];return!e.hasOwnProperty("requiredProjectId")&&0!==e.steps.filter(function(A){return A.title}).length}).map(function(A){return{rawURL:HA.a[A].img,id:A,name:HA.a[A].name,featured:!0,tags:HA.a[A].tags,urlId:HA.a[A].urlId,requiredProjectId:HA.a[A].requiredProjectId,hidden:HA.a[A].hidden||!1}});return this.props.visible?a.a.createElement(Mn.a,{filterable:!0,data:A,id:"tipsLibrary",tags:uw,title:this.props.intl.formatMessage(Iw.tipsLibraryTitle),visible:this.props.visible,onItemSelected:this.handleItemSelect,onRequestClose:this.props.onRequestClose}):null}}]),i}();fw.propTypes={intl:B.f.isRequired,onActivateDeck:o.a.func.isRequired,onRequestClose:o.a.func,projectId:o.a.oneOfType([o.a.string,o.a.number]),visible:o.a.bool};var Qw=Object(B.e)(Object(s.b)(function(A){return{visible:A.scratchGui.modals.tipsLibrary,projectId:A.scratchGui.projectState.projectId}},function(A){return{onActivateDeck:function(e){return A(Object(xA.a)(e))},onRequestClose:function(){return A(Object(C.j)())}}})(fw)),Dw=i(286),Mw=i.n(Dw),bw=i(25),yw=i.n(bw),Tw=i(823),kw=i.n(Tw),Fw=i(824),vw=i.n(Fw),Sw=i(378),Nw=i.n(Sw),Rw=i(379),Ow=i.n(Rw),Yw=i(825),Uw=i.n(Yw),Gw=i(826),Hw=i.n(Gw),Lw={"intro-move-sayhello":{en:"rpjvs3v9gj",it:"2im6c1f9kn",pt:"ngdfp8xg4x","pt-br":"ngdfp8xg4x",ja:"v2c2f3y2sc","ja-Hira":"v2c2f3y2sc",es:"htk2m9o65l","es-419":"htk2m9o65l",sw:"fd4bn2nli5",fr:"dt015ouls8",am:"e06wlsebqy",zu:"st2x0emdx7",uk:"1ith4m4f8u",ar:"s53zuo93o7",ca:"4tb26s73x7","zh-cn":"9i01bspmyx","zh-tw":"hr374tlx9t",da:"z9bns5dgiy",nl:"9wleha9s1e",de:"9lljmutx8m",ht:"7pyjz25tvf",he:"5rusa2qb6q",id:"zpzl7nqcyf",km:"zhq0596ewo",ko:"9u7cr4pwsc",ku:"jzwwqih2im",fa:"c15wlv18tt",pl:"ijhn36nicy",ru:"437odiewml",th:"zy7suscqn2",tr:"p3g8ek3cuh",vi:"fetjky76s4"},"intro-getting-started-ASL":{en:"i2g46ikddf"},"animate-a-name":{en:"pyur30ho05",ar:"bz5vgtroxs",fr:"lwb0ro4oly",it:"c8zcrk6w09",pt:"t49tfrukyf","pt-br":"t49tfrukyf",ja:"xrmgno02th","ja-Hira":"xrmgno02th"},"Make-Music":{en:"ir0j8ljsgm",ar:"gqlmfqx1g4",fr:"t4dw6fn2an",it:"8nm1v1m9zx",pt:"9v4zl8504z","pt-br":"9v4zl8504z",ja:"iybhyobckr","ja-Hira":"iybhyobckr"},"Make-A-Game":{en:"5rp47ys13g",ar:"dx5pqpaqsy",fr:"pntfdyyqqk",it:"vrs1e38944",pt:"rjst5ng61s","pt-br":"rjst5ng61s",ja:"h4q2ea3ojw","ja-Hira":"h4q2ea3ojw"},"Chase-Game":{en:"kusyx9thl5",ar:"qapon34gsw",fr:"0nszrbo4dt",it:"899b2jmjlu",pt:"rw6kr9e37n","pt-br":"rw6kr9e37n",ja:"wr6ysk8s6d","ja-Hira":"wr6ysk8s6d"},"add-a-backdrop":{en:"nict6zdzlx",ar:"ompj13t33k",fr:"nwyngs74xw",it:"vrrfpm5grh",pt:"wq7sm038pq","pt-br":"wq7sm038pq",ja:"j382ohngg7","ja-Hira":"j382ohngg7"},"change-size":{en:"p8va85hh61",ar:"acceih3x6k",fr:"rrowyylh2i",it:"1xb1jztsvr",pt:"1ad1ip3ly7","pt-br":"1ad1ip3ly7",ja:"uzkfi9uai0","ja-Hira":"uzkfi9uai0"},"glide-around":{en:"sh9j978rg8",ar:"8c4b4jb2se",fr:"f73cjf5zzf",it:"nvdhpgiebe",ja:"jsat4vhu48","ja-Hira":"jsat4vhu48"},"record-a-sound":{en:"ulzl1fbzny",ar:"vx60cuwzo9",fr:"ep92lqlp7p",it:"ncr9lqk7bt",pt:"aavagpvh5w","pt-br":"aavagpvh5w",ja:"5zmy6u614k","ja-Hira":"5zmy6u614k"},"spin-video":{en:"07fed5hhpv",ar:"5hl1dq3byk",fr:"cqzi6cr872",it:"obmrphhobt",pt:"jxqksu6zcw","pt-br":"jxqksu6zcw",ja:"hjhc0a8r7j","ja-Hira":"hjhc0a8r7j"},"hide-and-show":{en:"g479ahobo9",ar:"r25otzahzi",fr:"o1h6llwd0e",it:"v0vbx3l5uk",pt:"ibtmwb58y8","pt-br":"ibtmwb58y8",ja:"ruynguvag5","ja-Hira":"ruynguvag5"},"switch-costume":{en:"1ocp6a1ejn",ar:"2tz31cmeaq",fr:"2s9sagktio",it:"nty4xjtqcj",pt:"pnlmmv2hs7","pt-br":"pnlmmv2hs7",ja:"g3vluv0ms8","ja-Hira":"g3vluv0ms8"},"move-around-with-arrow-keys":{en:"yetrmk4iuu",ar:"270xh1zb1s",fr:"69tc5nvykx",it:"jse0g0uddw",pt:"erv6eff78p","pt-br":"erv6eff78p",ja:"fk34dcg5oz","ja-Hira":"fk34dcg5oz"},"add-effects":{en:"3jvl8zgjo2",ar:"fp4y3aumie",fr:"nyutlj812e",it:"q3cjjyfju9",pt:"dz6jzpf7hm","pt-br":"dz6jzpf7hm",ja:"q7zq9vu0wb","ja-Hira":"q7zq9vu0wb"},"make-it-fly":{en:"zbtdx2dem9"},"pong-game":{en:"8m48dv0ens"},imagine:{en:"1ndh08yiso"},"code-cartoon":{en:"fpfuky3x6g"},talking:{en:"j0208mq4qi"}},Pw=i(827),xw=i.n(Pw),_w=i(828),jw=i.n(_w),Jw=i(829),zw=i.n(Jw),Kw=i(287),Ww=i.n(Kw),Vw=i(830),Xw=i.n(Vw),Zw=i(831),qw=i.n(Zw),$w=i(832),Am=i.n($w),em=i(228),im=i.n(em),tm=i(383),om=i.n(tm),nm=i(833),am=i.n(nm),rm=i(834),sm=i.n(rm),gm=i(835),lm=i.n(gm),cm=i(836),um=i.n(cm),Bm=i(382),dm=i.n(Bm),Em=i(837),hm=i.n(Em),Cm=i(838),wm=i.n(Cm),mm=i(384),pm=i.n(mm),Im=i(839),fm=i.n(Im),Qm=i(104),Dm=i.n(Qm),Mm=i(840),bm=i.n(Mm),ym=i(841),Tm=i.n(ym),km=i(385),Fm=i.n(km),vm=i(386),Sm=i.n(vm),Nm=i(842),Rm=i.n(Nm),Om=i(387),Ym=i.n(Om),Um=i(843),Gm=i.n(Um),Hm=i(844),Lm=i.n(Hm),Pm=i(845),xm=i.n(Pm),_m=i(388),jm=i.n(_m),Jm=i(846),zm=i.n(Jm),Km=i(847),Wm=i.n(Km),Vm=i(848),Xm=i.n(Vm),Zm=i(849),qm=i.n(Zm),$m=i(389),Ap=i.n($m),ep=i(390),ip=i.n(ep),tp=i(850),op=i.n(tp),np=i(851),ap=i.n(np),rp=i(391),sp=i.n(rp),gp=i(852),lp=i.n(gp),cp=i(853),up=i.n(cp),Bp=i(854),dp=i.n(Bp),Ep=i(392),hp=i.n(Ep),Cp=i(855),wp=i.n(Cp),mp=i(856),pp=i.n(mp),Ip=i(857),fp=i.n(Ip),Qp=i(858),Dp=i.n(Qp),Mp=i(859),bp=i.n(Mp),yp=i(393),Tp=i.n(yp),kp=i(860),Fp=i.n(kp),vp=i(861),Sp=i.n(vp),Np=i(862),Rp=i.n(Np),Op=i(863),Yp=i.n(Op),Up=i(864),Gp=i.n(Up),Hp=i(865),Lp=i.n(Hp),Pp=i(394),xp=i.n(Pp),_p=i(395),jp=i.n(_p),Jp=i(866),zp=i.n(Jp),Kp=i(396),Wp=i.n(Kp),Vp=i(867),Xp=i.n(Vp),Zp=i(868),qp=i.n(Zp),$p=i(397),AI=i.n($p),eI=i(869),iI=i.n(eI),tI=i(870),oI=i.n(tI),nI=i(871),aI=i.n(nI),rI=i(872),sI=i.n(rI),gI=i(873),lI=i.n(gI),cI=i(874),uI=i.n(cI),BI=i(875),dI=i.n(BI),EI=i(398),hI=i.n(EI),CI=i(399),wI=i.n(CI),mI=i(876),pI=i.n(mI),II=i(877),fI=i.n(II),QI=i(400),DI=i.n(QI),MI=i(878),bI=i.n(MI),yI=i(401),TI=i.n(yI),kI=i(879),FI=i.n(kI),vI=i(402),SI=i.n(vI),NI=i(880),RI=i.n(NI),OI=i(881),YI=i.n(OI),UI=i(403),GI=i.n(UI),HI=i(404),LI=i.n(HI),PI=i(882),xI=i.n(PI),_I=i(405),jI=i.n(_I),JI=i(883),zI=i.n(JI),KI=i(406),WI=i.n(KI),VI=i(884),XI=i.n(VI),ZI=i(885),qI=i.n(ZI),$I=i(886),Af=i.n($I),ef=i(887),tf=i.n(ef),of=i(407),nf=i.n(of),af=i(888),rf=i.n(af),sf=i(889),gf=i.n(sf),lf=i(890),cf=i.n(lf),uf=i(408),Bf=i.n(uf),df=i(409),Ef=i.n(df),hf=i(891),Cf=i.n(hf),wf=i(410),mf=i.n(wf),pf=i(892),If=i.n(pf),ff=i(893),Qf=i.n(ff),Df=i(894),Mf=i.n(Df),bf=i(895),yf=i.n(bf),Tf=i(896),kf=i.n(Tf),Ff=i(411),vf=i.n(Ff),Sf=i(897),Nf=i.n(Sf),Rf=i(898),Of=i.n(Rf),Yf=i(899),Uf=i.n(Yf),Gf=i(412),Hf=i.n(Gf),Lf=i(900),Pf=i.n(Lf),xf=i(901),_f=i.n(xf),jf=i(902),Jf=i.n(jf),zf=i(903),Kf=i.n(zf),Wf=i(904),Vf=i.n(Wf),Xf=i(905),Zf=i.n(Xf),qf=i(906),$f=i.n(qf),AQ=i(907),eQ=i.n(AQ),iQ=i(908),tQ=i.n(iQ),oQ=i(909),nQ=i.n(oQ),aQ=i(910),rQ=i.n(aQ),sQ=i(911),gQ=i.n(sQ),lQ=i(912),cQ=i.n(lQ),uQ=i(913),BQ=i.n(uQ),dQ=i(914),EQ=i.n(dQ),hQ=i(915),CQ=i.n(hQ),wQ=i(916),mQ=i.n(wQ),pQ=i(413),IQ=i.n(pQ),fQ=i(917),QQ=i.n(fQ),DQ=i(918),MQ=i.n(DQ),bQ=i(414),yQ=i.n(bQ),TQ=i(919),kQ=i.n(TQ),FQ=i(920),vQ=i.n(FQ),SQ=i(921),NQ=i.n(SQ),RQ=i(922),OQ=i.n(RQ),YQ=i(415),UQ=i.n(YQ),GQ=i(416),HQ=i.n(GQ),LQ=i(923),PQ=i.n(LQ),xQ=i(417),_Q=i.n(xQ),jQ=i(924),JQ=i.n(jQ),zQ=i(418),KQ=i.n(zQ),WQ=i(925),VQ=i.n(WQ),XQ=i(419),ZQ=i.n(XQ),qQ=i(926),$Q=i.n(qQ),AD=i(420),eD=i.n(AD),iD=i(927),tD=i.n(iD),oD=i(928),nD=i.n(oD),aD=i(929),rD=i.n(aD),sD={introMove:xw.a,introSay:jw.a,introGreenFlag:zw.a,speechAddExtension:Ww.a,speechSaySomething:Xw.a,speechSetVoice:qw.a,speechMoveAround:Am.a,speechAddBackdrop:im.a,speechAddSprite:om.a,speechSong:am.a,speechChangeColor:sm.a,speechSpin:lm.a,speechGrowShrink:um.a,cnShowCharacter:dm.a,cnSay:hm.a,cnGlide:wm.a,cnPickSprite:pm.a,cnCollect:fm.a,cnVariable:Dm.a,cnScore:bm.a,cnBackdrop:Tm.a,addSprite:Fm.a,namePickLetter:Sm.a,namePlaySound:Rm.a,namePickLetter2:Ym.a,nameChangeColor:Gm.a,nameSpin:Lm.a,nameGrow:xm.a,musicPickInstrument:jm.a,musicPlaySound:zm.a,musicMakeSong:Wm.a,musicMakeBeat:Xm.a,musicMakeBeatbox:qm.a,chaseGameAddBackdrop:Ap.a,chaseGameAddSprite1:ip.a,chaseGameRightLeft:op.a,chaseGameUpDown:ap.a,chaseGameAddSprite2:sp.a,chaseGameMoveRandomly:lp.a,chaseGamePlaySound:up.a,chaseGameAddVariable:Dm.a,chaseGameChangeScore:dp.a,popGamePickSprite:hp.a,popGamePlaySound:wp.a,popGameAddScore:Dm.a,popGameChangeScore:pp.a,popGameRandomPosition:fp.a,popGameChangeColor:Dp.a,popGameResetScore:bp.a,animateCharPickBackdrop:im.a,animateCharPickSprite:Tp.a,animateCharSaySomething:Fp.a,animateCharAddSound:Sp.a,animateCharTalk:Rp.a,animateCharMove:Yp.a,animateCharJump:Gp.a,animateCharChangeColor:Lp.a,storyPickBackdrop:xp.a,storyPickSprite:jp.a,storySaySomething:zp.a,storyPickSprite2:Wp.a,storyFlip:Xp.a,storyConversation:qp.a,storyPickBackdrop2:AI.a,storySwitchBackdrop:iI.a,storyHideCharacter:oI.a,storyShowCharacter:aI.a,videoAddExtension:sI.a,videoPet:lI.a,videoAnimate:uI.a,videoPop:dI.a,flyChooseBackdrop:hI.a,flyChooseCharacter:wI.a,flySaySomething:pI.a,flyMoveArrows:fI.a,flyChooseObject:DI.a,flyFlyingObject:bI.a,flySelectFlyingSprite:TI.a,flyAddScore:Dm.a,flyKeepScore:FI.a,flyAddScenery:SI.a,flyMoveScenery:RI.a,flySwitchLooks:YI.a,pongAddBackdrop:GI.a,pongAddBallSprite:LI.a,pongBounceAround:xI.a,pongAddPaddle:jI.a,pongMoveThePaddle:zI.a,pongSelectBallSprite:WI.a,pongAddMoreCodeToBall:XI.a,pongAddAScore:Dm.a,pongChooseScoreFromMenu:qI.a,pongInsertChangeScoreBlock:Af.a,pongResetScore:tf.a,pongAddLineSprite:nf.a,pongGameOver:rf.a,imagineTypeWhatYouWant:gf.a,imagineClickGreenFlag:cf.a,imagineChooseBackdrop:Bf.a,imagineChooseSprite:Ef.a,imagineFlyAround:Cf.a,imagineChooseAnotherSprite:mf.a,imagineLeftRight:If.a,imagineUpDown:Qf.a,imagineChangeCostumes:Mf.a,imagineGlideToPoint:yf.a,imagineGrowShrink:kf.a,imagineChooseAnotherBackdrop:vf.a,imagineSwitchBackdrops:Nf.a,imagineRecordASound:Of.a,imagineChooseSound:Uf.a,addBackdrop:Hf.a,addEffects:Pf.a,hideAndShow:_f.a,switchCostumes:Jf.a,changeSize:Kf.a,spinTurn:Vf.a,spinPointInDirection:Zf.a,recordASoundSoundsTab:$f.a,recordASoundClickRecord:eQ.a,recordASoundPressRecordButton:tQ.a,recordASoundChooseSound:nQ.a,recordASoundPlayYourSound:rQ.a,moveArrowKeysLeftRight:gQ.a,moveArrowKeysUpDown:cQ.a,glideAroundBackAndForth:BQ.a,glideAroundPoint:EQ.a,codeCartoonSaySomething:CQ.a,codeCartoonAnimate:mQ.a,codeCartoonSelectDifferentCharacter:IQ.a,codeCartoonUseMinusSign:QQ.a,codeCartoonGrowShrink:MQ.a,codeCartoonSelectDifferentCharacter2:yQ.a,codeCartoonJump:kQ.a,codeCartoonChangeScenes:vQ.a,codeCartoonGlideAround:NQ.a,codeCartoonChangeCostumes:OQ.a,codeCartoonChooseMoreCharacters:UQ.a,talesAddExtension:Ww.a,talesChooseSprite:HQ.a,talesSaySomething:PQ.a,talesAskAnswer:rD.a,talesChooseBackdrop:_Q.a,talesSwitchBackdrop:JQ.a,talesChooseAnotherSprite:KQ.a,talesMoveAround:VQ.a,talesChooseAnotherBackdrop:ZQ.a,talesAnimateTalking:$Q.a,talesChooseThirdBackdrop:eD.a,talesChooseSound:tD.a,talesDanceMoves:nD.a},gD={},lD="",cD=function(){return i.e(5).then(i.bind(null,2944)).then(function(A){return A.esImages})},uD=function(){return i.e(10).then(i.bind(null,2949)).then(function(A){return A.ptBrImages})},BD=function(){return i.e(8).then(i.bind(null,2955)).then(function(A){return A.jaImages})},dD={es:function(){return cD()},"es-419":function(){return cD()},"zh-cn":function(){return i.e(14).then(i.bind(null,2945)).then(function(A){return A.zhCnImages})},"zh-tw":function(){return i.e(15).then(i.bind(null,2946)).then(function(A){return A.zhTwImages})},tr:function(){return i.e(12).then(i.bind(null,2947)).then(function(A){return A.trImages})},fr:function(){return i.e(6).then(i.bind(null,2948)).then(function(A){return A.frImages})},"pt-br":function(){return uD()},pt:function(){return uD()},ar:function(){return i.e(2).then(i.bind(null,2950)).then(function(A){return A.arImages})},am:function(){return i.e(1).then(i.bind(null,2951)).then(function(A){return A.amImages})},sw:function(){return i.e(11).then(i.bind(null,2952)).then(function(A){return A.swImages})},zu:function(){return i.e(16).then(i.bind(null,2953)).then(function(A){return A.zuImages})},uk:function(){return i.e(13).then(i.bind(null,2954)).then(function(A){return A.ukImages})},ja:function(){return BD()},"ja-Hira":function(){return BD()}},ED=function(A){dD.hasOwnProperty(A)&&dD[A]().then(function(e){gD=e,lD=A})};function hD(A){"@babel/helpers - typeof";return(hD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var CD=["activeDeckId","content","dragging","isRtl","locale","onActivateDeckFactory","onCloseCards","onShrinkExpandCards","onDrag","onStartDrag","onEndDrag","onShowAll","onNextStep","onPrevStep","showVideos","step","expanded"];function wD(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function mD(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function pD(A,e){return(pD=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function ID(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=fD(A);if(e){var o=fD(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===hD(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function fD(A){return(fD=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var QD=function(A){var e=A.onCloseCards,i=A.onShrinkExpandCards,t=A.onShowAll,o=A.totalSteps,n=A.step,r=A.expanded;return a.a.createElement("div",{className:r?yw.a.headerButtons:Le()(yw.a.headerButtons,yw.a.headerButtonsHidden)},a.a.createElement("div",{className:yw.a.allButton,onClick:t},a.a.createElement("img",{className:yw.a.helpIcon,src:Uw.a}),a.a.createElement(B.a,{defaultMessage:"Tutorials",id:"gui.cards.all-tutorials"})),o>1?a.a.createElement("div",{className:yw.a.stepsList},Array(o).fill(0).map(function(A,e){return a.a.createElement("div",{className:e===n?yw.a.activeStepPip:yw.a.inactiveStepPip,key:"pip-step-".concat(e)})})):null,a.a.createElement("div",{className:yw.a.headerButtonsRight},a.a.createElement("div",{className:yw.a.shrinkExpandButton,onClick:i},a.a.createElement("img",{draggable:!1,src:r?kw.a:vw.a}),r?a.a.createElement(B.a,{defaultMessage:"Shrink",id:"gui.cards.shrink"}):a.a.createElement(B.a,{defaultMessage:"Expand",id:"gui.cards.expand"})),a.a.createElement("div",{className:yw.a.removeButton,onClick:e},a.a.createElement("img",{className:yw.a.closeIcon,src:Hw.a}),a.a.createElement(B.a,{defaultMessage:"Close",id:"gui.cards.close"}))))},DD=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&pD(A,e)}(i,a.a.Component);var e=ID(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&mD(A.prototype,e),i&&mD(A,i)}(i,[{key:"componentDidMount",value:function(){var A=document.createElement("script");A.src="https://fast.wistia.com/embed/medias/".concat(this.props.video,".jsonp"),A.async=!0,A.setAttribute("id","wistia-video-content"),document.body.appendChild(A);var e=document.createElement("script");e.src="https://fast.wistia.com/assets/external/E-v1.js",e.async=!0,e.setAttribute("id","wistia-video-api"),document.body.appendChild(e)}},{key:"componentDidUpdate",value:function(A){if(window.Wistia&&window.Wistia.api){var e=window.Wistia.api(A.video);A.video!==this.props.video&&e.replaceWith(this.props.video),this.props.expanded||e.pause()}}},{key:"componentWillUnmount",value:function(){var A=document.getElementById("wistia-video-content");A.parentNode.removeChild(A);var e=document.getElementById("wistia-video-api");e.parentNode.removeChild(e)}},{key:"render",value:function(){return a.a.createElement("div",{className:yw.a.stepVideo},a.a.createElement("div",{className:"wistia_embed wistia_async_".concat(this.props.video),id:"video-div",style:{height:"257px",width:"466px"}}," "))}}]),i}();DD.propTypes={expanded:o.a.bool.isRequired,video:o.a.string.isRequired};var MD=function(A){var e=A.title,i=A.image;return a.a.createElement(n.Fragment,null,a.a.createElement("div",{className:yw.a.stepTitle},e),a.a.createElement("div",{className:yw.a.stepImageContainer},a.a.createElement("img",{className:yw.a.stepImage,draggable:!1,key:i,src:i})))};MD.propTypes={image:o.a.string.isRequired,title:o.a.node.isRequired};var bD=function(A){var e=A.isRtl,i=A.onNextStep,t=A.onPrevStep,o=A.expanded;return a.a.createElement(n.Fragment,null,i?a.a.createElement("div",null,a.a.createElement("div",{className:o?e?yw.a.leftCard:yw.a.rightCard:yw.a.hidden}),a.a.createElement("div",{className:o?e?yw.a.leftButton:yw.a.rightButton:yw.a.hidden,onClick:i},a.a.createElement("img",{draggable:!1,src:e?Ow.a:Nw.a}))):null,t?a.a.createElement("div",null,a.a.createElement("div",{className:o?e?yw.a.rightCard:yw.a.leftCard:yw.a.hidden}),a.a.createElement("div",{className:o?e?yw.a.rightButton:yw.a.leftButton:yw.a.hidden,onClick:t},a.a.createElement("img",{draggable:!1,src:e?Nw.a:Ow.a}))):null)};bD.propTypes={expanded:o.a.bool.isRequired,isRtl:o.a.bool,onNextStep:o.a.func,onPrevStep:o.a.func},QD.propTypes={expanded:o.a.bool.isRequired,onCloseCards:o.a.func.isRequired,onShowAll:o.a.func.isRequired,onShrinkExpandCards:o.a.func.isRequired,step:o.a.number,totalSteps:o.a.number};var yD=function(A){var e=A.deckIds,i=A.content,t=A.onActivateDeckFactory,o=A.onShowAll;return a.a.createElement(n.Fragment,null,a.a.createElement("div",{className:yw.a.stepTitle},a.a.createElement(B.a,{defaultMessage:"More things to try!",id:"gui.cards.more-things-to-try"})),a.a.createElement("div",{className:yw.a.decks},e.slice(0,2).map(function(A){return a.a.createElement("div",{className:yw.a.deck,key:"deck-preview-".concat(A),onClick:t(A)},a.a.createElement("img",{className:yw.a.deckImage,draggable:!1,src:i[A].img}),a.a.createElement("div",{className:yw.a.deckName},i[A].name))})),a.a.createElement("div",{className:yw.a.seeAll},a.a.createElement("div",{className:yw.a.seeAllButton,onClick:o},a.a.createElement(B.a,{defaultMessage:"See more",id:"gui.cards.see-more"}))))};yD.propTypes={content:o.a.shape({id:o.a.shape({name:o.a.node.isRequired,img:o.a.string.isRequired,steps:o.a.arrayOf(o.a.shape({title:o.a.node,image:o.a.string,video:o.a.string,deckIds:o.a.arrayOf(o.a.string)}))})}).isRequired,deckIds:o.a.arrayOf(o.a.string).isRequired,onActivateDeckFactory:o.a.func.isRequired,onShowAll:o.a.func.isRequired};var TD=function(A){var e=A.activeDeckId,i=A.content,t=A.dragging,o=A.isRtl,n=A.locale,r=A.onActivateDeckFactory,s=A.onCloseCards,g=A.onShrinkExpandCards,l=A.onDrag,c=A.onStartDrag,u=A.onEndDrag,B=A.onShowAll,d=A.onNextStep,E=A.onPrevStep,h=A.showVideos,C=A.step,w=A.expanded,m=wD(A,CD),p=m.x,I=m.y;if(null!==e){var f=w?257:0;if(0===p&&0===I){p=o?-1090:292,p+=400;I=window.innerHeight-320-60-48}var Q=i[e].steps;return a.a.createElement("div",{className:yw.a.cardContainerOverlay,style:{width:"".concat(window.innerWidth+800,"px"),height:"".concat(window.innerHeight-48+f,"px"),top:"".concat(48,"px"),left:"".concat(-400,"px")}},a.a.createElement(Mw.a,{bounds:"parent",cancel:"#video-div",position:{x:p,y:I},onDrag:l,onStart:c,onStop:u},a.a.createElement("div",{className:yw.a.cardContainer},a.a.createElement("div",{className:yw.a.card},a.a.createElement(QD,{expanded:w,step:C,totalSteps:Q.length,onCloseCards:s,onShowAll:B,onShrinkExpandCards:g}),a.a.createElement("div",{className:w?yw.a.stepBody:yw.a.hidden},Q[C].deckIds?a.a.createElement(yD,{content:i,deckIds:Q[C].deckIds,onActivateDeckFactory:r,onShowAll:B}):Q[C].video?h?a.a.createElement(DD,{dragging:t,expanded:w,video:function(A,e){return Lw.hasOwnProperty(A)?Lw[A].hasOwnProperty(e)?Lw[A][e]:Lw[A].en:A}(Q[C].video,n)}):a.a.createElement(MD,{image:i[e].img,title:i[e].name}):a.a.createElement(MD,{image:function(A,e){return e===lD&&gD.hasOwnProperty(A)?gD[A]:sD[A]}(Q[C].image,n),title:Q[C].title}),Q[C].trackingPixel&&Q[C].trackingPixel),a.a.createElement(bD,{expanded:w,isRtl:o,onNextStep:C<Q.length-1?d:null,onPrevStep:C>0?E:null})))))}};function kD(A){"@babel/helpers - typeof";return(kD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function FD(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function vD(A,e){return(vD=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function SD(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=ND(A);if(e){var o=ND(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===kD(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function ND(A){return(ND=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}TD.propTypes={activeDeckId:o.a.string.isRequired,content:o.a.shape({id:o.a.shape({name:o.a.node.isRequired,img:o.a.string.isRequired,steps:o.a.arrayOf(o.a.shape({title:o.a.node,image:o.a.string,video:o.a.string,deckIds:o.a.arrayOf(o.a.string)}))})}),dragging:o.a.bool.isRequired,expanded:o.a.bool.isRequired,isRtl:o.a.bool.isRequired,locale:o.a.string.isRequired,onActivateDeckFactory:o.a.func.isRequired,onCloseCards:o.a.func.isRequired,onDrag:o.a.func,onEndDrag:o.a.func,onNextStep:o.a.func.isRequired,onPrevStep:o.a.func.isRequired,onShowAll:o.a.func,onShrinkExpandCards:o.a.func.isRequired,onStartDrag:o.a.func,showVideos:o.a.bool,step:o.a.number.isRequired,x:o.a.number,y:o.a.number},TD.defaultProps={showVideos:!0};var RD=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&vD(A,e)}(i,a.a.Component);var e=SD(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&FD(A.prototype,e),i&&FD(A,i)}(i,[{key:"componentDidMount",value:function(){"en"!==this.props.locale&&ED(this.props.locale)}},{key:"componentDidUpdate",value:function(A){this.props.locale!==A.locale&&ED(this.props.locale)}},{key:"render",value:function(){return a.a.createElement(TD,this.props)}}]),i}();RD.propTypes={locale:o.a.string.isRequired};var OD=Object(s.b)(function(A){return{visible:A.scratchGui.cards.visible,content:A.scratchGui.cards.content,activeDeckId:A.scratchGui.cards.activeDeckId,step:A.scratchGui.cards.step,expanded:A.scratchGui.cards.expanded,x:A.scratchGui.cards.x,y:A.scratchGui.cards.y,isRtl:A.locales.isRtl,locale:A.locales.locale,dragging:A.scratchGui.cards.dragging,showVideos:dw()}},function(A){return{onActivateDeckFactory:function(e){return function(){return A(Object(xA.a)(e))}},onShowAll:function(){A(Object(C.u)()),A(Object(xA.c)())},onCloseCards:function(){return A(Object(xA.c)())},onShrinkExpandCards:function(){return A(Object(xA.i)())},onNextStep:function(){return A(Object(xA.g)())},onPrevStep:function(){return A(Object(xA.h)())},onDrag:function(e,i){return A(Object(xA.e)(i.x,i.y))},onStartDrag:function(){return A(Object(xA.j)())},onEndDrag:function(){return A(Object(xA.f)())}}})(RD);i(1560);function YD(A){"@babel/helpers - typeof";return(YD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function UD(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function GD(A,e){return(GD=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function HD(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=PD(A);if(e){var o=PD(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===YD(e)||"function"==typeof e))return e;return LD(A)}(this,i)}}function LD(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function PD(A){return(PD=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var xD=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&GD(A,e)}(i,a.a.Component);var e=HD(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(LD(t),["downloadProject"]),t}return function(A,e,i){e&&UD(A.prototype,e),i&&UD(A,i)}(i,[{key:"downloadProject",value:function(){var A=this;this.props.saveProjectSb3().then(function(e){A.props.onSaveFinished&&A.props.onSaveFinished(),function(A){return new Promise(function(e){var i=new FileReader;i.readAsDataURL(A),i.onloadend=function(){e(i.result)}})}(e).then(function(A){mv2Interface.savedProjectStates[slot.toString()]=A,mv2Interface.send_REST("save".concat(JSON.stringify(mv2Interface.savedProjectStates)))}),alert("Project Saved.")})}},{key:"render",value:function(){return(0,this.props.children)(this.props.className,this.downloadProject)}}]),i}();xD.propTypes={children:o.a.func,className:o.a.string,onSaveFinished:o.a.func,projectFilename:o.a.string,saveProjectSb3:o.a.func},xD.defaultProps={className:""};var _D,jD=Object(s.b)(function(A){return{saveProjectSb3:A.scratchGui.vm.saveProjectSb3.bind(A.scratchGui.vm),projectFilename:function(A,e){var i=A;return i&&0!==i.length||(i=e),"".concat(i.substring(0,100),".sb3")}(A.scratchGui.projectTitle,x.b)}},function(){return{}})(xD),JD=i(144),zD=i(278),KD=i(73),WD=i(80),VD=i.n(WD);function XD(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var ZD=(XD(_D={},KD.a.SUCCESS,JD.a.COLOR_GREEN),XD(_D,KD.a.WARN,JD.a.COLOR_ORANGE),_D),qD=function(A){var e=A.content,i=A.closeButton,t=A.extensionName,o=A.iconSpinner,n=A.iconURL,r=A.level,s=A.showDownload,g=A.showSaveNow,l=A.onCloseAlert,c=A.onDownload,u=A.onSaveNow,d=A.onReconnect,E=A.showReconnect;return a.a.createElement(hi.a,{className:Le()(VD.a.alert,VD.a[r])},(o||n)&&a.a.createElement("div",{className:VD.a.iconSection},o&&a.a.createElement(zD.a,{className:VD.a.alertSpinner,level:r}),n&&a.a.createElement("img",{className:VD.a.alertIcon,src:n})),a.a.createElement("div",{className:VD.a.alertMessage},t?a.a.createElement(B.a,{defaultMessage:"Scratch lost connection to {extensionName}.",id:"gui.alerts.lostPeripheralConnection",values:{extensionName:"".concat(t)}}):e),a.a.createElement("div",{className:VD.a.alertButtons},g&&a.a.createElement("button",{className:VD.a.alertConnectionButton,onClick:u},a.a.createElement(B.a,{defaultMessage:"Try Again",id:"gui.alerts.tryAgain"})),s&&a.a.createElement("button",{className:VD.a.alertConnectionButton,onClick:c},a.a.createElement(B.a,{defaultMessage:"Download",id:"gui.alerts.download"})),E&&a.a.createElement("button",{className:VD.a.alertConnectionButton,onClick:d},a.a.createElement(B.a,{defaultMessage:"Reconnect",id:"gui.connection.reconnect"})),i&&a.a.createElement(hi.a,{className:VD.a.alertCloseButtonContainer},a.a.createElement(JD.a,{className:Le()(VD.a.alertCloseButton),color:ZD[r],size:JD.a.SIZE_LARGE,onClick:l}))))};qD.propTypes={closeButton:o.a.bool,content:o.a.oneOfType([o.a.element,o.a.string]),extensionName:o.a.string,iconSpinner:o.a.bool,iconURL:o.a.string,level:o.a.string,onCloseAlert:o.a.func.isRequired,onDownload:o.a.func,onReconnect:o.a.func,onSaveNow:o.a.func,showDownload:o.a.func,showReconnect:o.a.bool,showSaveNow:o.a.bool},qD.defaultProps={level:KD.a.WARN};var $D=qD,AM=i(155);function eM(A){"@babel/helpers - typeof";return(eM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function iM(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function tM(A,e){return(tM=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function oM(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=aM(A);if(e){var o=aM(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===eM(e)||"function"==typeof e))return e;return nM(A)}(this,i)}}function nM(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function aM(A){return(aM=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var rM=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&tM(A,e)}(i,a.a.Component);var e=oM(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(nM(t),["handleOnCloseAlert","handleOnReconnect"]),t}return function(A,e,i){e&&iM(A.prototype,e),i&&iM(A,i)}(i,[{key:"handleOnCloseAlert",value:function(){this.props.onCloseAlert(this.props.index)}},{key:"handleOnReconnect",value:function(){this.props.onOpenConnectionModal(this.props.extensionId),this.handleOnCloseAlert()}},{key:"render",value:function(){var A=this,e=this.props,i=e.closeButton,t=e.content,o=e.extensionName,n=(e.index,e.level),r=e.iconSpinner,s=e.iconURL,g=e.message,l=e.onSaveNow,c=e.showDownload,u=e.showReconnect,B=e.showSaveNow;return a.a.createElement(jD,null,function(e,d){return a.a.createElement($D,{closeButton:i,content:t,extensionName:o,iconSpinner:r,iconURL:s,level:n,message:g,showDownload:c,showReconnect:u,showSaveNow:B,onCloseAlert:A.handleOnCloseAlert,onDownload:d,onReconnect:A.handleOnReconnect,onSaveNow:l})})}}]),i}();rM.propTypes={closeButton:o.a.bool,content:o.a.element,extensionId:o.a.string,extensionName:o.a.string,iconSpinner:o.a.bool,iconURL:o.a.string,index:o.a.number,level:o.a.string.isRequired,message:o.a.string,onCloseAlert:o.a.func.isRequired,onOpenConnectionModal:o.a.func,onSaveNow:o.a.func,showDownload:o.a.bool,showReconnect:o.a.bool,showSaveNow:o.a.bool};var sM=Object(s.b)(function(){return{}},function(A){return{onOpenConnectionModal:function(e){A(Object(AM.c)(e)),A(Object(C.n)())},onSaveNow:function(){A(Object(E.w)())}}})(rM),gM=i(930),lM=i.n(gM),cM=function(A){var e=A.alertsList,i=A.className,t=A.onCloseAlert;return a.a.createElement(hi.a,{bounds:"parent",className:i},a.a.createElement(hi.a,{className:lM.a.alertsInnerContainer},e.map(function(A,e){return a.a.createElement(sM,{closeButton:A.closeButton,content:A.content,extensionId:A.extensionId,extensionName:A.extensionName,iconSpinner:A.iconSpinner,iconURL:A.iconURL,index:e,key:e,level:A.level,message:A.message,showDownload:A.showDownload,showReconnect:A.showReconnect,showSaveNow:A.showSaveNow,onCloseAlert:t})})))};cM.propTypes={alertsList:o.a.arrayOf(o.a.object),className:o.a.string,onCloseAlert:o.a.func};var uM=cM,BM=function(A){var e=A.alertsList,i=A.className,t=A.onCloseAlert;return a.a.createElement(uM,{alertsList:Object(TA.e)(e),className:i,onCloseAlert:t})};BM.propTypes={alertsList:o.a.arrayOf(o.a.object),className:o.a.string,onCloseAlert:o.a.func};var dM=Object(s.b)(function(A){return{alertsList:A.scratchGui.alerts.alertsList}},function(A){return{onCloseAlert:function(e){return A(Object(TA.b)(e))}}})(BM),EM=i(305),hM=i.n(EM),CM=function(A){var e=A.dragging,i=A.img,t=A.currentOffset;return e?a.a.createElement("div",{className:hM.a.dragLayer},a.a.createElement("div",{className:hM.a.imageWrapper,style:{transform:"translate(".concat(t.x,"px, ").concat(t.y,"px)")}},a.a.createElement("img",{className:hM.a.image,src:i}))):null};CM.propTypes={currentOffset:o.a.shape({x:o.a.number.isRequired,y:o.a.number.isRequired}),dragging:o.a.bool.isRequired,img:o.a.string};var wM=CM,mM=Object(s.b)(function(A){return{dragging:A.scratchGui.assetDrag.dragging,currentOffset:A.scratchGui.assetDrag.currentOffset,img:A.scratchGui.assetDrag.img}})(wM),pM=i(40),IM=i.n(pM),fM=i(8),QM=i.n(fM);function DM(A){"@babel/helpers - typeof";return(DM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function MM(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}function bM(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function yM(A,e){return(yM=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function TM(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=FM(A);if(e){var o=FM(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===DM(e)||"function"==typeof e))return e;return kM(A)}(this,i)}}function kM(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function FM(A){return(FM=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var vM=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&yM(A,e)}(i,a.a.Component);var e=TM(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(kM(t),["handleConnecting"]),t}return function(A,e,i){e&&bM(A.prototype,e),i&&bM(A,i)}(i,[{key:"handleConnecting",value:function(){this.props.onConnecting(this.props.peripheralId)}},{key:"render",value:function(){return a.a.createElement(hi.a,{className:QM.a.peripheralTile},a.a.createElement(hi.a,{className:QM.a.peripheralTileName},a.a.createElement("img",{className:QM.a.peripheralTileImage,src:this.props.connectionSmallIconURL}),a.a.createElement(hi.a,{className:QM.a.peripheralTileNameWrapper},a.a.createElement(hi.a,{className:QM.a.peripheralTileNameLabel},a.a.createElement(B.a,{defaultMessage:"Device name",id:"gui.connection.peripheral-name-label"})),a.a.createElement(hi.a,{className:QM.a.peripheralTileNameText},this.props.name))),a.a.createElement(hi.a,{className:QM.a.peripheralTileWidgets},a.a.createElement(hi.a,{className:QM.a.signalStrengthMeter},a.a.createElement("div",{className:Le()(QM.a.signalBar,MM({},QM.a.greenBar,this.props.rssi>-80))}),a.a.createElement("div",{className:Le()(QM.a.signalBar,MM({},QM.a.greenBar,this.props.rssi>-60))}),a.a.createElement("div",{className:Le()(QM.a.signalBar,MM({},QM.a.greenBar,this.props.rssi>-40))}),a.a.createElement("div",{className:Le()(QM.a.signalBar,MM({},QM.a.greenBar,this.props.rssi>-20))})),a.a.createElement("button",{onClick:this.handleConnecting},a.a.createElement(B.a,{defaultMessage:"Connect",id:"gui.connection.connect"}))))}}]),i}();vM.propTypes={connectionSmallIconURL:o.a.string,name:o.a.string,onConnecting:o.a.func,peripheralId:o.a.string,rssi:o.a.number};var SM=vM;function NM(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var RM=function(A){var e;return a.a.createElement(hi.a,{className:Le()(A.className,QM.a.dotsRow)},a.a.createElement("div",{className:Le()(QM.a.dotsHolder,(e={},NM(e,QM.a.dotsHolderError,A.error),NM(e,QM.a.dotsHolderSuccess,A.success),e))},Array(A.total).fill(0).map(function(e,i){var t="inactive";return A.counter===i&&(t="active"),A.success&&(t="success"),A.error&&(t="error"),a.a.createElement(OM,{key:"dot-".concat(i),type:t})})))};RM.propTypes={className:o.a.string,counter:o.a.number,error:o.a.bool,success:o.a.bool,total:o.a.number};var OM=function(A){var e;return a.a.createElement("div",{className:Le()(QM.a.dot,(e={},NM(e,QM.a.inactiveStepDot,"inactive"===A.type),NM(e,QM.a.activeStepDot,"active"===A.type),NM(e,QM.a.successDot,"success"===A.type),NM(e,QM.a.errorDot,"error"===A.type),e))})};OM.propTypes={type:o.a.string};var YM=RM,UM=i(218),GM=i.n(UM),HM=i(931),LM=i.n(HM),PM=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},A.scanning?0===A.peripheralList.length?a.a.createElement("div",{className:QM.a.activityAreaInfo},a.a.createElement("div",{className:QM.a.centeredRow},a.a.createElement("img",{className:Le()(QM.a.radarSmall,QM.a.radarSpin),src:GM.a}),a.a.createElement(B.a,{defaultMessage:"Looking for devices",id:"gui.connection.scanning.lookingforperipherals"}))):a.a.createElement("div",{className:QM.a.peripheralTilePane},A.peripheralList.map(function(e){return a.a.createElement(SM,{connectionSmallIconURL:A.connectionSmallIconURL,key:e.peripheralId,name:e.name,peripheralId:e.peripheralId,rssi:e.rssi,onConnecting:A.onConnecting})})):a.a.createElement(hi.a,{className:QM.a.instructions},a.a.createElement(B.a,{defaultMessage:"No devices found",id:"gui.connection.scanning.noPeripheralsFound"}))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.instructions)},a.a.createElement(B.a,{defaultMessage:"Select your device in the list above.",id:"gui.connection.scanning.instructions"})),a.a.createElement(YM,{className:QM.a.bottomAreaItem,counter:0,total:3}),a.a.createElement("button",{className:Le()(QM.a.bottomAreaItem,QM.a.connectionButton),onClick:A.onRefresh},a.a.createElement(B.a,{defaultMessage:"Refresh",id:"gui.connection.search"}),a.a.createElement("img",{className:QM.a.buttonIconRight,src:LM.a}))))};PM.propTypes={connectionSmallIconURL:o.a.string,onConnecting:o.a.func,onRefresh:o.a.func,peripheralList:o.a.arrayOf(o.a.shape({name:o.a.string,rssi:o.a.number,peripheralId:o.a.string})),scanning:o.a.bool.isRequired},PM.defaultProps={peripheralList:[],scanning:!0};var xM=PM;function _M(A){"@babel/helpers - typeof";return(_M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function jM(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function JM(A,e){return(JM=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function zM(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=WM(A);if(e){var o=WM(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===_M(e)||"function"==typeof e))return e;return KM(A)}(this,i)}}function KM(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function WM(A){return(WM=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var VM=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&JM(A,e)}(i,a.a.Component);var e=zM(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(KM(t),["handlePeripheralListUpdate","handlePeripheralScanTimeout","handleRefresh"]),t.state={scanning:!0,peripheralList:[]},t}return function(A,e,i){e&&jM(A.prototype,e),i&&jM(A,i)}(i,[{key:"componentDidMount",value:function(){this.props.vm.scanForPeripheral(this.props.extensionId),this.props.vm.on("PERIPHERAL_LIST_UPDATE",this.handlePeripheralListUpdate),this.props.vm.on("PERIPHERAL_SCAN_TIMEOUT",this.handlePeripheralScanTimeout)}},{key:"componentWillUnmount",value:function(){this.props.vm.removeListener("PERIPHERAL_LIST_UPDATE",this.handlePeripheralListUpdate),this.props.vm.removeListener("PERIPHERAL_SCAN_TIMEOUT",this.handlePeripheralScanTimeout)}},{key:"handlePeripheralScanTimeout",value:function(){this.setState({scanning:!1,peripheralList:[]})}},{key:"handlePeripheralListUpdate",value:function(A){var e=Object.keys(A).map(function(e){return A[e]});this.setState({peripheralList:e})}},{key:"handleRefresh",value:function(){this.props.vm.scanForPeripheral(this.props.extensionId),this.setState({scanning:!0,peripheralList:[]})}},{key:"render",value:function(){return a.a.createElement(xM,{connectionSmallIconURL:this.props.connectionSmallIconURL,peripheralList:this.state.peripheralList,phase:this.state.phase,scanning:this.state.scanning,title:this.props.extensionId,onConnected:this.props.onConnected,onConnecting:this.props.onConnecting,onRefresh:this.handleRefresh})}}]),i}();VM.propTypes={connectionSmallIconURL:o.a.string,extensionId:o.a.string.isRequired,onConnected:o.a.func.isRequired,onConnecting:o.a.func.isRequired,vm:o.a.instanceOf(u.a).isRequired};var XM=VM,ZM=i(141),qM=i.n(ZM),$M=i(175),Ab=i.n($M),eb=i(176),ib=i.n(eb),tb=IM()({prescan:null,pressbutton:null,notfound:null}),ob=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},a.a.createElement("div",{className:QM.a.activityAreaInfo},a.a.createElement("div",{className:QM.a.centeredRow},A.phase===tb.prescan&&a.a.createElement(a.a.Fragment,null,a.a.createElement("img",{className:QM.a.radarBig,src:GM.a}),a.a.createElement("img",{className:QM.a.bluetoothCenteredIcon,src:Ab.a})),A.phase===tb.pressbutton&&a.a.createElement(a.a.Fragment,null,a.a.createElement("img",{className:Le()(QM.a.radarBig,QM.a.radarSpin),src:GM.a}),a.a.createElement("img",{className:QM.a.connectionTipIcon,src:A.connectionTipIconURL})),A.phase===tb.notfound&&a.a.createElement(hi.a,{className:QM.a.instructions},a.a.createElement(B.a,{defaultMessage:"No devices found",id:"gui.connection.auto-scanning.noPeripheralsFound"}))))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.instructions)},A.phase===tb.prescan&&a.a.createElement(B.a,{defaultMessage:"Have your device nearby, then begin searching.",id:"gui.connection.auto-scanning.prescan"}),A.phase===tb.pressbutton&&a.a.createElement(B.a,{defaultMessage:"Press the button on your device.",id:"gui.connection.auto-scanning.pressbutton"})),a.a.createElement(YM,{className:QM.a.bottomAreaItem,counter:0,total:3}),a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.buttonRow)},A.phase===tb.prescan&&a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onStartScan},a.a.createElement(B.a,{defaultMessage:"Start Searching",id:"gui.connection.auto-scanning.start-search"})),A.phase===tb.pressbutton&&a.a.createElement("div",{className:QM.a.segmentedButton},a.a.createElement("button",{disabled:!0,className:QM.a.connectionButton},a.a.createElement(B.a,{defaultMessage:"Searching...",id:"gui.connection.connecting-searchbutton"})),a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onRefresh},a.a.createElement("img",{className:QM.a.abortConnectingIcon,src:qM.a}))),A.phase===tb.notfound&&a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onRefresh},a.a.createElement("img",{className:QM.a.buttonIconLeft,src:ib.a}),a.a.createElement(B.a,{defaultMessage:"Try again",id:"gui.connection.auto-scanning.try-again"})))))};function nb(A){"@babel/helpers - typeof";return(nb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function ab(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function rb(A,e){return(rb=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function sb(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=lb(A);if(e){var o=lb(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===nb(e)||"function"==typeof e))return e;return gb(A)}(this,i)}}function gb(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function lb(A){return(lb=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}ob.propTypes={connectionTipIconURL:o.a.string,onRefresh:o.a.func,onStartScan:o.a.func,phase:o.a.oneOf(Object.keys(tb))},ob.defaultProps={phase:tb.prescan};var cb=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&rb(A,e)}(i,a.a.Component);var e=sb(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(gb(t),["handlePeripheralListUpdate","handlePeripheralScanTimeout","handleStartScan","handleRefresh"]),t.state={phase:tb.prescan},t}return function(A,e,i){e&&ab(A.prototype,e),i&&ab(A,i)}(i,[{key:"componentWillUnmount",value:function(){this.unbindPeripheralUpdates()}},{key:"handlePeripheralScanTimeout",value:function(){this.setState({phase:tb.notfound}),this.unbindPeripheralUpdates()}},{key:"handlePeripheralListUpdate",value:function(A){var e=Object.keys(A).map(function(e){return A[e]});e.length>0&&this.props.onConnecting(e[0].peripheralId)}},{key:"bindPeripheralUpdates",value:function(){this.props.vm.on("PERIPHERAL_LIST_UPDATE",this.handlePeripheralListUpdate),this.props.vm.on("PERIPHERAL_SCAN_TIMEOUT",this.handlePeripheralScanTimeout)}},{key:"unbindPeripheralUpdates",value:function(){this.props.vm.removeListener("PERIPHERAL_LIST_UPDATE",this.handlePeripheralListUpdate),this.props.vm.removeListener("PERIPHERAL_SCAN_TIMEOUT",this.handlePeripheralScanTimeout)}},{key:"handleRefresh",value:function(){this.setState({phase:tb.prescan}),this.unbindPeripheralUpdates()}},{key:"handleStartScan",value:function(){this.bindPeripheralUpdates(),this.props.vm.scanForPeripheral(this.props.extensionId),this.setState({phase:tb.pressbutton})}},{key:"render",value:function(){return a.a.createElement(ob,{connectionTipIconURL:this.props.connectionTipIconURL,phase:this.state.phase,title:this.props.extensionId,onRefresh:this.handleRefresh,onStartScan:this.handleStartScan})}}]),i}();cb.propTypes={connectionTipIconURL:o.a.string,extensionId:o.a.string.isRequired,onConnecting:o.a.func.isRequired,vm:o.a.instanceOf(u.a).isRequired};var ub=cb,Bb=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},a.a.createElement(hi.a,{className:QM.a.centeredRow},a.a.createElement("div",{className:QM.a.peripheralActivity},a.a.createElement("img",{className:QM.a.peripheralActivityIcon,src:A.connectionIconURL}),a.a.createElement("img",{className:QM.a.bluetoothConnectingIcon,src:Ab.a})))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.instructions)},A.connectingMessage),a.a.createElement(YM,{className:QM.a.bottomAreaItem,counter:1,total:3}),a.a.createElement("div",{className:Le()(QM.a.bottomAreaItem,QM.a.segmentedButton)},a.a.createElement("button",{disabled:!0,className:QM.a.connectionButton},a.a.createElement(B.a,{defaultMessage:"Connecting...",id:"gui.connection.connecting-cancelbutton"})),a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onDisconnect},a.a.createElement("img",{className:QM.a.abortConnectingIcon,src:qM.a})))))};Bb.propTypes={connectingMessage:o.a.node.isRequired,connectionIconURL:o.a.string.isRequired,onDisconnect:o.a.func};var db=Bb,Eb=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},a.a.createElement(hi.a,{className:QM.a.centeredRow},a.a.createElement("div",{className:QM.a.peripheralActivity},a.a.createElement("img",{className:QM.a.peripheralActivityIcon,src:A.connectionIconURL}),a.a.createElement("img",{className:QM.a.bluetoothConnectedIcon,src:Ab.a})))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.instructions)},a.a.createElement(B.a,{defaultMessage:"Connected",id:"gui.connection.connected"})),a.a.createElement(YM,{success:!0,className:QM.a.bottomAreaItem,total:3}),a.a.createElement("div",{className:Le()(QM.a.bottomAreaItem,QM.a.cornerButtons)},a.a.createElement("button",{className:Le()(QM.a.redButton,QM.a.connectionButton),onClick:A.onDisconnect},a.a.createElement(B.a,{defaultMessage:"Disconnect",id:"gui.connection.disconnect"})),a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onCancel},a.a.createElement(B.a,{defaultMessage:"Go to Editor",id:"gui.connection.go-to-editor"})))))};Eb.propTypes={connectionIconURL:o.a.string.isRequired,onCancel:o.a.func,onDisconnect:o.a.func};var hb=Eb,Cb=i(288),wb=i.n(Cb),mb=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},a.a.createElement(hi.a,{className:QM.a.centeredRow},a.a.createElement("div",{className:QM.a.peripheralActivity},a.a.createElement("img",{className:QM.a.peripheralActivityIcon,src:A.connectionIconURL})))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement("div",{className:Le()(QM.a.bottomAreaItem,QM.a.instructions)},a.a.createElement(B.a,{defaultMessage:"Oops, looks like something went wrong.",id:"gui.connection.error.errorMessage"})),a.a.createElement(YM,{error:!0,className:QM.a.bottomAreaItem,total:3}),a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.buttonRow)},a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onScanning},a.a.createElement("img",{className:Le()(QM.a.buttonIconLeft,QM.a.buttonIconBack),src:ib.a}),a.a.createElement(B.a,{defaultMessage:"Try again",id:"gui.connection.error.tryagainbutton"})),a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onHelp},a.a.createElement("img",{className:QM.a.buttonIconLeft,src:wb.a}),a.a.createElement(B.a,{defaultMessage:"Help",id:"gui.connection.error.helpbutton"})))))};mb.propTypes={connectionIconURL:o.a.string.isRequired,onHelp:o.a.func,onScanning:o.a.func};var pb=mb,Ib=i(932),fb=i.n(Ib),Qb=i(933),Db=i.n(Qb),Mb=function(A){return a.a.createElement(hi.a,{className:QM.a.body},a.a.createElement(hi.a,{className:QM.a.activityArea},a.a.createElement("div",{className:QM.a.scratchLinkHelp},a.a.createElement("div",{className:QM.a.scratchLinkHelpStep},a.a.createElement("div",{className:QM.a.helpStepNumber},"1"),a.a.createElement("div",{className:QM.a.helpStepImage},a.a.createElement("img",{className:QM.a.scratchLinkIcon,src:Db.a})),a.a.createElement("div",{className:QM.a.helpStepText},a.a.createElement(B.a,{defaultMessage:"Make sure you have Scratch Link installed and running",id:"gui.connection.unavailable.installscratchlink"}))),a.a.createElement("div",{className:QM.a.scratchLinkHelpStep},a.a.createElement("div",{className:QM.a.helpStepNumber},"2"),a.a.createElement("div",{className:QM.a.helpStepImage},a.a.createElement("img",{className:QM.a.scratchLinkIcon,src:fb.a})),a.a.createElement("div",{className:QM.a.helpStepText},a.a.createElement(B.a,{defaultMessage:"Check that Bluetooth is enabled",id:"gui.connection.unavailable.enablebluetooth"}))))),a.a.createElement(hi.a,{className:QM.a.bottomArea},a.a.createElement(YM,{error:!0,className:QM.a.bottomAreaItem,total:3}),a.a.createElement(hi.a,{className:Le()(QM.a.bottomAreaItem,QM.a.buttonRow)},a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onScanning},a.a.createElement("img",{className:Le()(QM.a.buttonIconLeft,QM.a.buttonIconBack),src:ib.a}),a.a.createElement(B.a,{defaultMessage:"Try again",id:"gui.connection.unavailable.tryagainbutton"})),a.a.createElement("button",{className:QM.a.connectionButton,onClick:A.onHelp},a.a.createElement("img",{className:QM.a.buttonIconLeft,src:wb.a}),a.a.createElement(B.a,{defaultMessage:"Help",id:"gui.connection.unavailable.helpbutton"})))))};Mb.propTypes={onHelp:o.a.func,onScanning:o.a.func};var bb=Mb,yb=IM()({scanning:null,connecting:null,connected:null,error:null,unavailable:null}),Tb=function(A){return a.a.createElement(Nl.a,{className:QM.a.modalContent,contentLabel:A.name,headerClassName:QM.a.header,headerImage:A.connectionSmallIconURL,id:"connectionModal",onHelp:A.onHelp,onRequestClose:A.onCancel},a.a.createElement(hi.a,{className:QM.a.body},A.phase===yb.scanning&&!A.useAutoScan&&a.a.createElement(XM,A),A.phase===yb.scanning&&A.useAutoScan&&a.a.createElement(ub,A),A.phase===yb.connecting&&a.a.createElement(db,A),A.phase===yb.connected&&a.a.createElement(hb,A),A.phase===yb.error&&a.a.createElement(pb,A),A.phase===yb.unavailable&&a.a.createElement(bb,A)))};Tb.propTypes={connectingMessage:o.a.node.isRequired,connectionSmallIconURL:o.a.string,connectionTipIconURL:o.a.string,name:o.a.node,onCancel:o.a.func.isRequired,onHelp:o.a.func.isRequired,phase:o.a.oneOf(Object.keys(yb)).isRequired,title:o.a.string.isRequired,useAutoScan:o.a.bool.isRequired},Tb.defaultProps={connectingMessage:"Connecting"};var kb=i(134);function Fb(A){"@babel/helpers - typeof";return(Fb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function vb(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Sb(A,e){return(Sb=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Nb(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Ob(A);if(e){var o=Ob(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Fb(e)||"function"==typeof e))return e;return Rb(A)}(this,i)}}function Rb(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Ob(A){return(Ob=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Yb=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Sb(A,e)}(i,a.a.Component);var e=Nb(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Rb(t),["handleScanning","handleCancel","handleConnected","handleConnecting","handleDisconnect","handleError","handleHelp"]),t.state={extension:kb.a.find(function(e){return e.extensionId===A.extensionId}),phase:A.vm.getPeripheralIsConnected(A.extensionId)?yb.connected:yb.scanning},t}return function(A,e,i){e&&vb(A.prototype,e),i&&vb(A,i)}(i,[{key:"componentDidMount",value:function(){this.props.vm.on("PERIPHERAL_CONNECTED",this.handleConnected),this.props.vm.on("PERIPHERAL_REQUEST_ERROR",this.handleError)}},{key:"componentWillUnmount",value:function(){this.props.vm.removeListener("PERIPHERAL_CONNECTED",this.handleConnected),this.props.vm.removeListener("PERIPHERAL_REQUEST_ERROR",this.handleError)}},{key:"handleScanning",value:function(){this.setState({phase:yb.scanning})}},{key:"handleConnecting",value:function(A){this.props.vm.connectPeripheral(this.props.extensionId,A),this.setState({phase:yb.connecting}),LA.a.event({category:"extensions",action:"connecting",label:this.props.extensionId})}},{key:"handleDisconnect",value:function(){try{this.props.vm.disconnectPeripheral(this.props.extensionId)}finally{this.props.onCancel()}}},{key:"handleCancel",value:function(){try{this.props.vm.getPeripheralIsConnected(this.props.extensionId)||this.props.vm.disconnectPeripheral(this.props.extensionId)}finally{this.props.onCancel()}}},{key:"handleError",value:function(){this.state.phase===yb.scanning||this.state.phase===yb.unavailable?this.setState({phase:yb.unavailable}):(this.setState({phase:yb.error}),LA.a.event({category:"extensions",action:"connecting error",label:this.props.extensionId}))}},{key:"handleConnected",value:function(){this.setState({phase:yb.connected}),LA.a.event({category:"extensions",action:"connected",label:this.props.extensionId})}},{key:"handleHelp",value:function(){window.open(this.state.extension.helpLink,"_blank"),LA.a.event({category:"extensions",action:"help",label:this.props.extensionId})}},{key:"render",value:function(){return a.a.createElement(Tb,{connectingMessage:this.state.extension&&this.state.extension.connectingMessage,connectionIconURL:this.state.extension&&this.state.extension.connectionIconURL,connectionSmallIconURL:this.state.extension&&this.state.extension.connectionSmallIconURL,connectionTipIconURL:this.state.extension&&this.state.extension.connectionTipIconURL,extensionId:this.props.extensionId,name:this.state.extension&&this.state.extension.name,phase:this.state.phase,title:this.props.extensionId,useAutoScan:this.state.extension&&this.state.extension.useAutoScan,vm:this.props.vm,onCancel:this.handleCancel,onConnected:this.handleConnected,onConnecting:this.handleConnecting,onDisconnect:this.handleDisconnect,onHelp:this.handleHelp,onScanning:this.handleScanning})}}]),i}();Yb.propTypes={extensionId:o.a.string.isRequired,onCancel:o.a.func.isRequired,vm:o.a.instanceOf(u.a).isRequired};var Ub=Object(s.b)(function(A){return{extensionId:A.scratchGui.connectionModal.extensionId}},function(A){return{onCancel:function(){A(Object(C.b)())}}})(Yb),Gb=i(91),Hb=i.n(Gb);function Lb(A){"@babel/helpers - typeof";return(Lb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Pb(){return(Pb=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function xb(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function _b(A,e){return(_b=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function jb(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=zb(A);if(e){var o=zb(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Lb(e)||"function"==typeof e))return e;return Jb(A)}(this,i)}}function Jb(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function zb(A){return(zb=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Kb=Object(B.d)({label:{id:"gui.telemetryOptIn.label",defaultMessage:"Report statistics to improve Scratch"},bodyText1:{id:"gui.telemetryOptIn.body1",defaultMessage:"The Scratch Team is always looking to better understand how Scratch is used around the world. To help support this effort, you can allow Scratch to automatically send usage information to the Scratch Team."},bodyText2:{id:"gui.telemetryOptIn.body2",defaultMessage:"The information we collect includes language selection, blocks usage, and some events like saving, loading, and uploading a project. We DO NOT collect any personal information. Please see our {privacyPolicyLink} for more information."},privacyPolicyLink:{id:"gui.telemetryOptIn.privacyPolicyLink",defaultMessage:"Privacy Policy"},optInText:{id:"gui.telemetryOptIn.optInText",defaultMessage:"Share my usage data with the Scratch Team"},optInTooltip:{id:"gui.telemetryOptIn.optInTooltip",defaultMessage:"Enable telemetry"},optOutText:{id:"gui.telemetryOptIn.optOutText",defaultMessage:"Do not share my usage data with the Scratch Team"},optOutTooltip:{id:"gui.telemetryOptIn.optOutTooltip",defaultMessage:"Disable telemetry"},settingWasUpdated:{id:"gui.telemetryOptIn.settingWasUpdated",defaultMessage:"Your setting was updated."},closeButton:{id:"gui.telemetryOptIn.buttonClose",defaultMessage:"Close"}}),Wb=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&_b(A,e)}(i,a.a.PureComponent);var e=jb(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Jb(t),["handleCancel","handleOptInOutChanged"]),t.state={settingWasUpdatedTimer:null},t}return function(A,e,i){e&&xb(A.prototype,e),i&&xb(A,i)}(i,[{key:"componentWillUnmount",value:function(){this.state.settingWasUpdatedTimer&&clearTimeout(this.state.settingWasUpdatedTimer)}},{key:"handleCancel",value:function(){this.props.onRequestClose(),this.props.onCancel&&this.props.onCancel()}},{key:"handleOptInOutChanged",value:function(A){"true"===A.target.value?this.props.onOptIn&&(this.props.onOptIn(),this.handleSettingWasUpdated()):"false"===A.target.value&&this.props.onOptOut&&(this.props.onOptOut(),this.handleSettingWasUpdated())}},{key:"handleSettingWasUpdated",value:function(){var A=this;this.state.settingWasUpdatedTimer&&clearTimeout(this.state.settingWasUpdatedTimer);var e=setTimeout(function(){return A.handleSettingWasUpdatedTimeout(e)},3e3);this.setState({settingWasUpdatedTimer:e})}},{key:"handleSettingWasUpdatedTimeout",value:function(A){A===this.state.settingWasUpdatedTimer&&this.setState({settingWasUpdatedTimer:null})}},{key:"render",value:function(){var A="boolean"!=typeof this.props.isTelemetryEnabled,e=!1===this.props.isTelemetryEnabled,i=!0===this.props.isTelemetryEnabled,t=this.state.settingWasUpdatedTimer&&a.a.createElement(B.a,Kb.settingWasUpdated);return a.a.createElement(l.a,{isOpen:!0,className:Hb.a.modalContent,contentLabel:this.props.intl.formatMessage(Kb.label),overlayClassName:Hb.a.modalOverlay,onRequestClose:this.handleCancel},a.a.createElement("div",{dir:this.props.isRtl?"rtl":"ltr"},a.a.createElement(hi.a,{className:Hb.a.illustration}),a.a.createElement(hi.a,{className:Hb.a.body},a.a.createElement("p",null,a.a.createElement(B.a,Kb.bodyText1)),a.a.createElement("p",null,a.a.createElement(B.a,Pb({},Kb.bodyText2,{values:{privacyPolicyLink:a.a.createElement("a",{className:Hb.a.privacyPolicyLink,href:"https://scratch.mit.edu/privacy_policy/",onClick:this.props.onShowPrivacyPolicy,target:"_blank",rel:"noopener noreferrer"},a.a.createElement(B.a,Kb.privacyPolicyLink))}}))),a.a.createElement(hi.a,{className:Hb.a.radioButtons},a.a.createElement("label",{className:i?Hb.a.labelSelected:null},a.a.createElement("input",{name:"optInOut",type:"radio",value:"true",title:this.props.intl.formatMessage(Kb.optInTooltip),checked:!0===this.props.isTelemetryEnabled,onChange:this.handleOptInOutChanged}),a.a.createElement(B.a,Kb.optInText)),a.a.createElement("label",{className:e?Hb.a.labelSelected:null},a.a.createElement("input",{name:"optInOut",type:"radio",value:"false",title:this.props.intl.formatMessage(Kb.optOutTooltip),checked:!1===this.props.isTelemetryEnabled,onChange:this.handleOptInOutChanged}),a.a.createElement(B.a,Kb.optOutText))),a.a.createElement(hi.a,{className:Hb.a.buttonRow},a.a.createElement("span",{className:Hb.a.settingWasUpdated,key:this.state.settingWasUpdatedTimer},t),a.a.createElement("button",{className:Hb.a.optIn,onClick:this.props.onRequestClose,disabled:A},a.a.createElement(B.a,Kb.closeButton))))))}}]),i}();Wb.propTypes={intl:B.f.isRequired,isRtl:o.a.bool,isTelemetryEnabled:o.a.bool,onCancel:o.a.func,onOptIn:o.a.func.isRequired,onOptOut:o.a.func.isRequired,onRequestClose:o.a.func,onShowPrivacyPolicy:o.a.func};var Vb=Object(B.e)(Wb),Xb=i(44),Zb=i.n(Xb),qb=i(934),$b=i.n(qb),Ay=i(935),ey=i.n(Ay),iy=i(936),ty=i.n(iy),oy=i(937),ny=i.n(oy),ay=i(938),ry=i.n(ay),sy=(i(1568),i(939)),gy=i.n(sy),ly=i(940),cy=i.n(ly),uy=i(941),By=i.n(uy),dy=i(59),Ey=i.n(dy),hy=Object(B.d)({largeStageSizeMessage:{id:"gui.stageHeader.stageSizeLarge",defaultMessage:"Switch to large stage"},smallStageSizeMessage:{id:"gui.stageHeader.stageSizeSmall",defaultMessage:"Switch to small stage"},fullStageSizeMessage:{id:"gui.stageHeader.stageSizeFull",defaultMessage:"Enter full screen mode"},unFullStageSizeMessage:{id:"gui.stageHeader.stageSizeUnFull",defaultMessage:"Exit full screen mode"},fullscreenControl:{id:"gui.stageHeader.fullscreenControl",defaultMessage:"Full Screen Control"}}),Cy=function(A){var e=A.isFullScreen,i=A.isPlayerOnly,t=A.onKeyPress,o=A.onSetStageLarge,n=A.onSetStageSmall,r=A.onSetStageUnFull,s=A.showBranding,g=A.stageSizeMode,l=A.vm,c=null;if(e){var u=WB(null,!0),B=s?a.a.createElement("div",{className:Ey.a.embedScratchLogo},a.a.createElement("a",{href:"https://scratch.mit.edu",rel:"noopener noreferrer",target:"_blank"},a.a.createElement("img",{alt:"Scratch",src:ed.a}))):a.a.createElement(xu.a,{className:Ey.a.stageButton,onClick:r,onKeyPress:t},a.a.createElement("img",{alt:A.intl.formatMessage(hy.unFullStageSizeMessage),className:Ey.a.stageButtonIcon,draggable:!1,src:By.a,title:A.intl.formatMessage(hy.fullscreenControl)}));c=a.a.createElement(hi.a,{className:Ey.a.stageHeaderWrapperOverlay},a.a.createElement(hi.a,{className:Ey.a.stageMenuWrapper,style:{width:u.width}},a.a.createElement(JB.a,{vm:l}),B))}else{var d=i?[]:a.a.createElement("div",{className:Ey.a.stageSizeToggleGroup},a.a.createElement("div",null,a.a.createElement(xu.a,{className:Le()(Ey.a.stageButton,Ey.a.stageButtonFirst,g===Pa.d.small?null:Ey.a.stageButtonToggledOff),onClick:n},a.a.createElement("img",{alt:A.intl.formatMessage(hy.smallStageSizeMessage),className:Ey.a.stageButtonIcon,draggable:!1,src:cy.a}))),a.a.createElement("div",null,a.a.createElement(xu.a,{className:Le()(Ey.a.stageButton,Ey.a.stageButtonLast,g===Pa.d.large?null:Ey.a.stageButtonToggledOff),onClick:o},a.a.createElement("img",{alt:A.intl.formatMessage(hy.largeStageSizeMessage),className:Ey.a.stageButtonIcon,draggable:!1,src:gy.a}))));c=a.a.createElement(hi.a,{className:Ey.a.stageHeaderWrapper},a.a.createElement(hi.a,{className:Ey.a.stageMenuWrapper},a.a.createElement("div",{className:Ey.a.stageSizeRow},d)))}return c};Cy.propTypes={intl:B.f,isFullScreen:o.a.bool.isRequired,isPlayerOnly:o.a.bool.isRequired,onKeyPress:o.a.func.isRequired,onSetStageFull:o.a.func.isRequired,onSetStageLarge:o.a.func.isRequired,onSetStageSmall:o.a.func.isRequired,onSetStageUnFull:o.a.func.isRequired,showBranding:o.a.bool.isRequired,stageSizeMode:o.a.oneOf(Object.keys(Pa.d)),vm:o.a.instanceOf(u.a).isRequired},Cy.defaultProps={stageSizeMode:Pa.d.large};var wy=Object(B.e)(Object(s.b)(function(A){return{stageSizeMode:A.scratchGui.stageSize.stageSize}})(Cy));function my(A){"@babel/helpers - typeof";return(my="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function py(){return(py=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Iy(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function fy(A,e){return(fy=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Qy(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=My(A);if(e){var o=My(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===my(e)||"function"==typeof e))return e;return Dy(A)}(this,i)}}function Dy(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function My(A){return(My=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var by=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&fy(A,e)}(i,a.a.Component);var e=Qy(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Dy(t),["handleKeyPress"]),t}return function(A,e,i){e&&Iy(A.prototype,e),i&&Iy(A,i)}(i,[{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyPress)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyPress)}},{key:"handleKeyPress",value:function(A){"Escape"===A.key&&this.props.isFullScreen&&this.props.onSetStageUnFull(!1)}},{key:"render",value:function(){var A=py({},this.props);return a.a.createElement(wy,py({},A,{onKeyPress:this.handleKeyPress}))}}]),i}();by.propTypes={isFullScreen:o.a.bool,isPlayerOnly:o.a.bool,onSetStageUnFull:o.a.func.isRequired,showBranding:o.a.bool,stageSizeMode:o.a.oneOf(Object.keys(Pa.d)),vm:o.a.instanceOf(u.a).isRequired};var yy=Object(s.b)(function(A){return{stageSizeMode:A.scratchGui.stageSize.stageSize,showBranding:A.scratchGui.mode.showBranding,isFullScreen:A.scratchGui.mode.isFullScreen,isPlayerOnly:A.scratchGui.mode.isPlayerOnly}},function(A){return{onSetStageLarge:function(){return A(Object(_B.b)(Pa.d.large))},onSetStageSmall:function(){return A(Object(_B.b)(Pa.d.small))},onSetStageFull:function(){return A(Object(jB.c)(!0))},onSetStageUnFull:function(){return A(Object(jB.c)(!1))}}})(by),Ty=i(105);function ky(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var Fy=Object(B.d)({motion_direction:{id:"gui.opcodeLabels.direction",defaultMessage:"direction"},motion_xposition:{id:"gui.opcodeLabels.xposition",defaultMessage:"x position"},motion_yposition:{id:"gui.opcodeLabels.yposition",defaultMessage:"y position"},looks_size:{id:"gui.opcodeLabels.size",defaultMessage:"size"},looks_costumename:{id:"gui.opcodeLabels.costumename",defaultMessage:"costume name"},looks_costumenumber:{id:"gui.opcodeLabels.costumenumber",defaultMessage:"costume number"},looks_backdropname:{id:"gui.opcodeLabels.backdropname",defaultMessage:"backdrop name"},looks_backdropnumber:{id:"gui.opcodeLabels.backdropnumber",defaultMessage:"backdrop number"},sound_volume:{id:"gui.opcodeLabels.volume",defaultMessage:"volume"},sound_tempo:{id:"gui.opcodeLabels.tempo",defaultMessage:"tempo"},sensing_answer:{id:"gui.opcodeLabels.answer",defaultMessage:"answer"},sensing_loudness:{id:"gui.opcodeLabels.loudness",defaultMessage:"loudness"},sensing_username:{id:"gui.opcodeLabels.username",defaultMessage:"username"},sensing_current_year:{id:"gui.opcodeLabels.year",defaultMessage:"year"},sensing_current_month:{id:"gui.opcodeLabels.month",defaultMessage:"month"},sensing_current_date:{id:"gui.opcodeLabels.date",defaultMessage:"date"},sensing_current_dayofweek:{id:"gui.opcodeLabels.dayofweek",defaultMessage:"day of week"},sensing_current_hour:{id:"gui.opcodeLabels.hour",defaultMessage:"hour"},sensing_current_minute:{id:"gui.opcodeLabels.minute",defaultMessage:"minute"},sensing_current_second:{id:"gui.opcodeLabels.second",defaultMessage:"second"},sensing_timer:{id:"gui.opcodeLabels.timer",defaultMessage:"timer"}}),vy=new(function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this._translator=function(A){return A.defaultMessage},this._opcodeMap={motion_direction:{category:"motion"},motion_xposition:{category:"motion"},motion_yposition:{category:"motion"},looks_size:{category:"looks"},looks_costumenumbername:{category:"looks"},looks_backdropnumbername:{category:"looks"},looks_backdropname:{category:"looks"},data_variable:{category:"data"},data_listcontents:{category:"list"},sound_volume:{category:"sound"},sound_tempo:{category:"sound"},sensing_answer:{category:"sensing"},sensing_loudness:{category:"sensing"},sensing_username:{category:"sensing"},sensing_current:{category:"sensing"},sensing_timer:{category:"sensing"}},this._refreshOpcodeMap()}return function(A,e,i){e&&ky(A.prototype,e),i&&ky(A,i)}(A,[{key:"setTranslatorFunction",value:function(A){this._translator=A,this._refreshOpcodeMap()}},{key:"_refreshOpcodeMap",value:function(){var A=this;this._opcodeMap.motion_direction.labelFn=function(){return A._translator(Fy.motion_direction)},this._opcodeMap.motion_xposition.labelFn=function(){return A._translator(Fy.motion_xposition)},this._opcodeMap.motion_yposition.labelFn=function(){return A._translator(Fy.motion_yposition)},this._opcodeMap.looks_size.labelFn=function(){return A._translator(Fy.looks_size)},this._opcodeMap.looks_costumenumbername.labelFn=function(e){return"number"===e.NUMBER_NAME?A._translator(Fy.looks_costumenumber):A._translator(Fy.looks_costumename)},this._opcodeMap.looks_backdropnumbername.labelFn=function(e){return"number"===e.NUMBER_NAME?A._translator(Fy.looks_backdropnumber):A._translator(Fy.looks_backdropname)},this._opcodeMap.looks_backdropname.labelFn=function(){return A._translator(Fy.looks_backdropname)},this._opcodeMap.data_variable.labelFn=function(A){return A.VARIABLE},this._opcodeMap.data_listcontents.labelFn=function(A){return A.LIST},this._opcodeMap.sound_volume.labelFn=function(){return A._translator(Fy.sound_volume)},this._opcodeMap.sound_tempo.labelFn=function(){return A._translator(Fy.sound_tempo)},this._opcodeMap.sensing_answer.labelFn=function(){return A._translator(Fy.sensing_answer)},this._opcodeMap.sensing_loudness.labelFn=function(){return A._translator(Fy.sensing_loudness)},this._opcodeMap.sensing_username.labelFn=function(){return A._translator(Fy.sensing_username)},this._opcodeMap.sensing_current.labelFn=function(e){switch(e.CURRENTMENU.toLowerCase()){case"year":return A._translator(Fy.sensing_current_year);case"month":return A._translator(Fy.sensing_current_month);case"date":return A._translator(Fy.sensing_current_date);case"dayofweek":return A._translator(Fy.sensing_current_dayofweek);case"hour":return A._translator(Fy.sensing_current_hour);case"minute":return A._translator(Fy.sensing_current_minute);case"second":return A._translator(Fy.sensing_current_second)}},this._opcodeMap.sensing_timer.labelFn=function(){return A._translator(Fy.sensing_timer)}}},{key:"getLabel",value:function(A){return A in this._opcodeMap?this._opcodeMap[A]:{category:"extension",label:A}}}]),A}()),Sy=i(46),Ny=i.n(Sy),Ry=i(29),Oy=i.n(Ry),Yy=function(A){var e=A.categoryColor,i=A.label,t=A.value;return a.a.createElement("div",{className:Oy.a.defaultMonitor},a.a.createElement("div",{className:Oy.a.row},a.a.createElement("div",{className:Oy.a.label},i),a.a.createElement("div",{className:Oy.a.value,style:{background:e}},t)))};Yy.propTypes={categoryColor:o.a.string.isRequired,label:o.a.string.isRequired,value:o.a.oneOfType([o.a.string,o.a.number])};var Uy=Yy,Gy=function(A){var e=A.categoryColor,i=A.value;return a.a.createElement("div",{className:Oy.a.largeMonitor},a.a.createElement("div",{className:Oy.a.largeValue,style:{background:e}},i))};Gy.propTypes={categoryColor:o.a.string,value:o.a.oneOfType([o.a.string,o.a.number])};var Hy=Gy,Ly=function(A,e,i){return(e?A.runtime.getTargetById(e):A.runtime.getTargetForStage()).variables[i]},Py=function(A,e,i){var t=Ly(A,e,i);return t.value instanceof Array?t.value.slice():t.value},xy=function(A,e,i,t){Ly(A,e,i).value=t},_y=function(A){var e=A.categoryColor,i=A.isDiscrete,t=A.label,o=A.min,n=A.max,r=A.value,s=A.onSliderUpdate;return a.a.createElement("div",{className:Oy.a.defaultMonitor},a.a.createElement("div",{className:Oy.a.row},a.a.createElement("div",{className:Oy.a.label},t),a.a.createElement("div",{className:Oy.a.value,style:{background:e}},r)),a.a.createElement("div",{className:Oy.a.row},a.a.createElement("input",{className:Le()(Oy.a.slider,"no-drag"),max:n,min:o,step:i?1:.01,type:"range",value:r,onChange:s})))};_y.propTypes={categoryColor:o.a.string.isRequired,isDiscrete:o.a.bool,label:o.a.string.isRequired,max:o.a.number,min:o.a.number,onSliderUpdate:o.a.func.isRequired,value:o.a.oneOfType([o.a.string,o.a.number])},_y.defaultProps={isDiscrete:!0,min:0,max:100};var jy=_y;function Jy(A){"@babel/helpers - typeof";return(Jy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var zy=["vm","value"];function Ky(){return(Ky=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function Wy(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function Vy(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Xy(A,e){return(Xy=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Zy(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=$y(A);if(e){var o=$y(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Jy(e)||"function"==typeof e))return e;return qy(A)}(this,i)}}function qy(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function $y(A){return($y=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var AT=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Xy(A,e)}(i,a.a.Component);var e=Zy(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(qy(t),["handleSliderUpdate"]),t.state={value:A.value},t}return function(A,e,i){e&&Vy(A.prototype,e),i&&Vy(A,i)}(i,[{key:"componentWillReceiveProps",value:function(A){this.state.value!==A.value&&this.setState({value:A.value})}},{key:"handleSliderUpdate",value:function(A){this.setState({value:Number(A.target.value)});var e=this.props,i=e.vm,t=e.targetId,o=e.id;xy(i,t,o,Number(A.target.value))}},{key:"render",value:function(){var A=this.props,e=(A.vm,A.value,Wy(A,zy));return a.a.createElement(jy,Ky({},e,{value:this.state.value,onSliderUpdate:this.handleSliderUpdate}))}}]),i}();AT.propTypes={id:o.a.string,targetId:o.a.string,value:o.a.oneOfType([o.a.number,o.a.string]),vm:o.a.instanceOf(u.a)};var eT=Object(s.b)(function(A){return{vm:A.scratchGui.vm}})(AT),iT=i(33),tT=i.n(iT),oT=i(20),nT=i.n(oT),aT=i(22),rT=i.n(aT),sT=i(28),gT=i.n(sT),lT=i(34),cT=i.n(lT),uT=i(93),BT=i(289),dT=i.n(BT),ET=i(18),hT=i.n(ET);function CT(A){var e=A.cellCount,i=A.cellSize,t=A.computeMetadataCallback,o=A.computeMetadataCallbackProps,n=A.nextCellsCount,a=A.nextCellSize,r=A.nextScrollToIndex,s=A.scrollToIndex,g=A.updateScrollOffsetForScrollToIndex;e===n&&("number"!=typeof i&&"number"!=typeof a||i===a)||(t(o),s>=0&&s===r&&g())}var wT=i(118),mT=i.n(wT),pT=(o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.bool.isRequired,o.a.bool.isRequired,o.a.string.isRequired,o.a.object.isRequired,o.a.number.isRequired,o.a.object.isRequired,o.a.func),IT=(o.a.objectOf(o.a.node.isRequired),o.a.objectOf(o.a.object.isRequired),o.a.objectOf(o.a.node.isRequired).isRequired,o.a.func.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.object,o.a.number.isRequired,o.a.bool.isRequired,o.a.bool.isRequired,o.a.object.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.objectOf(o.a.object.isRequired).isRequired,o.a.number.isRequired,o.a.object.isRequired,o.a.object.isRequired,o.a.func),fT=(o.a.func,o.a.oneOfType([o.a.func,o.a.number])),QT=o.a.func,DT=(o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.bool.isRequired,o.a.bool.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.oneOf(["horizontal","vertical"]).isRequired,o.a.oneOf([-1,1]).isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.func),MT=o.a.oneOf(["auto","end","start","center"]),bT=(o.a.number,o.a.number,function(){function A(e){var i=e.cellCount,t=e.cellSizeGetter,o=e.estimatedCellSize;nT()(this,A),this._cellSizeAndPositionData={},this._lastMeasuredIndex=-1,this._lastBatchedIndex=-1,this._cellSizeGetter=t,this._cellCount=i,this._estimatedCellSize=o}return rT()(A,[{key:"areOffsetsAdjusted",value:function(){return!1}},{key:"configure",value:function(A){var e=A.cellCount,i=A.estimatedCellSize,t=A.cellSizeGetter;this._cellCount=e,this._estimatedCellSize=i,this._cellSizeGetter=t}},{key:"getCellCount",value:function(){return this._cellCount}},{key:"getEstimatedCellSize",value:function(){return this._estimatedCellSize}},{key:"getLastMeasuredIndex",value:function(){return this._lastMeasuredIndex}},{key:"getOffsetAdjustment",value:function(){return 0}},{key:"getSizeAndPositionOfCell",value:function(A){if(A<0||A>=this._cellCount)throw Error("Requested index "+A+" is outside of range 0.."+this._cellCount);if(A>this._lastMeasuredIndex)for(var e=this.getSizeAndPositionOfLastMeasuredCell(),i=e.offset+e.size,t=this._lastMeasuredIndex+1;t<=A;t++){var o=this._cellSizeGetter({index:t});if(void 0===o||isNaN(o))throw Error("Invalid size returned for cell "+t+" of value "+o);null===o?(this._cellSizeAndPositionData[t]={offset:i,size:0},this._lastBatchedIndex=A):(this._cellSizeAndPositionData[t]={offset:i,size:o},i+=o,this._lastMeasuredIndex=A)}return this._cellSizeAndPositionData[A]}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}}},{key:"getTotalSize",value:function(){var A=this.getSizeAndPositionOfLastMeasuredCell();return A.offset+A.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize}},{key:"getUpdatedOffsetForIndex",value:function(A){var e=A.align,i=void 0===e?"auto":e,t=A.containerSize,o=A.currentOffset,n=A.targetIndex;if(t<=0)return 0;var a=this.getSizeAndPositionOfCell(n),r=a.offset,s=r-t+a.size,g=void 0;switch(i){case"start":g=r;break;case"end":g=s;break;case"center":g=r-(t-a.size)/2;break;default:g=Math.max(s,Math.min(r,o))}var l=this.getTotalSize();return Math.max(0,Math.min(l-t,g))}},{key:"getVisibleCellRange",value:function(A){var e=A.containerSize,i=A.offset;if(0===this.getTotalSize())return{};var t=i+e,o=this._findNearestCell(i),n=this.getSizeAndPositionOfCell(o);i=n.offset+n.size;for(var a=o;i<t&&a<this._cellCount-1;)a++,i+=this.getSizeAndPositionOfCell(a).size;return{start:o,stop:a}}},{key:"resetCell",value:function(A){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,A-1)}},{key:"_binarySearch",value:function(A,e,i){for(;e<=A;){var t=e+Math.floor((A-e)/2),o=this.getSizeAndPositionOfCell(t).offset;if(o===i)return t;o<i?e=t+1:o>i&&(A=t-1)}return e>0?e-1:0}},{key:"_exponentialSearch",value:function(A,e){for(var i=1;A<this._cellCount&&this.getSizeAndPositionOfCell(A).offset<e;)A+=i,i*=2;return this._binarySearch(Math.min(A,this._cellCount-1),Math.floor(A/2),e)}},{key:"_findNearestCell",value:function(A){if(isNaN(A))throw Error("Invalid offset "+A+" specified");A=Math.max(0,A);var e=this.getSizeAndPositionOfLastMeasuredCell(),i=Math.max(0,this._lastMeasuredIndex);return e.offset>=A?this._binarySearch(i,0,A):this._exponentialSearch(i,A)}}]),A}()),yT=function(){return"undefined"!=typeof window&&window.chrome&&window.chrome.webstore?16777100:15e5},TT=function(){function A(e){var i=e.maxScrollSize,t=void 0===i?yT():i,o=mT()(e,["maxScrollSize"]);nT()(this,A),this._cellSizeAndPositionManager=new bT(o),this._maxScrollSize=t}return rT()(A,[{key:"areOffsetsAdjusted",value:function(){return this._cellSizeAndPositionManager.getTotalSize()>this._maxScrollSize}},{key:"configure",value:function(A){this._cellSizeAndPositionManager.configure(A)}},{key:"getCellCount",value:function(){return this._cellSizeAndPositionManager.getCellCount()}},{key:"getEstimatedCellSize",value:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()}},{key:"getLastMeasuredIndex",value:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()}},{key:"getOffsetAdjustment",value:function(A){var e=A.containerSize,i=A.offset,t=this._cellSizeAndPositionManager.getTotalSize(),o=this.getTotalSize(),n=this._getOffsetPercentage({containerSize:e,offset:i,totalSize:o});return Math.round(n*(o-t))}},{key:"getSizeAndPositionOfCell",value:function(A){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(A)}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()}},{key:"getTotalSize",value:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())}},{key:"getUpdatedOffsetForIndex",value:function(A){var e=A.align,i=void 0===e?"auto":e,t=A.containerSize,o=A.currentOffset,n=A.targetIndex;o=this._safeOffsetToOffset({containerSize:t,offset:o});var a=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({align:i,containerSize:t,currentOffset:o,targetIndex:n});return this._offsetToSafeOffset({containerSize:t,offset:a})}},{key:"getVisibleCellRange",value:function(A){var e=A.containerSize,i=A.offset;return i=this._safeOffsetToOffset({containerSize:e,offset:i}),this._cellSizeAndPositionManager.getVisibleCellRange({containerSize:e,offset:i})}},{key:"resetCell",value:function(A){this._cellSizeAndPositionManager.resetCell(A)}},{key:"_getOffsetPercentage",value:function(A){var e=A.containerSize,i=A.offset,t=A.totalSize;return t<=e?0:i/(t-e)}},{key:"_offsetToSafeOffset",value:function(A){var e=A.containerSize,i=A.offset,t=this._cellSizeAndPositionManager.getTotalSize(),o=this.getTotalSize();if(t===o)return i;var n=this._getOffsetPercentage({containerSize:e,offset:i,totalSize:t});return Math.round(n*(o-e))}},{key:"_safeOffsetToOffset",value:function(A){var e=A.containerSize,i=A.offset,t=this._cellSizeAndPositionManager.getTotalSize(),o=this.getTotalSize();if(t===o)return i;var n=this._getOffsetPercentage({containerSize:e,offset:i,totalSize:o});return Math.round(n*(t-e))}}]),A}(),kT=i(159),FT=i.n(kT);function vT(){var A=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e={};return function(i){var t=i.callback,o=i.indices,n=FT()(o),a=!A||n.every(function(A){var e=o[A];return Array.isArray(e)?e.length>0:e>=0}),r=n.length!==FT()(e).length||n.some(function(A){var i=e[A],t=o[A];return Array.isArray(t)?i.join(",")!==t.join(","):i!==t});e=o,a&&r&&t(o)}}var ST=1;function NT(A){var e=A.cellSize,i=A.cellSizeAndPositionManager,t=A.previousCellsCount,o=A.previousCellSize,n=A.previousScrollToAlignment,a=A.previousScrollToIndex,r=A.previousSize,s=A.scrollOffset,g=A.scrollToAlignment,l=A.scrollToIndex,c=A.size,u=A.sizeJustIncreasedFromZero,B=A.updateScrollIndexCallback,d=i.getCellCount(),E=l>=0&&l<d;E&&(c!==r||u||!o||"number"==typeof e&&e!==o||g!==n||l!==a)?B(l):!E&&d>0&&(c<r||d<t)&&s>i.getTotalSize()-c&&B(d-1)}function RT(A,e){e&&(e.type&&e.type.__internalCellMeasurerFlag&&(e=e.props.children),e&&e.props&&void 0===e.props.style&&!0!==A.__warnedAboutMissingStyle&&(A.__warnedAboutMissingStyle=!0,console.warn("Rendered cell should include style property for positioning.")))}var OT=i(219),YT=i.n(OT),UT=i(942),GT=i.n(UT),HT=void 0,LT=(HT="undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).requestAnimationFrame||HT.webkitRequestAnimationFrame||HT.mozRequestAnimationFrame||HT.oRequestAnimationFrame||HT.msRequestAnimationFrame||function(A){return HT.setTimeout(A,1e3/60)},PT=HT.cancelAnimationFrame||HT.webkitCancelAnimationFrame||HT.mozCancelAnimationFrame||HT.oCancelAnimationFrame||HT.msCancelAnimationFrame||function(A){HT.clearTimeout(A)},xT=(o.a.number.isRequired,function(A){return PT(A.id)}),_T=function(A,e){var i=void 0;GT.a.resolve().then(function(){i=Date.now()});var t={id:LT(function o(){Date.now()-i>=e?A.call():t.id=LT(o)})};return t},jT="observed",JT="requested",zT=function(A){function e(A){nT()(this,e);var i=gT()(this,(e.__proto__||tT()(e)).call(this,A));i._onGridRenderedMemoizer=vT(),i._onScrollMemoizer=vT(!1),i._deferredInvalidateColumnIndex=null,i._deferredInvalidateRowIndex=null,i._recomputeScrollLeftFlag=!1,i._recomputeScrollTopFlag=!1,i._horizontalScrollBarSize=0,i._verticalScrollBarSize=0,i._scrollbarPresenceChanged=!1,i._renderedColumnStartIndex=0,i._renderedColumnStopIndex=0,i._renderedRowStartIndex=0,i._renderedRowStopIndex=0,i._styleCache={},i._cellCache={},i._debounceScrollEndedCallback=function(){i._disablePointerEventsTimeoutId=null,i.setState({isScrolling:!1,needToResetStyleCache:!1})},i._invokeOnGridRenderedHelper=function(){var A=i.props.onSectionRendered;i._onGridRenderedMemoizer({callback:A,indices:{columnOverscanStartIndex:i._columnStartIndex,columnOverscanStopIndex:i._columnStopIndex,columnStartIndex:i._renderedColumnStartIndex,columnStopIndex:i._renderedColumnStopIndex,rowOverscanStartIndex:i._rowStartIndex,rowOverscanStopIndex:i._rowStopIndex,rowStartIndex:i._renderedRowStartIndex,rowStopIndex:i._renderedRowStopIndex}})},i._setScrollingContainerRef=function(A){i._scrollingContainer=A},i._onScroll=function(A){A.target===i._scrollingContainer&&i.handleScrollEvent(A.target)};var t=new TT({cellCount:A.columnCount,cellSizeGetter:function(i){return e._wrapSizeGetter(A.columnWidth)(i)},estimatedCellSize:e._getEstimatedColumnSize(A)}),o=new TT({cellCount:A.rowCount,cellSizeGetter:function(i){return e._wrapSizeGetter(A.rowHeight)(i)},estimatedCellSize:e._getEstimatedRowSize(A)});return i.state={instanceProps:{columnSizeAndPositionManager:t,rowSizeAndPositionManager:o,prevColumnWidth:A.columnWidth,prevRowHeight:A.rowHeight,prevColumnCount:A.columnCount,prevRowCount:A.rowCount,prevIsScrolling:!0===A.isScrolling,prevScrollToColumn:A.scrollToColumn,prevScrollToRow:A.scrollToRow,scrollbarSize:0,scrollbarSizeMeasured:!1},isScrolling:!1,scrollDirectionHorizontal:ST,scrollDirectionVertical:ST,scrollLeft:0,scrollTop:0,scrollPositionChangeReason:null,needToResetStyleCache:!1},A.scrollToRow>0&&(i._initialScrollTop=i._getCalculatedScrollTop(A,i.state)),A.scrollToColumn>0&&(i._initialScrollLeft=i._getCalculatedScrollLeft(A,i.state)),i}return cT()(e,A),rT()(e,[{key:"getOffsetForCell",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.alignment,i=void 0===e?this.props.scrollToAlignment:e,t=A.columnIndex,o=void 0===t?this.props.scrollToColumn:t,n=A.rowIndex,a=void 0===n?this.props.scrollToRow:n,r=hT()({},this.props,{scrollToAlignment:i,scrollToColumn:o,scrollToRow:a});return{scrollLeft:this._getCalculatedScrollLeft(r),scrollTop:this._getCalculatedScrollTop(r)}}},{key:"getTotalRowsHeight",value:function(){return this.state.instanceProps.rowSizeAndPositionManager.getTotalSize()}},{key:"getTotalColumnsWidth",value:function(){return this.state.instanceProps.columnSizeAndPositionManager.getTotalSize()}},{key:"handleScrollEvent",value:function(A){var e=A.scrollLeft,i=void 0===e?0:e,t=A.scrollTop,o=void 0===t?0:t;if(!(o<0)){this._debounceScrollEnded();var n=this.props,a=n.autoHeight,r=n.autoWidth,s=n.height,g=n.width,l=this.state.instanceProps,c=l.scrollbarSize,u=l.rowSizeAndPositionManager.getTotalSize(),B=l.columnSizeAndPositionManager.getTotalSize(),d=Math.min(Math.max(0,B-g+c),i),E=Math.min(Math.max(0,u-s+c),o);if(this.state.scrollLeft!==d||this.state.scrollTop!==E){var h={isScrolling:!0,scrollDirectionHorizontal:d!==this.state.scrollLeft?d>this.state.scrollLeft?ST:-1:this.state.scrollDirectionHorizontal,scrollDirectionVertical:E!==this.state.scrollTop?E>this.state.scrollTop?ST:-1:this.state.scrollDirectionVertical,scrollPositionChangeReason:jT};a||(h.scrollTop=E),r||(h.scrollLeft=d),h.needToResetStyleCache=!1,this.setState(h)}this._invokeOnScrollMemoizer({scrollLeft:d,scrollTop:E,totalColumnsWidth:B,totalRowsHeight:u})}}},{key:"invalidateCellSizeAfterRender",value:function(A){var e=A.columnIndex,i=A.rowIndex;this._deferredInvalidateColumnIndex="number"==typeof this._deferredInvalidateColumnIndex?Math.min(this._deferredInvalidateColumnIndex,e):e,this._deferredInvalidateRowIndex="number"==typeof this._deferredInvalidateRowIndex?Math.min(this._deferredInvalidateRowIndex,i):i}},{key:"measureAllCells",value:function(){var A=this.props,e=A.columnCount,i=A.rowCount,t=this.state.instanceProps;t.columnSizeAndPositionManager.getSizeAndPositionOfCell(e-1),t.rowSizeAndPositionManager.getSizeAndPositionOfCell(i-1)}},{key:"recomputeGridSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.columnIndex,i=void 0===e?0:e,t=A.rowIndex,o=void 0===t?0:t,n=this.props,a=n.scrollToColumn,r=n.scrollToRow,s=this.state.instanceProps;s.columnSizeAndPositionManager.resetCell(i),s.rowSizeAndPositionManager.resetCell(o),this._recomputeScrollLeftFlag=a>=0&&(this.state.scrollDirectionHorizontal===ST?i<=a:i>=a),this._recomputeScrollTopFlag=r>=0&&(this.state.scrollDirectionVertical===ST?o<=r:o>=r),this._styleCache={},this._cellCache={},this.forceUpdate()}},{key:"scrollToCell",value:function(A){var e=A.columnIndex,i=A.rowIndex,t=this.props.columnCount,o=this.props;t>1&&void 0!==e&&this._updateScrollLeftForScrollToColumn(hT()({},o,{scrollToColumn:e})),void 0!==i&&this._updateScrollTopForScrollToRow(hT()({},o,{scrollToRow:i}))}},{key:"componentDidMount",value:function(){var A=this.props,i=A.getScrollbarSize,t=A.height,o=A.scrollLeft,n=A.scrollToColumn,a=A.scrollTop,r=A.scrollToRow,s=A.width,g=this.state.instanceProps;if(this._initialScrollTop=0,this._initialScrollLeft=0,this._handleInvalidatedGridSize(),g.scrollbarSizeMeasured||this.setState(function(A){var e=hT()({},A,{needToResetStyleCache:!1});return e.instanceProps.scrollbarSize=i(),e.instanceProps.scrollbarSizeMeasured=!0,e}),"number"==typeof o&&o>=0||"number"==typeof a&&a>=0){var l=e._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:o,scrollTop:a});l&&(l.needToResetStyleCache=!1,this.setState(l))}this._scrollingContainer&&(this._scrollingContainer.scrollLeft!==this.state.scrollLeft&&(this._scrollingContainer.scrollLeft=this.state.scrollLeft),this._scrollingContainer.scrollTop!==this.state.scrollTop&&(this._scrollingContainer.scrollTop=this.state.scrollTop));var c=t>0&&s>0;n>=0&&c&&this._updateScrollLeftForScrollToColumn(),r>=0&&c&&this._updateScrollTopForScrollToRow(),this._invokeOnGridRenderedHelper(),this._invokeOnScrollMemoizer({scrollLeft:o||0,scrollTop:a||0,totalColumnsWidth:g.columnSizeAndPositionManager.getTotalSize(),totalRowsHeight:g.rowSizeAndPositionManager.getTotalSize()}),this._maybeCallOnScrollbarPresenceChange()}},{key:"componentDidUpdate",value:function(A,e){var i=this,t=this.props,o=t.autoHeight,n=t.autoWidth,a=t.columnCount,r=t.height,s=t.rowCount,g=t.scrollToAlignment,l=t.scrollToColumn,c=t.scrollToRow,u=t.width,B=this.state,d=B.scrollLeft,E=B.scrollPositionChangeReason,h=B.scrollTop,C=B.instanceProps;this._handleInvalidatedGridSize();var w=a>0&&0===A.columnCount||s>0&&0===A.rowCount;E===JT&&(!n&&d>=0&&(d!==this._scrollingContainer.scrollLeft||w)&&(this._scrollingContainer.scrollLeft=d),!o&&h>=0&&(h!==this._scrollingContainer.scrollTop||w)&&(this._scrollingContainer.scrollTop=h));var m=(0===A.width||0===A.height)&&r>0&&u>0;if(this._recomputeScrollLeftFlag?(this._recomputeScrollLeftFlag=!1,this._updateScrollLeftForScrollToColumn(this.props)):NT({cellSizeAndPositionManager:C.columnSizeAndPositionManager,previousCellsCount:A.columnCount,previousCellSize:A.columnWidth,previousScrollToAlignment:A.scrollToAlignment,previousScrollToIndex:A.scrollToColumn,previousSize:A.width,scrollOffset:d,scrollToAlignment:g,scrollToIndex:l,size:u,sizeJustIncreasedFromZero:m,updateScrollIndexCallback:function(){return i._updateScrollLeftForScrollToColumn(i.props)}}),this._recomputeScrollTopFlag?(this._recomputeScrollTopFlag=!1,this._updateScrollTopForScrollToRow(this.props)):NT({cellSizeAndPositionManager:C.rowSizeAndPositionManager,previousCellsCount:A.rowCount,previousCellSize:A.rowHeight,previousScrollToAlignment:A.scrollToAlignment,previousScrollToIndex:A.scrollToRow,previousSize:A.height,scrollOffset:h,scrollToAlignment:g,scrollToIndex:c,size:r,sizeJustIncreasedFromZero:m,updateScrollIndexCallback:function(){return i._updateScrollTopForScrollToRow(i.props)}}),this._invokeOnGridRenderedHelper(),d!==e.scrollLeft||h!==e.scrollTop){var p=C.rowSizeAndPositionManager.getTotalSize(),I=C.columnSizeAndPositionManager.getTotalSize();this._invokeOnScrollMemoizer({scrollLeft:d,scrollTop:h,totalColumnsWidth:I,totalRowsHeight:p})}this._maybeCallOnScrollbarPresenceChange()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&xT(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var A=this.props,e=A.autoContainerWidth,i=A.autoHeight,t=A.autoWidth,o=A.className,a=A.containerProps,r=A.containerRole,s=A.containerStyle,g=A.height,l=A.id,c=A.noContentRenderer,u=A.role,B=A.style,d=A.tabIndex,E=A.width,h=this.state,C=h.instanceProps,w=h.needToResetStyleCache,m=this._isScrolling(),p={boxSizing:"border-box",direction:"ltr",height:i?"auto":g,position:"relative",width:t?"auto":E,WebkitOverflowScrolling:"touch",willChange:"transform"};w&&(this._styleCache={}),this.state.isScrolling||this._resetStyleCache(),this._calculateChildrenToRender(this.props,this.state);var I=C.columnSizeAndPositionManager.getTotalSize(),f=C.rowSizeAndPositionManager.getTotalSize(),Q=f>g?C.scrollbarSize:0,D=I>E?C.scrollbarSize:0;D===this._horizontalScrollBarSize&&Q===this._verticalScrollBarSize||(this._horizontalScrollBarSize=D,this._verticalScrollBarSize=Q,this._scrollbarPresenceChanged=!0),p.overflowX=I+Q<=E?"hidden":"auto",p.overflowY=f+D<=g?"hidden":"auto";var M=this._childrenToDisplay,b=0===M.length&&g>0&&E>0;return n.createElement("div",hT()({ref:this._setScrollingContainerRef},a,{"aria-label":this.props["aria-label"],"aria-readonly":this.props["aria-readonly"],className:Le()("ReactVirtualized__Grid",o),id:l,onScroll:this._onScroll,role:u,style:hT()({},p,B),tabIndex:d}),M.length>0&&n.createElement("div",{className:"ReactVirtualized__Grid__innerScrollContainer",role:r,style:hT()({width:e?"auto":I,height:f,maxWidth:I,maxHeight:f,overflow:"hidden",pointerEvents:m?"none":"",position:"relative"},s)},M),b&&c())}},{key:"_calculateChildrenToRender",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,i=A.cellRenderer,t=A.cellRangeRenderer,o=A.columnCount,n=A.deferredMeasurementCache,a=A.height,r=A.overscanColumnCount,s=A.overscanIndicesGetter,g=A.overscanRowCount,l=A.rowCount,c=A.width,u=A.isScrollingOptOut,B=e.scrollDirectionHorizontal,d=e.scrollDirectionVertical,E=e.instanceProps,h=this._initialScrollTop>0?this._initialScrollTop:e.scrollTop,C=this._initialScrollLeft>0?this._initialScrollLeft:e.scrollLeft,w=this._isScrolling(A,e);if(this._childrenToDisplay=[],a>0&&c>0){var m=E.columnSizeAndPositionManager.getVisibleCellRange({containerSize:c,offset:C}),p=E.rowSizeAndPositionManager.getVisibleCellRange({containerSize:a,offset:h}),I=E.columnSizeAndPositionManager.getOffsetAdjustment({containerSize:c,offset:C}),f=E.rowSizeAndPositionManager.getOffsetAdjustment({containerSize:a,offset:h});this._renderedColumnStartIndex=m.start,this._renderedColumnStopIndex=m.stop,this._renderedRowStartIndex=p.start,this._renderedRowStopIndex=p.stop;var Q=s({direction:"horizontal",cellCount:o,overscanCellsCount:r,scrollDirection:B,startIndex:"number"==typeof m.start?m.start:0,stopIndex:"number"==typeof m.stop?m.stop:-1}),D=s({direction:"vertical",cellCount:l,overscanCellsCount:g,scrollDirection:d,startIndex:"number"==typeof p.start?p.start:0,stopIndex:"number"==typeof p.stop?p.stop:-1}),M=Q.overscanStartIndex,b=Q.overscanStopIndex,y=D.overscanStartIndex,T=D.overscanStopIndex;if(n){if(!n.hasFixedHeight())for(var k=y;k<=T;k++)if(!n.has(k,0)){M=0,b=o-1;break}if(!n.hasFixedWidth())for(var F=M;F<=b;F++)if(!n.has(0,F)){y=0,T=l-1;break}}this._childrenToDisplay=t({cellCache:this._cellCache,cellRenderer:i,columnSizeAndPositionManager:E.columnSizeAndPositionManager,columnStartIndex:M,columnStopIndex:b,deferredMeasurementCache:n,horizontalOffsetAdjustment:I,isScrolling:w,isScrollingOptOut:u,parent:this,rowSizeAndPositionManager:E.rowSizeAndPositionManager,rowStartIndex:y,rowStopIndex:T,scrollLeft:C,scrollTop:h,styleCache:this._styleCache,verticalOffsetAdjustment:f,visibleColumnIndices:m,visibleRowIndices:p}),this._columnStartIndex=M,this._columnStopIndex=b,this._rowStartIndex=y,this._rowStopIndex=T}}},{key:"_debounceScrollEnded",value:function(){var A=this.props.scrollingResetTimeInterval;this._disablePointerEventsTimeoutId&&xT(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=_T(this._debounceScrollEndedCallback,A)}},{key:"_handleInvalidatedGridSize",value:function(){if("number"==typeof this._deferredInvalidateColumnIndex&&"number"==typeof this._deferredInvalidateRowIndex){var A=this._deferredInvalidateColumnIndex,e=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:A,rowIndex:e})}}},{key:"_invokeOnScrollMemoizer",value:function(A){var e=this,i=A.scrollLeft,t=A.scrollTop,o=A.totalColumnsWidth,n=A.totalRowsHeight;this._onScrollMemoizer({callback:function(A){var i=A.scrollLeft,t=A.scrollTop,a=e.props,r=a.height;(0,a.onScroll)({clientHeight:r,clientWidth:a.width,scrollHeight:n,scrollLeft:i,scrollTop:t,scrollWidth:o})},indices:{scrollLeft:i,scrollTop:t}})}},{key:"_isScrolling",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return Object.hasOwnProperty.call(A,"isScrolling")?Boolean(A.isScrolling):Boolean(e.isScrolling)}},{key:"_maybeCallOnScrollbarPresenceChange",value:function(){if(this._scrollbarPresenceChanged){var A=this.props.onScrollbarPresenceChange;this._scrollbarPresenceChanged=!1,A({horizontal:this._horizontalScrollBarSize>0,size:this.state.instanceProps.scrollbarSize,vertical:this._verticalScrollBarSize>0})}}},{key:"scrollToPosition",value:function(A){var i=A.scrollLeft,t=A.scrollTop,o=e._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:i,scrollTop:t});o&&(o.needToResetStyleCache=!1,this.setState(o))}},{key:"_getCalculatedScrollLeft",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return e._getCalculatedScrollLeft(A,i)}},{key:"_updateScrollLeftForScrollToColumn",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,t=e._getScrollLeftForScrollToColumnStateUpdate(A,i);t&&(t.needToResetStyleCache=!1,this.setState(t))}},{key:"_getCalculatedScrollTop",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return e._getCalculatedScrollTop(A,i)}},{key:"_resetStyleCache",value:function(){var A=this._styleCache,e=this._cellCache,i=this.props.isScrollingOptOut;this._cellCache={},this._styleCache={};for(var t=this._rowStartIndex;t<=this._rowStopIndex;t++)for(var o=this._columnStartIndex;o<=this._columnStopIndex;o++){var n=t+"-"+o;this._styleCache[n]=A[n],i&&(this._cellCache[n]=e[n])}}},{key:"_updateScrollTopForScrollToRow",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,t=e._getScrollTopForScrollToRowStateUpdate(A,i);t&&(t.needToResetStyleCache=!1,this.setState(t))}}],[{key:"getDerivedStateFromProps",value:function(A,i){var t={};0===A.columnCount&&0!==i.scrollLeft||0===A.rowCount&&0!==i.scrollTop?(t.scrollLeft=0,t.scrollTop=0):(A.scrollLeft!==i.scrollLeft&&A.scrollToColumn<0||A.scrollTop!==i.scrollTop&&A.scrollToRow<0)&&dT()(t,e._getScrollToPositionStateUpdate({prevState:i,scrollLeft:A.scrollLeft,scrollTop:A.scrollTop}));var o=i.instanceProps;t.needToResetStyleCache=!1,A.columnWidth===o.prevColumnWidth&&A.rowHeight===o.prevRowHeight||(t.needToResetStyleCache=!0),o.columnSizeAndPositionManager.configure({cellCount:A.columnCount,estimatedCellSize:e._getEstimatedColumnSize(A),cellSizeGetter:e._wrapSizeGetter(A.columnWidth)}),o.rowSizeAndPositionManager.configure({cellCount:A.rowCount,estimatedCellSize:e._getEstimatedRowSize(A),cellSizeGetter:e._wrapSizeGetter(A.rowHeight)}),0!==o.prevColumnCount&&0!==o.prevRowCount||(o.prevColumnCount=0,o.prevRowCount=0),A.autoHeight&&!1===A.isScrolling&&!0===o.prevIsScrolling&&dT()(t,{isScrolling:!1});var n=void 0,a=void 0;return CT({cellCount:o.prevColumnCount,cellSize:"number"==typeof o.prevColumnWidth?o.prevColumnWidth:null,computeMetadataCallback:function(){return o.columnSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:A,nextCellsCount:A.columnCount,nextCellSize:"number"==typeof A.columnWidth?A.columnWidth:null,nextScrollToIndex:A.scrollToColumn,scrollToIndex:o.prevScrollToColumn,updateScrollOffsetForScrollToIndex:function(){n=e._getScrollLeftForScrollToColumnStateUpdate(A,i)}}),CT({cellCount:o.prevRowCount,cellSize:"number"==typeof o.prevRowHeight?o.prevRowHeight:null,computeMetadataCallback:function(){return o.rowSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:A,nextCellsCount:A.rowCount,nextCellSize:"number"==typeof A.rowHeight?A.rowHeight:null,nextScrollToIndex:A.scrollToRow,scrollToIndex:o.prevScrollToRow,updateScrollOffsetForScrollToIndex:function(){a=e._getScrollTopForScrollToRowStateUpdate(A,i)}}),o.prevColumnCount=A.columnCount,o.prevColumnWidth=A.columnWidth,o.prevIsScrolling=!0===A.isScrolling,o.prevRowCount=A.rowCount,o.prevRowHeight=A.rowHeight,o.prevScrollToColumn=A.scrollToColumn,o.prevScrollToRow=A.scrollToRow,o.scrollbarSize=A.getScrollbarSize(),void 0===o.scrollbarSize?(o.scrollbarSizeMeasured=!1,o.scrollbarSize=0):o.scrollbarSizeMeasured=!0,t.instanceProps=o,hT()({},t,n,a)}},{key:"_getEstimatedColumnSize",value:function(A){return"number"==typeof A.columnWidth?A.columnWidth:A.estimatedColumnSize}},{key:"_getEstimatedRowSize",value:function(A){return"number"==typeof A.rowHeight?A.rowHeight:A.estimatedRowSize}},{key:"_getScrollToPositionStateUpdate",value:function(A){var e=A.prevState,i=A.scrollLeft,t=A.scrollTop,o={scrollPositionChangeReason:JT};return"number"==typeof i&&i>=0&&(o.scrollDirectionHorizontal=i>e.scrollLeft?ST:-1,o.scrollLeft=i),"number"==typeof t&&t>=0&&(o.scrollDirectionVertical=t>e.scrollTop?ST:-1,o.scrollTop=t),"number"==typeof i&&i>=0&&i!==e.scrollLeft||"number"==typeof t&&t>=0&&t!==e.scrollTop?o:null}},{key:"_wrapSizeGetter",value:function(A){return"function"==typeof A?A:function(){return A}}},{key:"_getCalculatedScrollLeft",value:function(A,e){var i=A.columnCount,t=A.height,o=A.scrollToAlignment,n=A.scrollToColumn,a=A.width,r=e.scrollLeft,s=e.instanceProps;if(i>0){var g=i-1,l=n<0?g:Math.min(g,n),c=s.rowSizeAndPositionManager.getTotalSize(),u=s.scrollbarSizeMeasured&&c>t?s.scrollbarSize:0;return s.columnSizeAndPositionManager.getUpdatedOffsetForIndex({align:o,containerSize:a-u,currentOffset:r,targetIndex:l})}return 0}},{key:"_getScrollLeftForScrollToColumnStateUpdate",value:function(A,i){var t=i.scrollLeft,o=e._getCalculatedScrollLeft(A,i);return"number"==typeof o&&o>=0&&t!==o?e._getScrollToPositionStateUpdate({prevState:i,scrollLeft:o,scrollTop:-1}):null}},{key:"_getCalculatedScrollTop",value:function(A,e){var i=A.height,t=A.rowCount,o=A.scrollToAlignment,n=A.scrollToRow,a=A.width,r=e.scrollTop,s=e.instanceProps;if(t>0){var g=t-1,l=n<0?g:Math.min(g,n),c=s.columnSizeAndPositionManager.getTotalSize(),u=s.scrollbarSizeMeasured&&c>a?s.scrollbarSize:0;return s.rowSizeAndPositionManager.getUpdatedOffsetForIndex({align:o,containerSize:i-u,currentOffset:r,targetIndex:l})}return 0}},{key:"_getScrollTopForScrollToRowStateUpdate",value:function(A,i){var t=i.scrollTop,o=e._getCalculatedScrollTop(A,i);return"number"==typeof o&&o>=0&&t!==o?e._getScrollToPositionStateUpdate({prevState:i,scrollLeft:-1,scrollTop:o}):null}}]),e}(n.PureComponent);zT.defaultProps={"aria-label":"grid","aria-readonly":!0,autoContainerWidth:!1,autoHeight:!1,autoWidth:!1,cellRangeRenderer:function(A){for(var e=A.cellCache,i=A.cellRenderer,t=A.columnSizeAndPositionManager,o=A.columnStartIndex,n=A.columnStopIndex,a=A.deferredMeasurementCache,r=A.horizontalOffsetAdjustment,s=A.isScrolling,g=A.isScrollingOptOut,l=A.parent,c=A.rowSizeAndPositionManager,u=A.rowStartIndex,B=A.rowStopIndex,d=A.styleCache,E=A.verticalOffsetAdjustment,h=A.visibleColumnIndices,C=A.visibleRowIndices,w=[],m=t.areOffsetsAdjusted()||c.areOffsetsAdjusted(),p=!s&&!m,I=u;I<=B;I++)for(var f=c.getSizeAndPositionOfCell(I),Q=o;Q<=n;Q++){var D=t.getSizeAndPositionOfCell(Q),M=Q>=h.start&&Q<=h.stop&&I>=C.start&&I<=C.stop,b=I+"-"+Q,y=void 0;p&&d[b]?y=d[b]:a&&!a.has(I,Q)?y={height:"auto",left:0,position:"absolute",top:0,width:"auto"}:(y={height:f.size,left:D.offset+r,position:"absolute",top:f.offset+E,width:D.size},d[b]=y);var T={columnIndex:Q,isScrolling:s,isVisible:M,key:b,parent:l,rowIndex:I,style:y},k=void 0;!g&&!s||r||E?k=i(T):(e[b]||(e[b]=i(T)),k=e[b]),null!=k&&!1!==k&&(RT(l,k),w.push(k))}return w},containerRole:"rowgroup",containerStyle:{},estimatedColumnSize:100,estimatedRowSize:30,getScrollbarSize:YT.a,noContentRenderer:function(){return null},onScroll:function(){},onScrollbarPresenceChange:function(){},onSectionRendered:function(){},overscanColumnCount:0,overscanIndicesGetter:function(A){var e=A.cellCount,i=A.overscanCellsCount,t=A.scrollDirection,o=A.startIndex,n=A.stopIndex;return t===ST?{overscanStartIndex:Math.max(0,o),overscanStopIndex:Math.min(e-1,n+i)}:{overscanStartIndex:Math.max(0,o-i),overscanStopIndex:Math.min(e-1,n)}},overscanRowCount:10,role:"grid",scrollingResetTimeInterval:150,scrollToAlignment:"auto",scrollToColumn:-1,scrollToRow:-1,style:{},tabIndex:0,isScrollingOptOut:!1},zT.propTypes={"aria-label":o.a.string.isRequired,"aria-readonly":o.a.bool,autoContainerWidth:o.a.bool.isRequired,autoHeight:o.a.bool.isRequired,autoWidth:o.a.bool.isRequired,cellRenderer:function(){return("function"==typeof pT?pT.isRequired?pT.isRequired:pT:o.a.shape(pT).isRequired).apply(this,arguments)},cellRangeRenderer:function(){return("function"==typeof IT?IT.isRequired?IT.isRequired:IT:o.a.shape(IT).isRequired).apply(this,arguments)},className:o.a.string,columnCount:o.a.number.isRequired,columnWidth:function(){return("function"==typeof fT?fT.isRequired?fT.isRequired:fT:o.a.shape(fT).isRequired).apply(this,arguments)},containerProps:o.a.object,containerRole:o.a.string.isRequired,containerStyle:o.a.object.isRequired,deferredMeasurementCache:o.a.object,estimatedColumnSize:o.a.number.isRequired,estimatedRowSize:o.a.number.isRequired,getScrollbarSize:o.a.func.isRequired,height:o.a.number.isRequired,id:o.a.string,isScrolling:o.a.bool,isScrollingOptOut:o.a.bool.isRequired,noContentRenderer:function(){return("function"==typeof QT?QT.isRequired?QT.isRequired:QT:o.a.shape(QT).isRequired).apply(this,arguments)},onScroll:o.a.func.isRequired,onScrollbarPresenceChange:o.a.func.isRequired,onSectionRendered:o.a.func.isRequired,overscanColumnCount:o.a.number.isRequired,overscanIndicesGetter:function(){return("function"==typeof DT?DT.isRequired?DT.isRequired:DT:o.a.shape(DT).isRequired).apply(this,arguments)},overscanRowCount:o.a.number.isRequired,role:o.a.string.isRequired,rowHeight:function(){return("function"==typeof fT?fT.isRequired?fT.isRequired:fT:o.a.shape(fT).isRequired).apply(this,arguments)},rowCount:o.a.number.isRequired,scrollingResetTimeInterval:o.a.number.isRequired,scrollLeft:o.a.number,scrollToAlignment:function(){return("function"==typeof MT?MT.isRequired?MT.isRequired:MT:o.a.shape(MT).isRequired).apply(this,arguments)},scrollToColumn:o.a.number.isRequired,scrollTop:o.a.number,scrollToRow:o.a.number.isRequired,style:o.a.object.isRequired,tabIndex:o.a.number,width:o.a.number.isRequired},Object(uT.polyfill)(zT);var KT=zT,WT=1;function VT(A){var e=A.cellCount,i=A.overscanCellsCount,t=A.scrollDirection,o=A.startIndex,n=A.stopIndex;return i=Math.max(1,i),t===WT?{overscanStartIndex:Math.max(0,o-1),overscanStopIndex:Math.min(e-1,n+i)}:{overscanStartIndex:Math.max(0,o-i),overscanStopIndex:Math.min(e-1,n+1)}}o.a.number.isRequired,o.a.number.isRequired;var XT=function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t.state={scrollToColumn:0,scrollToRow:0},t._columnStartIndex=0,t._columnStopIndex=0,t._rowStartIndex=0,t._rowStopIndex=0,t._onKeyDown=function(A){var e=t.props,i=e.columnCount,o=e.disabled,n=e.mode,a=e.rowCount;if(!o){var r=t._getScrollState(),s=r.scrollToColumn,g=r.scrollToRow,l=t._getScrollState(),c=l.scrollToColumn,u=l.scrollToRow;switch(A.key){case"ArrowDown":u="cells"===n?Math.min(u+1,a-1):Math.min(t._rowStopIndex+1,a-1);break;case"ArrowLeft":c="cells"===n?Math.max(c-1,0):Math.max(t._columnStartIndex-1,0);break;case"ArrowRight":c="cells"===n?Math.min(c+1,i-1):Math.min(t._columnStopIndex+1,i-1);break;case"ArrowUp":u="cells"===n?Math.max(u-1,0):Math.max(t._rowStartIndex-1,0)}c===s&&u===g||(A.preventDefault(),t._updateScrollState({scrollToColumn:c,scrollToRow:u}))}},t._onSectionRendered=function(A){var e=A.columnStartIndex,i=A.columnStopIndex,o=A.rowStartIndex,n=A.rowStopIndex;t._columnStartIndex=e,t._columnStopIndex=i,t._rowStartIndex=o,t._rowStopIndex=n},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"setScrollIndexes",value:function(A){var e=A.scrollToColumn,i=A.scrollToRow;this.setState({scrollToRow:i,scrollToColumn:e})}},{key:"render",value:function(){var A=this.props,e=A.className,i=A.children,t=this._getScrollState(),o=t.scrollToColumn,a=t.scrollToRow;return n.createElement("div",{className:e,onKeyDown:this._onKeyDown},i({onSectionRendered:this._onSectionRendered,scrollToColumn:o,scrollToRow:a}))}},{key:"_getScrollState",value:function(){return this.props.isControlled?this.props:this.state}},{key:"_updateScrollState",value:function(A){var e=A.scrollToColumn,i=A.scrollToRow,t=this.props,o=t.isControlled,n=t.onScrollToChange;"function"==typeof n&&n({scrollToColumn:e,scrollToRow:i}),o||this.setState({scrollToColumn:e,scrollToRow:i})}}],[{key:"getDerivedStateFromProps",value:function(A,e){return A.isControlled?null:A.scrollToColumn!==e.scrollToColumn||A.scrollToRow!==e.scrollToRow?{scrollToColumn:A.scrollToColumn,scrollToRow:A.scrollToRow}:null}}]),e}(n.PureComponent);XT.defaultProps={disabled:!1,isControlled:!1,mode:"edges",scrollToColumn:0,scrollToRow:0},XT.propTypes={children:o.a.func.isRequired,className:o.a.string,columnCount:o.a.number.isRequired,disabled:o.a.bool.isRequired,isControlled:o.a.bool.isRequired,mode:o.a.oneOf(["cells","edges"]).isRequired,onScrollToChange:o.a.func,rowCount:o.a.number.isRequired,scrollToColumn:o.a.number.isRequired,scrollToRow:o.a.number.isRequired},Object(uT.polyfill)(XT);var ZT=i(290),qT=function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t.state={height:t.props.defaultHeight||0,width:t.props.defaultWidth||0},t._onResize=function(){var A=t.props,e=A.disableHeight,i=A.disableWidth,o=A.onResize;if(t._parentNode){var n=t._parentNode.offsetHeight||0,a=t._parentNode.offsetWidth||0,r=window.getComputedStyle(t._parentNode)||{},s=parseInt(r.paddingLeft,10)||0,g=parseInt(r.paddingRight,10)||0,l=parseInt(r.paddingTop,10)||0,c=parseInt(r.paddingBottom,10)||0,u=n-l-c,B=a-s-g;(!e&&t.state.height!==u||!i&&t.state.width!==B)&&(t.setState({height:n-l-c,width:a-s-g}),o({height:n,width:a}))}},t._setRef=function(A){t._autoSizer=A},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"componentDidMount",value:function(){var A=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._detectElementResize=Object(ZT.a)(A),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var A=this.props,e=A.children,i=A.className,t=A.disableHeight,o=A.disableWidth,a=A.style,r=this.state,s=r.height,g=r.width,l={overflow:"visible"},c={};return t||(l.height=0,c.height=s),o||(l.width=0,c.width=g),n.createElement("div",{className:i,ref:this._setRef,style:hT()({},l,a)},e(c))}}]),e}(n.PureComponent);qT.defaultProps={onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}},qT.propTypes={children:o.a.func.isRequired,className:o.a.string,defaultHeight:o.a.number,defaultWidth:o.a.number,disableHeight:o.a.bool.isRequired,disableWidth:o.a.bool.isRequired,nonce:o.a.string,onResize:o.a.func.isRequired,style:o.a.object};var $T={hasFixedWidth:o.a.func.isRequired,hasFixedHeight:o.a.func.isRequired,has:o.a.func.isRequired,set:o.a.func.isRequired,getHeight:o.a.func.isRequired,getWidth:o.a.func.isRequired},Ak=function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t._measure=function(){var A=t.props,e=A.cache,i=A.columnIndex,o=void 0===i?0:i,n=A.parent,a=A.rowIndex,r=void 0===a?t.props.index||0:a,s=t._getCellMeasurements(),g=s.height,l=s.width;g===e.getHeight(r,o)&&l===e.getWidth(r,o)||(e.set(r,o,l,g),n&&"function"==typeof n.recomputeGridSize&&n.recomputeGridSize({columnIndex:o,rowIndex:r}))},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"componentDidMount",value:function(){this._maybeMeasureCell()}},{key:"componentDidUpdate",value:function(){this._maybeMeasureCell()}},{key:"render",value:function(){var A=this.props.children;return"function"==typeof A?A({measure:this._measure}):A}},{key:"_getCellMeasurements",value:function(){var A=this.props.cache,e=Object(Sy.findDOMNode)(this);if(e&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.HTMLElement){var i=e.style.width,t=e.style.height;A.hasFixedWidth()||(e.style.width="auto"),A.hasFixedHeight()||(e.style.height="auto");var o=Math.ceil(e.offsetHeight),n=Math.ceil(e.offsetWidth);return i&&(e.style.width=i),t&&(e.style.height=t),{height:o,width:n}}return{height:0,width:0}}},{key:"_maybeMeasureCell",value:function(){var A=this.props,e=A.cache,i=A.columnIndex,t=void 0===i?0:i,o=A.parent,n=A.rowIndex,a=void 0===n?this.props.index||0:n;if(!e.has(a,t)){var r=this._getCellMeasurements(),s=r.height,g=r.width;e.set(a,t,g,s),o&&"function"==typeof o.invalidateCellSizeAfterRender&&o.invalidateCellSizeAfterRender({columnIndex:t,rowIndex:a})}}}]),e}(n.PureComponent);Ak.__internalCellMeasurerFlag=!1,Ak.propTypes={cache:function(){return("function"==typeof $T?$T.isRequired?$T.isRequired:$T:o.a.shape($T).isRequired).apply(this,arguments)},children:o.a.oneOfType([o.a.func,o.a.node]).isRequired,columnIndex:o.a.number,index:o.a.number,parent:o.a.shape({invalidateCellSizeAfterRender:o.a.func,recomputeGridSize:o.a.func}).isRequired,rowIndex:o.a.number};Ak.__internalCellMeasurerFlag=!0;var ek=30,ik=100;!function(){function A(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};nT()(this,A),this._cellHeightCache={},this._cellWidthCache={},this._columnWidthCache={},this._rowHeightCache={},this._columnCount=0,this._rowCount=0,this.columnWidth=function(A){var i=A.index,t=e._keyMapper(0,i);return e._columnWidthCache.hasOwnProperty(t)?e._columnWidthCache[t]:e._defaultWidth},this.rowHeight=function(A){var i=A.index,t=e._keyMapper(i,0);return e._rowHeightCache.hasOwnProperty(t)?e._rowHeightCache[t]:e._defaultHeight};var t=i.defaultHeight,o=i.defaultWidth,n=i.fixedHeight,a=i.fixedWidth,r=i.keyMapper,s=i.minHeight,g=i.minWidth;this._hasFixedHeight=!0===n,this._hasFixedWidth=!0===a,this._minHeight=s||0,this._minWidth=g||0,this._keyMapper=r||tk,this._defaultHeight=Math.max(this._minHeight,"number"==typeof t?t:ek),this._defaultWidth=Math.max(this._minWidth,"number"==typeof o?o:ik),!1===this._hasFixedHeight&&!1===this._hasFixedWidth&&console.warn("CellMeasurerCache should only measure a cell's width or height. You have configured CellMeasurerCache to measure both. This will result in poor performance."),!1===this._hasFixedHeight&&0===this._defaultHeight&&console.warn("Fixed height CellMeasurerCache should specify a :defaultHeight greater than 0. Failing to do so will lead to unnecessary layout and poor performance."),!1===this._hasFixedWidth&&0===this._defaultWidth&&console.warn("Fixed width CellMeasurerCache should specify a :defaultWidth greater than 0. Failing to do so will lead to unnecessary layout and poor performance.")}rT()(A,[{key:"clear",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this._keyMapper(A,e);delete this._cellHeightCache[i],delete this._cellWidthCache[i],this._updateCachedColumnAndRowSizes(A,e)}},{key:"clearAll",value:function(){this._cellHeightCache={},this._cellWidthCache={},this._columnWidthCache={},this._rowHeightCache={},this._rowCount=0,this._columnCount=0}},{key:"hasFixedHeight",value:function(){return this._hasFixedHeight}},{key:"hasFixedWidth",value:function(){return this._hasFixedWidth}},{key:"getHeight",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this._hasFixedHeight)return this._defaultHeight;var i=this._keyMapper(A,e);return this._cellHeightCache.hasOwnProperty(i)?Math.max(this._minHeight,this._cellHeightCache[i]):this._defaultHeight}},{key:"getWidth",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this._hasFixedWidth)return this._defaultWidth;var i=this._keyMapper(A,e);return this._cellWidthCache.hasOwnProperty(i)?Math.max(this._minWidth,this._cellWidthCache[i]):this._defaultWidth}},{key:"has",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this._keyMapper(A,e);return this._cellHeightCache.hasOwnProperty(i)}},{key:"set",value:function(A,e,i,t){var o=this._keyMapper(A,e);e>=this._columnCount&&(this._columnCount=e+1),A>=this._rowCount&&(this._rowCount=A+1),this._cellHeightCache[o]=t,this._cellWidthCache[o]=i,this._updateCachedColumnAndRowSizes(A,e)}},{key:"_updateCachedColumnAndRowSizes",value:function(A,e){if(!this._hasFixedWidth){for(var i=0,t=0;t<this._rowCount;t++)i=Math.max(i,this.getWidth(t,e));var o=this._keyMapper(0,e);this._columnWidthCache[o]=i}if(!this._hasFixedHeight){for(var n=0,a=0;a<this._columnCount;a++)n=Math.max(n,this.getHeight(A,a));var r=this._keyMapper(A,0);this._rowHeightCache[r]=n}}},{key:"defaultHeight",get:function(){return this._defaultHeight}},{key:"defaultWidth",get:function(){return this._defaultWidth}}])}();function tk(A,e){return A+"-"+e}var ok={OBSERVED:"observed",REQUESTED:"requested"},nk=function(A){function e(){var A;nT()(this,e);for(var i=arguments.length,t=Array(i),o=0;o<i;o++)t[o]=arguments[o];var n=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(t)));return n.state={isScrolling:!1,scrollLeft:0,scrollTop:0},n._calculateSizeAndPositionDataOnNextUpdate=!1,n._onSectionRenderedMemoizer=vT(),n._onScrollMemoizer=vT(!1),n._invokeOnSectionRenderedHelper=function(){var A=n.props,e=A.cellLayoutManager,i=A.onSectionRendered;n._onSectionRenderedMemoizer({callback:i,indices:{indices:e.getLastRenderedIndices()}})},n._setScrollingContainerRef=function(A){n._scrollingContainer=A},n._updateScrollPositionForScrollToCell=function(){var A=n.props,e=A.cellLayoutManager,i=A.height,t=A.scrollToAlignment,o=A.scrollToCell,a=A.width,r=n.state,s=r.scrollLeft,g=r.scrollTop;if(o>=0){var l=e.getScrollPositionForCell({align:t,cellIndex:o,height:i,scrollLeft:s,scrollTop:g,width:a});l.scrollLeft===s&&l.scrollTop===g||n._setScrollPosition(l)}},n._onScroll=function(A){if(A.target===n._scrollingContainer){n._enablePointerEventsAfterDelay();var e=n.props,i=e.cellLayoutManager,t=e.height,o=e.isScrollingChange,a=e.width,r=n._scrollbarSize,s=i.getTotalSize(),g=s.height,l=s.width,c=Math.max(0,Math.min(l-a+r,A.target.scrollLeft)),u=Math.max(0,Math.min(g-t+r,A.target.scrollTop));if(n.state.scrollLeft!==c||n.state.scrollTop!==u){var B=A.cancelable?ok.OBSERVED:ok.REQUESTED;n.state.isScrolling||o(!0),n.setState({isScrolling:!0,scrollLeft:c,scrollPositionChangeReason:B,scrollTop:u})}n._invokeOnScrollMemoizer({scrollLeft:c,scrollTop:u,totalWidth:l,totalHeight:g})}},n._scrollbarSize=YT()(),void 0===n._scrollbarSize?(n._scrollbarSizeMeasured=!1,n._scrollbarSize=0):n._scrollbarSizeMeasured=!0,n}return cT()(e,A),rT()(e,[{key:"recomputeCellSizesAndPositions",value:function(){this._calculateSizeAndPositionDataOnNextUpdate=!0,this.forceUpdate()}},{key:"componentDidMount",value:function(){var A=this.props,e=A.cellLayoutManager,i=A.scrollLeft,t=A.scrollToCell,o=A.scrollTop;this._scrollbarSizeMeasured||(this._scrollbarSize=YT()(),this._scrollbarSizeMeasured=!0,this.setState({})),t>=0?this._updateScrollPositionForScrollToCell():(i>=0||o>=0)&&this._setScrollPosition({scrollLeft:i,scrollTop:o}),this._invokeOnSectionRenderedHelper();var n=e.getTotalSize(),a=n.height,r=n.width;this._invokeOnScrollMemoizer({scrollLeft:i||0,scrollTop:o||0,totalHeight:a,totalWidth:r})}},{key:"componentDidUpdate",value:function(A,e){var i=this.props,t=i.height,o=i.scrollToAlignment,n=i.scrollToCell,a=i.width,r=this.state,s=r.scrollLeft,g=r.scrollPositionChangeReason,l=r.scrollTop;g===ok.REQUESTED&&(s>=0&&s!==e.scrollLeft&&s!==this._scrollingContainer.scrollLeft&&(this._scrollingContainer.scrollLeft=s),l>=0&&l!==e.scrollTop&&l!==this._scrollingContainer.scrollTop&&(this._scrollingContainer.scrollTop=l)),t===A.height&&o===A.scrollToAlignment&&n===A.scrollToCell&&a===A.width||this._updateScrollPositionForScrollToCell(),this._invokeOnSectionRenderedHelper()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var A=this.props,e=A.autoHeight,i=A.cellCount,t=A.cellLayoutManager,o=A.className,a=A.height,r=A.horizontalOverscanSize,s=A.id,g=A.noContentRenderer,l=A.style,c=A.verticalOverscanSize,u=A.width,B=this.state,d=B.isScrolling,E=B.scrollLeft,h=B.scrollTop;(this._lastRenderedCellCount!==i||this._lastRenderedCellLayoutManager!==t||this._calculateSizeAndPositionDataOnNextUpdate)&&(this._lastRenderedCellCount=i,this._lastRenderedCellLayoutManager=t,this._calculateSizeAndPositionDataOnNextUpdate=!1,t.calculateSizeAndPositionData());var C=t.getTotalSize(),w=C.height,m=C.width,p=Math.max(0,E-r),I=Math.max(0,h-c),f=Math.min(m,E+u+r),Q=Math.min(w,h+a+c),D=a>0&&u>0?t.cellRenderers({height:Q-I,isScrolling:d,width:f-p,x:p,y:I}):[],M={boxSizing:"border-box",direction:"ltr",height:e?"auto":a,position:"relative",WebkitOverflowScrolling:"touch",width:u,willChange:"transform"},b=w>a?this._scrollbarSize:0,y=m>u?this._scrollbarSize:0;return M.overflowX=m+b<=u?"hidden":"auto",M.overflowY=w+y<=a?"hidden":"auto",n.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:Le()("ReactVirtualized__Collection",o),id:s,onScroll:this._onScroll,role:"grid",style:hT()({},M,l),tabIndex:0},i>0&&n.createElement("div",{className:"ReactVirtualized__Collection__innerScrollContainer",style:{height:w,maxHeight:w,maxWidth:m,overflow:"hidden",pointerEvents:d?"none":"",width:m}},D),0===i&&g())}},{key:"_enablePointerEventsAfterDelay",value:function(){var A=this;this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=setTimeout(function(){(0,A.props.isScrollingChange)(!1),A._disablePointerEventsTimeoutId=null,A.setState({isScrolling:!1})},150)}},{key:"_invokeOnScrollMemoizer",value:function(A){var e=this,i=A.scrollLeft,t=A.scrollTop,o=A.totalHeight,n=A.totalWidth;this._onScrollMemoizer({callback:function(A){var i=A.scrollLeft,t=A.scrollTop,a=e.props,r=a.height;(0,a.onScroll)({clientHeight:r,clientWidth:a.width,scrollHeight:o,scrollLeft:i,scrollTop:t,scrollWidth:n})},indices:{scrollLeft:i,scrollTop:t}})}},{key:"_setScrollPosition",value:function(A){var e=A.scrollLeft,i=A.scrollTop,t={scrollPositionChangeReason:ok.REQUESTED};e>=0&&(t.scrollLeft=e),i>=0&&(t.scrollTop=i),(e>=0&&e!==this.state.scrollLeft||i>=0&&i!==this.state.scrollTop)&&this.setState(t)}}],[{key:"getDerivedStateFromProps",value:function(A,e){return 0!==A.cellCount||0===e.scrollLeft&&0===e.scrollTop?A.scrollLeft!==e.scrollLeft||A.scrollTop!==e.scrollTop?{scrollLeft:null!=A.scrollLeft?A.scrollLeft:e.scrollLeft,scrollTop:null!=A.scrollTop?A.scrollTop:e.scrollTop}:null:{scrollLeft:0,scrollTop:0}}}]),e}(n.PureComponent);nk.defaultProps={"aria-label":"grid",horizontalOverscanSize:0,noContentRenderer:function(){return null},onScroll:function(){return null},onSectionRendered:function(){return null},scrollToAlignment:"auto",scrollToCell:-1,style:{},verticalOverscanSize:0},nk.propTypes={"aria-label":o.a.string,autoHeight:o.a.bool,cellCount:o.a.number.isRequired,cellLayoutManager:o.a.object.isRequired,className:o.a.string,height:o.a.number.isRequired,id:o.a.string,horizontalOverscanSize:o.a.number.isRequired,isScrollingChange:o.a.func,noContentRenderer:o.a.func.isRequired,onScroll:o.a.func.isRequired,onSectionRendered:o.a.func.isRequired,scrollLeft:o.a.number,scrollToAlignment:o.a.oneOf(["auto","end","start","center"]).isRequired,scrollToCell:o.a.number.isRequired,scrollTop:o.a.number,style:o.a.object,verticalOverscanSize:o.a.number.isRequired,width:o.a.number.isRequired},Object(uT.polyfill)(nk);var ak=nk,rk=(o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,function(){function A(e){var i=e.height,t=e.width,o=e.x,n=e.y;nT()(this,A),this.height=i,this.width=t,this.x=o,this.y=n,this._indexMap={},this._indices=[]}return rT()(A,[{key:"addCellIndex",value:function(A){var e=A.index;this._indexMap[e]||(this._indexMap[e]=!0,this._indices.push(e))}},{key:"getCellIndices",value:function(){return this._indices}},{key:"toString",value:function(){return this.x+","+this.y+" "+this.width+"x"+this.height}}]),A}()),sk=100,gk=function(){function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sk;nT()(this,A),this._sectionSize=e,this._cellMetadata=[],this._sections={}}return rT()(A,[{key:"getCellIndices",value:function(A){var e=A.height,i=A.width,t=A.x,o=A.y,n={};return this.getSections({height:e,width:i,x:t,y:o}).forEach(function(A){return A.getCellIndices().forEach(function(A){n[A]=A})}),FT()(n).map(function(A){return n[A]})}},{key:"getCellMetadata",value:function(A){var e=A.index;return this._cellMetadata[e]}},{key:"getSections",value:function(A){for(var e=A.height,i=A.width,t=A.x,o=A.y,n=Math.floor(t/this._sectionSize),a=Math.floor((t+i-1)/this._sectionSize),r=Math.floor(o/this._sectionSize),s=Math.floor((o+e-1)/this._sectionSize),g=[],l=n;l<=a;l++)for(var c=r;c<=s;c++){var u=l+"."+c;this._sections[u]||(this._sections[u]=new rk({height:this._sectionSize,width:this._sectionSize,x:l*this._sectionSize,y:c*this._sectionSize})),g.push(this._sections[u])}return g}},{key:"getTotalSectionCount",value:function(){return FT()(this._sections).length}},{key:"toString",value:function(){var A=this;return FT()(this._sections).map(function(e){return A._sections[e].toString()})}},{key:"registerCell",value:function(A){var e=A.cellMetadatum,i=A.index;this._cellMetadata[i]=e,this.getSections(e).forEach(function(A){return A.addCellIndex({index:i})})}}]),A}();function lk(A){var e=A.align,i=void 0===e?"auto":e,t=A.cellOffset,o=A.cellSize,n=A.containerSize,a=A.currentOffset,r=t,s=r-n+o;switch(i){case"start":return r;case"end":return s;case"center":return r-(n-o)/2;default:return Math.max(s,Math.min(r,a))}}var ck=function(A){function e(A,i){nT()(this,e);var t=gT()(this,(e.__proto__||tT()(e)).call(this,A,i));return t._cellMetadata=[],t._lastRenderedCellIndices=[],t._cellCache=[],t._isScrollingChange=t._isScrollingChange.bind(t),t._setCollectionViewRef=t._setCollectionViewRef.bind(t),t}return cT()(e,A),rT()(e,[{key:"forceUpdate",value:function(){void 0!==this._collectionView&&this._collectionView.forceUpdate()}},{key:"recomputeCellSizesAndPositions",value:function(){this._cellCache=[],this._collectionView.recomputeCellSizesAndPositions()}},{key:"render",value:function(){var A=mT()(this.props,[]);return n.createElement(ak,hT()({cellLayoutManager:this,isScrollingChange:this._isScrollingChange,ref:this._setCollectionViewRef},A))}},{key:"calculateSizeAndPositionData",value:function(){var A=this.props,e=function(A){for(var e=A.cellCount,i=A.cellSizeAndPositionGetter,t=A.sectionSize,o=[],n=new gk(t),a=0,r=0,s=0;s<e;s++){var g=i({index:s});if(null==g.height||isNaN(g.height)||null==g.width||isNaN(g.width)||null==g.x||isNaN(g.x)||null==g.y||isNaN(g.y))throw Error("Invalid metadata returned for cell "+s+":\n x:"+g.x+", y:"+g.y+", width:"+g.width+", height:"+g.height);a=Math.max(a,g.y+g.height),r=Math.max(r,g.x+g.width),o[s]=g,n.registerCell({cellMetadatum:g,index:s})}return{cellMetadata:o,height:a,sectionManager:n,width:r}}({cellCount:A.cellCount,cellSizeAndPositionGetter:A.cellSizeAndPositionGetter,sectionSize:A.sectionSize});this._cellMetadata=e.cellMetadata,this._sectionManager=e.sectionManager,this._height=e.height,this._width=e.width}},{key:"getLastRenderedIndices",value:function(){return this._lastRenderedCellIndices}},{key:"getScrollPositionForCell",value:function(A){var e=A.align,i=A.cellIndex,t=A.height,o=A.scrollLeft,n=A.scrollTop,a=A.width,r=this.props.cellCount;if(i>=0&&i<r){var s=this._cellMetadata[i];o=lk({align:e,cellOffset:s.x,cellSize:s.width,containerSize:a,currentOffset:o,targetIndex:i}),n=lk({align:e,cellOffset:s.y,cellSize:s.height,containerSize:t,currentOffset:n,targetIndex:i})}return{scrollLeft:o,scrollTop:n}}},{key:"getTotalSize",value:function(){return{height:this._height,width:this._width}}},{key:"cellRenderers",value:function(A){var e=this,i=A.height,t=A.isScrolling,o=A.width,n=A.x,a=A.y,r=this.props,s=r.cellGroupRenderer,g=r.cellRenderer;return this._lastRenderedCellIndices=this._sectionManager.getCellIndices({height:i,width:o,x:n,y:a}),s({cellCache:this._cellCache,cellRenderer:g,cellSizeAndPositionGetter:function(A){var i=A.index;return e._sectionManager.getCellMetadata({index:i})},indices:this._lastRenderedCellIndices,isScrolling:t})}},{key:"_isScrollingChange",value:function(A){A||(this._cellCache=[])}},{key:"_setCollectionViewRef",value:function(A){this._collectionView=A}}]),e}(n.PureComponent);ck.defaultProps={"aria-label":"grid",cellGroupRenderer:function(A){var e=A.cellCache,i=A.cellRenderer,t=A.cellSizeAndPositionGetter,o=A.indices,n=A.isScrolling;return o.map(function(A){var o=t({index:A}),a={index:A,isScrolling:n,key:A,style:{height:o.height,left:o.x,position:"absolute",top:o.y,width:o.width}};return n?(A in e||(e[A]=i(a)),e[A]):i(a)}).filter(function(A){return!!A})}};ck.propTypes={"aria-label":o.a.string,cellCount:o.a.number.isRequired,cellGroupRenderer:o.a.func.isRequired,cellRenderer:o.a.func.isRequired,cellSizeAndPositionGetter:o.a.func.isRequired,sectionSize:o.a.number};var uk=function(A){function e(A,i){nT()(this,e);var t=gT()(this,(e.__proto__||tT()(e)).call(this,A,i));return t._registerChild=t._registerChild.bind(t),t}return cT()(e,A),rT()(e,[{key:"componentDidUpdate",value:function(A){var e=this.props,i=e.columnMaxWidth,t=e.columnMinWidth,o=e.columnCount,n=e.width;i===A.columnMaxWidth&&t===A.columnMinWidth&&o===A.columnCount&&n===A.width||this._registeredChild&&this._registeredChild.recomputeGridSize()}},{key:"render",value:function(){var A=this.props,e=A.children,i=A.columnMaxWidth,t=A.columnMinWidth,o=A.columnCount,n=A.width,a=t||1,r=i?Math.min(i,n):n,s=n/o;return s=Math.max(a,s),s=Math.min(r,s),s=Math.floor(s),e({adjustedWidth:Math.min(n,s*o),columnWidth:s,getColumnWidth:function(){return s},registerChild:this._registerChild})}},{key:"_registerChild",value:function(A){if(A&&"function"!=typeof A.recomputeGridSize)throw Error("Unexpected child type registered; only Grid/MultiGrid children are supported.");this._registeredChild=A,this._registeredChild&&this._registeredChild.recomputeGridSize()}}]),e}(n.PureComponent);uk.propTypes={children:o.a.func.isRequired,columnMaxWidth:o.a.number,columnMinWidth:o.a.number,columnCount:o.a.number.isRequired,width:o.a.number.isRequired};var Bk=function(A){function e(A,i){nT()(this,e);var t=gT()(this,(e.__proto__||tT()(e)).call(this,A,i));return t._loadMoreRowsMemoizer=vT(),t._onRowsRendered=t._onRowsRendered.bind(t),t._registerChild=t._registerChild.bind(t),t}return cT()(e,A),rT()(e,[{key:"resetLoadMoreRowsCache",value:function(A){this._loadMoreRowsMemoizer=vT(),A&&this._doStuff(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"render",value:function(){return(0,this.props.children)({onRowsRendered:this._onRowsRendered,registerChild:this._registerChild})}},{key:"_loadUnloadedRanges",value:function(A){var e=this,i=this.props.loadMoreRows;A.forEach(function(A){var t=i(A);t&&t.then(function(){(function(A){var e=A.lastRenderedStartIndex,i=A.lastRenderedStopIndex,t=A.startIndex,o=A.stopIndex;return!(t>i||o<e)})({lastRenderedStartIndex:e._lastRenderedStartIndex,lastRenderedStopIndex:e._lastRenderedStopIndex,startIndex:A.startIndex,stopIndex:A.stopIndex})&&e._registeredChild&&function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i="function"==typeof A.recomputeGridSize?A.recomputeGridSize:A.recomputeRowHeights;i?i.call(A,e):A.forceUpdate()}(e._registeredChild,e._lastRenderedStartIndex)})})}},{key:"_onRowsRendered",value:function(A){var e=A.startIndex,i=A.stopIndex;this._lastRenderedStartIndex=e,this._lastRenderedStopIndex=i,this._doStuff(e,i)}},{key:"_doStuff",value:function(A,e){var i=this,t=this.props,o=t.isRowLoaded,n=t.minimumBatchSize,a=t.rowCount,r=t.threshold,s=function(A){for(var e=A.isRowLoaded,i=A.minimumBatchSize,t=A.rowCount,o=A.startIndex,n=A.stopIndex,a=[],r=null,s=null,g=o;g<=n;g++){var l=e({index:g});l?null!==s&&(a.push({startIndex:r,stopIndex:s}),r=s=null):(s=g,null===r&&(r=g))}if(null!==s){for(var c=Math.min(Math.max(s,r+i-1),t-1),u=s+1;u<=c&&!e({index:u});u++)s=u;a.push({startIndex:r,stopIndex:s})}if(a.length)for(var B=a[0];B.stopIndex-B.startIndex+1<i&&B.startIndex>0;){var d=B.startIndex-1;if(e({index:d}))break;B.startIndex=d}return a}({isRowLoaded:o,minimumBatchSize:n,rowCount:a,startIndex:Math.max(0,A-r),stopIndex:Math.min(a-1,e+r)}),g=s.reduce(function(A,e){return A.concat([e.startIndex,e.stopIndex])},[]);this._loadMoreRowsMemoizer({callback:function(){i._loadUnloadedRanges(s)},indices:{squashedUnloadedRanges:g}})}},{key:"_registerChild",value:function(A){this._registeredChild=A}}]),e}(n.PureComponent);Bk.defaultProps={minimumBatchSize:10,rowCount:0,threshold:15};Bk.propTypes={children:o.a.func.isRequired,isRowLoaded:o.a.func.isRequired,loadMoreRows:o.a.func.isRequired,minimumBatchSize:o.a.number.isRequired,rowCount:o.a.number.isRequired,threshold:o.a.number.isRequired};var dk=i(943),Ek=i.n(dk),hk=(o.a.number.isRequired,o.a.bool.isRequired,o.a.bool.isRequired,o.a.string.isRequired,o.a.object.isRequired,o.a.object.isRequired,o.a.func),Ck=(o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,o.a.number.isRequired,function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t._cellRenderer=function(A){var e=A.parent,i=A.rowIndex,o=A.style,n=A.isScrolling,a=A.isVisible,r=A.key,s=t.props.rowRenderer;return Ek()(o,"width").writable&&(o.width="100%"),s({index:i,style:o,isScrolling:n,isVisible:a,key:r,parent:e})},t._setRef=function(A){t.Grid=A},t._onScroll=function(A){var e=A.clientHeight,i=A.scrollHeight,o=A.scrollTop;(0,t.props.onScroll)({clientHeight:e,scrollHeight:i,scrollTop:o})},t._onSectionRendered=function(A){var e=A.rowOverscanStartIndex,i=A.rowOverscanStopIndex,o=A.rowStartIndex,n=A.rowStopIndex;(0,t.props.onRowsRendered)({overscanStartIndex:e,overscanStopIndex:i,startIndex:o,stopIndex:n})},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(A){var e=A.alignment,i=A.index;return this.Grid?this.Grid.getOffsetForCell({alignment:e,rowIndex:i,columnIndex:0}).scrollTop:0}},{key:"invalidateCellSizeAfterRender",value:function(A){var e=A.columnIndex,i=A.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:i,columnIndex:e})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.columnIndex,i=void 0===e?0:e,t=A.rowIndex,o=void 0===t?0:t;this.Grid&&this.Grid.recomputeGridSize({rowIndex:o,columnIndex:i})}},{key:"recomputeRowHeights",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:A,columnIndex:0})}},{key:"scrollToPosition",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:A})}},{key:"scrollToRow",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:A})}},{key:"render",value:function(){var A=this.props,e=A.className,i=A.noRowsRenderer,t=A.scrollToIndex,o=A.width,a=Le()("ReactVirtualized__List",e);return n.createElement(KT,hT()({},this.props,{autoContainerWidth:!0,cellRenderer:this._cellRenderer,className:a,columnWidth:o,columnCount:1,noContentRenderer:i,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,scrollToRow:t}))}}]),e}(n.PureComponent));Ck.defaultProps={autoHeight:!1,estimatedRowSize:30,onScroll:function(){},noRowsRenderer:function(){return null},onRowsRendered:function(){},overscanIndicesGetter:VT,overscanRowCount:10,scrollToAlignment:"auto",scrollToIndex:-1,style:{}},Ck.propTypes={"aria-label":o.a.string,autoHeight:o.a.bool.isRequired,className:o.a.string,estimatedRowSize:o.a.number.isRequired,height:o.a.number.isRequired,noRowsRenderer:function(){return("function"==typeof QT?QT.isRequired?QT.isRequired:QT:o.a.shape(QT).isRequired).apply(this,arguments)},onRowsRendered:o.a.func.isRequired,onScroll:o.a.func.isRequired,overscanIndicesGetter:function(){return("function"==typeof DT?DT.isRequired?DT.isRequired:DT:o.a.shape(DT).isRequired).apply(this,arguments)},overscanRowCount:o.a.number.isRequired,rowHeight:function(){return("function"==typeof fT?fT.isRequired?fT.isRequired:fT:o.a.shape(fT).isRequired).apply(this,arguments)},rowRenderer:function(){return("function"==typeof hk?hk.isRequired?hk.isRequired:hk:o.a.shape(hk).isRequired).apply(this,arguments)},rowCount:o.a.number.isRequired,scrollToAlignment:function(){return("function"==typeof MT?MT.isRequired?MT.isRequired:MT:o.a.shape(MT).isRequired).apply(this,arguments)},scrollToIndex:o.a.number.isRequired,scrollTop:o.a.number,style:o.a.object.isRequired,tabIndex:o.a.number,width:o.a.number.isRequired};var wk=Ck,mk=i(227),pk=i.n(mk),Ik=i(944),fk=i.n(Ik);var Qk={ge:function(A,e,i,t,o){return"function"==typeof i?function(A,e,i,t,o){for(var n=i+1;e<=i;){var a=e+i>>>1;o(A[a],t)>=0?(n=a,i=a-1):e=a+1}return n}(A,void 0===t?0:0|t,void 0===o?A.length-1:0|o,e,i):function(A,e,i,t){for(var o=i+1;e<=i;){var n=e+i>>>1;A[n]>=t?(o=n,i=n-1):e=n+1}return o}(A,void 0===i?0:0|i,void 0===t?A.length-1:0|t,e)},gt:function(A,e,i,t,o){return"function"==typeof i?function(A,e,i,t,o){for(var n=i+1;e<=i;){var a=e+i>>>1;o(A[a],t)>0?(n=a,i=a-1):e=a+1}return n}(A,void 0===t?0:0|t,void 0===o?A.length-1:0|o,e,i):function(A,e,i,t){for(var o=i+1;e<=i;){var n=e+i>>>1;A[n]>t?(o=n,i=n-1):e=n+1}return o}(A,void 0===i?0:0|i,void 0===t?A.length-1:0|t,e)},lt:function(A,e,i,t,o){return"function"==typeof i?function(A,e,i,t,o){for(var n=e-1;e<=i;){var a=e+i>>>1;o(A[a],t)<0?(n=a,e=a+1):i=a-1}return n}(A,void 0===t?0:0|t,void 0===o?A.length-1:0|o,e,i):function(A,e,i,t){for(var o=e-1;e<=i;){var n=e+i>>>1;A[n]<t?(o=n,e=n+1):i=n-1}return o}(A,void 0===i?0:0|i,void 0===t?A.length-1:0|t,e)},le:function(A,e,i,t,o){return"function"==typeof i?function(A,e,i,t,o){for(var n=e-1;e<=i;){var a=e+i>>>1;o(A[a],t)<=0?(n=a,e=a+1):i=a-1}return n}(A,void 0===t?0:0|t,void 0===o?A.length-1:0|o,e,i):function(A,e,i,t){for(var o=e-1;e<=i;){var n=e+i>>>1;A[n]<=t?(o=n,e=n+1):i=n-1}return o}(A,void 0===i?0:0|i,void 0===t?A.length-1:0|t,e)},eq:function(A,e,i,t,o){return"function"==typeof i?function(A,e,i,t,o){for(;e<=i;){var n=e+i>>>1,a=o(A[n],t);if(0===a)return n;a<=0?e=n+1:i=n-1}return-1}(A,void 0===t?0:0|t,void 0===o?A.length-1:0|o,e,i):function(A,e,i,t){for(;e<=i;){var o=e+i>>>1,n=A[o];if(n===t)return o;n<=t?e=o+1:i=o-1}return-1}(A,void 0===i?0:0|i,void 0===t?A.length-1:0|t,e)}},Dk=0,Mk=1;function bk(A,e,i,t,o){this.mid=A,this.left=e,this.right=i,this.leftPoints=t,this.rightPoints=o,this.count=(e?e.count:0)+(i?i.count:0)+t.length}var yk=bk.prototype;function Tk(A,e){A.mid=e.mid,A.left=e.left,A.right=e.right,A.leftPoints=e.leftPoints,A.rightPoints=e.rightPoints,A.count=e.count}function kk(A,e){var i=Gk(e);A.mid=i.mid,A.left=i.left,A.right=i.right,A.leftPoints=i.leftPoints,A.rightPoints=i.rightPoints,A.count=i.count}function Fk(A,e){var i=A.intervals([]);i.push(e),kk(A,i)}function vk(A,e){var i=A.intervals([]),t=i.indexOf(e);return t<0?Dk:(i.splice(t,1),kk(A,i),Mk)}function Sk(A,e,i){for(var t=0;t<A.length&&A[t][0]<=e;++t){var o=i(A[t]);if(o)return o}}function Nk(A,e,i){for(var t=A.length-1;t>=0&&A[t][1]>=e;--t){var o=i(A[t]);if(o)return o}}function Rk(A,e){for(var i=0;i<A.length;++i){var t=e(A[i]);if(t)return t}}function Ok(A,e){return A-e}function Yk(A,e){var i=A[0]-e[0];return i||A[1]-e[1]}function Uk(A,e){var i=A[1]-e[1];return i||A[0]-e[0]}function Gk(A){if(0===A.length)return null;for(var e=[],i=0;i<A.length;++i)e.push(A[i][0],A[i][1]);e.sort(Ok);var t=e[e.length>>1],o=[],n=[],a=[];for(i=0;i<A.length;++i){var r=A[i];r[1]<t?o.push(r):t<r[0]?n.push(r):a.push(r)}var s=a,g=a.slice();return s.sort(Yk),g.sort(Uk),new bk(t,Gk(o),Gk(n),s,g)}function Hk(A){this.root=A}yk.intervals=function(A){return A.push.apply(A,this.leftPoints),this.left&&this.left.intervals(A),this.right&&this.right.intervals(A),A},yk.insert=function(A){var e=this.count-this.leftPoints.length;if(this.count+=1,A[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?Fk(this,A):this.left.insert(A):this.left=Gk([A]);else if(A[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?Fk(this,A):this.right.insert(A):this.right=Gk([A]);else{var i=Qk.ge(this.leftPoints,A,Yk),t=Qk.ge(this.rightPoints,A,Uk);this.leftPoints.splice(i,0,A),this.rightPoints.splice(t,0,A)}},yk.remove=function(A){var e=this.count-this.leftPoints;if(A[1]<this.mid){return this.left?4*(this.right?this.right.count:0)>3*(e-1)?vk(this,A):2===(n=this.left.remove(A))?(this.left=null,this.count-=1,Mk):(n===Mk&&(this.count-=1),n):Dk}else{if(!(A[0]>this.mid)){if(1===this.count)return this.leftPoints[0]===A?2:Dk;if(1===this.leftPoints.length&&this.leftPoints[0]===A){if(this.left&&this.right){for(var i=this,t=this.left;t.right;)i=t,t=t.right;if(i===this)t.right=this.right;else{var o=this.left;n=this.right;i.count-=t.count,i.right=t.left,t.left=o,t.right=n}Tk(this,t),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?Tk(this,this.left):Tk(this,this.right);return Mk}for(o=Qk.ge(this.leftPoints,A,Yk);o<this.leftPoints.length&&this.leftPoints[o][0]===A[0];++o)if(this.leftPoints[o]===A){this.count-=1,this.leftPoints.splice(o,1);for(n=Qk.ge(this.rightPoints,A,Uk);n<this.rightPoints.length&&this.rightPoints[n][1]===A[1];++n)if(this.rightPoints[n]===A)return this.rightPoints.splice(n,1),Mk}return Dk}return this.right?4*(this.left?this.left.count:0)>3*(e-1)?vk(this,A):2===(n=this.right.remove(A))?(this.right=null,this.count-=1,Mk):(n===Mk&&(this.count-=1),n):Dk;var n}},yk.queryPoint=function(A,e){if(A<this.mid){if(this.left)if(i=this.left.queryPoint(A,e))return i;return Sk(this.leftPoints,A,e)}if(A>this.mid){var i;if(this.right)if(i=this.right.queryPoint(A,e))return i;return Nk(this.rightPoints,A,e)}return Rk(this.leftPoints,e)},yk.queryInterval=function(A,e,i){var t;if(A<this.mid&&this.left&&(t=this.left.queryInterval(A,e,i)))return t;if(e>this.mid&&this.right&&(t=this.right.queryInterval(A,e,i)))return t;return e<this.mid?Sk(this.leftPoints,e,i):A>this.mid?Nk(this.rightPoints,A,i):Rk(this.leftPoints,i)};var Lk=Hk.prototype;Lk.insert=function(A){this.root?this.root.insert(A):this.root=new bk(A[0],null,null,[A],[A])},Lk.remove=function(A){if(this.root){var e=this.root.remove(A);return 2===e&&(this.root=null),e!==Dk}return!1},Lk.queryPoint=function(A,e){if(this.root)return this.root.queryPoint(A,e)},Lk.queryInterval=function(A,e,i){if(A<=e&&this.root)return this.root.queryInterval(A,e,i)},Object.defineProperty(Lk,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(Lk,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});var Pk=function(){function A(){nT()(this,A),this._columnSizeMap={},this._intervalTree=function(A){return A&&0!==A.length?new Hk(Gk(A)):new Hk(null)}(),this._leftMap={}}return rT()(A,[{key:"estimateTotalHeight",value:function(A,e,i){var t=A-this.count;return this.tallestColumnSize+Math.ceil(t/e)*i}},{key:"range",value:function(A,e,i){var t=this;this._intervalTree.queryInterval(A,A+e,function(A){var e=fk()(A,3),o=e[0],n=(e[1],e[2]);return i(n,t._leftMap[n],o)})}},{key:"setPosition",value:function(A,e,i,t){this._intervalTree.insert([i,i+t,A]),this._leftMap[A]=e;var o=this._columnSizeMap,n=o[e];o[e]=void 0===n?i+t:Math.max(n,i+t)}},{key:"count",get:function(){return this._intervalTree.count}},{key:"shortestColumnSize",get:function(){var A=this._columnSizeMap,e=0;for(var i in A){var t=A[i];e=0===e?t:Math.min(e,t)}return e}},{key:"tallestColumnSize",get:function(){var A=this._columnSizeMap,e=0;for(var i in A){var t=A[i];e=Math.max(e,t)}return e}}]),A}(),xk=function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t.state={isScrolling:!1,scrollTop:0},t._invalidateOnUpdateStartIndex=null,t._invalidateOnUpdateStopIndex=null,t._positionCache=new Pk,t._startIndex=null,t._startIndexMemoized=null,t._stopIndex=null,t._stopIndexMemoized=null,t._debounceResetIsScrollingCallback=function(){t.setState({isScrolling:!1})},t._setScrollingContainerRef=function(A){t._scrollingContainer=A},t._onScroll=function(A){var e=t.props.height,i=A.target.scrollTop,o=Math.min(Math.max(0,t._getEstimatedTotalHeight()-e),i);i===o&&(t._debounceResetIsScrolling(),t.state.scrollTop!==o&&t.setState({isScrolling:!0,scrollTop:o}))},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"clearCellPositions",value:function(){this._positionCache=new Pk,this.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(A){var e=A.rowIndex;null===this._invalidateOnUpdateStartIndex?(this._invalidateOnUpdateStartIndex=e,this._invalidateOnUpdateStopIndex=e):(this._invalidateOnUpdateStartIndex=Math.min(this._invalidateOnUpdateStartIndex,e),this._invalidateOnUpdateStopIndex=Math.max(this._invalidateOnUpdateStopIndex,e))}},{key:"recomputeCellPositions",value:function(){var A=this._positionCache.count-1;this._positionCache=new Pk,this._populatePositionCache(0,A),this.forceUpdate()}},{key:"componentDidMount",value:function(){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback()}},{key:"componentDidUpdate",value:function(A,e){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback(),this.props.scrollTop!==A.scrollTop&&this._debounceResetIsScrolling()}},{key:"componentWillUnmount",value:function(){this._debounceResetIsScrollingId&&xT(this._debounceResetIsScrollingId)}},{key:"render",value:function(){var A=this,e=this.props,i=e.autoHeight,t=e.cellCount,o=e.cellMeasurerCache,a=e.cellRenderer,r=e.className,s=e.height,g=e.id,l=e.keyMapper,c=e.overscanByPixels,u=e.role,B=e.style,d=e.tabIndex,E=e.width,h=e.rowDirection,C=this.state,w=C.isScrolling,m=C.scrollTop,p=[],I=this._getEstimatedTotalHeight(),f=this._positionCache.shortestColumnSize,Q=this._positionCache.count,D=0,M=void 0;if(this._positionCache.range(Math.max(0,m-c),s+2*c,function(e,i,t){var n;void 0===M?(D=e,M=e):(D=Math.min(D,e),M=Math.max(M,e)),p.push(a({index:e,isScrolling:w,key:l(e),parent:A,style:(n={height:o.getHeight(e)},pk()(n,"ltr"===h?"left":"right",i),pk()(n,"position","absolute"),pk()(n,"top",t),pk()(n,"width",o.getWidth(e)),n)}))}),f<m+s+c&&Q<t)for(var b=Math.min(t-Q,Math.ceil((m+s+c-f)/o.defaultHeight*E/o.defaultWidth)),y=Q;y<Q+b;y++)M=y,p.push(a({index:y,isScrolling:w,key:l(y),parent:this,style:{width:o.getWidth(y)}}));return this._startIndex=D,this._stopIndex=M,n.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:Le()("ReactVirtualized__Masonry",r),id:g,onScroll:this._onScroll,role:u,style:hT()({boxSizing:"border-box",direction:"ltr",height:i?"auto":s,overflowX:"hidden",overflowY:I<s?"hidden":"auto",position:"relative",width:E,WebkitOverflowScrolling:"touch",willChange:"transform"},B),tabIndex:d},n.createElement("div",{className:"ReactVirtualized__Masonry__innerScrollContainer",style:{width:"100%",height:I,maxWidth:"100%",maxHeight:I,overflow:"hidden",pointerEvents:w?"none":"",position:"relative"}},p))}},{key:"_checkInvalidateOnUpdate",value:function(){if("number"==typeof this._invalidateOnUpdateStartIndex){var A=this._invalidateOnUpdateStartIndex,e=this._invalidateOnUpdateStopIndex;this._invalidateOnUpdateStartIndex=null,this._invalidateOnUpdateStopIndex=null,this._populatePositionCache(A,e),this.forceUpdate()}}},{key:"_debounceResetIsScrolling",value:function(){var A=this.props.scrollingResetTimeInterval;this._debounceResetIsScrollingId&&xT(this._debounceResetIsScrollingId),this._debounceResetIsScrollingId=_T(this._debounceResetIsScrollingCallback,A)}},{key:"_getEstimatedTotalHeight",value:function(){var A=this.props,e=A.cellCount,i=A.cellMeasurerCache,t=A.width,o=Math.max(1,Math.floor(t/i.defaultWidth));return this._positionCache.estimateTotalHeight(e,o,i.defaultHeight)}},{key:"_invokeOnScrollCallback",value:function(){var A=this.props,e=A.height,i=A.onScroll,t=this.state.scrollTop;this._onScrollMemoized!==t&&(i({clientHeight:e,scrollHeight:this._getEstimatedTotalHeight(),scrollTop:t}),this._onScrollMemoized=t)}},{key:"_invokeOnCellsRenderedCallback",value:function(){this._startIndexMemoized===this._startIndex&&this._stopIndexMemoized===this._stopIndex||((0,this.props.onCellsRendered)({startIndex:this._startIndex,stopIndex:this._stopIndex}),this._startIndexMemoized=this._startIndex,this._stopIndexMemoized=this._stopIndex)}},{key:"_populatePositionCache",value:function(A,e){for(var i=this.props,t=i.cellMeasurerCache,o=i.cellPositioner,n=A;n<=e;n++){var a=o(n),r=a.left,s=a.top;this._positionCache.setPosition(n,r,s,t.getHeight(n))}}}],[{key:"getDerivedStateFromProps",value:function(A,e){return void 0!==A.scrollTop&&e.scrollTop!==A.scrollTop?{isScrolling:!0,scrollTop:A.scrollTop}:null}}]),e}(n.PureComponent);function _k(){}xk.defaultProps={autoHeight:!1,keyMapper:function(A){return A},onCellsRendered:_k,onScroll:_k,overscanByPixels:20,role:"grid",scrollingResetTimeInterval:150,style:{},tabIndex:0,rowDirection:"ltr"},xk.propTypes={autoHeight:o.a.bool.isRequired,cellCount:o.a.number.isRequired,cellMeasurerCache:function(){return("function"==typeof CellMeasurerCache?o.a.instanceOf(CellMeasurerCache).isRequired:o.a.any.isRequired).apply(this,arguments)},cellPositioner:function(){return("function"==typeof Positioner?o.a.instanceOf(Positioner).isRequired:o.a.any.isRequired).apply(this,arguments)},cellRenderer:function(){return("function"==typeof CellRenderer?o.a.instanceOf(CellRenderer).isRequired:o.a.any.isRequired).apply(this,arguments)},className:o.a.string,height:o.a.number.isRequired,id:o.a.string,keyMapper:function(){return("function"==typeof KeyMapper?o.a.instanceOf(KeyMapper).isRequired:o.a.any.isRequired).apply(this,arguments)},onCellsRendered:function(){return("function"==typeof OnCellsRenderedCallback?o.a.instanceOf(OnCellsRenderedCallback):o.a.any).apply(this,arguments)},onScroll:function(){return("function"==typeof OnScrollCallback?o.a.instanceOf(OnScrollCallback):o.a.any).apply(this,arguments)},overscanByPixels:o.a.number.isRequired,role:o.a.string.isRequired,scrollingResetTimeInterval:o.a.number.isRequired,style:function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")},tabIndex:o.a.number.isRequired,width:o.a.number.isRequired,rowDirection:o.a.string.isRequired};o.a.number.isRequired,o.a.number.isRequired,o.a.func.isRequired,o.a.func.isRequired;Object(uT.polyfill)(xk);o.a.func;var jk=function(){function A(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};nT()(this,A),this.columnWidth=function(A){var i=A.index;e._cellMeasurerCache.columnWidth({index:i+e._columnIndexOffset})},this.rowHeight=function(A){var i=A.index;e._cellMeasurerCache.rowHeight({index:i+e._rowIndexOffset})};var t=i.cellMeasurerCache,o=i.columnIndexOffset,n=void 0===o?0:o,a=i.rowIndexOffset,r=void 0===a?0:a;this._cellMeasurerCache=t,this._columnIndexOffset=n,this._rowIndexOffset=r}return rT()(A,[{key:"clear",value:function(A,e){this._cellMeasurerCache.clear(A+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"clearAll",value:function(){this._cellMeasurerCache.clearAll()}},{key:"hasFixedHeight",value:function(){return this._cellMeasurerCache.hasFixedHeight()}},{key:"hasFixedWidth",value:function(){return this._cellMeasurerCache.hasFixedWidth()}},{key:"getHeight",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.getHeight(A+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"getWidth",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.getWidth(A+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"has",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.has(A+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"set",value:function(A,e,i,t){this._cellMeasurerCache.set(A+this._rowIndexOffset,e+this._columnIndexOffset,i,t)}},{key:"defaultHeight",get:function(){return this._cellMeasurerCache.defaultHeight}},{key:"defaultWidth",get:function(){return this._cellMeasurerCache.defaultWidth}}]),A}(),Jk=function(A){function e(A,i){nT()(this,e);var t=gT()(this,(e.__proto__||tT()(e)).call(this,A,i));zk.call(t);var o=A.deferredMeasurementCache,n=A.fixedColumnCount,a=A.fixedRowCount;return t._maybeCalculateCachedStyles(!0),o&&(t._deferredMeasurementCacheBottomLeftGrid=a>0?new jk({cellMeasurerCache:o,columnIndexOffset:0,rowIndexOffset:a}):o,t._deferredMeasurementCacheBottomRightGrid=n>0||a>0?new jk({cellMeasurerCache:o,columnIndexOffset:n,rowIndexOffset:a}):o,t._deferredMeasurementCacheTopRightGrid=n>0?new jk({cellMeasurerCache:o,columnIndexOffset:n,rowIndexOffset:0}):o),t}return cT()(e,A),rT()(e,[{key:"forceUpdateGrids",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.forceUpdate(),this._bottomRightGrid&&this._bottomRightGrid.forceUpdate(),this._topLeftGrid&&this._topLeftGrid.forceUpdate(),this._topRightGrid&&this._topRightGrid.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.columnIndex,i=void 0===e?0:e,t=A.rowIndex,o=void 0===t?0:t;this._deferredInvalidateColumnIndex="number"==typeof this._deferredInvalidateColumnIndex?Math.min(this._deferredInvalidateColumnIndex,i):i,this._deferredInvalidateRowIndex="number"==typeof this._deferredInvalidateRowIndex?Math.min(this._deferredInvalidateRowIndex,o):o}},{key:"measureAllCells",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.measureAllCells(),this._bottomRightGrid&&this._bottomRightGrid.measureAllCells(),this._topLeftGrid&&this._topLeftGrid.measureAllCells(),this._topRightGrid&&this._topRightGrid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.columnIndex,i=void 0===e?0:e,t=A.rowIndex,o=void 0===t?0:t,n=this.props,a=n.fixedColumnCount,r=n.fixedRowCount,s=Math.max(0,i-a),g=Math.max(0,o-r);this._bottomLeftGrid&&this._bottomLeftGrid.recomputeGridSize({columnIndex:i,rowIndex:g}),this._bottomRightGrid&&this._bottomRightGrid.recomputeGridSize({columnIndex:s,rowIndex:g}),this._topLeftGrid&&this._topLeftGrid.recomputeGridSize({columnIndex:i,rowIndex:o}),this._topRightGrid&&this._topRightGrid.recomputeGridSize({columnIndex:s,rowIndex:o}),this._leftGridWidth=null,this._topGridHeight=null,this._maybeCalculateCachedStyles(!0)}},{key:"componentDidMount",value:function(){var A=this.props,e=A.scrollLeft,i=A.scrollTop;if(e>0||i>0){var t={};e>0&&(t.scrollLeft=e),i>0&&(t.scrollTop=i),this.setState(t)}this._handleInvalidatedGridSize()}},{key:"componentDidUpdate",value:function(){this._handleInvalidatedGridSize()}},{key:"render",value:function(){var A=this.props,e=A.onScroll,i=A.onSectionRendered,t=(A.onScrollbarPresenceChange,A.scrollLeft,A.scrollToColumn),o=(A.scrollTop,A.scrollToRow),a=mT()(A,["onScroll","onSectionRendered","onScrollbarPresenceChange","scrollLeft","scrollToColumn","scrollTop","scrollToRow"]);if(this._prepareForRender(),0===this.props.width||0===this.props.height)return null;var r=this.state,s=r.scrollLeft,g=r.scrollTop;return n.createElement("div",{style:this._containerOuterStyle},n.createElement("div",{style:this._containerTopStyle},this._renderTopLeftGrid(a),this._renderTopRightGrid(hT()({},a,{onScroll:e,scrollLeft:s}))),n.createElement("div",{style:this._containerBottomStyle},this._renderBottomLeftGrid(hT()({},a,{onScroll:e,scrollTop:g})),this._renderBottomRightGrid(hT()({},a,{onScroll:e,onSectionRendered:i,scrollLeft:s,scrollToColumn:t,scrollToRow:o,scrollTop:g}))))}},{key:"_getBottomGridHeight",value:function(A){return A.height-this._getTopGridHeight(A)}},{key:"_getLeftGridWidth",value:function(A){var e=A.fixedColumnCount,i=A.columnWidth;if(null==this._leftGridWidth)if("function"==typeof i){for(var t=0,o=0;o<e;o++)t+=i({index:o});this._leftGridWidth=t}else this._leftGridWidth=i*e;return this._leftGridWidth}},{key:"_getRightGridWidth",value:function(A){return A.width-this._getLeftGridWidth(A)}},{key:"_getTopGridHeight",value:function(A){var e=A.fixedRowCount,i=A.rowHeight;if(null==this._topGridHeight)if("function"==typeof i){for(var t=0,o=0;o<e;o++)t+=i({index:o});this._topGridHeight=t}else this._topGridHeight=i*e;return this._topGridHeight}},{key:"_handleInvalidatedGridSize",value:function(){if("number"==typeof this._deferredInvalidateColumnIndex){var A=this._deferredInvalidateColumnIndex,e=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:A,rowIndex:e}),this.forceUpdate()}}},{key:"_maybeCalculateCachedStyles",value:function(A){var e=this.props,i=e.columnWidth,t=e.enableFixedColumnScroll,o=e.enableFixedRowScroll,n=e.height,a=e.fixedColumnCount,r=e.fixedRowCount,s=e.rowHeight,g=e.style,l=e.styleBottomLeftGrid,c=e.styleBottomRightGrid,u=e.styleTopLeftGrid,B=e.styleTopRightGrid,d=e.width,E=A||n!==this._lastRenderedHeight||d!==this._lastRenderedWidth,h=A||i!==this._lastRenderedColumnWidth||a!==this._lastRenderedFixedColumnCount,C=A||r!==this._lastRenderedFixedRowCount||s!==this._lastRenderedRowHeight;(A||E||g!==this._lastRenderedStyle)&&(this._containerOuterStyle=hT()({height:n,overflow:"visible",width:d},g)),(A||E||C)&&(this._containerTopStyle={height:this._getTopGridHeight(this.props),position:"relative",width:d},this._containerBottomStyle={height:n-this._getTopGridHeight(this.props),overflow:"visible",position:"relative",width:d}),(A||l!==this._lastRenderedStyleBottomLeftGrid)&&(this._bottomLeftGridStyle=hT()({left:0,overflowX:"hidden",overflowY:t?"auto":"hidden",position:"absolute"},l)),(A||h||c!==this._lastRenderedStyleBottomRightGrid)&&(this._bottomRightGridStyle=hT()({left:this._getLeftGridWidth(this.props),position:"absolute"},c)),(A||u!==this._lastRenderedStyleTopLeftGrid)&&(this._topLeftGridStyle=hT()({left:0,overflowX:"hidden",overflowY:"hidden",position:"absolute",top:0},u)),(A||h||B!==this._lastRenderedStyleTopRightGrid)&&(this._topRightGridStyle=hT()({left:this._getLeftGridWidth(this.props),overflowX:o?"auto":"hidden",overflowY:"hidden",position:"absolute",top:0},B)),this._lastRenderedColumnWidth=i,this._lastRenderedFixedColumnCount=a,this._lastRenderedFixedRowCount=r,this._lastRenderedHeight=n,this._lastRenderedRowHeight=s,this._lastRenderedStyle=g,this._lastRenderedStyleBottomLeftGrid=l,this._lastRenderedStyleBottomRightGrid=c,this._lastRenderedStyleTopLeftGrid=u,this._lastRenderedStyleTopRightGrid=B,this._lastRenderedWidth=d}},{key:"_prepareForRender",value:function(){this._lastRenderedColumnWidth===this.props.columnWidth&&this._lastRenderedFixedColumnCount===this.props.fixedColumnCount||(this._leftGridWidth=null),this._lastRenderedFixedRowCount===this.props.fixedRowCount&&this._lastRenderedRowHeight===this.props.rowHeight||(this._topGridHeight=null),this._maybeCalculateCachedStyles(),this._lastRenderedColumnWidth=this.props.columnWidth,this._lastRenderedFixedColumnCount=this.props.fixedColumnCount,this._lastRenderedFixedRowCount=this.props.fixedRowCount,this._lastRenderedRowHeight=this.props.rowHeight}},{key:"_renderBottomLeftGrid",value:function(A){var e=A.enableFixedColumnScroll,i=A.fixedColumnCount,t=A.fixedRowCount,o=A.rowCount,a=A.hideBottomLeftGridScrollbar,r=this.state.showVerticalScrollbar;if(!i)return null;var s=r?1:0,g=this._getBottomGridHeight(A),l=this._getLeftGridWidth(A),c=this.state.showVerticalScrollbar?this.state.scrollbarSize:0,u=a?l+c:l,B=n.createElement(KT,hT()({},A,{cellRenderer:this._cellRendererBottomLeftGrid,className:this.props.classNameBottomLeftGrid,columnCount:i,deferredMeasurementCache:this._deferredMeasurementCacheBottomLeftGrid,height:g,onScroll:e?this._onScrollTop:void 0,ref:this._bottomLeftGridRef,rowCount:Math.max(0,o-t)+s,rowHeight:this._rowHeightBottomGrid,style:this._bottomLeftGridStyle,tabIndex:null,width:u}));return a?n.createElement("div",{className:"BottomLeftGrid_ScrollWrapper",style:hT()({},this._bottomLeftGridStyle,{height:g,width:l,overflowY:"hidden"})},B):B}},{key:"_renderBottomRightGrid",value:function(A){var e=A.columnCount,i=A.fixedColumnCount,t=A.fixedRowCount,o=A.rowCount,a=A.scrollToColumn,r=A.scrollToRow;return n.createElement(KT,hT()({},A,{cellRenderer:this._cellRendererBottomRightGrid,className:this.props.classNameBottomRightGrid,columnCount:Math.max(0,e-i),columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheBottomRightGrid,height:this._getBottomGridHeight(A),onScroll:this._onScroll,onScrollbarPresenceChange:this._onScrollbarPresenceChange,ref:this._bottomRightGridRef,rowCount:Math.max(0,o-t),rowHeight:this._rowHeightBottomGrid,scrollToColumn:a-i,scrollToRow:r-t,style:this._bottomRightGridStyle,width:this._getRightGridWidth(A)}))}},{key:"_renderTopLeftGrid",value:function(A){var e=A.fixedColumnCount,i=A.fixedRowCount;return e&&i?n.createElement(KT,hT()({},A,{className:this.props.classNameTopLeftGrid,columnCount:e,height:this._getTopGridHeight(A),ref:this._topLeftGridRef,rowCount:i,style:this._topLeftGridStyle,tabIndex:null,width:this._getLeftGridWidth(A)})):null}},{key:"_renderTopRightGrid",value:function(A){var e=A.columnCount,i=A.enableFixedRowScroll,t=A.fixedColumnCount,o=A.fixedRowCount,a=A.scrollLeft,r=A.hideTopRightGridScrollbar,s=this.state,g=s.showHorizontalScrollbar,l=s.scrollbarSize;if(!o)return null;var c=g?1:0,u=this._getTopGridHeight(A),B=this._getRightGridWidth(A),d=g?l:0,E=u,h=this._topRightGridStyle;r&&(E=u+d,h=hT()({},this._topRightGridStyle,{left:0}));var C=n.createElement(KT,hT()({},A,{cellRenderer:this._cellRendererTopRightGrid,className:this.props.classNameTopRightGrid,columnCount:Math.max(0,e-t)+c,columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheTopRightGrid,height:E,onScroll:i?this._onScrollLeft:void 0,ref:this._topRightGridRef,rowCount:o,scrollLeft:a,style:h,tabIndex:null,width:B}));return r?n.createElement("div",{className:"TopRightGrid_ScrollWrapper",style:hT()({},this._topRightGridStyle,{height:u,width:B,overflowX:"hidden"})},C):C}}],[{key:"getDerivedStateFromProps",value:function(A,e){return A.scrollLeft!==e.scrollLeft||A.scrollTop!==e.scrollTop?{scrollLeft:null!=A.scrollLeft&&A.scrollLeft>=0?A.scrollLeft:e.scrollLeft,scrollTop:null!=A.scrollTop&&A.scrollTop>=0?A.scrollTop:e.scrollTop}:null}}]),e}(n.PureComponent);Jk.defaultProps={classNameBottomLeftGrid:"",classNameBottomRightGrid:"",classNameTopLeftGrid:"",classNameTopRightGrid:"",enableFixedColumnScroll:!1,enableFixedRowScroll:!1,fixedColumnCount:0,fixedRowCount:0,scrollToColumn:-1,scrollToRow:-1,style:{},styleBottomLeftGrid:{},styleBottomRightGrid:{},styleTopLeftGrid:{},styleTopRightGrid:{},hideTopRightGridScrollbar:!1,hideBottomLeftGridScrollbar:!1};var zk=function(){var A=this;this.state={scrollLeft:0,scrollTop:0,scrollbarSize:0,showHorizontalScrollbar:!1,showVerticalScrollbar:!1},this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this._bottomLeftGridRef=function(e){A._bottomLeftGrid=e},this._bottomRightGridRef=function(e){A._bottomRightGrid=e},this._cellRendererBottomLeftGrid=function(e){var i=e.rowIndex,t=mT()(e,["rowIndex"]),o=A.props,a=o.cellRenderer,r=o.fixedRowCount;return i===o.rowCount-r?n.createElement("div",{key:t.key,style:hT()({},t.style,{height:20})}):a(hT()({},t,{parent:A,rowIndex:i+r}))},this._cellRendererBottomRightGrid=function(e){var i=e.columnIndex,t=e.rowIndex,o=mT()(e,["columnIndex","rowIndex"]),n=A.props,a=n.cellRenderer,r=n.fixedColumnCount,s=n.fixedRowCount;return a(hT()({},o,{columnIndex:i+r,parent:A,rowIndex:t+s}))},this._cellRendererTopRightGrid=function(e){var i=e.columnIndex,t=mT()(e,["columnIndex"]),o=A.props,a=o.cellRenderer,r=o.columnCount,s=o.fixedColumnCount;return i===r-s?n.createElement("div",{key:t.key,style:hT()({},t.style,{width:20})}):a(hT()({},t,{columnIndex:i+s,parent:A}))},this._columnWidthRightGrid=function(e){var i=e.index,t=A.props,o=t.columnCount,n=t.fixedColumnCount,a=t.columnWidth,r=A.state,s=r.scrollbarSize;return r.showHorizontalScrollbar&&i===o-n?s:"function"==typeof a?a({index:i+n}):a},this._onScroll=function(e){var i=e.scrollLeft,t=e.scrollTop;A.setState({scrollLeft:i,scrollTop:t});var o=A.props.onScroll;o&&o(e)},this._onScrollbarPresenceChange=function(e){var i=e.horizontal,t=e.size,o=e.vertical,n=A.state,a=n.showHorizontalScrollbar,r=n.showVerticalScrollbar;if(i!==a||o!==r){A.setState({scrollbarSize:t,showHorizontalScrollbar:i,showVerticalScrollbar:o});var s=A.props.onScrollbarPresenceChange;"function"==typeof s&&s({horizontal:i,size:t,vertical:o})}},this._onScrollLeft=function(e){var i=e.scrollLeft;A._onScroll({scrollLeft:i,scrollTop:A.state.scrollTop})},this._onScrollTop=function(e){var i=e.scrollTop;A._onScroll({scrollTop:i,scrollLeft:A.state.scrollLeft})},this._rowHeightBottomGrid=function(e){var i=e.index,t=A.props,o=t.fixedRowCount,n=t.rowCount,a=t.rowHeight,r=A.state,s=r.scrollbarSize;return r.showVerticalScrollbar&&i===n-o?s:"function"==typeof a?a({index:i+o}):a},this._topLeftGridRef=function(e){A._topLeftGrid=e},this._topRightGridRef=function(e){A._topRightGrid=e}};Jk.propTypes={classNameBottomLeftGrid:o.a.string.isRequired,classNameBottomRightGrid:o.a.string.isRequired,classNameTopLeftGrid:o.a.string.isRequired,classNameTopRightGrid:o.a.string.isRequired,enableFixedColumnScroll:o.a.bool.isRequired,enableFixedRowScroll:o.a.bool.isRequired,fixedColumnCount:o.a.number.isRequired,fixedRowCount:o.a.number.isRequired,onScrollbarPresenceChange:o.a.func,style:o.a.object.isRequired,styleBottomLeftGrid:o.a.object.isRequired,styleBottomRightGrid:o.a.object.isRequired,styleTopLeftGrid:o.a.object.isRequired,styleTopRightGrid:o.a.object.isRequired,hideTopRightGridScrollbar:o.a.bool,hideBottomLeftGridScrollbar:o.a.bool},Object(uT.polyfill)(Jk);var Kk=function(A){function e(A,i){nT()(this,e);var t=gT()(this,(e.__proto__||tT()(e)).call(this,A,i));return t.state={clientHeight:0,clientWidth:0,scrollHeight:0,scrollLeft:0,scrollTop:0,scrollWidth:0},t._onScroll=t._onScroll.bind(t),t}return cT()(e,A),rT()(e,[{key:"render",value:function(){var A=this.props.children,e=this.state,i=e.clientHeight,t=e.clientWidth,o=e.scrollHeight,n=e.scrollLeft,a=e.scrollTop,r=e.scrollWidth;return A({clientHeight:i,clientWidth:t,onScroll:this._onScroll,scrollHeight:o,scrollLeft:n,scrollTop:a,scrollWidth:r})}},{key:"_onScroll",value:function(A){var e=A.clientHeight,i=A.clientWidth,t=A.scrollHeight,o=A.scrollLeft,n=A.scrollTop,a=A.scrollWidth;this.setState({clientHeight:e,clientWidth:i,scrollHeight:t,scrollLeft:o,scrollTop:n,scrollWidth:a})}}]),e}(n.PureComponent);Kk.propTypes={children:o.a.func.isRequired};o.a.any,o.a.string.isRequired,o.a.any,o.a.any,o.a.string.isRequired,o.a.number.isRequired;var Wk={className:o.a.string.isRequired,columns:o.a.arrayOf(function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")}).isRequired,style:function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")}},Vk={columnData:o.a.any,dataKey:o.a.string.isRequired,disableSort:o.a.bool,label:o.a.any,sortBy:o.a.string,sortDirection:o.a.string},Xk={className:o.a.string.isRequired,columns:o.a.arrayOf(function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")}).isRequired,index:o.a.number.isRequired,isScrolling:o.a.bool.isRequired,onRowClick:o.a.func,onRowDoubleClick:o.a.func,onRowMouseOver:o.a.func,onRowMouseOut:o.a.func,rowData:function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")},style:function(A,e,i){if(!Object.prototype.hasOwnProperty.call(A,e))throw new Error("Prop `"+e+"` has type 'any' or 'mixed', but was not provided to `"+i+"`. Pass undefined or any other value.")}};function Zk(A){var e=A.className,i=A.columns,t=A.style;return n.createElement("div",{className:e,role:"row",style:t},i)}Zk.propTypes=Wk===o.a.any?{}:Wk;var qk={ASC:"ASC",DESC:"DESC"};function $k(A){var e=A.sortDirection,i=Le()("ReactVirtualized__Table__sortableHeaderIcon",{"ReactVirtualized__Table__sortableHeaderIcon--ASC":e===qk.ASC,"ReactVirtualized__Table__sortableHeaderIcon--DESC":e===qk.DESC});return n.createElement("svg",{className:i,width:18,height:18,viewBox:"0 0 24 24"},e===qk.ASC?n.createElement("path",{d:"M7 14l5-5 5 5z"}):n.createElement("path",{d:"M7 10l5 5 5-5z"}),n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}function AF(A){var e=A.dataKey,i=A.label,t=A.sortBy,o=A.sortDirection,a=t===e,r=[n.createElement("span",{className:"ReactVirtualized__Table__headerTruncatedText",key:"label",title:i},i)];return a&&r.push(n.createElement($k,{key:"SortIndicator",sortDirection:o})),r}function eF(A){var e=A.className,i=A.columns,t=A.index,o=A.key,a=A.onRowClick,r=A.onRowDoubleClick,s=A.onRowMouseOut,g=A.onRowMouseOver,l=A.onRowRightClick,c=A.rowData,u=A.style,B={};return(a||r||s||g||l)&&(B["aria-label"]="row",B.tabIndex=0,a&&(B.onClick=function(A){return a({event:A,index:t,rowData:c})}),r&&(B.onDoubleClick=function(A){return r({event:A,index:t,rowData:c})}),s&&(B.onMouseOut=function(A){return s({event:A,index:t,rowData:c})}),g&&(B.onMouseOver=function(A){return g({event:A,index:t,rowData:c})}),l&&(B.onContextMenu=function(A){return l({event:A,index:t,rowData:c})})),n.createElement("div",hT()({},B,{className:e,key:o,role:"row",style:u}),i)}$k.propTypes={sortDirection:o.a.oneOf([qk.ASC,qk.DESC])},AF.propTypes=Vk===o.a.any?{}:Vk,eF.propTypes=Xk===o.a.any?{}:Xk;var iF=function(A){function e(){return nT()(this,e),gT()(this,(e.__proto__||tT()(e)).apply(this,arguments))}return cT()(e,A),e}(n.Component);iF.defaultProps={cellDataGetter:function(A){var e=A.dataKey,i=A.rowData;return"function"==typeof i.get?i.get(e):i[e]},cellRenderer:function(A){var e=A.cellData;return null==e?"":String(e)},defaultSortDirection:qk.ASC,flexGrow:0,flexShrink:1,headerRenderer:AF,style:{}};var tF=iF;iF.propTypes={"aria-label":o.a.string,cellDataGetter:o.a.func,cellRenderer:o.a.func,className:o.a.string,columnData:o.a.object,dataKey:o.a.any.isRequired,defaultSortDirection:o.a.oneOf([qk.ASC,qk.DESC]),disableSort:o.a.bool,flexGrow:o.a.number,flexShrink:o.a.number,headerClassName:o.a.string,headerRenderer:o.a.func.isRequired,headerStyle:o.a.object,id:o.a.string,label:o.a.node,maxWidth:o.a.number,minWidth:o.a.number,style:o.a.object,width:o.a.number.isRequired};var oF=function(A){function e(A){nT()(this,e);var i=gT()(this,(e.__proto__||tT()(e)).call(this,A));return i.state={scrollbarWidth:0},i._createColumn=i._createColumn.bind(i),i._createRow=i._createRow.bind(i),i._onScroll=i._onScroll.bind(i),i._onSectionRendered=i._onSectionRendered.bind(i),i._setRef=i._setRef.bind(i),i}return cT()(e,A),rT()(e,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(A){var e=A.alignment,i=A.index;return this.Grid?this.Grid.getOffsetForCell({alignment:e,rowIndex:i}).scrollTop:0}},{key:"invalidateCellSizeAfterRender",value:function(A){var e=A.columnIndex,i=A.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:i,columnIndex:e})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=A.columnIndex,i=void 0===e?0:e,t=A.rowIndex,o=void 0===t?0:t;this.Grid&&this.Grid.recomputeGridSize({rowIndex:o,columnIndex:i})}},{key:"recomputeRowHeights",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:A})}},{key:"scrollToPosition",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:A})}},{key:"scrollToRow",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:A})}},{key:"componentDidMount",value:function(){this._setScrollbarWidth()}},{key:"componentDidUpdate",value:function(){this._setScrollbarWidth()}},{key:"render",value:function(){var A=this,e=this.props,i=e.children,t=e.className,o=e.disableHeader,a=e.gridClassName,r=e.gridStyle,s=e.headerHeight,g=e.headerRowRenderer,l=e.height,c=e.id,u=e.noRowsRenderer,B=e.rowClassName,d=e.rowStyle,E=e.scrollToIndex,h=e.style,C=e.width,w=this.state.scrollbarWidth,m=o?l:l-s,p="function"==typeof B?B({index:-1}):B,I="function"==typeof d?d({index:-1}):d;return this._cachedColumnStyles=[],n.Children.toArray(i).forEach(function(e,i){var t=A._getFlexStyleForColumn(e,e.props.style);A._cachedColumnStyles[i]=hT()({},t,{overflow:"hidden"})}),n.createElement("div",{className:Le()("ReactVirtualized__Table",t),id:c,role:"grid",style:h},!o&&g({className:Le()("ReactVirtualized__Table__headerRow",p),columns:this._getHeaderColumns(),style:hT()({},I,{height:s,overflow:"hidden",paddingRight:w,width:C})}),n.createElement(KT,hT()({},this.props,{autoContainerWidth:!0,className:Le()("ReactVirtualized__Table__Grid",a),cellRenderer:this._createRow,columnWidth:C,columnCount:1,height:m,id:void 0,noContentRenderer:u,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,role:"rowgroup",scrollbarWidth:w,scrollToRow:E,style:hT()({},r,{overflowX:"hidden"})})))}},{key:"_createColumn",value:function(A){var e=A.column,i=A.columnIndex,t=A.isScrolling,o=A.parent,a=A.rowData,r=A.rowIndex,s=e.props,g=s.cellDataGetter,l=s.cellRenderer,c=s.className,u=s.columnData,B=s.dataKey,d=s.id,E=l({cellData:g({columnData:u,dataKey:B,rowData:a}),columnData:u,columnIndex:i,dataKey:B,isScrolling:t,parent:o,rowData:a,rowIndex:r}),h=this._cachedColumnStyles[i],C="string"==typeof E?E:null;return n.createElement("div",{"aria-describedby":d,className:Le()("ReactVirtualized__Table__rowColumn",c),key:"Row"+r+"-Col"+i,role:"gridcell",style:h,title:C},E)}},{key:"_createHeader",value:function(A){var e=A.column,i=A.index,t=this.props,o=t.headerClassName,a=t.headerStyle,r=t.onHeaderClick,s=t.sort,g=t.sortBy,l=t.sortDirection,c=e.props,u=c.columnData,B=c.dataKey,d=c.defaultSortDirection,E=c.disableSort,h=c.headerRenderer,C=c.id,w=c.label,m=!E&&s,p=Le()("ReactVirtualized__Table__headerColumn",o,e.props.headerClassName,{ReactVirtualized__Table__sortableHeaderColumn:m}),I=this._getFlexStyleForColumn(e,hT()({},a,e.props.headerStyle)),f=h({columnData:u,dataKey:B,disableSort:E,label:w,sortBy:g,sortDirection:l}),Q=void 0,D=void 0,M=void 0,b=void 0,y=void 0;if(m||r){var T=g!==B?d:l===qk.DESC?qk.ASC:qk.DESC,k=function(A){m&&s({defaultSortDirection:d,event:A,sortBy:B,sortDirection:T}),r&&r({columnData:u,dataKey:B,event:A})};y=e.props["aria-label"]||w||B,M=0,Q=k,D=function(A){"Enter"!==A.key&&" "!==A.key||k(A)}}return g===B&&(b=l===qk.ASC?"ascending":"descending"),n.createElement("div",{"aria-label":y,"aria-sort":b,className:p,id:C,key:"Header-Col"+i,onClick:Q,onKeyDown:D,role:"columnheader",style:I,tabIndex:M},f)}},{key:"_createRow",value:function(A){var e=this,i=A.rowIndex,t=A.isScrolling,o=A.key,a=A.parent,r=A.style,s=this.props,g=s.children,l=s.onRowClick,c=s.onRowDoubleClick,u=s.onRowRightClick,B=s.onRowMouseOver,d=s.onRowMouseOut,E=s.rowClassName,h=s.rowGetter,C=s.rowRenderer,w=s.rowStyle,m=this.state.scrollbarWidth,p="function"==typeof E?E({index:i}):E,I="function"==typeof w?w({index:i}):w,f=h({index:i}),Q=n.Children.toArray(g).map(function(A,o){return e._createColumn({column:A,columnIndex:o,isScrolling:t,parent:a,rowData:f,rowIndex:i,scrollbarWidth:m})}),D=Le()("ReactVirtualized__Table__row",p),M=hT()({},r,I,{height:this._getRowHeight(i),overflow:"hidden",paddingRight:m});return C({className:D,columns:Q,index:i,isScrolling:t,key:o,onRowClick:l,onRowDoubleClick:c,onRowRightClick:u,onRowMouseOver:B,onRowMouseOut:d,rowData:f,style:M})}},{key:"_getFlexStyleForColumn",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=A.props.flexGrow+" "+A.props.flexShrink+" "+A.props.width+"px",t=hT()({},e,{flex:i,msFlex:i,WebkitFlex:i});return A.props.maxWidth&&(t.maxWidth=A.props.maxWidth),A.props.minWidth&&(t.minWidth=A.props.minWidth),t}},{key:"_getHeaderColumns",value:function(){var A=this,e=this.props,i=e.children;return(e.disableHeader?[]:n.Children.toArray(i)).map(function(e,i){return A._createHeader({column:e,index:i})})}},{key:"_getRowHeight",value:function(A){var e=this.props.rowHeight;return"function"==typeof e?e({index:A}):e}},{key:"_onScroll",value:function(A){var e=A.clientHeight,i=A.scrollHeight,t=A.scrollTop;(0,this.props.onScroll)({clientHeight:e,scrollHeight:i,scrollTop:t})}},{key:"_onSectionRendered",value:function(A){var e=A.rowOverscanStartIndex,i=A.rowOverscanStopIndex,t=A.rowStartIndex,o=A.rowStopIndex;(0,this.props.onRowsRendered)({overscanStartIndex:e,overscanStopIndex:i,startIndex:t,stopIndex:o})}},{key:"_setRef",value:function(A){this.Grid=A}},{key:"_setScrollbarWidth",value:function(){if(this.Grid){var A=Object(Sy.findDOMNode)(this.Grid),e=A.clientWidth||0,i=(A.offsetWidth||0)-e;this.setState({scrollbarWidth:i})}}}]),e}(n.PureComponent);oF.defaultProps={disableHeader:!1,estimatedRowSize:30,headerHeight:0,headerStyle:{},noRowsRenderer:function(){return null},onRowsRendered:function(){return null},onScroll:function(){return null},overscanIndicesGetter:VT,overscanRowCount:10,rowRenderer:eF,headerRowRenderer:Zk,rowStyle:{},scrollToAlignment:"auto",scrollToIndex:-1,style:{}};oF.propTypes={"aria-label":o.a.string,autoHeight:o.a.bool,children:function(A){for(var e=n.Children.toArray(A.children),i=0;i<e.length;i++){var t=e[i].type;if(t!==tF&&!(t.prototype instanceof tF))return new Error("Table only accepts children of type Column")}},className:o.a.string,disableHeader:o.a.bool,estimatedRowSize:o.a.number.isRequired,gridClassName:o.a.string,gridStyle:o.a.object,headerClassName:o.a.string,headerHeight:o.a.number.isRequired,headerRowRenderer:o.a.func,headerStyle:o.a.object,height:o.a.number.isRequired,id:o.a.string,noRowsRenderer:o.a.func,onHeaderClick:o.a.func,onRowClick:o.a.func,onRowDoubleClick:o.a.func,onRowMouseOut:o.a.func,onRowMouseOver:o.a.func,onRowRightClick:o.a.func,onRowsRendered:o.a.func,onScroll:o.a.func.isRequired,overscanIndicesGetter:o.a.func.isRequired,overscanRowCount:o.a.number.isRequired,rowClassName:o.a.oneOfType([o.a.string,o.a.func]),rowGetter:o.a.func.isRequired,rowHeight:o.a.oneOfType([o.a.number,o.a.func]).isRequired,rowCount:o.a.number.isRequired,rowRenderer:o.a.func,rowStyle:o.a.oneOfType([o.a.object,o.a.func]).isRequired,scrollToAlignment:o.a.oneOf(["auto","end","start","center"]).isRequired,scrollToIndex:o.a.number.isRequired,scrollTop:o.a.number,sort:o.a.func,sortBy:o.a.string,sortDirection:o.a.oneOf([qk.ASC,qk.DESC]),style:o.a.object,tabIndex:o.a.number,width:o.a.number.isRequired};var nF=[],aF=null,rF=null;function sF(){rF&&(rF=null,document.body&&null!=aF&&(document.body.style.pointerEvents=aF),aF=null)}function gF(){sF(),nF.forEach(function(A){return A.__resetIsScrolling()})}function lF(A){A.currentTarget===window&&null==aF&&document.body&&(aF=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),function(){rF&&xT(rF);var A=0;nF.forEach(function(e){A=Math.max(A,e.props.scrollingResetTimeInterval)}),rF=_T(gF,A)}(),nF.forEach(function(e){e.props.scrollElement===A.currentTarget&&e.__handleWindowScrollEvent()})}function cF(A,e){nF.some(function(A){return A.props.scrollElement===e})||e.addEventListener("scroll",lF),nF.push(A)}function uF(A,e){(nF=nF.filter(function(e){return e!==A})).length||(e.removeEventListener("scroll",lF),rF&&(xT(rF),sF()))}var BF=function(A){return A===window},dF=function(A){return A.getBoundingClientRect()};function EF(A,e){if(A){if(BF(A)){var i=window,t=i.innerHeight,o=i.innerWidth;return{height:"number"==typeof t?t:0,width:"number"==typeof o?o:0}}return dF(A)}return{height:e.serverHeight,width:e.serverWidth}}function hF(A){return BF(A)&&document.documentElement?{top:"scrollY"in window?window.scrollY:document.documentElement.scrollTop,left:"scrollX"in window?window.scrollX:document.documentElement.scrollLeft}:{top:A.scrollTop,left:A.scrollLeft}}var CF=function(){return"undefined"!=typeof window?window:void 0},wF=function(A){function e(){var A,i,t,o;nT()(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=gT()(this,(A=e.__proto__||tT()(e)).call.apply(A,[this].concat(a))),t._window=CF(),t._isMounted=!1,t._positionFromTop=0,t._positionFromLeft=0,t.state=hT()({},EF(t.props.scrollElement,t.props),{isScrolling:!1,scrollLeft:0,scrollTop:0}),t._registerChild=function(A){!A||A instanceof Element||console.warn("WindowScroller registerChild expects to be passed Element or null"),t._child=A,t.updatePosition()},t._onChildScroll=function(A){var e=A.scrollTop;if(t.state.scrollTop!==e){var i=t.props.scrollElement;i&&("function"==typeof i.scrollTo?i.scrollTo(0,e+t._positionFromTop):i.scrollTop=e+t._positionFromTop)}},t._registerResizeListener=function(A){A===window?window.addEventListener("resize",t._onResize,!1):t._detectElementResize.addResizeListener(A,t._onResize)},t._unregisterResizeListener=function(A){A===window?window.removeEventListener("resize",t._onResize,!1):A&&t._detectElementResize.removeResizeListener(A,t._onResize)},t._onResize=function(){t.updatePosition()},t.__handleWindowScrollEvent=function(){if(t._isMounted){var A=t.props.onScroll,e=t.props.scrollElement;if(e){var i=hF(e),o=Math.max(0,i.left-t._positionFromLeft),n=Math.max(0,i.top-t._positionFromTop);t.setState({isScrolling:!0,scrollLeft:o,scrollTop:n}),A({scrollLeft:o,scrollTop:n})}}},t.__resetIsScrolling=function(){t.setState({isScrolling:!1})},o=i,gT()(t,o)}return cT()(e,A),rT()(e,[{key:"updatePosition",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.scrollElement,e=this.props.onResize,i=this.state,t=i.height,o=i.width,n=this._child||Sy.findDOMNode(this);if(n instanceof Element&&A){var a=function(A,e){if(BF(e)&&document.documentElement){var i=document.documentElement,t=dF(A),o=dF(i);return{top:t.top-o.top,left:t.left-o.left}}var n=hF(e),a=dF(A),r=dF(e);return{top:a.top+n.top-r.top,left:a.left+n.left-r.left}}(n,A);this._positionFromTop=a.top,this._positionFromLeft=a.left}var r=EF(A,this.props);t===r.height&&o===r.width||(this.setState({height:r.height,width:r.width}),e({height:r.height,width:r.width}))}},{key:"componentDidMount",value:function(){var A=this.props.scrollElement;this._detectElementResize=Object(ZT.a)(),this.updatePosition(A),A&&(cF(this,A),this._registerResizeListener(A)),this._isMounted=!0}},{key:"componentDidUpdate",value:function(A,e){var i=this.props.scrollElement,t=A.scrollElement;t!==i&&null!=t&&null!=i&&(this.updatePosition(i),uF(this,t),cF(this,i),this._unregisterResizeListener(t),this._registerResizeListener(i))}},{key:"componentWillUnmount",value:function(){var A=this.props.scrollElement;A&&(uF(this,A),this._unregisterResizeListener(A)),this._isMounted=!1}},{key:"render",value:function(){var A=this.props.children,e=this.state,i=e.isScrolling,t=e.scrollTop,o=e.scrollLeft,n=e.height,a=e.width;return A({onChildScroll:this._onChildScroll,registerChild:this._registerChild,height:n,isScrolling:i,scrollLeft:o,scrollTop:t,width:a})}}]),e}(n.PureComponent);wF.defaultProps={onResize:function(){},onScroll:function(){},scrollingResetTimeInterval:150,scrollElement:CF(),serverHeight:0,serverWidth:0},wF.propTypes={children:o.a.func.isRequired,onResize:o.a.func.isRequired,onScroll:o.a.func.isRequired,scrollElement:o.a.oneOfType([o.a.any,function(){return("function"==typeof Element?o.a.instanceOf(Element):o.a.any).apply(this,arguments)}]),scrollingResetTimeInterval:o.a.number.isRequired,serverHeight:o.a.number.isRequired,serverWidth:o.a.number.isRequired};function mF(A){"@babel/helpers - typeof";return(mF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function pF(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function IF(A,e){return(IF=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function fF(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=DF(A);if(e){var o=DF(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===mF(e)||"function"==typeof e))return e;return QF(A)}(this,i)}}function QF(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function DF(A){return(DF=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var MF=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&IF(A,e)}(i,a.a.Component);var e=fF(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(QF(t),["rowRenderer","noRowsRenderer","handleEventFactory"]),t}return function(A,e,i){e&&pF(A.prototype,e),i&&pF(A,i)}(i,[{key:"handleEventFactory",value:function(A){var e=this;return function(){return e.props.onActivate(A)}}},{key:"noRowsRenderer",value:function(){return a.a.createElement("div",{className:Le()(Oy.a.listRow,Oy.a.listEmpty)},a.a.createElement(B.a,{defaultMessage:"(empty)",id:"gui.monitor.listMonitor.empty"}))}},{key:"rowRenderer",value:function(A){var e=A.index,i=A.key,t=A.style;return a.a.createElement("div",{className:Oy.a.listRow,key:i,style:t},a.a.createElement("div",{className:Oy.a.listIndex},e+1),a.a.createElement("div",{className:Oy.a.listValue,dataIndex:e,style:{background:this.props.categoryColor},onClick:this.props.draggable?this.handleEventFactory(e):null},this.props.draggable&&this.props.activeIndex===e?a.a.createElement("div",{className:Oy.a.inputWrapper},a.a.createElement("input",{autoFocus:!0,autoComplete:!1,className:Le()(Oy.a.listInput,"no-drag"),spellCheck:!1,type:"text",value:this.props.activeValue,onBlur:this.props.onDeactivate,onChange:this.props.onInput,onFocus:this.props.onFocus,onKeyDown:this.props.onKeyPress}),a.a.createElement("div",{className:Oy.a.removeButton,onMouseDown:this.props.onRemove},"✖︎")):a.a.createElement("div",{className:Oy.a.valueInner},this.props.values[e])))}},{key:"render",value:function(){var A=this.props,e=A.height,i=A.values,t=A.width,o=A.activeIndex,n=A.activeValue,r=null===o?void 0:o;return a.a.createElement(wk,{activeIndex:o,activeValue:n,height:e-44,noRowsRenderer:this.noRowsRenderer,rowCount:i.length,rowHeight:24,rowRenderer:this.rowRenderer,scrollToIndex:r,values:i,width:t})}}]),i}();MF.propTypes={activeIndex:o.a.number,activeValue:o.a.string,categoryColor:o.a.string,draggable:o.a.bool,height:o.a.number,onActivate:o.a.func,onDeactivate:o.a.func,onFocus:o.a.func,onInput:o.a.func,onKeyPress:o.a.func,onRemove:o.a.func,values:o.a.arrayOf(o.a.oneOfType([o.a.string,o.a.number])),width:o.a.number};var bF=MF,yF=["draggable","label","width","height","value","onResizeMouseDown","onAdd"];function TF(){return(TF=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function kF(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var FF=function(A){var e=A.draggable,i=A.label,t=A.width,o=A.height,n=A.value,r=A.onResizeMouseDown,s=A.onAdd,g=kF(A,yF);return a.a.createElement("div",{className:Oy.a.listMonitor,style:{width:"".concat(t,"px"),height:"".concat(o,"px")}},a.a.createElement("div",{className:Oy.a.listHeader},i),a.a.createElement("div",{className:Oy.a.listBody},a.a.createElement(bF,TF({draggable:e,height:o,values:n,width:t},g))),a.a.createElement("div",{className:Oy.a.listFooter},a.a.createElement("div",{className:Le()(e?Oy.a.addButton:null,"no-drag"),onClick:e?s:null},"+"),a.a.createElement("div",{className:Oy.a.footerLength},a.a.createElement(B.a,{defaultMessage:"length {length}",id:"gui.monitor.listMonitor.listLength",values:{length:n.length}})),a.a.createElement("div",{className:Le()(e?Oy.a.resizeHandle:null,"no-drag"),onMouseDown:e?r:null},"=")))};FF.propTypes={activeIndex:o.a.number,categoryColor:o.a.string.isRequired,draggable:o.a.bool.isRequired,height:o.a.number,label:o.a.string.isRequired,onActivate:o.a.func,onAdd:o.a.func,onResizeMouseDown:o.a.func,value:o.a.oneOfType([o.a.string,o.a.number,o.a.arrayOf(o.a.oneOfType([o.a.string,o.a.number]))]),width:o.a.number},FF.defaultProps={width:110,height:200};var vF=FF,SF=i(68);function NF(A){"@babel/helpers - typeof";return(NF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var RF=["vm"];function OF(){return(OF=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function YF(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function UF(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function GF(A,e){return(GF=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function HF(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=PF(A);if(e){var o=PF(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===NF(e)||"function"==typeof e))return e;return LF(A)}(this,i)}}function LF(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function PF(A){return(PF=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var xF=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&GF(A,e)}(i,a.a.Component);var e=HF(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(LF(t),["handleActivate","handleDeactivate","handleInput","handleRemove","handleKeyPress","handleFocus","handleAdd","handleResizeMouseDown"]),t.state={activeIndex:null,activeValue:null,width:A.width||100,height:A.height||200},t}return function(A,e,i){e&&UF(A.prototype,e),i&&UF(A,i)}(i,[{key:"handleActivate",value:function(A){this.state.activeIndex!==A&&this.setState({activeIndex:A,activeValue:this.props.value[A]})}},{key:"handleDeactivate",value:function(){if(null!==this.state.activeIndex){var A=this.props,e=A.vm,i=A.targetId,t=A.id,o=Py(e,i,t);o[this.state.activeIndex]=this.state.activeValue,xy(e,i,t,o),this.setState({activeIndex:null,activeValue:null})}}},{key:"handleFocus",value:function(A){A.target.select()}},{key:"handleKeyPress",value:function(A){var e=this.state.activeIndex,i=this.props,t=i.vm,o=i.targetId,n=i.id,a=0;if("Tab"===A.key?a=A.shiftKey?-1:1:"ArrowUp"===A.key?a=-1:"ArrowDown"===A.key&&(a=1),a){this.handleDeactivate();var r=this.wrapListIndex(e+a,this.props.value.length);this.setState({activeIndex:r,activeValue:this.props.value[r]}),A.preventDefault()}else if("Enter"===A.key){this.handleDeactivate();var s=A.shiftKey?0:1,g=Py(t,o,n),l=g.slice(0,e+s).concat([""]).concat(g.slice(e+s));xy(t,o,n,l);var c=this.wrapListIndex(e+s,l.length);this.setState({activeIndex:c,activeValue:""})}}},{key:"handleInput",value:function(A){this.setState({activeValue:A.target.value})}},{key:"handleRemove",value:function(A){A.preventDefault(),A.stopPropagation();var e=this.props,i=e.vm,t=e.targetId,o=e.id,n=Py(i,t,o),a=n.slice(0,this.state.activeIndex).concat(n.slice(this.state.activeIndex+1));xy(i,t,o,a);var r=Math.min(a.length-1,this.state.activeIndex);this.setState({activeIndex:r,activeValue:a[r]})}},{key:"handleAdd",value:function(){var A=this.props,e=A.vm,i=A.targetId,t=A.id,o=Py(e,i,t).concat([""]);xy(e,i,t,o),this.setState({activeIndex:o.length-1,activeValue:""})}},{key:"handleResizeMouseDown",value:function(A){var e=this;this.initialPosition=Ii(A),this.initialWidth=this.state.width,this.initialHeight=this.state.height;var i=function(A){var i=Ii(A),t=i.x-e.initialPosition.x,o=i.y-e.initialPosition.y;e.setState({width:Math.max(Math.min(e.initialWidth+t,480),100),height:Math.max(Math.min(e.initialHeight+o,360),60)})};window.addEventListener("mousemove",i),window.addEventListener("mouseup",function A(t){i(t),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",A),e.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:e.props.id,height:e.state.height,width:e.state.width}))})}},{key:"wrapListIndex",value:function(A,e){return(A+e)%e}},{key:"render",value:function(){var A=this.props,e=(A.vm,YF(A,RF));return a.a.createElement(vF,OF({},e,{activeIndex:this.state.activeIndex,activeValue:this.state.activeValue,height:this.state.height,width:this.state.width,onActivate:this.handleActivate,onAdd:this.handleAdd,onDeactivate:this.handleDeactivate,onFocus:this.handleFocus,onInput:this.handleInput,onKeyPress:this.handleKeyPress,onRemove:this.handleRemove,onResizeMouseDown:this.handleResizeMouseDown}))}}]),i}();xF.propTypes={height:o.a.number,id:o.a.string,targetId:o.a.string,value:o.a.oneOfType([o.a.number,o.a.string]),vm:o.a.instanceOf(u.a),width:o.a.number,x:o.a.number,y:o.a.number};function _F(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function jF(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var JF={data:"#FF8C1A",sensing:"#5CB1D6",sound:"#CF63CF",looks:"#9966FF",motion:"#4C97FF",list:"#FC662C",extension:"#0FBD8C"},zF={default:Uy,large:Hy,slider:eT,list:Object(s.b)(function(A){return{vm:A.scratchGui.vm}})(xF)},KF=function(A){return a.a.createElement(mt,{disable:!A.draggable,holdToDisplay:"slider"===A.mode?-1:1e3,id:"monitor-".concat(A.label)},a.a.createElement(Mw.a,{bounds:".monitor-overlay",cancel:".no-drag",defaultClassNameDragging:Oy.a.dragging,disabled:!A.draggable,onStop:A.onDragEnd},a.a.createElement(hi.a,{className:Oy.a.monitorContainer,componentRef:A.componentRef,onDoubleClick:"list"!==A.mode&&A.draggable?A.onNextMode:null},a.a.createElement(zF[A.mode],function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?_F(Object(i),!0).forEach(function(e){jF(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):_F(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({categoryColor:JF[A.category]},A)))),Ny.a.createPortal(a.a.createElement(Qt,{id:"monitor-".concat(A.label)},A.onSetModeToDefault&&a.a.createElement(Dt,{onClick:A.onSetModeToDefault},a.a.createElement(B.a,{defaultMessage:"normal readout",id:"gui.monitor.contextMenu.default"})),A.onSetModeToLarge&&a.a.createElement(Dt,{onClick:A.onSetModeToLarge},a.a.createElement(B.a,{defaultMessage:"large readout",id:"gui.monitor.contextMenu.large"})),A.onSetModeToSlider&&a.a.createElement(Dt,{onClick:A.onSetModeToSlider},a.a.createElement(B.a,{defaultMessage:"slider",id:"gui.monitor.contextMenu.slider"})),A.onSliderPromptOpen&&"slider"===A.mode&&a.a.createElement(Mt,{onClick:A.onSliderPromptOpen},a.a.createElement(B.a,{defaultMessage:"change slider range",id:"gui.monitor.contextMenu.sliderRange"})),A.onImport&&a.a.createElement(Dt,{onClick:A.onImport},a.a.createElement(B.a,{defaultMessage:"import",id:"gui.monitor.contextMenu.import"})),A.onExport&&a.a.createElement(Dt,{onClick:A.onExport},a.a.createElement(B.a,{defaultMessage:"export",id:"gui.monitor.contextMenu.export"})),A.onHide&&a.a.createElement(Mt,{onClick:A.onHide},a.a.createElement(B.a,{defaultMessage:"hide",id:"gui.monitor.contextMenu.hide"}))),document.body))};KF.categories=JF;var WF=Object.keys(zF);KF.propTypes={category:o.a.oneOf(Object.keys(JF)),componentRef:o.a.func.isRequired,draggable:o.a.bool.isRequired,label:o.a.string.isRequired,mode:o.a.oneOf(WF),onDragEnd:o.a.func.isRequired,onExport:o.a.func,onImport:o.a.func,onHide:o.a.func,onNextMode:o.a.func.isRequired,onSetModeToDefault:o.a.func,onSetModeToLarge:o.a.func,onSetModeToSlider:o.a.func,onSliderPromptOpen:o.a.func},KF.defaultProps={category:"extension",mode:"default"};var VF=i(945),XF=i.n(VF),ZF=i(108),qF=i.n(ZF),$F=Object(B.d)({minValue:{id:"gui.sliderModal.min",defaultMessage:"Minimum value"},maxValue:{id:"gui.sliderModal.max",defaultMessage:"Maximum value"},title:{id:"gui.sliderModal.title",defaultMessage:"Change slider range"}}),Av=function(A){return a.a.createElement(Nl.a,{className:qF.a.modalContent,contentLabel:A.intl.formatMessage($F.title),id:"sliderPrompt",onRequestClose:A.onCancel},a.a.createElement(hi.a,{className:qF.a.body},a.a.createElement(hi.a,{className:qF.a.label},A.intl.formatMessage($F.minValue)),a.a.createElement(hi.a,null,a.a.createElement("input",{className:qF.a.minInput,name:A.intl.formatMessage($F.minValue),pattern:"-?[0-9]*(\\.[0-9]+)?",type:"text",value:A.minValue,onChange:A.onChangeMin,onKeyPress:A.onKeyPress})),a.a.createElement(hi.a,{className:qF.a.label},A.intl.formatMessage($F.maxValue)),a.a.createElement(hi.a,null,a.a.createElement("input",{className:qF.a.maxInput,name:A.intl.formatMessage($F.maxValue),pattern:"-?[0-9]*(\\.[0-9]+)?",type:"text",value:A.maxValue,onChange:A.onChangeMax,onKeyPress:A.onKeyPress})),a.a.createElement(hi.a,{className:qF.a.buttonRow},a.a.createElement("button",{className:qF.a.cancelButton,onClick:A.onCancel},a.a.createElement(B.a,{defaultMessage:"Cancel",id:"gui.sliderPrompt.cancel"})),a.a.createElement("button",{className:qF.a.okButton,onClick:A.onOk},a.a.createElement(B.a,{defaultMessage:"OK",id:"gui.sliderPrompt.ok"})))))};Av.propTypes={intl:B.f,maxValue:o.a.string,minValue:o.a.string,onCancel:o.a.func.isRequired,onChangeMax:o.a.func.isRequired,onChangeMin:o.a.func.isRequired,onKeyPress:o.a.func.isRequired,onOk:o.a.func.isRequired};var ev=Object(B.e)(Av);function iv(A){"@babel/helpers - typeof";return(iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function tv(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function ov(A,e){return(ov=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function nv(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=rv(A);if(e){var o=rv(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===iv(e)||"function"==typeof e))return e;return av(A)}(this,i)}}function av(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function rv(A){return(rv=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var sv=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&ov(A,e)}(i,a.a.Component);var e=nv(i);function i(A){var t;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(av(t),["handleOk","handleCancel","handleChangeMin","handleChangeMax","handleKeyPress","validates","shouldBeDiscrete"]);var o=t.props,n=o.isDiscrete,a=o.minValue,r=o.maxValue;return t.state={minValue:n?a.toFixed(0):a.toFixed(2),maxValue:n?r.toFixed(0):r.toFixed(2)},t}return function(A,e,i){e&&tv(A.prototype,e),i&&tv(A,i)}(i,[{key:"handleKeyPress",value:function(A){"Enter"===A.key&&this.handleOk()}},{key:"handleOk",value:function(){var A=this.state,e=A.minValue,i=A.maxValue;this.validates(e,i)?this.props.onOk(parseFloat(e),parseFloat(i),this.shouldBeDiscrete(e,i)):this.props.onCancel()}},{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleChangeMin",value:function(A){this.setState({minValue:A.target.value})}},{key:"handleChangeMax",value:function(A){this.setState({maxValue:A.target.value})}},{key:"shouldBeDiscrete",value:function(A,e){return A.indexOf(".")+e.indexOf(".")===-2}},{key:"validates",value:function(A,e){return isFinite(A)&&isFinite(e)}},{key:"render",value:function(){return a.a.createElement(ev,{maxValue:this.state.maxValue,minValue:this.state.minValue,onCancel:this.handleCancel,onChangeMax:this.handleChangeMax,onChangeMin:this.handleChangeMin,onKeyPress:this.handleKeyPress,onOk:this.handleOk})}}]),i}();sv.propTypes={isDiscrete:o.a.bool,maxValue:o.a.number,minValue:o.a.number,onCancel:o.a.func.isRequired,onOk:o.a.func.isRequired},sv.defaultProps={maxValue:100,minValue:0,isDiscrete:!0};var gv=sv;function lv(A){"@babel/helpers - typeof";return(lv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function cv(){return(cv=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function uv(A,e){var i="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!i){if(Array.isArray(A)||(i=function(A,e){if(!A)return;if("string"==typeof A)return Bv(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Bv(A,e)}(A))||e&&A&&"number"==typeof A.length){i&&(A=i);var t=0,o=function(){};return{s:o,n:function(){return t>=A.length?{done:!0}:{done:!1,value:A[t++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,r=!1;return{s:function(){i=i.call(A)},n:function(){var A=i.next();return a=A.done,A},e:function(A){r=!0,n=A},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw n}}}}function Bv(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function dv(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Ev(A,e){return(Ev=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function hv(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=wv(A);if(e){var o=wv(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===lv(e)||"function"==typeof e))return e;return Cv(A)}(this,i)}}function Cv(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function wv(A){return(wv=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var mv=function(A){return WF.filter(function(e){return"data_variable"===A?"list"!==e:"data_listcontents"===A?"list"===e:"slider"!==e&&"list"!==e})},pv=Object(B.d)({columnPrompt:{id:"gui.monitors.importListColumnPrompt",defaultMessage:"Which column should be used (1-{numberOfColumns})?"}}),Iv=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Ev(A,e)}(i,a.a.Component);var e=hv(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Cv(t),["handleDragEnd","handleHide","handleNextMode","handleSetModeToDefault","handleSetModeToLarge","handleSetModeToSlider","handleSliderPromptClose","handleSliderPromptOk","handleSliderPromptOpen","handleImport","handleExport","setElement"]),t.state={sliderPrompt:!1},t}return function(A,e,i){e&&dv(A.prototype,e),i&&dv(A,i)}(i,[{key:"componentDidMount",value:function(){var A,e=this,i=function(A){return"number"==typeof A&&!isNaN(A)},t=setTimeout(function(){i(e.props.x)&&i(e.props.y)&&!e.props.monitorLayout.savedMonitorPositions[e.props.id]?(A={upperStart:{x:e.props.x,y:e.props.y},lowerEnd:{x:e.props.x+e.element.offsetWidth,y:e.props.y+e.element.offsetHeight}},e.props.addMonitorRect(e.props.id,A,!0)):(A=Object(Ty.c)(e.props.monitorLayout,e.props.id,e.element.offsetWidth,e.element.offsetHeight),e.props.addMonitorRect(e.props.id,A),e.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:e.props.id,x:A.upperStart.x,y:A.upperStart.y}))),e.element.style.top="".concat(A.upperStart.y,"px"),e.element.style.left="".concat(A.upperStart.x,"px"),clearTimeout(t)},1)}},{key:"shouldComponentUpdate",value:function(A,e){if(e!==this.state)return!0;var i,t=uv(Object.getOwnPropertyNames(A));try{for(t.s();!(i=t.n()).done;){var o=i.value;if("monitorLayout"!==o&&A[o]!==this.props[o])return!0}}catch(A){t.e(A)}finally{t.f()}return!1}},{key:"componentDidUpdate",value:function(){this.props.resizeMonitorRect(this.props.id,this.element.offsetWidth,this.element.offsetHeight)}},{key:"componentWillUnmount",value:function(){this.props.removeMonitorRect(this.props.id)}},{key:"handleDragEnd",value:function(A,e){var i=e.x,t=e.y,o=parseInt(this.element.style.left,10)+i,n=parseInt(this.element.style.top,10)+t;this.props.onDragEnd(this.props.id,o,n),this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,x:o,y:n}))}},{key:"handleHide",value:function(){this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,visible:!1}))}},{key:"handleNextMode",value:function(){var A=mv(this.props.opcode),e=A[(A.indexOf(this.props.mode)+1)%A.length];this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,mode:e}))}},{key:"handleSetModeToDefault",value:function(){this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,mode:"default"}))}},{key:"handleSetModeToLarge",value:function(){this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,mode:"large"}))}},{key:"handleSetModeToSlider",value:function(){this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,mode:"slider"}))}},{key:"handleSliderPromptClose",value:function(){this.setState({sliderPrompt:!1})}},{key:"handleSliderPromptOpen",value:function(){this.setState({sliderPrompt:!0})}},{key:"handleSliderPromptOk",value:function(A,e,i){var t=Math.min(A,e),o=Math.max(A,e);this.props.vm.runtime.requestUpdateMonitor(Object(SF.Map)({id:this.props.id,sliderMin:t,sliderMax:o,isDiscrete:i})),this.handleSliderPromptClose()}},{key:"setElement",value:function(A){this.element=A}},{key:"handleImport",value:function(){var A=this;new Promise(function(A,e){var i=document.createElement("input");i.setAttribute("type","file"),i.setAttribute("accept",".csv, .tsv, .txt"),i.onchange=function(t){var o=t.target.files[0];XF.a.parse(o,{header:!1,complete:function(e){document.body.removeChild(i),A(e.data)},error:function(A){document.body.removeChild(i),e(A)}})},document.body.appendChild(i),i.click()}).then(function(e){var i=e[0].length,t=1;if(i>1){var o=A.props.intl.formatMessage(pv.columnPrompt,{numberOfColumns:i});t=parseInt(prompt(o),10)}var n=e.map(function(A){return A[t-1]}).filter(function(A){return"string"==typeof A}),a=A.props,r=a.vm,s=a.targetId,g=a.id;xy(r,s,g,n)})}},{key:"handleExport",value:function(){var A=this.props,e=A.vm,i=A.targetId,t=A.id,o=Ly(e,i,t),n=o.value.join("\r\n"),a=new Blob([n],{type:"text/plain;charset=utf-8"});Ko("".concat(o.name,".txt"),a)}},{key:"render",value:function(){var A=function(A){var e=A.id,i=A.spriteName,t=A.opcode,o=A.params,n=A.value,a=A.vm,r=a&&a.runtime.getLabelForOpcode(t)||vy.getLabel(t),s=r.label,g=r.category,l=r.labelFn;return function(A){return void 0===A}(l)||(s=l(o)),i&&(s="".concat(i,": ").concat(s)),"number"==typeof n&&(n=Number(n.toFixed(6))),"boolean"==typeof n&&(n=n.toString()),Array.isArray(n)&&(n=n.map(function(A){return A.toString()})),{id:e,label:s,category:g,value:n}}(this.props),e=-1!==mv(this.props.opcode).indexOf("slider"),i="list"===this.props.mode;return a.a.createElement(a.a.Fragment,null,this.state.sliderPrompt&&a.a.createElement(gv,{isDiscrete:this.props.isDiscrete,maxValue:parseFloat(this.props.max),minValue:parseFloat(this.props.min),onCancel:this.handleSliderPromptClose,onOk:this.handleSliderPromptOk}),a.a.createElement(KF,cv({componentRef:this.setElement},A,{draggable:this.props.draggable,height:this.props.height,isDiscrete:this.props.isDiscrete,max:this.props.max,min:this.props.min,mode:this.props.mode,targetId:this.props.targetId,width:this.props.width,onDragEnd:this.handleDragEnd,onExport:i?this.handleExport:null,onImport:i?this.handleImport:null,onHide:this.handleHide,onNextMode:this.handleNextMode,onSetModeToDefault:i?null:this.handleSetModeToDefault,onSetModeToLarge:i?null:this.handleSetModeToLarge,onSetModeToSlider:e?this.handleSetModeToSlider:null,onSliderPromptOpen:this.handleSliderPromptOpen})))}}]),i}();Iv.propTypes={addMonitorRect:o.a.func.isRequired,draggable:o.a.bool,height:o.a.number,id:o.a.string.isRequired,intl:B.f,isDiscrete:o.a.bool,max:o.a.number,min:o.a.number,mode:o.a.oneOf(["default","slider","large","list"]),monitorLayout:o.a.shape({monitors:o.a.object,savedMonitorPositions:o.a.object}).isRequired,onDragEnd:o.a.func.isRequired,opcode:o.a.string.isRequired,params:o.a.object,removeMonitorRect:o.a.func.isRequired,resizeMonitorRect:o.a.func.isRequired,spriteName:o.a.string,targetId:o.a.string,value:o.a.oneOfType([o.a.string,o.a.number,o.a.arrayOf(o.a.oneOfType([o.a.string,o.a.number]))]),vm:o.a.instanceOf(u.a),width:o.a.number,x:o.a.number,y:o.a.number};var fv=Object(B.e)(Object(s.b)(function(A){return{monitorLayout:A.scratchGui.monitorLayout,vm:A.scratchGui.vm}},function(A){return{addMonitorRect:function(e,i,t){return A(Object(Ty.a)(e,i.upperStart,i.lowerEnd,t))},resizeMonitorRect:function(e,i,t){return A(Object(Ty.g)(e,i,t))},removeMonitorRect:function(e){return A(Object(Ty.f)(e))}}})(Iv)),Qv=i(380),Dv=i.n(Qv),Mv=function(A){return a.a.createElement(hi.a,{className:Le()(Dv.a.monitorList,"monitor-overlay"),style:{width:A.stageSize.width||0,height:A.stageSize.height||0}},a.a.createElement(hi.a,{className:Dv.a.monitorListScaler,style:VB(A.stageSize)},A.monitors.valueSeq().filter(function(A){return A.visible}).map(function(e){return a.a.createElement(fv,{draggable:A.draggable,height:e.height,id:e.id,isDiscrete:e.isDiscrete,key:e.id,max:e.sliderMax,min:e.sliderMin,mode:e.mode,opcode:e.opcode,params:e.params,spriteName:e.spriteName,targetId:e.targetId,value:e.value,width:e.width,x:null,y:null,onDragEnd:A.onMonitorChange})})))};Mv.propTypes={draggable:o.a.bool.isRequired,monitors:o.a.instanceOf(SF.OrderedMap),onMonitorChange:o.a.func.isRequired,stageSize:o.a.shape({width:o.a.number,height:o.a.number,widthDefault:o.a.number,heightDefault:o.a.number}).isRequired};var bv=Mv;function yv(A){"@babel/helpers - typeof";return(yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Tv(){return(Tv=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function kv(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Fv(A,e){return(Fv=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function vv(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Nv(A);if(e){var o=Nv(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===yv(e)||"function"==typeof e))return e;return Sv(A)}(this,i)}}function Sv(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function Nv(A){return(Nv=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Rv=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Fv(A,e)}(i,a.a.Component);var e=vv(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),H()(Sv(t),["handleMonitorChange"]),vy.setTranslatorFunction(A.intl.formatMessage),t}return function(A,e,i){e&&kv(A.prototype,e),i&&kv(A,i)}(i,[{key:"handleMonitorChange",value:function(A,e,i){this.props.moveMonitorRect(A,e,i)}},{key:"render",value:function(){return a.a.createElement(bv,Tv({onMonitorChange:this.handleMonitorChange},this.props))}}]),i}();Rv.propTypes={intl:B.f.isRequired,moveMonitorRect:o.a.func.isRequired};var Ov=Object(d.a)("Monitors")(Object(B.e)(Object(s.b)(function(A){return{monitors:A.scratchGui.monitors}},function(A){return{moveMonitorRect:function(e,i,t){return A(Object(Ty.e)(e,i,t))}}})(Rv))),Yv=i(306),Uv=i.n(Yv),Gv=i(291),Hv=i.n(Gv);function Lv(A){"@babel/helpers - typeof";return(Lv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Pv(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function xv(A,e){return(xv=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function _v(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=jv(A);if(e){var o=jv(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===Lv(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function jv(A){return(jv=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Jv=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&xv(A,e)}(i,a.a.Component);var e=_v(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.call(this)}return function(A,e,i){e&&Pv(A.prototype,e),i&&Pv(A,i)}(i,[{key:"render",value:function(){return a.a.createElement("div",{className:Hv.a.martyConnectBtnContainer},a.a.createElement("svg",{id:"a",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.459 41.2807"},a.a.createElement("rect",{x:".5",y:".5",width:"129.459",height:"40.2807",rx:"9.1484",ry:"9.1484",fill:"#37abc8",stroke:"#050505","stroke-miterlimit":"10"}),a.a.createElement("rect",{x:"15.2596",y:"23.9589",width:"8.6585",height:"15.8269",rx:"4.3293",ry:"4.3293",transform:"translate(51.4612 12.2835) rotate(90)",fill:"#a1d5e3",stroke:"#020202","stroke-miterlimit":"10","stroke-width":".25"}),a.a.createElement("circle",{cx:"15.7005",cy:"31.8724",r:"4.3613",fill:"#70888e",stroke:"#020202","stroke-miterlimit":"10","stroke-width":".25"}),a.a.createElement("g",null,a.a.createElement("path",{d:"M17.4972,4.2222l3.8022-.0263c1.2734,.8363,2.761,1.4764,3.7515,2.5718,.7708,.8524,.9223,2.2717,1.3491,3.4392,.0074,3.0388,.0147,6.0776,.0221,9.1164-.5164,4.2866-2.9297,5.8431-5.9385,6.2073-4.3465,.5262-6.935-1.4588-8.0642-5.6011,.0825-1.7646,.2274-3.529,.2293-5.2937,.0018-1.665-.1468-3.3302-.2293-4.9954,.5347-2.905,2.4132-4.5346,5.0778-5.4182Zm1.3235,10.6415l-3.2986,2.9308,.8646,.8287,2.4468-2.3209v7.1878l4.7277-5.7427-3.5222-3.088,3.4013-2.7912-4.6594-5.3953v6.5622q-2.6482-1.7846-3.2099-1.0286l3.2497,2.8573Z",fill:"#70888e"}),a.a.createElement("path",{d:"M18.8207,14.8637l-3.2497-2.8573q.5617-.756,3.2099,1.0286V6.4729l4.6594,5.3953-3.4013,2.7912,3.5222,3.088-4.7277,5.7427v-7.1878l-2.4468,2.3209-.8646-.8287,3.2986-2.9308Zm1.2259-1.3338l1.7429-1.8487-1.7429-1.989v3.8377Zm1.5723,4.8031l-1.5572-2.1154v3.9743l1.5572-1.8589Z",fill:"#fcfdfd"}),a.a.createElement("path",{d:"M20.0466,13.5299v-3.8377l1.7429,1.989-1.7429,1.8487Z",fill:"#70888e"}),a.a.createElement("path",{d:"M21.619,18.333l-1.5572,1.8589v-3.9743l1.5572,2.1154Z",fill:"#70888e"})),a.a.createElement("g",null,a.a.createElement("path",{d:"M38.9786,23.4017v.6881c0,1.2177-.5734,1.8259-1.7214,1.8259h-.9276c-1.1474,0-1.7208-.6083-1.7208-1.8259v-7.0946c0-1.2177,.5734-1.8259,1.7208-1.8259h.9276c1.148,0,1.7214,.6083,1.7214,1.8259v1.212h-1.4369v-1.1075c0-.4194-.2148-.6285-.6431-.6285h-.2845c-.3789,0-.5689,.2091-.5689,.6285v6.8855c0,.4183,.19,.6285,.5689,.6285h.3598c.3789,0,.5678-.2103,.5678-.6285v-.5835h1.4369Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M41.7625,25.9157c-1.157,0-1.736-.6083-1.736-1.8259v-7.08c0-1.2267,.5734-1.8406,1.7214-1.8406h1.3773c1.1468,0,1.7214,.6139,1.7214,1.8406v7.08c0,1.2177-.579,1.8259-1.736,1.8259h-1.3481Zm.3452-1.302h.7331c.3789,0,.5689-.2103,.5689-.6285v-6.8855c0-.4194-.2148-.6285-.6443-.6285h-.6735c-.4183,0-.6285,.2091-.6285,.6285v6.8855c0,.4183,.2148,.6285,.6443,.6285Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M49.0966,20.3625v-5.1934h1.4369v10.7465h-1.4369v-2.1408l-1.5415-4.8943v7.035h-1.4369V15.1692h1.4369l1.5415,5.1934Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M54.8589,20.3625v-5.1934h1.4369v10.7465h-1.4369v-2.1408l-1.5415-4.8943v7.035h-1.4369V15.1692h1.4369l1.5415,5.1934Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M57.6428,25.9157V15.1692h3.5631v1.302h-2.1261v3.2629h1.8867v1.302h-1.8867v3.5777h2.1261v1.302h-3.5631Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M66.533,23.4017v.6881c0,1.2177-.5734,1.8259-1.7214,1.8259h-.9276c-1.148,0-1.7214-.6083-1.7214-1.8259v-7.0946c0-1.2177,.5734-1.8259,1.7214-1.8259h.9276c1.148,0,1.7214,.6083,1.7214,1.8259v1.212h-1.4369v-1.1075c0-.4194-.2148-.6285-.6431-.6285h-.2845c-.3789,0-.5689,.2091-.5689,.6285v6.8855c0,.4183,.19,.6285,.5689,.6285h.3598c.3789,0,.5678-.2103,.5678-.6285v-.5835h1.4369Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M69.9465,16.4712v9.4445h-1.4369v-9.4445h-1.3773v-1.302h4.1904v1.302h-1.3762Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M76.8309,16.4712v9.4445h-1.4369v-9.4445h-1.3773v-1.302h4.1904v1.302h-1.3762Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M80.6919,25.9157c-1.1581,0-1.7371-.6083-1.7371-1.8259v-7.08c0-1.2267,.5745-1.8406,1.7214-1.8406h1.3773c1.148,0,1.7214,.6139,1.7214,1.8406v7.08c0,1.2177-.579,1.8259-1.736,1.8259h-1.347Zm.344-1.302h.7331c.3789,0,.5689-.2103,.5689-.6285v-6.8855c0-.4194-.2148-.6285-.6431-.6285h-.6735c-.4194,0-.6296,.2091-.6296,.6285v6.8855c0,.4183,.2148,.6285,.6443,.6285Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M88.8029,25.9157h-1.4369v-8.9059c0-1.2267,.5745-1.8406,1.7214-1.8406h1.0782c1.1468,0,1.7214,.6139,1.7214,1.8406v8.9059h-1.4369v-3.9363h-1.6472v3.9363Zm1.6472-5.2383v-3.5777c0-.4194-.2103-.6285-.6285-.6285h-.389c-.4194,0-.6296,.2091-.6296,.6285v3.5777h1.6472Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M98.4723,21.4858l1.3324-6.3166h1.5865v10.7465h-1.4369l.1495-7.035-1.0782,5.0888h-1.1075l-1.0771-5.0888,.1495,7.035h-1.4369V15.1692h1.5865l1.3324,6.3166Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M104.0996,25.9157h-1.4369v-8.9059c0-1.2267,.5745-1.8406,1.7214-1.8406h1.0782c1.1468,0,1.7214,.6139,1.7214,1.8406v8.9059h-1.4369v-3.9363h-1.6472v3.9363Zm1.6472-5.2383v-3.5777c0-.4194-.2103-.6285-.6285-.6285h-.389c-.4194,0-.6296,.2091-.6296,.6285v3.5777h1.6472Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M108.4553,15.1692h2.8142c1.0974,0,1.646,.6139,1.646,1.8406v2.6501c0,.9377-.2845,1.5314-.8534,1.781l1.0029,4.4749h-1.3616l-.9433-4.34h-.868v4.34h-1.4369V15.1692Zm1.4369,5.1787h.9433c.4284,0,.6431-.2597,.6431-.778v-2.3207c0-.5183-.2148-.778-.6431-.778h-.9433v3.8767Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M116.4033,16.4712v9.4445h-1.4369v-9.4445h-1.3773v-1.302h4.1904v1.302h-1.3762Z",fill:"#f9f9f9"}),a.a.createElement("path",{d:"M121.2819,25.9157h-1.4369v-3.951l-1.7663-6.7955h1.4223l1.0771,4.6694h.045l.9726-4.6694h1.4223l-1.736,6.7955v3.951Z",fill:"#f9f9f9"})),a.a.createElement("rect",{x:"12.4195",y:"4.1959",width:"14.0026",height:"21.4131",rx:"7.0013",ry:"7.0013",fill:"none",stroke:"#000","stroke-miterlimit":"10","stroke-width":".25"})))}}]),i}();function zv(A){"@babel/helpers - typeof";return(zv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function Kv(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Wv(A,e){return(Wv=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function Vv(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=Xv(A);if(e){var o=Xv(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===zv(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function Xv(A){return(Xv=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var Zv=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Wv(A,e)}(i,a.a.Component);var e=Vv(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.call(this)}return function(A,e,i){e&&Kv(A.prototype,e),i&&Kv(A,i)}(i,[{key:"render",value:function(){return a.a.createElement("div",{className:Hv.a.martyDisconnectBtnContainer},a.a.createElement("svg",{id:"a",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 29.3735 42.9438"},a.a.createElement("g",null,a.a.createElement("rect",{x:".3053",y:".2501",width:"28.8736",height:"42.4442",rx:"11.2782",ry:"11.2782",fill:"#d67b7b"}),a.a.createElement("path",{d:"M17.8452,42.9438h-6.3169c-6.3569,0-11.5283-5.1709-11.5283-11.5273V11.5283C0,5.1714,5.1714,0,11.5283,0h6.3169c6.3564,0,11.5283,5.1714,11.5283,11.5283V31.4165c0,6.3564-5.1719,11.5273-11.5283,11.5273ZM11.5283,.5C5.4473,.5,.5,5.4473,.5,11.5283V31.4165c0,6.0801,4.9473,11.0273,11.0283,11.0273h6.3169c6.0811,0,11.0283-4.9473,11.0283-11.0273V11.5283C28.8735,5.4473,23.9263,.5,17.8452,.5h-6.3169Z"})),a.a.createElement("g",null,a.a.createElement("rect",{x:"10.2558",y:"25.2469",width:"9.6217",height:"17.5874",rx:"4.8108",ry:"4.8108",transform:"translate(49.1072 18.974) rotate(90)",fill:"#d6f3f6"}),a.a.createElement("path",{d:"M19.0493,38.9761h-7.9658c-2.7217,0-4.9355-2.2139-4.9355-4.9355s2.2139-4.9355,4.9355-4.9355h7.9658c2.7217,0,4.9355,2.2139,4.9355,4.9355s-2.2139,4.9355-4.9355,4.9355Zm-7.9658-9.6211c-2.5835,0-4.6855,2.1016-4.6855,4.6855s2.1021,4.6855,4.6855,4.6855h7.9658c2.584,0,4.6855-2.1016,4.6855-4.6855s-2.1016-4.6855-4.6855-4.6855h-7.9658Z",fill:"#050505"})),a.a.createElement("g",null,a.a.createElement("circle",{cx:"18.9892",cy:"34.0406",r:"4.8653",fill:"#2e8fa7"}),a.a.createElement("path",{d:"M18.9888,39.0308c-2.751,0-4.9897-2.2383-4.9897-4.9902s2.2388-4.9902,4.9897-4.9902,4.9912,2.2383,4.9912,4.9902-2.2393,4.9902-4.9912,4.9902Zm0-9.7305c-2.6133,0-4.7397,2.126-4.7397,4.7402s2.1265,4.7402,4.7397,4.7402,4.7412-2.126,4.7412-4.7402-2.127-4.7402-4.7412-4.7402Z",fill:"#050505"})),a.a.createElement("path",{d:"M13.6282,4.3198c4.1103-.1344,2.9372,.1652,3.5473,.254,.8884,.2993,.8608-.3553,4.1145,2.5785,.9211,.8306,1.0319,2.2698,1.4925,3.5298,.008,3.2797,.0159,6.5594,.0238,9.8391-.5573,4.6265-3.8375,6.0184-6.4092,6.6994-4.0961,.3912-7.4848-1.5745-8.7035-6.0451,.089-1.9044-.0021-3.6518,0-5.5563,.002-1.797,.2142-3.394,.1252-5.1912,.577-3.1353,2.9336-5.1545,5.8093-6.1082Zm.9741,11.3884l-3.5601,3.1631,.9332,.8944,2.6408-2.5049v7.7576l5.1025-6.198-3.8015-3.3328,3.671-3.0124-5.0288-5.823v7.0824q-2.8582-1.9261-3.4644-1.1102l3.5073,3.0838Z",fill:"#2e8ea6"}),a.a.createElement("path",{d:"M14.6023,15.7082l-3.5073-3.0838q.6062-.8159,3.4644,1.1102V6.6522l5.0288,5.823-3.671,3.0124,3.8015,3.3328-5.1025,6.198v-7.7576l-2.6408,2.5049-.9332-.8944,3.5601-3.1631Zm1.3231-1.4396l1.8811-1.9953-1.8811-2.1467v4.142Zm1.697,5.1838l-1.6807-2.2831v4.2894l1.6807-2.0063Z",fill:"#fcfdfd"}),a.a.createElement("path",{d:"M15.9254,14.2687v-4.142l1.8811,2.1467-1.8811,1.9953Z",fill:"#4b9eb3"}),a.a.createElement("path",{d:"M17.6224,19.4525l-1.6807,2.0063v-4.2894l1.6807,2.2831Z",fill:"#4a9eb2"}),a.a.createElement("path",{d:"M15.25,27.4351c-4.2354,0-7.6812-3.4453-7.6812-7.6812V11.751c0-4.2354,3.4458-7.6812,7.6812-7.6812s7.6812,3.4458,7.6812,7.6812v8.0029c0,4.2358-3.4453,7.6812-7.6812,7.6812Zm0-23.1152c-4.0977,0-7.4312,3.3335-7.4312,7.4312v8.0029c0,4.0972,3.3335,7.4312,7.4312,7.4312s7.4312-3.334,7.4312-7.4312V11.751c0-4.0977-3.334-7.4312-7.4312-7.4312Z"})))}}]),i}(),qv=i(185),$v=i.n(qv);function AS(A){"@babel/helpers - typeof";return(AS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function eS(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function iS(A,e){return(iS=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function tS(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=nS(A);if(e){var o=nS(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===AS(e)||"function"==typeof e))return e;return oS(A)}(this,i)}}function oS(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function nS(A){return(nS=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var aS=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&iS(A,e)}(i,a.a.Component);var e=tS(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={batteryPercent:0},t.onBatteryPerecentChange=t.onBatteryPerecentChange.bind(oS(t)),mv2Interface.addEventListener("onBattRemainCapacityPercentChange",t.onBatteryPerecentChange),t}return function(A,e,i){e&&eS(A.prototype,e),i&&eS(A,i)}(i,[{key:"componentWillUnmount",value:function(){mv2Interface.removeEventListener("onBattRemainCapacityPercentChange",this.onBatteryPerecentChange)}},{key:"onBatteryPerecentChange",value:function(A){this.setState({batteryPercent:A.battRemainCapacityPercent})}},{key:"getBorderColor",value:function(A){return A>=70?"black":A>=30?"black":"rgb(255,69,0)"}},{key:"getFillColor",value:function(A){var e=function(A){var e=A;return A<=90&&A>=71&&(e=80),A<=70&&A>=51&&(e=60),A<=50&&A>=31&&(e=40),A<=30&&A>=11&&(e=20),e}(A),i="rgb(3, 125, 60)";return e<=10?i="rgb(91, 20, 19)":e>10&&e<=30&&(i="rgb(250, 217, 5)"),i}},{key:"render",value:function(){var A=this.state.batteryPercent,e=this.getFillColor(A);return a.a.createElement("div",{className:$v.a.container},a.a.createElement("div",{className:"".concat(!1," ").concat($v.a.batteryContainer)},a.a.createElement("div",{className:$v.a.batteryCap,style:{backgroundColor:"black"}}),a.a.createElement("div",{className:$v.a.batteryCylinder,style:{borderColor:"black"}},a.a.createElement("div",{style:{backgroundColor:e,width:"100%",height:"".concat(Math.round(A),"%")}}))),a.a.createElement("p",{className:$v.a.batteryPercent},Math.round(A),"%"))}}]),i}(),rS=i(148),sS=i.n(rS);function gS(A){"@babel/helpers - typeof";return(gS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function lS(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function cS(A,e){return(cS=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function uS(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=dS(A);if(e){var o=dS(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===gS(e)||"function"==typeof e))return e;return BS(A)}(this,i)}}function BS(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function dS(A){return(dS=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var ES=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&cS(A,e)}(i,a.a.Component);var e=uS(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={rssi:-200},t.onRSSIChange=t.onRSSIChange.bind(BS(t)),mv2Interface.addEventListener("onRSSIChange",t.onRSSIChange),t}return function(A,e,i){e&&lS(A.prototype,e),i&&lS(A,i)}(i,[{key:"componentWillUnmount",value:function(){mv2Interface.removeEventListener("onRSSIChange",this.onRSSIChange)}},{key:"onRSSIChange",value:function(A){this.setState({rssi:A.rssi})}},{key:"render",value:function(){var A=this.state.rssi,e=0==A?sS.a.signalFlash:"";return a.a.createElement("div",{className:"".concat(e," ").concat(sS.a.signalStrengthContainer)},a.a.createElement("div",{className:sS.a.signalBar,style:{backgroundColor:A<=-100?"white":A<=-60?"rgb(250, 217, 5)":"rgb(3, 125, 60)",height:"20%"}}),a.a.createElement("div",{className:sS.a.signalBar,style:{backgroundColor:A<=-80?"white":A<=-60?"rgb(250, 217, 5)":"rgb(3, 125, 60)",height:"40%"}}),a.a.createElement("div",{className:sS.a.signalBar,style:{backgroundColor:A<=-70?"white":A<=-60?"rgb(250, 217, 5)":"rgb(3, 125, 60)",height:"60%"}}),a.a.createElement("div",{className:sS.a.signalBar,style:{backgroundColor:A<=-60?"white":"rgb(3, 125, 60)",height:"80%"}}),a.a.createElement("div",{className:sS.a.signalBar,style:{backgroundColor:A<=-50?"white":"rgb(3, 125, 60)",height:"100%"}}))}}]),i}();function hS(A){"@babel/helpers - typeof";return(hS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function CS(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function wS(A,e){return(wS=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function mS(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=IS(A);if(e){var o=IS(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===hS(e)||"function"==typeof e))return e;return pS(A)}(this,i)}}function pS(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function IS(A){return(IS=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var fS=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&wS(A,e)}(i,a.a.Component);var e=mS(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this,A)).state={isConnected:mv2Interface.isConnected},H()(pS(t),["clickBtnHandler"]),t.onIsConnectedChange=t.onIsConnectedChange.bind(pS(t)),mv2Interface.addEventListener("onIsConnectedChange",t.onIsConnectedChange),t}return function(A,e,i){e&&CS(A.prototype,e),i&&CS(A,i)}(i,[{key:"componentWillUnmount",value:function(){mv2Interface.removeEventListener("onIsConnectedChange",this.onIsConnectedChange)}},{key:"onIsConnectedChange",value:function(A){this.setState({isConnected:A.isConnected})}},{key:"clickBtnHandler",value:function(){var A=mv2Interface.isConnected?"disconnect":"connect";mv2Interface.send_REST(A)}},{key:"render",value:function(){return a.a.createElement("div",{className:Uv.a.martyConnectBtnContainer,onClick:this.clickBtnHandler},this.state.isConnected?a.a.createElement("div",{className:Uv.a.batterySignalContainer},a.a.createElement(aS,null),a.a.createElement(ES,null),a.a.createElement("div",{className:Uv.a.disconnectBtnContainer},a.a.createElement(Zv,null))):a.a.createElement(Jv,null))}}]),i}(),QS=["accountNavOpen","activeTabIndex","alertsVisible","authorId","authorThumbnailUrl","authorUsername","basePath","backdropLibraryVisible","backpackHost","backpackVisible","blocksTabVisible","cardsVisible","canChangeLanguage","canCreateNew","canEditTitle","canManageFiles","canRemix","canSave","canCreateCopy","canShare","canUseCloud","children","connectionModalVisible","costumeLibraryVisible","costumesTabVisible","enableCommunity","intl","isCreating","isFullScreen","isPlayerOnly","isRtl","isShared","loading","logo","renderLogin","onClickAccountNav","onCloseAccountNav","onLogOut","onOpenRegistration","onToggleLoginOpen","onActivateCostumesTab","onActivateSaveLoadTab","onActivateSoundsTab","onActivateTab","onClickLogo","onExtensionButtonClick","onProjectTelemetryEvent","onRequestCloseBackdropLibrary","onRequestCloseCostumeLibrary","onRequestCloseTelemetryModal","onSeeCommunity","onShare","onTelemetryModalCancel","onTelemetryModalOptIn","onTelemetryModalOptOut","saveLoadTabVisible","showComingSoon","soundsTabVisible","stageSizeForSensors","stageSizeMode","targetIsStage","telemetryModalVisible","tipsLibraryVisible","useEditorDragStyle","vm"];function DS(){return(DS=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function MS(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var bS=Object(B.d)({addExtension:{id:"gui.gui.addExtension",defaultMessage:"Add Extension"}}),yS=null,TS=function(A){var e=m()(A,"dispatch"),i=(e.accountNavOpen,e.activeTabIndex),t=e.alertsVisible,o=(e.authorId,e.authorThumbnailUrl,e.authorUsername,e.basePath),n=e.backdropLibraryVisible,r=(e.backpackHost,e.backpackVisible,e.blocksTabVisible),s=e.cardsVisible,g=e.canChangeLanguage,l=(e.canCreateNew,e.canEditTitle,e.canManageFiles,e.canRemix,e.canSave,e.canCreateCopy,e.canShare,e.canUseCloud),c=e.children,u=e.connectionModalVisible,d=e.costumeLibraryVisible,E=e.costumesTabVisible,h=(e.enableCommunity,e.intl),C=e.isCreating,w=e.isFullScreen,p=e.isPlayerOnly,I=e.isRtl,f=(e.isShared,e.loading),Q=(e.logo,e.renderLogin,e.onClickAccountNav,e.onCloseAccountNav,e.onLogOut,e.onOpenRegistration,e.onToggleLoginOpen,e.onActivateCostumesTab),D=e.onActivateSaveLoadTab,M=e.onActivateSoundsTab,b=e.onActivateTab,y=(e.onClickLogo,e.onExtensionButtonClick),T=(e.onProjectTelemetryEvent,e.onRequestCloseBackdropLibrary),k=e.onRequestCloseCostumeLibrary,F=e.onRequestCloseTelemetryModal,v=(e.onSeeCommunity,e.onShare,e.onTelemetryModalCancel),S=e.onTelemetryModalOptIn,N=e.onTelemetryModalOptOut,R=e.saveLoadTabVisible,O=(e.showComingSoon,e.soundsTabVisible),Y=e.stageSizeForSensors,U=e.stageSizeMode,G=e.targetIsStage,H=e.telemetryModalVisible,L=e.tipsLibraryVisible,P=(e.useEditorDragStyle,e.vm),x=MS(e,QS);if(c)return a.a.createElement(hi.a,x,c);var _=WB(Y,w),j={tabs:Zb.a.tabs,tab:Le()(ui.a.reactTabsTab,Zb.a.tab),tabList:Le()(ui.a.reactTabsTabList,Zb.a.tabList),tabPanel:Le()(ui.a.reactTabsTabPanel,Zb.a.tabPanel),tabPanelSelected:Le()(ui.a.reactTabsTabPanelSelected,Zb.a.isSelected),tabSelected:Le()(ui.a.reactTabsTabSelected,Zb.a.isSelected)};return null===yS&&(yS=di.a.isSupported()),a.a.createElement(xe.a,{minWidth:Pa.e.fullSizeMinWidth},function(A){var e=function(A,e){return A===Pa.d.small?Pa.c.small:e?Pa.c.large:Pa.c.largeConstrained}(U,A);return p?a.a.createElement(bh,{isFullScreen:w,isRendererSupported:yS,isRtl:I,loading:f,stageSize:Pa.d.large,vm:P},t?a.a.createElement(dM,{className:Zb.a.alertsContainer}):null):a.a.createElement(hi.a,DS({className:Zb.a.pageWrapper,dir:I?"rtl":"ltr"},x),H?a.a.createElement(Vb,{onCancel:v,onOptIn:S,onOptOut:N,onRequestClose:F}):null,f?a.a.createElement(ph,null):null,C?a.a.createElement(ph,{messageId:"gui.loader.creating"}):null,yS?null:a.a.createElement(cw,{isRtl:I}),L?a.a.createElement(Qw,null):null,s?a.a.createElement(OD,null):null,t?a.a.createElement(dM,{className:Zb.a.alertsContainer}):null,u?a.a.createElement(Ub,{vm:P}):null,d?a.a.createElement(Oh,{vm:P,onRequestClose:k}):null,n?a.a.createElement(Jh,{vm:P,onRequestClose:T}):null,a.a.createElement(hi.a,{className:Zb.a.bodyWrapper},a.a.createElement(hi.a,{className:Zb.a.flexWrapper},a.a.createElement(hi.a,{className:Zb.a.editorWrapper},a.a.createElement(oi,{forceRenderTabPanel:!0,className:j.tabs,selectedIndex:i,selectedTabClassName:j.tabSelected,selectedTabPanelClassName:j.tabPanelSelected,onSelect:b},a.a.createElement(ai,{className:j.tabList},a.a.createElement(si,{className:j.tab},a.a.createElement("img",{draggable:!1,src:ey.a}),a.a.createElement(B.a,{defaultMessage:"Code",id:"gui.gui.codeTab"})),a.a.createElement(si,{className:j.tab,onClick:Q},a.a.createElement("img",{draggable:!1,src:ty.a}),G?a.a.createElement(B.a,{defaultMessage:"Backdrops",id:"gui.gui.backdropsTab"}):a.a.createElement(B.a,{defaultMessage:"Costumes",id:"gui.gui.costumesTab"})),a.a.createElement(si,{className:j.tab,onClick:M},a.a.createElement("img",{draggable:!1,src:ny.a}),a.a.createElement(B.a,{defaultMessage:"Sounds",id:"gui.gui.soundsTab"})),a.a.createElement(si,{className:j.tab,onClick:D},a.a.createElement("img",{draggable:!1,src:ry.a}),a.a.createElement(B.a,{defaultMessage:"Save / Load",id:"gui.gui.toggleSpriteTab"})),a.a.createElement(WC,{canChangeLanguage:g}),a.a.createElement(fS,null),a.a.createElement(hi.a,{className:Zb.a.controlsWrapper},a.a.createElement(JB.a,{vm:P}),a.a.createElement(yy,{stageSize:e,vm:P}))),a.a.createElement(li,{className:j.tabPanel},a.a.createElement(hi.a,{className:Zb.a.blocksWrapper},a.a.createElement(Ei.a,{canUseCloud:l,grow:1,isVisible:r,options:{media:"".concat(o,"static/blocks-media/")},stageSize:e,vm:P})),a.a.createElement(hi.a,{className:Zb.a.extensionButtonContainer},a.a.createElement("button",{className:Zb.a.extensionButton,title:h.formatMessage(bS.addExtension),onClick:y},a.a.createElement("img",{className:Zb.a.extensionButtonIcon,draggable:!1,src:$b.a}))),a.a.createElement(hi.a,{className:Zb.a.monitorWrapper},a.a.createElement(Ov,{draggable:!1,stageSize:_})),a.a.createElement(hi.a,{className:Zb.a.watermark},a.a.createElement(oC,null))),a.a.createElement(li,{className:j.tabPanel},E?a.a.createElement(In,{vm:P}):null),a.a.createElement(li,{className:j.tabPanel},O?a.a.createElement(Hu,{vm:P}):null),a.a.createElement(li,{className:[j.tabPanel,Zb.a["tab-panel-height-100"]].join(" ")},R?a.a.createElement(xB,{vm:P}):null))),a.a.createElement(hi.a,{className:Le()(Zb.a.stageAndTargetWrapper,Zb.a[e]),style:e===Pa.d.small?"":{display:"none"}},a.a.createElement(bh,{isRendererSupported:yS,isRtl:I,stageSize:e,vm:P}),a.a.createElement(hi.a,{className:Zb.a.targetWrapper},a.a.createElement(Hs,{stageSize:e,vm:P}))))),a.a.createElement(mM,null))})};TS.propTypes={accountNavOpen:o.a.bool,activeTabIndex:o.a.number,authorId:o.a.oneOfType([o.a.string,o.a.bool]),authorThumbnailUrl:o.a.string,authorUsername:o.a.oneOfType([o.a.string,o.a.bool]),backdropLibraryVisible:o.a.bool,backpackHost:o.a.string,backpackVisible:o.a.bool,basePath:o.a.string,blocksTabVisible:o.a.bool,canChangeLanguage:o.a.bool,canCreateCopy:o.a.bool,canCreateNew:o.a.bool,canEditTitle:o.a.bool,canManageFiles:o.a.bool,canRemix:o.a.bool,canSave:o.a.bool,canShare:o.a.bool,canUseCloud:o.a.bool,cardsVisible:o.a.bool,children:o.a.node,costumeLibraryVisible:o.a.bool,costumesTabVisible:o.a.bool,enableCommunity:o.a.bool,intl:B.f.isRequired,isCreating:o.a.bool,isFullScreen:o.a.bool,isPlayerOnly:o.a.bool,isRtl:o.a.bool,isShared:o.a.bool,loading:o.a.bool,logo:o.a.string,onActivateCostumesTab:o.a.func,onActivateSoundsTab:o.a.func,onActivateTab:o.a.func,onClickAccountNav:o.a.func,onClickLogo:o.a.func,onCloseAccountNav:o.a.func,onExtensionButtonClick:o.a.func,onLogOut:o.a.func,onOpenRegistration:o.a.func,onRequestCloseBackdropLibrary:o.a.func,onRequestCloseCostumeLibrary:o.a.func,onRequestCloseTelemetryModal:o.a.func,onSeeCommunity:o.a.func,onShare:o.a.func,onTabSelect:o.a.func,onTelemetryModalCancel:o.a.func,onTelemetryModalOptIn:o.a.func,onTelemetryModalOptOut:o.a.func,onToggleLoginOpen:o.a.func,renderLogin:o.a.func,saveLoadTabVisible:o.a.bool,showComingSoon:o.a.bool,soundsTabVisible:o.a.bool,stageSizeMode:o.a.oneOf(Object.keys(Pa.d)),targetIsStage:o.a.bool,telemetryModalVisible:o.a.bool,tipsLibraryVisible:o.a.bool,useEditorDragStyle:o.a.bool,vm:o.a.instanceOf(u.a).isRequired},TS.defaultProps={backpackHost:null,backpackVisible:!1,basePath:"./",canChangeLanguage:!0,canCreateNew:!1,canEditTitle:!1,canManageFiles:!0,canRemix:!1,canSave:!1,canCreateCopy:!1,canShare:!1,canUseCloud:!1,enableCommunity:!1,isCreating:!1,isShared:!1,loading:!1,showComingSoon:!1,stageSizeMode:Pa.d.large};var kS=Object(B.e)(Object(s.b)(function(A){return{stageSizeMode:A.scratchGui.stageSize.stageSize}})(TS));function FS(A){"@babel/helpers - typeof";return(FS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var vS=["assetHost","cloudHost","error","isError","isScratchDesktop","isShowingProject","onProjectLoaded","onStorageInit","onUpdateProjectId","onVmInit","projectHost","projectId","children","fetchingProject","isLoading","loadingStateVisible"];function SS(){return(SS=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function NS(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function RS(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function OS(A,e){return(OS=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function YS(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=US(A);if(e){var o=US(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===FS(e)||"function"==typeof e))return e;return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(this,i)}}function US(A){return(US=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var GS=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&OS(A,e)}(i,a.a.Component);var e=YS(i);function i(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.apply(this,arguments)}return function(A,e,i){e&&RS(A.prototype,e),i&&RS(A,i)}(i,[{key:"componentDidMount",value:function(){!function(A){lw=A}(this.props.isScratchDesktop),this.props.onStorageInit(eA.a),this.props.onVmInit(this.props.vm)}},{key:"componentDidUpdate",value:function(A){this.props.projectId!==A.projectId&&null!==this.props.projectId&&this.props.onUpdateProjectId(this.props.projectId),this.props.isShowingProject&&!A.isShowingProject&&this.props.onProjectLoaded()}},{key:"render",value:function(){this.props.isError&&console.log("Error in Scratch GUI [location=".concat(window.location,"]: ").concat(this.props.error));var A=this.props,e=(A.assetHost,A.cloudHost,A.error,A.isError,A.isScratchDesktop,A.isShowingProject,A.onProjectLoaded,A.onStorageInit,A.onUpdateProjectId,A.onVmInit,A.projectHost,A.projectId,A.children),i=A.fetchingProject,t=A.isLoading,o=A.loadingStateVisible,n=NS(A,vS);return a.a.createElement(kS,SS({loading:i||t||o},n),e)}}]),i}();GS.propTypes={assetHost:o.a.string,children:o.a.node,cloudHost:o.a.string,error:o.a.oneOfType([o.a.object,o.a.string]),fetchingProject:o.a.bool,intl:B.f,isError:o.a.bool,isLoading:o.a.bool,isScratchDesktop:o.a.bool,isShowingProject:o.a.bool,loadingStateVisible:o.a.bool,onProjectLoaded:o.a.func,onSeeCommunity:o.a.func,onStorageInit:o.a.func,onUpdateProjectId:o.a.func,onVmInit:o.a.func,projectHost:o.a.string,projectId:o.a.oneOfType([o.a.string,o.a.number]),telemetryModalVisible:o.a.bool,vm:o.a.instanceOf(u.a).isRequired},GS.defaultProps={isScratchDesktop:!1,onStorageInit:function(A){return A.addOfficialScratchWebStores()},onProjectLoaded:function(){},onUpdateProjectId:function(){},onVmInit:function(){}};var HS=Object(B.e)(Object(s.b)(function(A){var e=A.scratchGui.projectState.loadingState;return{activeTabIndex:A.scratchGui.editorTab.activeTabIndex,alertsVisible:A.scratchGui.alerts.visible,backdropLibraryVisible:A.scratchGui.modals.backdropLibrary,blocksTabVisible:A.scratchGui.editorTab.activeTabIndex===h.a,cardsVisible:A.scratchGui.cards.visible,connectionModalVisible:A.scratchGui.modals.connectionModal,costumeLibraryVisible:A.scratchGui.modals.costumeLibrary,costumesTabVisible:A.scratchGui.editorTab.activeTabIndex===h.b,error:A.scratchGui.projectState.error,isError:Object(E.k)(e),isFullScreen:A.scratchGui.mode.isFullScreen,isPlayerOnly:A.scratchGui.mode.isPlayerOnly,isRtl:A.locales.isRtl,isShowingProject:Object(E.s)(e),loadingStateVisible:A.scratchGui.modals.loadingProject,projectId:A.scratchGui.projectState.projectId,saveLoadTabVisible:A.scratchGui.editorTab.activeTabIndex===h.c,soundsTabVisible:A.scratchGui.editorTab.activeTabIndex===h.d,targetIsStage:A.scratchGui.targets.stage&&A.scratchGui.targets.stage.id===A.scratchGui.targets.editingTarget,telemetryModalVisible:A.scratchGui.modals.telemetryModal,tipsLibraryVisible:A.scratchGui.modals.tipsLibrary,vm:A.scratchGui.vm}},function(A){return{onExtensionButtonClick:function(){return A(Object(C.p)())},onActivateTab:function(e){return A(Object(h.e)(e))},onActivateCostumesTab:function(){return A(Object(h.e)(h.b))},onActivateSoundsTab:function(){return A(Object(h.e)(h.d))},onActivateSaveLoadTab:function(){return A(Object(h.e)(h.c))},onRequestCloseBackdropLibrary:function(){return A(Object(C.a)())},onRequestCloseCostumeLibrary:function(){return A(Object(C.c)())},onRequestCloseTelemetryModal:function(){return A(Object(C.i)())}}})(GS)),LS=Object(r.d)(U,Object(d.a)("Top Level App"),function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&M(A,e)}(t,a.a.Component);var i=b(t);function t(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i.apply(this,arguments)}return function(A,e,i){e&&D(A.prototype,e),i&&D(A,i)}(t,[{key:"componentDidMount",value:function(){var A=this;if(!this.props.fontsLoaded){var e=function(){var A=[];if(document.fonts&&"function"==typeof document.fonts.values&&"function"==typeof document.fonts.values()[Symbol.iterator]){var e,i=f(document.fonts.values());try{for(i.s();!(e=i.n()).done;){var t=e.value;-1!==T.indexOf(t.family)&&(A.push(t.loaded),t.load())}}catch(A){i.e(A)}finally{i.f()}}return A};"complete"===document.readyState?Promise.all(e()).then(function(){A.props.onSetFontsLoaded()}):document.onreadystatechange=function(){"complete"===document.readyState&&(document.onreadystatechange=null,Promise.all(e()).then(function(){A.props.onSetFontsLoaded()}))}}}},{key:"render",value:function(){var e=m()(this.props,["onSetFontsLoaded"]);return a.a.createElement(A,e)}}]),t}();e.propTypes={fontsLoaded:o.a.bool.isRequired,onSetFontsLoaded:o.a.func.isRequired};return Object(s.b)(function(A){return{fontsLoaded:A.scratchGui.fontsLoaded}},function(A){return{onSetFontsLoaded:function(){return A(Object(p.c)())}}})(e)},function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&KA(A,e)}(t,a.a.Component);var i=WA(t);function t(A){var e;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A);var o=DA.a.parse(location.search),n=PA(o);return n&&("all"===n?e.openTutorials():e.setActiveCards(n)),e}return function(A,e,i){e&&zA(A.prototype,e),i&&zA(A,i)}(t,[{key:"setActiveCards",value:function(A){this.props.onUpdateReduxDeck(A)}},{key:"openTutorials",value:function(){this.props.onOpenTipsLibrary()}},{key:"render",value:function(){var e=this.props,i=(e.onOpenTipsLibrary,e.onUpdateReduxDeck,JA(e,jA));return a.a.createElement(A,i)}}]),t}();e.propTypes={onOpenTipsLibrary:o.a.func,onUpdateReduxDeck:o.a.func};return Object(s.b)(null,function(A){return{onOpenTipsLibrary:function(){A(Object(C.u)())},onUpdateReduxDeck:function(e){A(Object(xA.a)(e))}}})(e)},function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&sA(A,e)}(t,a.a.Component);var i=gA(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(lA(e),["fetchProject"]),eA.a.setProjectHost(A.projectHost),eA.a.setAssetHost(A.assetHost),eA.a.setTranslatorFunction(A.intl.formatMessage),""!==A.projectId&&null!==A.projectId&&void 0!==A.projectId&&e.props.setProjectId(A.projectId.toString()),e}return function(A,e,i){e&&rA(A.prototype,e),i&&rA(A,i)}(t,[{key:"componentDidUpdate",value:function(A){A.projectHost!==this.props.projectHost&&eA.a.setProjectHost(this.props.projectHost),A.assetHost!==this.props.assetHost&&eA.a.setAssetHost(this.props.assetHost),this.props.isFetchingWithId&&!A.isFetchingWithId&&this.fetchProject(this.props.reduxProjectId,this.props.loadingState).then(function(){return console.log("Fetch project success")},function(A){return console.error("Error fetching project",A.message)}),this.props.isShowingProject&&!A.isShowingProject&&this.props.onProjectUnchanged(),this.props.isShowingProject&&(A.isLoadingProject||A.isCreatingNew)&&this.props.onActivateTab(h.a)}},{key:"fetchProject",value:function(){var A=function(A){return function(){var e=this,i=arguments;return new Promise(function(t,o){var n=A.apply(e,i);function a(A){aA(n,t,o,a,r,"next",A)}function r(A){aA(n,t,o,a,r,"throw",A)}a(void 0)})}}(function*(A,e){try{var i=new URLSearchParams(window.location.search).get("p"),t=yield(yield fetch("https://martyblocks-projects-default-rtdb.europe-west1.firebasedatabase.app/projects/"+i+".json")).json();if(!t||!t.data)throw new Error("Invalid project id");var o=yield(yield fetch(t.data)).arrayBuffer();return this.props.onFetchedProjectData(o,e)}catch(A){console.log("Couldn't load project from db:",A)}try{var n=yield mv2Interface.loadScratchFile("__autosave");if(!n||!n.contents||!confirm("Would you like to load the last autosave?"))throw new Error("No autosave file");console.log("Using autosave file");var a=yield(yield fetch(n.contents)).arrayBuffer();return this.props.onFetchedProjectData(a,e)}catch(A){console.warn("No autosave data available")}console.log("Falling back to default project");var r=yield eA.a.load(eA.a.AssetType.Project,A,eA.a.DataFormat.JSON);return this.props.onFetchedProjectData(r.data,e)});return function(e,i){return A.apply(this,arguments)}}()},{key:"render",value:function(){var e=this.props,i=(e.assetHost,e.intl,e.isLoadingProject,e.loadingState,e.onActivateTab,e.onError,e.onFetchedProjectData,e.onProjectUnchanged,e.projectHost,e.projectId,e.reduxProjectId,e.setProjectId,e.isFetchingWithId),t=nA(e,tA);return a.a.createElement(A,oA({fetchingProject:i},t))}}]),t}();e.propTypes={assetHost:o.a.string,canSave:o.a.bool,intl:B.f.isRequired,isCreatingNew:o.a.bool,isFetchingWithId:o.a.bool,isLoadingProject:o.a.bool,isShowingProject:o.a.bool,loadingState:o.a.oneOf(E.a),onActivateTab:o.a.func,onError:o.a.func,onFetchedProjectData:o.a.func,onProjectUnchanged:o.a.func,projectHost:o.a.string,projectId:o.a.oneOfType([o.a.string,o.a.number]),reduxProjectId:o.a.oneOfType([o.a.string,o.a.number]),setProjectId:o.a.func},e.defaultProps={assetHost:"https://assets.scratch.mit.edu",projectHost:"https://projects.scratch.mit.edu"};return Object(B.e)(Object(s.b)(function(A){return{isCreatingNew:Object(E.j)(A.scratchGui.projectState.loadingState),isFetchingWithId:Object(E.l)(A.scratchGui.projectState.loadingState),isLoadingProject:Object(E.n)(A.scratchGui.projectState.loadingState),isShowingProject:Object(E.s)(A.scratchGui.projectState.loadingState),loadingState:A.scratchGui.projectState.loadingState,reduxProjectId:A.scratchGui.projectState.projectId}},function(A){return{onActivateTab:function(e){return A(Object(h.e)(e))},onError:function(e){return A(Object(E.z)(e))},onFetchedProjectData:function(e,i){return A(Object(E.x)(e,i))},setProjectId:function(e){return A(Object(E.F)(e))},onProjectUnchanged:function(){return A(Object(AA.d)())}}},function(A,e,i){return Object.assign({},A,e,i)})(e))},function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&hA(A,e)}(t,a.a.Component);var i=CA(t);function t(){return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i.apply(this,arguments)}return function(A,e,i){e&&EA(A.prototype,e),i&&EA(A,i)}(t,[{key:"componentDidMount",value:function(){this.handleReceivedProjectTitle(this.props.projectTitle)}},{key:"componentDidUpdate",value:function(A){if(this.props.projectTitle!==A.projectTitle&&this.handleReceivedProjectTitle(this.props.projectTitle),this.props.isShowingWithoutId&&A.isAnyCreatingNewState){var e=this.handleReceivedProjectTitle();this.props.onUpdateProjectTitle(e)}this.props.reduxProjectTitle!==A.reduxProjectTitle&&this.props.reduxProjectTitle!==this.props.projectTitle&&this.props.onUpdateProjectTitle(this.props.reduxProjectTitle)}},{key:"handleReceivedProjectTitle",value:function(A){var e=A;return null!==e&&void 0!==e||(e=this.props.intl.formatMessage(mA.defaultProjectTitle)),this.props.onChangedProjectTitle(e),e}},{key:"render",value:function(){var e=this.props,i=(e.intl,e.isAnyCreatingNewState,e.isShowingWithoutId,e.onChangedProjectTitle,e.onUpdateProjectTitle,e.projectTitle,e.reduxProjectTitle,dA(e,BA));return a.a.createElement(A,i)}}]),t}();e.propTypes={intl:B.f,isAnyCreatingNewState:o.a.bool,isShowingWithoutId:o.a.bool,onChangedProjectTitle:o.a.func,onUpdateProjectTitle:o.a.func,projectTitle:o.a.string,reduxProjectTitle:o.a.string},e.defaultProps={onUpdateProjectTitle:function(){}};return Object(B.e)(Object(s.b)(function(A){var e=A.scratchGui.projectState.loadingState;return{isAnyCreatingNewState:Object(E.h)(e),isShowingWithoutId:Object(E.u)(e),reduxProjectTitle:A.scratchGui.projectTitle}},function(A){return{onChangedProjectTitle:function(e){return A(Object(x.c)(e))}}})(e))},function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&OA(A,e)}(t,a.a.Component);var i=YA(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(UA(e),["getProjectThumbnail","leavePageConfirm","tryToAutoSave"]),e}return function(A,e,i){e&&RA(A.prototype,e),i&&RA(A,i)}(t,[{key:"componentWillMount",value:function(){var A=this;"object"===("undefined"==typeof window?"undefined":NA(window))&&(window.onbeforeunload=function(e){return A.leavePageConfirm(e)}),this.props.onSetProjectThumbnailer(this.getProjectThumbnail),this.props.onSetProjectSaver(this.tryToAutoSave)}},{key:"componentDidUpdate",value:function(A){if(!this.props.isAnyCreatingNewState&&A.isAnyCreatingNewState&&this.reportTelemetryEvent("projectWasCreated"),!this.props.isLoading&&A.isLoading&&this.reportTelemetryEvent("projectDidLoad"),this.props.projectChanged&&!A.projectChanged&&this.scheduleAutoSave(),this.props.isUpdating&&!A.isUpdating&&this.updateProjectToStorage(),this.props.isCreatingNew&&!A.isCreatingNew&&this.createNewProjectToStorage(),this.props.isCreatingCopy&&!A.isCreatingCopy&&this.createCopyToStorage(),this.props.isRemixing&&!A.isRemixing?(this.props.onRemixing(!0),this.createRemixToStorage()):!this.props.isRemixing&&A.isRemixing&&this.props.onRemixing(!1),!A.isCreatingNew&&(this.isShowingCreatable(this.props)&&!this.isShowingCreatable(A)&&this.props.onCreateProject(),!A.isUpdating)){var e=this.props.canSave&&!A.canSave,i=this.props.isShared&&!A.isShared;this.props.isShowingSaveable&&(e||i)&&this.props.onAutoUpdateProject()}}},{key:"componentWillUnmount",value:function(){this.clearAutoSaveTimeout(),this.props.onSetProjectThumbnailer(null),this.props.onSetProjectSaver(null)}},{key:"leavePageConfirm",value:function(A){if(this.props.projectChanged)return(A||window.event).returnValue=!0,!0}},{key:"clearAutoSaveTimeout",value:function(){null!==this.props.autoSaveTimeoutId&&(clearTimeout(this.props.autoSaveTimeoutId),this.props.setAutoSaveTimeoutId(null))}},{key:"scheduleAutoSave",value:function(){if(this.props.isShowingSaveable&&null===this.props.autoSaveTimeoutId){var A=setTimeout(this.tryToAutoSave,1e3*this.props.autoSaveIntervalSecs);this.props.setAutoSaveTimeoutId(A)}}},{key:"tryToAutoSave",value:function(){this.props.projectChanged&&this.props.isShowingSaveable&&this.props.onAutoUpdateProject()}},{key:"isShowingCreatable",value:function(A){return A.canCreateNew&&A.isShowingWithoutId}},{key:"updateProjectToStorage",value:function(){var A=this;return this.props.onShowSavingAlert(),this.storeProject(this.props.reduxProjectId).then(function(){A.props.onUpdatedProject(A.props.loadingState),A.props.onShowSaveSuccessAlert()}).catch(function(e){A.props.onShowAlert("savingError"),A.props.onProjectError(e)})}},{key:"createNewProjectToStorage",value:function(){var A=this;return this.storeProject(null).then(function(e){A.props.onCreatedProject(e.id.toString(),A.props.loadingState)}).catch(function(e){A.props.onShowAlert("creatingError"),A.props.onProjectError(e)})}},{key:"createCopyToStorage",value:function(){var A=this;return this.props.onShowCreatingCopyAlert(),this.storeProject(null,{originalId:this.props.reduxProjectId,isCopy:1,title:this.props.reduxProjectTitle}).then(function(e){A.props.onCreatedProject(e.id.toString(),A.props.loadingState),A.props.onShowCopySuccessAlert()}).catch(function(e){A.props.onShowAlert("creatingError"),A.props.onProjectError(e)})}},{key:"createRemixToStorage",value:function(){var A=this;return this.props.onShowCreatingRemixAlert(),this.storeProject(null,{originalId:this.props.reduxProjectId,isRemix:1,title:this.props.reduxProjectTitle}).then(function(e){A.props.onCreatedProject(e.id.toString(),A.props.loadingState),A.props.onShowRemixSuccessAlert()}).catch(function(e){A.props.onShowAlert("creatingError"),A.props.onProjectError(e)})}},{key:"storeProject",value:function(A,e){var i=this;e=e||{},this.clearAutoSaveTimeout();var t=this.props.vm.toJSON();return Promise.all(this.props.vm.assets.filter(function(A){return!A.clean}).map(function(A){return eA.a.store(A.assetType,A.dataFormat,A.data,A.assetId).then(function(e){if("ok"!==e.status)return Promise.reject(e.code);A.clean=!0})})).then(function(){return i.props.onUpdateProjectData(A,t,e)}).then(function(A){i.props.onSetProjectUnchanged();var e=A.id.toString();return e&&i.props.onUpdateProjectThumbnail&&i.storeProjectThumbnail(e),i.reportTelemetryEvent("projectDidSave"),A}).catch(function(A){throw L.a.error(A),A})}},{key:"storeProjectThumbnail",value:function(A){var e=this;try{this.getProjectThumbnail(function(i){e.props.onUpdateProjectThumbnail(A,function(A){for(var e=atob(A.split(",")[1]),i=A.split(",")[0].split(":")[1].split(";")[0],t=new ArrayBuffer(e.length),o=new Uint8Array(t),n=0;n<e.length;n++)o[n]=e.charCodeAt(n);return new Blob([t],{type:i})}(i))})}catch(A){L.a.error("Project thumbnail save error",A)}}},{key:"getProjectThumbnail",value:function(A){var e=this;this.props.vm.postIOData("video",{forceTransparentPreview:!0}),this.props.vm.renderer.requestSnapshot(function(i){e.props.vm.postIOData("video",{forceTransparentPreview:!1}),A(i)}),this.props.vm.renderer.draw()}},{key:"reportTelemetryEvent",value:function(A){try{if(this.props.onProjectTelemetryEvent){var e=fA(this.props.vm,this.props.reduxProjectTitle,this.props.locale);this.props.onProjectTelemetryEvent(A,e)}}catch(e){L.a.error("Telemetry error",A,e)}}},{key:"render",value:function(){var e=this.props,i=(e.autoSaveTimeoutId,e.autoSaveIntervalSecs,e.isCreatingCopy,e.isCreatingNew,e.projectChanged,e.isAnyCreatingNewState),t=(e.isLoading,e.isManualUpdating,e.isRemixing,e.isShowingSaveable,e.isShowingWithId,e.isShowingWithoutId,e.isUpdating,e.loadingState,e.onAutoUpdateProject,e.onCreatedProject,e.onCreateProject,e.onProjectError,e.onRemixing,e.onSetProjectUnchanged,e.onSetProjectThumbnailer,e.onSetProjectSaver,e.onShowAlert,e.onShowCopySuccessAlert,e.onShowRemixSuccessAlert,e.onShowCreatingCopyAlert,e.onShowCreatingRemixAlert,e.onShowSaveSuccessAlert,e.onShowSavingAlert,e.onUpdatedProject,e.onUpdateProjectData,e.onUpdateProjectThumbnail,e.reduxProjectId,e.reduxProjectTitle,e.setAutoSaveTimeoutId,SA(e,FA));return a.a.createElement(A,vA({isCreating:i},t))}}]),t}();e.propTypes={autoSaveIntervalSecs:o.a.number.isRequired,autoSaveTimeoutId:o.a.number,canCreateNew:o.a.bool,canSave:o.a.bool,isAnyCreatingNewState:o.a.bool,isCreatingCopy:o.a.bool,isCreatingNew:o.a.bool,isLoading:o.a.bool,isManualUpdating:o.a.bool,isRemixing:o.a.bool,isShared:o.a.bool,isShowingSaveable:o.a.bool,isShowingWithId:o.a.bool,isShowingWithoutId:o.a.bool,isUpdating:o.a.bool,loadingState:o.a.oneOf(E.a),locale:o.a.string.isRequired,onAutoUpdateProject:o.a.func,onCreateProject:o.a.func,onCreatedProject:o.a.func,onProjectError:o.a.func,onProjectTelemetryEvent:o.a.func,onRemixing:o.a.func,onSetProjectSaver:o.a.func.isRequired,onSetProjectThumbnailer:o.a.func.isRequired,onSetProjectUnchanged:o.a.func.isRequired,onShowAlert:o.a.func,onShowCopySuccessAlert:o.a.func,onShowCreatingCopyAlert:o.a.func,onShowCreatingRemixAlert:o.a.func,onShowRemixSuccessAlert:o.a.func,onShowSaveSuccessAlert:o.a.func,onShowSavingAlert:o.a.func,onUpdateProjectData:o.a.func.isRequired,onUpdateProjectThumbnail:o.a.func,onUpdatedProject:o.a.func,projectChanged:o.a.bool,reduxProjectId:o.a.oneOfType([o.a.string,o.a.number]),reduxProjectTitle:o.a.string,setAutoSaveTimeoutId:o.a.func.isRequired,vm:o.a.instanceOf(u.a).isRequired},e.defaultProps={autoSaveIntervalSecs:120,onRemixing:function(){},onSetProjectThumbnailer:function(){},onSetProjectSaver:function(){},onUpdateProjectData:yA};return Object(s.b)(function(A,e){var i=A.scratchGui.projectState.loadingState,t=Object(E.t)(i);return{autoSaveTimeoutId:A.scratchGui.timeout.autoSaveTimeoutId,isAnyCreatingNewState:Object(E.h)(i),isLoading:Object(E.n)(i),isCreatingCopy:Object(E.i)(i),isCreatingNew:Object(E.j)(i),isRemixing:Object(E.r)(i),isShowingSaveable:e.canSave&&t,isShowingWithId:t,isShowingWithoutId:Object(E.u)(i),isUpdating:Object(E.v)(i),isManualUpdating:Object(E.q)(i),loadingState:i,locale:A.locales.locale,projectChanged:A.scratchGui.projectChanged,reduxProjectId:A.scratchGui.projectState.projectId,reduxProjectTitle:A.scratchGui.projectTitle,vm:A.scratchGui.vm}},function(A){return{onAutoUpdateProject:function(){return A(Object(E.b)())},onCreatedProject:function(e,i){return A(Object(E.f)(e,i))},onCreateProject:function(){return A(Object(E.c)())},onProjectError:function(e){return A(Object(E.z)(e))},onSetProjectUnchanged:function(){return A(Object(AA.d)())},onShowAlert:function(e){return A(Object(TA.h)(e))},onShowCopySuccessAlert:function(){return Object(TA.f)(A,"createCopySuccess")},onShowRemixSuccessAlert:function(){return Object(TA.f)(A,"createRemixSuccess")},onShowCreatingCopyAlert:function(){return Object(TA.f)(A,"creatingCopy")},onShowCreatingRemixAlert:function(){return Object(TA.f)(A,"creatingRemix")},onShowSaveSuccessAlert:function(){return Object(TA.f)(A,"saveSuccess")},onShowSavingAlert:function(){return Object(TA.f)(A,"saving")},onUpdatedProject:function(e){return A(Object(E.g)(e))},setAutoSaveTimeoutId:function(e){return A(Object(kA.b)(e))}}},function(A,e,i){return Object.assign({},A,e,i)})(e)},ue,De,function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&V(A,e)}(t,a.a.Component);var i=X(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),H()(Z(e),["createFileObjects","getProjectTitleFromFilename","handleFinishedLoadingUpload","handleStartSelectingFileUpload","handleChange","onload","removeFileObjects"]),e}return function(A,e,i){e&&W(A.prototype,e),i&&W(A,i)}(t,[{key:"componentDidUpdate",value:function(A){this.props.isLoadingUpload&&!A.isLoadingUpload&&this.handleFinishedLoadingUpload()}},{key:"componentWillUnmount",value:function(){this.removeFileObjects()}},{key:"handleStartSelectingFileUpload",value:function(){this.createFileObjects()}},{key:"createFileObjects",value:function(){this.removeFileObjects(),this.fileReader=new FileReader,this.fileReader.onload=this.onload,this.inputElement=document.createElement("input"),this.inputElement.accept=".sb,.sb2,.sb3",this.inputElement.style="display: none;",this.inputElement.type="file",this.inputElement.onchange=this.handleChange,document.body.appendChild(this.inputElement),this.inputElement.click()}},{key:"handleChange",value:function(A){var e=this.props,i=e.intl,t=e.isShowingWithoutId,o=e.loadingState,n=e.projectChanged,a=e.userOwnsProject,r=A.target;if(r.files){this.fileToUpload=r.files[0];var s=!0;(a||n&&t)&&(s=confirm(i.formatMessage(P.a.replaceProjectWarning))),s?this.props.requestProjectUpload(o):this.removeFileObjects(),this.props.closeFileMenu()}}},{key:"handleFinishedLoadingUpload",value:function(){this.fileToUpload&&this.fileReader?this.fileReader.readAsArrayBuffer(this.fileToUpload):(this.props.cancelFileUpload(this.props.loadingState),this.removeFileObjects())}},{key:"getProjectTitleFromFilename",value:function(A){if(!A)return"";var e=A.match(/^(.*)\.sb[23]?$/);return e?e[1].substring(0,100):""}},{key:"onload",value:function(){var A=this;if(this.fileReader){this.props.onLoadingStarted();var e=this.fileToUpload&&this.fileToUpload.name,i=!1;this.props.vm.loadProject(this.fileReader.result).then(function(){if(e){var t=A.getProjectTitleFromFilename(e);A.props.onSetProjectTitle(t)}i=!0}).catch(function(e){L.a.warn(e),alert(A.props.intl.formatMessage($.loadError))}).then(function(){A.props.onLoadingFinished(A.props.loadingState,i),A.removeFileObjects()})}}},{key:"removeFileObjects",value:function(){this.inputElement&&(this.inputElement.value=null,document.body.removeChild(this.inputElement)),this.inputElement=null,this.fileReader=null,this.fileToUpload=null}},{key:"render",value:function(){var e=this.props,i=(e.cancelFileUpload,e.closeFileMenu,e.isLoadingUpload,e.isShowingWithoutId,e.loadingState,e.onLoadingFinished,e.onLoadingStarted,e.onSetProjectTitle,e.projectChanged,e.requestProjectUpload,e.userOwnsProject,K(e,J));return a.a.createElement(a.a.Fragment,null,a.a.createElement(A,z({onStartSelectingFileUpload:this.handleStartSelectingFileUpload},i)))}}]),t}();e.propTypes={canSave:o.a.bool,cancelFileUpload:o.a.func,closeFileMenu:o.a.func,intl:B.f.isRequired,isLoadingUpload:o.a.bool,isShowingWithoutId:o.a.bool,loadingState:o.a.oneOf(E.a),onLoadingFinished:o.a.func,onLoadingStarted:o.a.func,onSetProjectTitle:o.a.func,projectChanged:o.a.bool,requestProjectUpload:o.a.func,userOwnsProject:o.a.bool,vm:o.a.shape({loadProject:o.a.func})};return Object(B.e)(Object(s.b)(function(A,e){var i=A.scratchGui.projectState.loadingState,t=A.session&&A.session.session&&A.session.session.user;return{isLoadingUpload:Object(E.o)(i),isShowingWithoutId:Object(E.u)(i),loadingState:i,projectChanged:A.scratchGui.projectChanged,userOwnsProject:e.authorUsername&&t&&e.authorUsername===t.username,vm:A.scratchGui.vm}},function(A,e){return{cancelFileUpload:function(e){return A(Object(E.y)(e,!1,!1))},closeFileMenu:function(){return A(Object(_.d)())},onLoadingFinished:function(i,t){A(Object(E.y)(i,e.canSave,t)),A(Object(C.e)()),A(Object(_.d)())},onLoadingStarted:function(){return A(Object(C.q)())},onSetProjectTitle:function(e){return A(Object(x.c)(e))},requestProjectUpload:function(e){return A(Object(E.D)(e))}}},function(A,e,i){return Object.assign({},A,e,i)})(e))},Ge)(HS);LS.setAppElement=l.a.setAppElement;e.a=LS},function(A,e,i){"use strict";i.d(e,"a",function(){return o}),i.d(e,"c",function(){return t}),i.d(e,"b",function(){return n});var t={stageSize:i(16).c.large},o=function(A,e){switch(void 0===A&&(A=t),e.type){case"scratch-gui/StageSize/SET_STAGE_SIZE":return{stageSize:e.stageSize};default:return A}},n=function(A){return{type:"scratch-gui/StageSize/SET_STAGE_SIZE",stageSize:A}}},function(A,e,i){"use strict";e.__esModule=!0,e.default=function(A,e){var i={};for(var t in A)e.indexOf(t)>=0||Object.prototype.hasOwnProperty.call(A,t)&&(i[t]=A[t]);return i}},function(A,e,i){"use strict";i.d(e,"a",function(){return o}),i.d(e,"e",function(){return t}),i.d(e,"b",function(){return a}),i.d(e,"c",function(){return n}),i.d(e,"d",function(){return r});var t={running:!1,started:!1,turbo:!1},o=function(A,e){switch(void 0===A&&(A=t),e.type){case"scratch-gui/vm-status/SET_STARTED_STATE":return Object.assign({},A,{started:e.started});case"scratch-gui/vm-status/SET_RUNNING_STATE":return Object.assign({},A,{running:e.running});case"scratch-gui/vm-status/SET_TURBO_STATE":return Object.assign({},A,{turbo:e.turbo});default:return A}},n=function(A){return{type:"scratch-gui/vm-status/SET_STARTED_STATE",started:A}},a=function(A){return{type:"scratch-gui/vm-status/SET_RUNNING_STATE",running:A}},r=function(A){return{type:"scratch-gui/vm-status/SET_TURBO_STATE",turbo:A}}},function(A,e,i){var t=i(1400);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e,i){var t=i(1556);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e){var i=A.exports={version:"2.5.7"};"number"==typeof __e&&(__e=i)},function(A,e,i){function t(){}i(999).mixin(t),t.prototype.write=function(A,e,i){this.emit("item",A,e,i)},t.prototype.end=function(){this.emit("end"),this.removeAllListeners()},t.prototype.pipe=function(A){var e=this;function i(){A.write.apply(A,Array.prototype.slice.call(arguments))}function t(){!A._isStdio&&A.end()}return e.emit("unpipe",A),A.emit("pipe",e),e.on("item",i),e.on("end",t),e.when("unpipe",function(o){var n=o===A||void 0===o;return n&&(e.removeListener("item",i),e.removeListener("end",t),A.emit("unpipe")),n}),A},t.prototype.unpipe=function(A){return this.emit("unpipe",A),this},t.prototype.format=function(A){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},t.mixin=function(A){var e,i=t.prototype;for(e in i)i.hasOwnProperty(e)&&(A.prototype[e]=i[e])},A.exports=t},function(A,e,i){function t(){}i(1065).mixin(t),t.prototype.write=function(A,e,i){this.emit("item",A,e,i)},t.prototype.end=function(){this.emit("end"),this.removeAllListeners()},t.prototype.pipe=function(A){var e=this;function i(){A.write.apply(A,Array.prototype.slice.call(arguments))}function t(){!A._isStdio&&A.end()}return e.emit("unpipe",A),A.emit("pipe",e),e.on("item",i),e.on("end",t),e.when("unpipe",function(o){var n=o===A||void 0===o;return n&&(e.removeListener("item",i),e.removeListener("end",t),A.emit("unpipe")),n}),A},t.prototype.unpipe=function(A){return this.emit("unpipe",A),this},t.prototype.format=function(A){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},t.mixin=function(A){var e,i=t.prototype;for(e in i)i.hasOwnProperty(e)&&(A.prototype[e]=i[e])},A.exports=t},function(A,e){function i(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var t=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return function(A,e,t){e&&i(A.prototype,e),t&&i(A,t)}(A,null,[{key:"simple",value:function(A){return JSON.parse(JSON.stringify(A))}}]),A}();A.exports=t},function(A,e,i){function t(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var o=i(101),n=i(237),a=function(){function A(e,i,t,n){switch(function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.id=e||o(),this.name=i,this.type=t,this.isCloud=n,this.type){case A.SCALAR_TYPE:this.value=0;break;case A.LIST_TYPE:this.value=[];break;case A.BROADCAST_MESSAGE_TYPE:this.value=this.name;break;default:throw new Error("Invalid variable type: ".concat(this.type))}}return function(A,e,i){e&&t(A.prototype,e),i&&t(A,i)}(A,[{key:"toXML",value:function(A){return A=!0===A,'<variable type="'.concat(this.type,'" id="').concat(this.id,'" islocal="').concat(A,'" iscloud="').concat(this.isCloud,'">').concat(n(this.name),"</variable>")}}],[{key:"SCALAR_TYPE",get:function(){return""}},{key:"LIST_TYPE",get:function(){return"list"}},{key:"BROADCAST_MESSAGE_TYPE",get:function(){return"broadcast_msg"}}]),A}();A.exports=a},function(A,e){function i(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var t=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return function(A,e,t){e&&i(A.prototype,e),t&&i(A,t)}(A,null,[{key:"BACKGROUND_LAYER",get:function(){return"background"}},{key:"VIDEO_LAYER",get:function(){return"video"}},{key:"PEN_LAYER",get:function(){return"pen"}},{key:"SPRITE_LAYER",get:function(){return"sprite"}},{key:"LAYER_GROUPS",get:function(){return[A.BACKGROUND_LAYER,A.VIDEO_LAYER,A.PEN_LAYER,A.SPRITE_LAYER]}}]),A}();A.exports=t},function(A,e,i){"use strict";(function(A){if(e.base64=!0,e.array=!0,e.string=!0,e.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,e.nodebuffer=void 0!==A,e.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)e.blob=!1;else{var t=new ArrayBuffer(0);try{e.blob=0===new Blob([t],{type:"application/zip"}).size}catch(A){try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(t),e.blob=0===o.getBlob("application/zip").size}catch(A){e.blob=!1}}}try{e.nodestream=!!i(485).Readable}catch(A){e.nodestream=!1}}).call(this,i(56).Buffer)},function(A,e,i){"use strict";var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function o(A,e){return Object.prototype.hasOwnProperty.call(A,e)}e.assign=function(A){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var t in i)o(i,t)&&(A[t]=i[t])}}return A},e.shrinkBuf=function(A,e){return A.length===e?A:A.subarray?A.subarray(0,e):(A.length=e,A)};var n={arraySet:function(A,e,i,t,o){if(e.subarray&&A.subarray)A.set(e.subarray(i,i+t),o);else for(var n=0;n<t;n++)A[o+n]=e[i+n]},flattenChunks:function(A){var e,i,t,o,n,a;for(t=0,e=0,i=A.length;e<i;e++)t+=A[e].length;for(a=new Uint8Array(t),o=0,e=0,i=A.length;e<i;e++)n=A[e],a.set(n,o),o+=n.length;return a}},a={arraySet:function(A,e,i,t,o){for(var n=0;n<t;n++)A[o+n]=e[i+n]},flattenChunks:function(A){return[].concat.apply([],A)}};e.setTyped=function(A){A?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(t)},function(A,e,i){var t=i(103),o=i(560),n=i(352),a=Object.defineProperty;e.f=i(132)?Object.defineProperty:function(A,e,i){if(t(A),e=n(e,!0),t(i),o)try{return a(A,e,i)}catch(A){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(A[e]=i.value),A}},function(A,e){A.exports=function(A){return"object"==typeof A?null!==A:"function"==typeof A}},function(A,e,i){A.exports=!i(169)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(A,e,i){"use strict";i.r(e),i.d(e,"default",function(){return z}),i.d(e,"guiInitialState",function(){return L}),i.d(e,"guiMiddleware",function(){return H}),i.d(e,"initEmbedded",function(){return _}),i.d(e,"initFullScreen",function(){return x}),i.d(e,"initPlayer",function(){return P}),i.d(e,"initTelemetryModal",function(){return J}),i.d(e,"initTutorialCard",function(){return j});var t=i(41),o=i(35),n=i(204),a=i(61),r=i(140),s=i(155),g=i(178),l=i(205),c=i(19),u=i(112),B=i(43),d=i(206),E=i(24),h=i(60),C=i(207),w=i(105),m=i(86),p=i(13),I=i(113),f=i(208),Q=i(114),D=i(117),M=i(156),b=i(209),y=i(210),T=i(11),k=i.n(T),F=i(42),v="scratch-gui/vm/SET_VM",S=new k.a;S.attachStorage(F.a);var N=S;window.vm=S;var R=i(119),O=i(211),Y=i(707),U=i.n(Y),G=i(65),H=Object(t.d)(Object(t.a)(U()(300,{leading:!0,trailing:!0}))),L={alerts:o.a,assetDrag:n.a,blockDrag:l.a,cards:a.b,colorPicker:r.b,connectionModal:s.a,customProcedures:g.b,editorTab:c.g,mode:h.b,hoveredTarget:u.b,stageSize:D.c,menus:B.l,micIndicator:d.b,modals:E.l,monitors:C.b,monitorLayout:w.d,projectChanged:m.b,projectState:p.A,projectTitle:I.b,fontsLoaded:f.b,restoreDeletion:Q.b,targets:M.c,timeout:b.c,toolbox:y.b,vm:N,vmStatus:R.e,workspaceMetrics:O.c},P=function(A){return Object.assign({},A,{mode:{isFullScreen:A.mode.isFullScreen,isPlayerOnly:!0,hasEverEnteredEditor:!1}})},x=function(A){return Object.assign({},A,{mode:{isFullScreen:!0,isPlayerOnly:A.mode.isPlayerOnly,hasEverEnteredEditor:A.mode.hasEverEnteredEditor}})},_=function(A){return Object.assign({},A,{mode:{showBranding:!0,isFullScreen:!0,isPlayerOnly:!0,hasEverEnteredEditor:!1}})},j=function(A,e){return Object.assign({},A,{cards:{visible:!0,content:G.a,activeDeckId:e,expanded:!0,step:0,x:0,y:0,dragging:!1}})},J=function(A){return Object.assign({},A,{modals:{telemetryModal:!0}})},z=Object(t.c)({alerts:o.d,assetDrag:n.b,blockDrag:l.b,cards:a.d,colorPicker:r.d,connectionModal:s.b,customProcedures:g.d,editorTab:c.f,mode:h.a,hoveredTarget:u.a,stageSize:D.a,menus:B.g,micIndicator:d.a,modals:E.k,monitors:C.a,monitorLayout:w.b,projectChanged:m.a,projectState:p.d,projectTitle:I.a,fontsLoaded:f.a,restoreDeletion:Q.a,targets:M.a,timeout:b.a,toolbox:y.a,vm:function(A,e){switch(void 0===A&&(A=N),e.type){case v:return window.vm=e.vm,e.vm;default:return A}},vmStatus:R.a,workspaceMetrics:O.a})},function(A,e,i){"use strict";var t=i(1),o=i.n(t),n=i(2),a=i(651),r=i.n(a),s=i(652),g=i.n(s),l=i(653),c=i.n(l),u=i(654),B=i.n(u),d=i(655),E=i.n(d),h=i(656),C=i.n(h),w=i(657),m=i.n(w),p=i(658),I=i.n(p),f=i(659),Q=i.n(f),D=i(660),M=i.n(D),b=i(661),y=i.n(b),T=i(662),k=i.n(T),F=i(663),v=i.n(F),S=i(260),N=i.n(S),R=i(664),O=i.n(R),Y=i(665),U=i.n(Y),G=i(261),H=i.n(G),L=i(666),P=i.n(L),x=i(667),_=i.n(x),j=i(262),J=i.n(j),z=i(668),K=i.n(z),W=i(669),V=i.n(W),X=i(670),Z=i.n(X),q=i(263),$=i.n(q),AA=i(671),eA=i.n(AA),iA=i(672),tA=i.n(iA),oA=i(673),nA=i.n(oA),aA=i(264),rA=i.n(aA),sA=i(674),gA=i.n(sA);e.a=[{name:o.a.createElement(n.a,{defaultMessage:"Music",id:"gui.extension.music.name"}),extensionId:"music",iconURL:r.a,insetIconURL:g.a,description:o.a.createElement(n.a,{defaultMessage:"Play instruments and drums.",id:"gui.extension.music.description"}),featured:!0},{name:o.a.createElement(n.a,{defaultMessage:"Pen",id:"gui.extension.pen.name"}),extensionId:"pen",iconURL:c.a,insetIconURL:B.a,description:o.a.createElement(n.a,{defaultMessage:"Draw with your sprites.",id:"gui.extension.pen.description"}),featured:!0},{name:o.a.createElement(n.a,{defaultMessage:"Video Sensing",id:"gui.extension.videosensing.name"}),extensionId:"videoSensing",iconURL:E.a,insetIconURL:C.a,description:o.a.createElement(n.a,{defaultMessage:"Sense motion with the camera.",id:"gui.extension.videosensing.description"}),featured:!0},{name:o.a.createElement(n.a,{defaultMessage:"Text to Speech",id:"gui.extension.text2speech.name"}),extensionId:"text2speech",collaborator:"Amazon Web Services",iconURL:m.a,insetIconURL:I.a,description:o.a.createElement(n.a,{defaultMessage:"Make your projects talk.",id:"gui.extension.text2speech.description"}),featured:!0,internetConnectionRequired:!0},{name:o.a.createElement(n.a,{defaultMessage:"Translate",id:"gui.extension.translate.name"}),extensionId:"translate",collaborator:"Google",iconURL:Q.a,insetIconURL:M.a,description:o.a.createElement(n.a,{defaultMessage:"Translate text into many languages.",id:"gui.extension.translate.description"}),featured:!0,internetConnectionRequired:!0},{name:"Makey Makey",extensionId:"makeymakey",collaborator:"JoyLabz",iconURL:y.a,insetIconURL:k.a,description:o.a.createElement(n.a,{defaultMessage:"Make anything into a key.",id:"gui.extension.makeymakey.description"}),featured:!0},{name:"micro:bit",extensionId:"microbit",collaborator:"micro:bit",iconURL:v.a,insetIconURL:N.a,description:o.a.createElement(n.a,{defaultMessage:"Connect your projects with the world.",id:"gui.extension.microbit.description"}),featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!1,connectionIconURL:O.a,connectionSmallIconURL:N.a,connectingMessage:o.a.createElement(n.a,{defaultMessage:"Connecting",id:"gui.extension.microbit.connectingMessage"}),helpLink:"https://scratch.mit.edu/microbit"},{name:"LEGO MINDSTORMS EV3",extensionId:"ev3",collaborator:"LEGO",iconURL:U.a,insetIconURL:H.a,description:o.a.createElement(n.a,{defaultMessage:"Build interactive robots and more.",id:"gui.extension.ev3.description"}),featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!1,connectionIconURL:P.a,connectionSmallIconURL:H.a,connectingMessage:o.a.createElement(n.a,{defaultMessage:"Connecting. Make sure the pin on your EV3 is set to 1234.",id:"gui.extension.ev3.connectingMessage"}),helpLink:"https://scratch.mit.edu/ev3"},{name:"LEGO BOOST",extensionId:"boost",collaborator:"LEGO",iconURL:Z.a,insetIconURL:$.a,description:o.a.createElement(n.a,{defaultMessage:"Bring robotic creations to life.",id:"gui.extension.boost.description"}),featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!0,connectionIconURL:eA.a,connectionSmallIconURL:$.a,connectionTipIconURL:tA.a,connectingMessage:o.a.createElement(n.a,{defaultMessage:"Connecting",id:"gui.extension.boost.connectingMessage"}),helpLink:"https://scratch.mit.edu/boost"},{name:"LEGO Education WeDo 2.0",extensionId:"wedo2",collaborator:"LEGO",iconURL:_.a,insetIconURL:J.a,description:o.a.createElement(n.a,{defaultMessage:"Build with motors and sensors.",id:"gui.extension.wedo2.description"}),featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!0,connectionIconURL:K.a,connectionSmallIconURL:J.a,connectionTipIconURL:V.a,connectingMessage:o.a.createElement(n.a,{defaultMessage:"Connecting",id:"gui.extension.wedo2.connectingMessage"}),helpLink:"https://scratch.mit.edu/wedo"},{name:"Go Direct Force & Acceleration",extensionId:"gdxfor",collaborator:"Vernier",iconURL:nA.a,insetIconURL:rA.a,description:o.a.createElement(n.a,{defaultMessage:"Sense push, pull, motion, and spin.",id:"gui.extension.gdxfor.description"}),featured:!0,disabled:!1,bluetoothRequired:!0,internetConnectionRequired:!0,launchPeripheralConnectionFlow:!0,useAutoScan:!1,connectionIconURL:gA.a,connectionSmallIconURL:rA.a,connectingMessage:o.a.createElement(n.a,{defaultMessage:"Connecting",id:"gui.extension.gdxfor.connectingMessage"}),helpLink:"https://scratch.mit.edu/vernier"}]},function(A,e,i){A.exports=i.p+"static/assets/e587d9d7e9a2f1f28041ba5c15db7a40.svg"},function(A,e,i){A.exports=i.p+"static/assets/301439e2e5ab88b658368ee525e6752b.svg"},function(A,e,i){A.exports=i.p+"static/assets/551aae506dfa65ce3b45713b5300a678.svg"},function(A,e,i){"use strict";i.d(e,"a",function(){return m});var t=i(5),o=i.n(t),n=i(1),a=i.n(n),r=i(0),s=i.n(r),g=i(6),l=i(13);function c(A){"@babel/helpers - typeof";return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var u=["isFetchingWithoutId","reduxProjectId","setProjectId"];function B(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function d(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function E(A,e){return(E=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function h(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=w(A);if(e){var o=w(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===c(e)||"function"==typeof e))return e;return C(A)}(this,i)}}function C(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function w(A){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var m=function(A){var e=function(e){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&E(A,e)}(t,a.a.Component);var i=h(t);function t(A){var e;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=i.call(this,A),o()(C(e),["handleHashChange"]),e}return function(A,e,i){e&&d(A.prototype,e),i&&d(A,i)}(t,[{key:"componentDidMount",value:function(){window.addEventListener("hashchange",this.handleHashChange),this.handleHashChange()}},{key:"componentDidUpdate",value:function(A){this.props.isFetchingWithoutId&&!A.isFetchingWithoutId&&history.pushState("new-project","new-project",window.location.pathname+window.location.search)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("hashchange",this.handleHashChange)}},{key:"handleHashChange",value:function(){var A=window.location.hash.match(/#(\d+)/),e=null===A?l.e:A[1];this.props.setProjectId(e.toString())}},{key:"render",value:function(){var e=this.props,i=(e.isFetchingWithoutId,e.reduxProjectId,e.setProjectId,B(e,u));return a.a.createElement(A,i)}}]),t}();e.propTypes={isFetchingWithoutId:s.a.bool,reduxProjectId:s.a.oneOfType([s.a.string,s.a.number]),setProjectId:s.a.func};return Object(g.b)(function(A){var e=A.scratchGui.projectState.loadingState;return{isFetchingWithoutId:Object(l.m)(e),reduxProjectId:A.scratchGui.projectState.projectId}},function(A){return{setProjectId:function(e){A(Object(l.F)(e))}}},function(A,e,i){return Object.assign({},A,e,i)})(e)}},function(A,e,i){"use strict";var t=i(5),o=i.n(t),n=i(0),a=i.n(n),r=i(1),s=i.n(r),g=i(11),l=i.n(g),c=i(6),u=i(4),B=i.n(u),d=i(2),E=i(284),h=i.n(E),C=i(376),w=i.n(C),m=["active","className","onClick","title"];function p(){return(p=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function I(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var f=function(A){var e=A.active,i=A.className,t=A.onClick,o=A.title,n=I(A,m);return s.a.createElement("img",p({className:B()(i,w.a.greenFlag,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},w.a.isActive,e)),draggable:!1,src:h.a,title:o,onClick:t},n))};f.propTypes={active:a.a.bool,className:a.a.string,onClick:a.a.func.isRequired,title:a.a.string},f.defaultProps={active:!1,title:"Go"};var Q=f,D=i(806),M=i.n(D),b=i(377),y=i.n(b),T=["active","className","onClick","title"];function k(){return(k=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function F(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var v=function(A){var e=A.active,i=A.className,t=A.onClick,o=A.title,n=F(A,T);return s.a.createElement("img",k({className:B()(i,y.a.stopAll,function(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}({},y.a.isActive,e)),draggable:!1,src:M.a,title:o,onClick:t},n))};v.propTypes={active:a.a.bool,className:a.a.string,onClick:a.a.func.isRequired,title:a.a.string},v.defaultProps={active:!1,title:"Stop"};var S=v,N=i(807),R=i.n(N),O=i(304),Y=i.n(O),U=function(){return s.a.createElement("div",{className:Y.a.turboContainer},s.a.createElement("img",{className:Y.a.turboIcon,src:R.a}),s.a.createElement("div",{className:Y.a.turboLabel},s.a.createElement(d.a,{defaultMessage:"Turbo Mode",id:"gui.turboMode.active"})))},G=i(808),H=i.n(G),L=["active","className","intl","onGreenFlagClick","onStopAllClick","turbo"];function P(){return(P=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function x(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}var _=Object(d.d)({goTitle:{id:"gui.controls.go",defaultMessage:"Go"},stopTitle:{id:"gui.controls.stop",defaultMessage:"Stop"}}),j=function(A){var e=A.active,i=A.className,t=A.intl,o=A.onGreenFlagClick,n=A.onStopAllClick,a=A.turbo,r=x(A,L);return s.a.createElement("div",P({className:B()(H.a.controlsContainer,i)},r),s.a.createElement(Q,{active:e,title:t.formatMessage(_.goTitle),onClick:o}),s.a.createElement(S,{active:e,title:t.formatMessage(_.stopTitle),onClick:n}),a?s.a.createElement(U,null):null)};j.propTypes={active:a.a.bool,className:a.a.string,intl:d.f.isRequired,onGreenFlagClick:a.a.func.isRequired,onStopAllClick:a.a.func.isRequired,turbo:a.a.bool},j.defaultProps={active:!1,turbo:!1};var J=Object(d.e)(j);function z(A){"@babel/helpers - typeof";return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}var K=["vm","isStarted","projectRunning","turbo"];function W(){return(W=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A}).apply(this,arguments)}function V(A,e){if(null==A)return{};var i,t,o=function(A,e){if(null==A)return{};var i,t,o={},n=Object.keys(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||(o[i]=A[i]);return o}(A,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);for(t=0;t<n.length;t++)i=n[t],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(A,i)&&(o[i]=A[i])}return o}function X(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}function Z(A,e){return(Z=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function q(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(A){return!1}}();return function(){var i,t=AA(A);if(e){var o=AA(this).constructor;i=Reflect.construct(t,arguments,o)}else i=t.apply(this,arguments);return function(A,e){if(e&&("object"===z(e)||"function"==typeof e))return e;return $(A)}(this,i)}}function $(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function AA(A){return(AA=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}var eA=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&Z(A,e)}(i,s.a.Component);var e=q(i);function i(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),t=e.call(this,A),o()($(t),["handleGreenFlagClick","handleStopAllClick"]),t}return function(A,e,i){e&&X(A.prototype,e),i&&X(A,i)}(i,[{key:"handleGreenFlagClick",value:function(A){A.preventDefault(),A.shiftKey?this.props.vm.setTurboMode(!this.props.turbo):(this.props.isStarted||this.props.vm.start(),this.props.vm.greenFlag())}},{key:"handleStopAllClick",value:function(A){A.preventDefault(),this.props.vm.stopAll(),mv2Interface.send_REST("robot/stop")}},{key:"render",value:function(){var A=this.props,e=(A.vm,A.isStarted,A.projectRunning),i=A.turbo,t=V(A,K);return s.a.createElement(J,W({},t,{active:e,turbo:i,onGreenFlagClick:this.handleGreenFlagClick,onStopAllClick:this.handleStopAllClick}))}}]),i}();eA.propTypes={isStarted:a.a.bool.isRequired,projectRunning:a.a.bool.isRequired,turbo:a.a.bool.isRequired,vm:a.a.instanceOf(l.a)};e.a=Object(c.b)(function(A){return{isStarted:A.scratchGui.vmStatus.running,projectRunning:A.scratchGui.vmStatus.running,turbo:A.scratchGui.vmStatus.turbo}},function(){return{}})(eA)},function(A,e,i){"use strict";i.d(e,"d",function(){return n}),i.d(e,"b",function(){return o}),i.d(e,"a",function(){return a}),i.d(e,"c",function(){return r});var t="scratch-gui/color-picker/SET_CALLBACK",o={active:!1,callback:function(){throw new Error("Color picker callback not initialized")}},n=function(A,e){switch(void 0===A&&(A=o),e.type){case"scratch-gui/color-picker/ACTIVATE_COLOR_PICKER":return Object.assign({},A,{active:!0,callback:e.callback});case"scratch-gui/color-picker/DEACTIVATE_COLOR_PICKER":return"string"==typeof e.color&&A.callback(e.color),Object.assign({},A,{active:!1});case t:return Object.assign({},A,{callback:e.callback});default:return A}},a=function(A){return{type:"scratch-gui/color-picker/ACTIVATE_COLOR_PICKER",callback:A}},r=function(A){return{type:"scratch-gui/color-picker/DEACTIVATE_COLOR_PICKER",color:A}}},function(A,e,i){A.exports=i.p+"static/assets/cb666b99d3528f91b52f985dfb102afa.svg"},function(A){A.exports=JSON.parse('[{"name":"Arctic","tags":["outdoors","cold","north pole","south pole","ice","antarctica","robert hunter"],"assetId":"67e0db3305b3c8bac3a363b1c428892e","bitmapResolution":2,"dataFormat":"png","md5ext":"67e0db3305b3c8bac3a363b1c428892e.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Baseball 1","tags":["baseball","sports","outdoors","alex eben meyer"],"assetId":"825d9b54682c406215d9d1f98a819449","bitmapResolution":1,"dataFormat":"svg","md5ext":"825d9b54682c406215d9d1f98a819449.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Baseball 2","tags":["baseball","sports","outdoors","alex eben meyer"],"assetId":"7be1f5b3e682813dac1f297e52ff7dca","bitmapResolution":1,"dataFormat":"svg","md5ext":"7be1f5b3e682813dac1f297e52ff7dca.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Basketball 1","tags":["sports","outdoors","basketball","alex eben meyer"],"assetId":"ae21eac3d1814aee1d37ae82ea287816","bitmapResolution":1,"dataFormat":"svg","md5ext":"ae21eac3d1814aee1d37ae82ea287816.svg","rotationCenterX":249,"rotationCenterY":186},{"name":"Basketball 2","tags":["outdoors","sports","basketball"],"assetId":"a5865738283613a2725b2c9dda6d8c78","bitmapResolution":2,"dataFormat":"png","md5ext":"a5865738283613a2725b2c9dda6d8c78.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Beach Malibu","tags":["outdoors"],"assetId":"050615fe992a00d6af0e664e497ebf53","bitmapResolution":2,"dataFormat":"png","md5ext":"050615fe992a00d6af0e664e497ebf53.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Beach Rio","tags":["outdoors"],"assetId":"968f0ede6e70e1dbb763d6fd4c5003e0","bitmapResolution":2,"dataFormat":"png","md5ext":"968f0ede6e70e1dbb763d6fd4c5003e0.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Bedroom 1","tags":["bedroom","indoors"],"assetId":"7aa6bbb2ddc4c10f901e1a50aeac1c7e","bitmapResolution":2,"dataFormat":"png","md5ext":"7aa6bbb2ddc4c10f901e1a50aeac1c7e.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Bedroom 2","tags":["indoors"],"assetId":"e2f8b0dbd0a65d2ad8bfc21616662a6a","bitmapResolution":2,"dataFormat":"png","md5ext":"e2f8b0dbd0a65d2ad8bfc21616662a6a.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Bedroom 3","tags":["indoors"],"assetId":"8cc0b88d53345b3e337e8f028a32a4e7","bitmapResolution":2,"dataFormat":"png","md5ext":"8cc0b88d53345b3e337e8f028a32a4e7.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Bench With View","tags":["outdoors","hill","view"],"assetId":"962201a2b712a302fb087f8f0dcb2076","bitmapResolution":2,"dataFormat":"png","md5ext":"962201a2b712a302fb087f8f0dcb2076.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Blue Sky","tags":["outdoors","flying"],"assetId":"e7c147730f19d284bcd7b3f00af19bb6","bitmapResolution":1,"dataFormat":"svg","md5ext":"e7c147730f19d284bcd7b3f00af19bb6.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Blue Sky 2 ","tags":["outdoors","flying"],"assetId":"8eb8790be5507fdccf73e7c1570bbbab","bitmapResolution":1,"dataFormat":"svg","md5ext":"8eb8790be5507fdccf73e7c1570bbbab.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Boardwalk","tags":["outdoors","ocean"],"assetId":"de0e54cd11551566f044e7e6bc588b2c","bitmapResolution":2,"dataFormat":"png","md5ext":"de0e54cd11551566f044e7e6bc588b2c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Canyon","tags":["outdoors","nature"],"assetId":"c7c0b27b959193a0b570a9639cfe8158","bitmapResolution":2,"dataFormat":"png","md5ext":"c7c0b27b959193a0b570a9639cfe8158.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Castle 1","tags":["fantasy"],"assetId":"e1914ed7917267f1c2ef2b48004cade9","bitmapResolution":2,"dataFormat":"png","md5ext":"e1914ed7917267f1c2ef2b48004cade9.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Castle 2","tags":["fantasy"],"assetId":"951765ee7f7370f120c9df20b577c22f","bitmapResolution":2,"dataFormat":"png","md5ext":"951765ee7f7370f120c9df20b577c22f.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Castle 3","tags":["fantasy"],"assetId":"76fa99f67569fcd39b4be74ed38c33f3","bitmapResolution":2,"dataFormat":"png","md5ext":"76fa99f67569fcd39b4be74ed38c33f3.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Castle 4","tags":["fantasy"],"assetId":"4f45f79af8e8dac3d41eb5a06ade61d4","bitmapResolution":2,"dataFormat":"png","md5ext":"4f45f79af8e8dac3d41eb5a06ade61d4.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Chalkboard","tags":["indoors","school"],"assetId":"a8a24b5aa717bbef09dbe31368914427","bitmapResolution":2,"dataFormat":"png","md5ext":"a8a24b5aa717bbef09dbe31368914427.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Circles","tags":["patterns"],"assetId":"c9847be305920807c5597d81576dd0c4","bitmapResolution":1,"dataFormat":"svg","md5ext":"c9847be305920807c5597d81576dd0c4.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"City With Water","tags":["outdoors","boston"],"assetId":"1ef98019fc94ea65a1b55d5521285c7a","bitmapResolution":2,"dataFormat":"png","md5ext":"1ef98019fc94ea65a1b55d5521285c7a.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Colorful City","tags":["city","town","road","skyline","outdoors"],"assetId":"04d18ddd1b85f0ea30beb14b8da49f60","bitmapResolution":2,"dataFormat":"png","md5ext":"04d18ddd1b85f0ea30beb14b8da49f60.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Concert","tags":["indoors","music","andrew rae"],"assetId":"c8d90320d2966c08af8cdd1c6a7a93b5","bitmapResolution":2,"dataFormat":"png","md5ext":"c8d90320d2966c08af8cdd1c6a7a93b5.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Desert","tags":["desert"," landscape"," outdoors"," cacti"],"assetId":"d98a9526a34890cf4bad11b5409eae2a","bitmapResolution":2,"dataFormat":"png","md5ext":"d98a9526a34890cf4bad11b5409eae2a.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Farm","tags":["outdoors","chicken","barn","coup","owen davey"],"assetId":"1e8a70bd07f1dcba3383883f3b948266","bitmapResolution":2,"dataFormat":"png","md5ext":"1e8a70bd07f1dcba3383883f3b948266.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Field At Mit","tags":["outdoors","architecture"],"assetId":"5b0a970202b464915915260c03f05455","bitmapResolution":2,"dataFormat":"png","md5ext":"5b0a970202b464915915260c03f05455.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Flowers","tags":["outdoors","nature"],"assetId":"25a6ede51a96d4e55de2ffb81ae96f8c","bitmapResolution":2,"dataFormat":"png","md5ext":"25a6ede51a96d4e55de2ffb81ae96f8c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Forest","tags":["outdoors","forest"],"assetId":"92968ac16b2f0c3f7835a6dacd172c7b","bitmapResolution":2,"dataFormat":"png","md5ext":"92968ac16b2f0c3f7835a6dacd172c7b.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Galaxy","tags":["space","stars","nasa"],"assetId":"5fab1922f254ae9fd150162c3e392bef","bitmapResolution":2,"dataFormat":"png","md5ext":"5fab1922f254ae9fd150162c3e392bef.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Garden-rock","tags":["outdoors"," garden"," park"],"assetId":"4f66053598bea0905e1559ab9d5a6e31","bitmapResolution":2,"dataFormat":"png","md5ext":"4f66053598bea0905e1559ab9d5a6e31.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Greek Theater","tags":["outdoors","theatre"],"assetId":"93d71e8b8a96cc007b8d68f36acd338a","bitmapResolution":2,"dataFormat":"png","md5ext":"93d71e8b8a96cc007b8d68f36acd338a.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Hall","tags":["indoors"],"assetId":"ea86ca30b346f27ca5faf1254f6a31e3","bitmapResolution":2,"dataFormat":"png","md5ext":"ea86ca30b346f27ca5faf1254f6a31e3.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Hay Field","tags":["outdoors","farm"],"assetId":"da102a69d135973e0fc139131dec785a","bitmapResolution":2,"dataFormat":"png","md5ext":"da102a69d135973e0fc139131dec785a.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Hearts","tags":["patterns"],"assetId":"f98526ccb0eec3ac7d6c8f8ab502825e","bitmapResolution":1,"dataFormat":"svg","md5ext":"f98526ccb0eec3ac7d6c8f8ab502825e.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Hill","tags":["outdoors","nature"],"assetId":"2129c842f28d6881f622fdc3497ff2da","bitmapResolution":2,"dataFormat":"png","md5ext":"2129c842f28d6881f622fdc3497ff2da.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Jungle","tags":["outdoors","forest","robert hunter"],"assetId":"f4f908da19e2753f3ed679d7b37650ca","bitmapResolution":2,"dataFormat":"png","md5ext":"f4f908da19e2753f3ed679d7b37650ca.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Jurassic","tags":["outdoors","dinosaur","alex eben meyer"],"assetId":"64025bdca5db4938f65597e3682fddcf","bitmapResolution":1,"dataFormat":"svg","md5ext":"64025bdca5db4938f65597e3682fddcf.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Light","tags":["patterns"],"assetId":"4b98c07876ed8997c3762e75790507b4","bitmapResolution":1,"dataFormat":"svg","md5ext":"4b98c07876ed8997c3762e75790507b4.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Metro","tags":["outdoors","city","urban"],"assetId":"0b4a15ba028bf205ec051390d6ac4de7","bitmapResolution":2,"dataFormat":"png","md5ext":"0b4a15ba028bf205ec051390d6ac4de7.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Moon","tags":["space","nasa","apollo"],"assetId":"0b1d2eaf22d62ef88de80ccde5578fba","bitmapResolution":2,"dataFormat":"png","md5ext":"0b1d2eaf22d62ef88de80ccde5578fba.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Mountain","tags":["outdoors","snow","cave","robert hunter"],"assetId":"f84989feee2cf462a1c597169777ee3c","bitmapResolution":2,"dataFormat":"png","md5ext":"f84989feee2cf462a1c597169777ee3c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Mural","tags":["outdoors","mural","graffiti","street","art"],"assetId":"efb625f7e0b199b15f69e116cd053cea","bitmapResolution":2,"dataFormat":"png","md5ext":"efb625f7e0b199b15f69e116cd053cea.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Nebula","tags":["space","nasa","bubble","hubble"],"assetId":"9b5cdbd596da1b6149f56b794b6394f4","bitmapResolution":2,"dataFormat":"png","md5ext":"9b5cdbd596da1b6149f56b794b6394f4.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Neon Tunnel","tags":["games","game","space"],"assetId":"57d2b13b2f73d3d878c72810c137b0d6","bitmapResolution":2,"dataFormat":"png","md5ext":"57d2b13b2f73d3d878c72810c137b0d6.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Night City","tags":["outdoors","urban","city","metro"],"assetId":"6fdc795ff487204f72740567be5f64f9","bitmapResolution":2,"dataFormat":"png","md5ext":"6fdc795ff487204f72740567be5f64f9.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Night City With Street","tags":["urban","city","metro","transportation"],"assetId":"14443ad7907b6479d7562a12b8ae0efb","bitmapResolution":2,"dataFormat":"png","md5ext":"14443ad7907b6479d7562a12b8ae0efb.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Party","tags":["indoors","inflatable"],"assetId":"108160d0e44d1c340182e31c9dc0758a","bitmapResolution":1,"dataFormat":"svg","md5ext":"108160d0e44d1c340182e31c9dc0758a.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Pathway","tags":["outdoors","garden"],"assetId":"5d747ec036755a4b129f0d5b978bc61c","bitmapResolution":2,"dataFormat":"png","md5ext":"5d747ec036755a4b129f0d5b978bc61c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Playground","tags":["outdoors","play"],"assetId":"e5f794c8756ca0cead5cb7e7fe354c41","bitmapResolution":2,"dataFormat":"png","md5ext":"e5f794c8756ca0cead5cb7e7fe354c41.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Playing Field","tags":["outdoors","sports"],"assetId":"2de108f3098e92f5c5976cf75d38e99d","bitmapResolution":2,"dataFormat":"png","md5ext":"2de108f3098e92f5c5976cf75d38e99d.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Pool","tags":["outdoors","sports","swim","swimming"],"assetId":"6cab934df643d2fc508cfa90c0c4059b","bitmapResolution":2,"dataFormat":"png","md5ext":"6cab934df643d2fc508cfa90c0c4059b.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Rays","tags":["patterns","raimondious"],"assetId":"87e963282db9e020e8c4d075891ea12b","bitmapResolution":1,"dataFormat":"svg","md5ext":"87e963282db9e020e8c4d075891ea12b.svg","rotationCenterX":240.1199951171875,"rotationCenterY":180},{"name":"Refrigerator","tags":["food","indoors","alex eben meyer"],"assetId":"98f053f9681e872f34fafd783ce72205","bitmapResolution":1,"dataFormat":"svg","md5ext":"98f053f9681e872f34fafd783ce72205.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Room 1","tags":["indoors","books","library"],"assetId":"a81668321aa3dcc0fc185d3e36ae76f6","bitmapResolution":2,"dataFormat":"png","md5ext":"a81668321aa3dcc0fc185d3e36ae76f6.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Room 2","tags":["indoors"],"assetId":"05ae3e3bbea890a6e3552ffe8456775e","bitmapResolution":2,"dataFormat":"png","md5ext":"05ae3e3bbea890a6e3552ffe8456775e.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Savanna","tags":["africa","savanna","savanah","outdoors","robert hunter"],"assetId":"9b020b8c7cb6a9592f7303add9441d8f","bitmapResolution":2,"dataFormat":"png","md5ext":"9b020b8c7cb6a9592f7303add9441d8f.png","rotationCenterX":480,"rotationCenterY":360},{"name":"School","tags":["outdoors","building","education","learning"],"assetId":"1dea69ac0f62cf538d368a7bde1372ac","bitmapResolution":2,"dataFormat":"png","md5ext":"1dea69ac0f62cf538d368a7bde1372ac.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Slopes","tags":["outdoors","winter","ski","snowboard","cold","snow"],"assetId":"63b6a69594a0a87888b56244bfa2ac1b","bitmapResolution":2,"dataFormat":"png","md5ext":"63b6a69594a0a87888b56244bfa2ac1b.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Soccer","tags":["soccer","football","sports","alex eben meyer"],"assetId":"04a63154f04b09494354090f7cc2f1b9","bitmapResolution":2,"dataFormat":"png","md5ext":"04a63154f04b09494354090f7cc2f1b9.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Soccer 2","tags":["soccer","football","sports","alex eben meyer"],"assetId":"b0dc1268cb595aaeef405bce40d1639c","bitmapResolution":2,"dataFormat":"png","md5ext":"b0dc1268cb595aaeef405bce40d1639c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Space","tags":["space","moon","science fiction","planet","wren mcdonald"],"assetId":"84208d9a3718ec3c9fc5a32a792fa1d0","bitmapResolution":2,"dataFormat":"png","md5ext":"84208d9a3718ec3c9fc5a32a792fa1d0.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Space City 1","tags":["space","moon","science fiction","planet","wren mcdonald"],"assetId":"20344b0edcc498281e4cb80242a72667","bitmapResolution":2,"dataFormat":"png","md5ext":"20344b0edcc498281e4cb80242a72667.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Space City 2","tags":["space","moon","science fiction","planet","wren mcdonald"],"assetId":"32b2316fd375faa18088f6c57ebb1c8d","bitmapResolution":2,"dataFormat":"png","md5ext":"32b2316fd375faa18088f6c57ebb1c8d.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Spaceship","tags":["space","moon","science fiction","planet","wren mcdonald"],"assetId":"0c450891306fa63ef02aa0fda7fd0ef9","bitmapResolution":2,"dataFormat":"png","md5ext":"0c450891306fa63ef02aa0fda7fd0ef9.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Spotlight","tags":["music","dance"],"assetId":"d26bf4c3980163d9106625cc2ea6c50d","bitmapResolution":2,"dataFormat":"png","md5ext":"d26bf4c3980163d9106625cc2ea6c50d.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Stars","tags":["space","nasa"],"assetId":"47282ff0f7047c6fab9c94b531abf721","bitmapResolution":2,"dataFormat":"png","md5ext":"47282ff0f7047c6fab9c94b531abf721.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Stripes","tags":["patterns"],"assetId":"a6a21f5c08d586e8daaebde37c97fb6f","bitmapResolution":1,"dataFormat":"svg","md5ext":"a6a21f5c08d586e8daaebde37c97fb6f.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Theater","tags":["indoors","music","andrew rae"],"assetId":"c2b097bc5cdb6a14ef5485202bc5ee76","bitmapResolution":2,"dataFormat":"png","md5ext":"c2b097bc5cdb6a14ef5485202bc5ee76.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Theater 2","tags":["music"],"assetId":"061a78ed83495dd0acd6d62e83e1b972","bitmapResolution":2,"dataFormat":"png","md5ext":"061a78ed83495dd0acd6d62e83e1b972.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Tree","tags":["outdoors","nature"],"assetId":"a23fbf972001c94637b568992f8fd7bd","bitmapResolution":2,"dataFormat":"png","md5ext":"a23fbf972001c94637b568992f8fd7bd.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Underwater 1","tags":["ocean","outdoors","underwater","ipzy"],"assetId":"d3344650f594bcecdf46aa4a9441badd","bitmapResolution":1,"dataFormat":"svg","md5ext":"d3344650f594bcecdf46aa4a9441badd.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Underwater 2","tags":["outdoors","nature","underwater"],"assetId":"1517c21786d2d0edc2f3037408d850bd","bitmapResolution":2,"dataFormat":"png","md5ext":"1517c21786d2d0edc2f3037408d850bd.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Urban","tags":["outdoors","city","metro","transportation"],"assetId":"1679049718869e1f548e1e8823e29c1c","bitmapResolution":2,"dataFormat":"png","md5ext":"1679049718869e1f548e1e8823e29c1c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Wall 1","tags":["outdoors","brick"],"assetId":"7e5327c68ff6ddabc48dbfe4717a04fe","bitmapResolution":2,"dataFormat":"png","md5ext":"7e5327c68ff6ddabc48dbfe4717a04fe.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Wall 2","tags":["outdoors","brick"],"assetId":"82d867fcd9f1b5f49e29c2f853d55665","bitmapResolution":2,"dataFormat":"png","md5ext":"82d867fcd9f1b5f49e29c2f853d55665.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Water And Rocks","tags":["outdoors","nature","tree","river","stream"],"assetId":"0015433a406a53f00b792424b823268c","bitmapResolution":2,"dataFormat":"png","md5ext":"0015433a406a53f00b792424b823268c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Wetland","tags":["outdoor","nature","swamp","wetland","owen davey"],"assetId":"ef9973bcff6d4cbc558e946028ec7d23","bitmapResolution":2,"dataFormat":"png","md5ext":"ef9973bcff6d4cbc558e946028ec7d23.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Winter","tags":["outdoors","trees","forest","winter"],"assetId":"5fa9385a60b904672d0e46e9d768bb32","bitmapResolution":1,"dataFormat":"svg","md5ext":"5fa9385a60b904672d0e46e9d768bb32.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Witch House","tags":["fantasy","indoors","ipzy"],"assetId":"30085b2d27beb5acdbe895d8b3e64b04","bitmapResolution":1,"dataFormat":"svg","md5ext":"30085b2d27beb5acdbe895d8b3e64b04.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Woods","tags":["fantasy","spooky","halloween","outdoors","haunted","forest","alex eben meyer"],"assetId":"f3eb165d6f3fd23370f97079f2e631bf","bitmapResolution":1,"dataFormat":"svg","md5ext":"f3eb165d6f3fd23370f97079f2e631bf.svg","rotationCenterX":240,"rotationCenterY":180},{"name":"Woods And Bench","tags":["outdoors","park"],"assetId":"4fcf7ed0de6c6b6e9b52c511b0650e9c","bitmapResolution":2,"dataFormat":"png","md5ext":"4fcf7ed0de6c6b6e9b52c511b0650e9c.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Xy-grid","tags":["grid","xy","coordinates"],"assetId":"9838d02002d05f88dc54d96494fbc202","bitmapResolution":2,"dataFormat":"png","md5ext":"9838d02002d05f88dc54d96494fbc202.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Xy-grid-20px","tags":["grid","xy","coordinates"],"assetId":"4eec0e1db92b8dea3e5bee25105e8f46","bitmapResolution":2,"dataFormat":"png","md5ext":"4eec0e1db92b8dea3e5bee25105e8f46.png","rotationCenterX":480,"rotationCenterY":360},{"name":"Xy-grid-30px","tags":["grid","xy","coordinates"],"assetId":"3b8bcabd0ac683b7cb3673208039764b","bitmapResolution":2,"dataFormat":"png","md5ext":"3b8bcabd0ac683b7cb3673208039764b.png","rotationCenterX":480,"rotationCenterY":360}]')},function(A,e,i){"use strict";var t=i(1008).default;i(1015),(e=A.exports=t).default=e},function(A,e,i){"use strict";var t,o=i(0),n=i.n(o),a=i(1),r=i.n(a),s=i(4),g=i.n(s),l=i(145),c=i.n(l),u=i(141),B=i.n(u),d=i(749),E=i.n(d),h=i(277),C=i.n(h);function w(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}var m={},p=function A(e){var i;return r.a.createElement("div",{"aria-label":"Close",className:g()(c.a.closeButton,e.className,(i={},w(i,c.a.small,e.size===A.SIZE_SMALL),w(i,c.a.large,e.size===A.SIZE_LARGE),w(i,c.a.orange,e.color===A.COLOR_ORANGE),i)),role:"button",tabIndex:"0",onClick:e.onClick},"back"===e.buttonType?r.a.createElement("img",{className:c.a.backIcon,src:C.a}):r.a.createElement("img",{className:g()(c.a.closeIcon,w({},c.a[e.color],e.color!==A.COLOR_NEUTRAL)),src:e.color&&m[e.color]?m[e.color]:B.a}))};p.SIZE_SMALL="small",p.SIZE_LARGE="large",p.COLOR_NEUTRAL="neutral",p.COLOR_GREEN="green",p.COLOR_ORANGE="orange",w(t={},p.COLOR_NEUTRAL,B.a),w(t,p.COLOR_GREEN,B.a),w(t,p.COLOR_ORANGE,E.a),m=t,p.propTypes={buttonType:n.a.oneOf(["back","close"]),className:n.a.string,color:n.a.string,onClick:n.a.func.isRequired,size:n.a.oneOf([p.SIZE_SMALL,p.SIZE_LARGE])},p.defaultProps={color:p.COLOR_NEUTRAL,size:p.SIZE_LARGE,buttonType:"close"},e.a=p},function(A,e,i){var t=i(1481);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e,i){var t=i(1501);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e,i){var t=i(1519);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e,i){var t=i(1635);"string"==typeof t&&(t=[[A.i,t,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};i(10)(t,o);t.locals&&(A.exports=t.locals)},function(A,e,i){function t(A,e){var i="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!i){if(Array.isArray(A)||(i=function(A,e){if(!A)return;if("string"==typeof A)return o(A,e);var i=Object.prototype.toString.call(A).slice(8,-1);"Object"===i&&A.constructor&&(i=A.constructor.name);if("Map"===i||"Set"===i)return Array.from(A);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return o(A,e)}(A))||e&&A&&"number"==typeof A.length){i&&(A=i);var t=0,n=function(){};return{s:n,n:function(){return t>=A.length?{done:!0}:{done:!1,value:A[t++]}},e:function(A){throw A},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){i=i.call(A)},n:function(){var A=i.next();return r=A.done,A},e:function(A){s=!0,a=A},f:function(){try{r||null==i.return||i.return()}finally{if(s)throw a}}}}function o(A,e){(null==e||e>A.length)&&(e=A.length);for(var i=0,t=new Array(e);i<e;i++)t[i]=A[i];return t}function n(A){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}function a(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var r=i(1083),s=i(459),g=i(237),l=i(318),c=i(125),u=i(190).Map,B=i(466),d=i(467),E=i(39),h=i(126),C=i(319),w=function(){function A(e,i){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.runtime=e,this._blocks={},this._scripts=[],Object.defineProperty(this,"_cache",{writable:!0,enumerable:!1}),this._cache={inputs:{},procedureParamNames:{},procedureDefinitions:{},_executeCached:{},_monitored:null,scripts:{}},this.forceNoGlow=i||!1}return function(A,e,i){e&&a(A.prototype,e),i&&a(A,i)}(A,[{key:"getBlock",value:function(A){return this._blocks[A]}},{key:"getScripts",value:function(){return this._scripts}},{key:"getNextBlock",value:function(A){var e=this._blocks[A];return void 0===e?null:e.next}},{key:"getBranch",value:function(e,i){var t=this._blocks[e];if(void 0===t)return null;i||(i=1);var o=A.BRANCH_INPUT_PREFIX;i>1&&(o+=i);var n=t.inputs[o];return void 0===n?null:n.block}},{key:"getOpcode",value:function(A){return void 0===A?null:A.opcode}},{key:"getFields",value:function(A){return void 0===A?null:A.fields}},{key:"getInputs",value:function(e){if(void 0===e)return null;var i=this._cache.inputs[e.id];if(void 0!==i)return i;for(var t in i={},e.inputs)t.substring(0,A.BRANCH_INPUT_PREFIX.length)!==A.BRANCH_INPUT_PREFIX&&(i[t]=e.inputs[t]);return this._cache.inputs[e.id]=i,i}},{key:"getMutation",value:function(A){return void 0===A?null:A.mutation}},{key:"getTopLevelScript",value:function(A){var e=this._blocks[A];if(void 0===e)return null;for(;null!==e.parent;)e=this._blocks[e.parent];return e.id}},{key:"getProcedureDefinition",value:function(A){var e=this._cache.procedureDefinitions[A];if(void 0!==e)return e;for(var i in this._blocks)if(this._blocks.hasOwnProperty(i)){var t=this._blocks[i];if("procedures_definition"===t.opcode){var o=this._getCustomBlockInternal(t);if(o&&o.mutation.proccode===A)return this._cache.procedureDefinitions[A]=i,i}}return this._cache.procedureDefinitions[A]=null,null}},{key:"getProcedureParamNamesAndIds",value:function(A){return this.getProcedureParamNamesIdsAndDefaults(A).slice(0,2)}},{key:"getProcedureParamNamesIdsAndDefaults",value:function(A){var e=this._cache.procedureParamNames[A];if(void 0!==e)return e;for(var i in this._blocks)if(this._blocks.hasOwnProperty(i)){var t=this._blocks[i];if("procedures_prototype"===t.opcode&&t.mutation.proccode===A){var o=JSON.parse(t.mutation.argumentnames),n=JSON.parse(t.mutation.argumentids),a=JSON.parse(t.mutation.argumentdefaults);return this._cache.procedureParamNames[A]=[o,n,a],this._cache.procedureParamNames[A]}}return this._cache.procedureParamNames[A]=null,null}},{key:"duplicate",value:function(){var e=new A(this.runtime,this.forceNoGlow);return e._blocks=c.simple(this._blocks),e._scripts=c.simple(this._scripts),e}},{key:"blocklyListen",value:function(A){if("object"===n(A)&&("string"==typeof A.blockId||"string"==typeof A.varId||"string"==typeof A.commentId)){var e=this.runtime.getTargetForStage(),i=this.runtime.getEditingTarget();if("stackclick"!==A.element)switch(A.type){case"create":for(var o=r(A),a=0;a<o.length;a++)this.createBlock(o[a]);break;case"change":this.changeBlock({id:A.blockId,element:A.element,name:A.name,value:A.newValue});break;case"move":this.moveBlock({id:A.blockId,oldParent:A.oldParentId,oldInput:A.oldInputName,newParent:A.newParentId,newInput:A.newInputName,newCoordinate:A.newCoordinate});break;case"dragOutside":this.runtime.emitBlockDragUpdate(A.isOutside);break;case"endDrag":if(this.runtime.emitBlockDragUpdate(!1),A.isOutside){var s=r(A);this.runtime.emitBlockEndDrag(s,A.blockId)}break;case"delete":if(!this._blocks.hasOwnProperty(A.blockId)||this._blocks[A.blockId].shadow)return;this._blocks[A.blockId].topLevel&&this.runtime.quietGlow(A.blockId),this.deleteBlock(A.blockId);break;case"var_create":if(A.isLocal&&i&&!i.isStage&&!A.isCloud)i.lookupVariableById(A.varId)||(i.createVariable(A.varId,A.varName,A.varType),this.emitProjectChanged());else{if(e.lookupVariableById(A.varId))return;var g,l=t(this.runtime.targets.filter(function(A){return A.isOriginal}));try{for(l.s();!(g=l.n()).done;){if(g.value.lookupVariableByNameAndType(A.varName,A.varType,!0))return}}catch(A){l.e(A)}finally{l.f()}e.createVariable(A.varId,A.varName,A.varType,A.isCloud),this.emitProjectChanged()}break;case"var_rename":if(i&&i.variables.hasOwnProperty(A.varId))i.renameVariable(A.varId,A.newName),i.blocks.updateBlocksAfterVarRename(A.varId,A.newName);else{e.renameVariable(A.varId,A.newName);for(var c=this.runtime.targets,u=0;u<c.length;u++){c[u].blocks.updateBlocksAfterVarRename(A.varId,A.newName)}}this.emitProjectChanged();break;case"var_delete":(i&&i.variables.hasOwnProperty(A.varId)?i:e).deleteVariable(A.varId),this.emitProjectChanged();break;case"comment_create":if(this.runtime.getEditingTarget()){var B=this.runtime.getEditingTarget();B.createComment(A.commentId,A.blockId,A.text,A.xy.x,A.xy.y,A.width,A.height,A.minimized),null===B.comments[A.commentId].x&&null===B.comments[A.commentId].y&&(B.comments[A.commentId].x=A.xy.x,B.comments[A.commentId].y=A.xy.y)}this.emitProjectChanged();break;case"comment_change":if(this.runtime.getEditingTarget()){var d=this.runtime.getEditingTarget();if(!d.comments.hasOwnProperty(A.commentId))return void E.warn("Cannot change comment with id ".concat(A.commentId," because it does not exist."));var h=d.comments[A.commentId],C=A.newContents_;C.hasOwnProperty("minimized")&&(h.minimized=C.minimized),C.hasOwnProperty("width")&&C.hasOwnProperty("height")&&(h.width=C.width,h.height=C.height),C.hasOwnProperty("text")&&(h.text=C.text),this.emitProjectChanged()}break;case"comment_move":if(this.runtime.getEditingTarget()){var w=this.runtime.getEditingTarget();if(w&&!w.comments.hasOwnProperty(A.commentId))return void E.warn("Cannot change comment with id ".concat(A.commentId," because it does not exist."));var m=w.comments[A.commentId],p=A.newCoordinate_;m.x=p.x,m.y=p.y,this.emitProjectChanged()}break;case"comment_delete":if(this.runtime.getEditingTarget()){var I=this.runtime.getEditingTarget();if(!I.comments.hasOwnProperty(A.commentId))return;if(delete I.comments[A.commentId],A.blockId){var f=I.blocks.getBlock(A.blockId);if(!f)return void E.warn("Could not find block referenced by comment with id: ".concat(A.commentId));delete f.comment}this.emitProjectChanged()}}else this.runtime.toggleScript(A.blockId,{stackClick:!0})}}},{key:"resetCache",value:function(){this._cache.inputs={},this._cache.procedureParamNames={},this._cache.procedureDefinitions={},this._cache._executeCached={},this._cache._monitored=null,this._cache.scripts={}}},{key:"emitProjectChanged",value:function(){this.forceNoGlow||this.runtime.emitProjectChanged()}},{key:"createBlock",value:function(A){this._blocks.hasOwnProperty(A.id)||(this._blocks[A.id]=A,A.topLevel&&this._addScript(A.id),this.resetCache(),this.emitProjectChanged())}},{key:"changeBlock",value:function(A){if(-1!==["field","mutation","checkbox"].indexOf(A.element)){var e=this._blocks[A.id];if(void 0!==e){switch(A.element){case"field":if(!e.fields[A.name])return;if("VARIABLE"===A.name||"LIST"===A.name||"BROADCAST_OPTION"===A.name){var i=this.runtime.getEditingTarget().lookupVariableById(A.value);i&&(e.fields[A.name].value=i.name,e.fields[A.name].id=A.value)}else{e.fields[A.name].value=A.value,"sensing_of_object_menu"===e.opcode&&("_stage_"===e.fields.OBJECT.value?this._blocks[e.parent].fields.PROPERTY.value="backdrop #":this._blocks[e.parent].fields.PROPERTY.value="x position",this.runtime.requestBlocksUpdate());var t=e.shadow&&e.parent?this._blocks[e.parent]:e;t.isMonitored&&this.runtime.requestUpdateMonitor(u({id:t.id,params:this._getBlockParams(t)}))}break;case"mutation":e.mutation=s(A.value);break;case"checkbox":if(e.fields&&Object.keys(e.fields).length>0&&"data_variable"!==e.opcode&&"data_listcontents"!==e.opcode){var o=C(e.id,e.fields),n=this.runtime.monitorBlocks.getBlock(o);n||((n=JSON.parse(JSON.stringify(e))).id=o,this.runtime.monitorBlocks.createBlock(n)),e=n}var a=e.isMonitored;e.isMonitored=A.value;var r=!1;"data_variable"===e.opcode?r=!this.runtime.getTargetForStage().variables[e.fields.VARIABLE.id]:"data_listcontents"===e.opcode&&(r=!this.runtime.getTargetForStage().variables[e.fields.LIST.id]);var g=r||this.runtime.monitorBlockInfo.hasOwnProperty(e.opcode)&&this.runtime.monitorBlockInfo[e.opcode].isSpriteSpecific;e.targetId=g?e.targetId||this.runtime.getEditingTarget().id:null,a&&!e.isMonitored?this.runtime.requestHideMonitor(e.id):!a&&e.isMonitored&&(this.runtime.requestShowMonitor(e.id)||this.runtime.requestAddMonitor(l({id:e.id,targetId:e.targetId,spriteName:e.targetId?this.runtime.getTargetById(e.targetId).getName():null,opcode:e.opcode,params:this._getBlockParams(e),value:"",mode:"data_listcontents"===e.opcode?"list":"default"})))}this.emitProjectChanged(),this.resetCache()}}}},{key:"moveBlock",value:function(A){if(this._blocks.hasOwnProperty(A.id)){var e=this._blocks[A.id],i=!1;if(A.newCoordinate&&(i=e.x!==A.newCoordinate.x||e.y!==A.newCoordinate.y,e.x=A.newCoordinate.x,e.y=A.newCoordinate.y),void 0!==A.oldParent){var t=this._blocks[A.oldParent];void 0!==A.oldInput&&t.inputs[A.oldInput].block===A.id?t.inputs[A.oldInput].block=null:t.next===A.id&&(t.next=null),this._blocks[A.id].parent=null,i=!0}if(void 0===A.newParent)this._addScript(A.id);else{if(this._deleteScript(A.id),void 0===A.newInput)this._blocks[A.newParent].next=A.id;else{var o=null;this._blocks[A.newParent].inputs.hasOwnProperty(A.newInput)&&(o=this._blocks[A.newParent].inputs[A.newInput].shadow),this._blocks[A.id].shadow&&(o=A.id),this._blocks[A.newParent].inputs[A.newInput]={name:A.newInput,block:A.id,shadow:o}}this._blocks[A.id].parent=A.newParent,i=!0}this.resetCache(),i&&this.emitProjectChanged()}}},{key:"runAllMonitored",value:function(A){var e=this;null===this._cache._monitored&&(this._cache._monitored=Object.keys(this._blocks).filter(function(A){return e.getBlock(A).isMonitored}).map(function(i){var t=e.getBlock(i).targetId;return{blockId:i,target:t?A.getTargetById(t):null}}));for(var i=this._cache._monitored,t=0;t<i.length;t++){var o=i[t],n=o.blockId,a=o.target;A.addMonitorScript(n,a)}}},{key:"deleteBlock",value:function(A){var e=this._blocks[A];if(e){for(var i in null!==e.next&&this.deleteBlock(e.next),e.inputs)null!==e.inputs[i].block&&this.deleteBlock(e.inputs[i].block),null!==e.inputs[i].shadow&&e.inputs[i].shadow!==e.inputs[i].block&&this.deleteBlock(e.inputs[i].shadow);this._deleteScript(A),delete this._blocks[A],this.resetCache(),this.emitProjectChanged()}}},{key:"getAllVariableAndListReferences",value:function(A,e){var i=A||this._blocks,t=Object.create(null);for(var o in i){var n=null,a=null;if(i[o].fields.VARIABLE?(n=i[o].fields.VARIABLE,a=h.SCALAR_TYPE):i[o].fields.LIST?(n=i[o].fields.LIST,a=h.LIST_TYPE):e&&i[o].fields.BROADCAST_OPTION&&(n=i[o].fields.BROADCAST_OPTION,a=h.BROADCAST_MESSAGE_TYPE),n){var r=n.id;t[r]?t[r].push({referencingField:n,type:a}):t[r]=[{referencingField:n,type:a}]}}return t}},{key:"updateBlocksAfterVarRename",value:function(A,e){var i=this._blocks;for(var t in i){var o=null;if(i[t].fields.VARIABLE?o=i[t].fields.VARIABLE:i[t].fields.LIST&&(o=i[t].fields.LIST),o)A===o.id&&(o.value=e)}}},{key:"updateTargetSpecificBlocks",value:function(A){var e=this._blocks;for(var i in e)A&&"event_whenthisspriteclicked"===e[i].opcode?e[i].opcode="event_whenstageclicked":A||"event_whenstageclicked"!==e[i].opcode||(e[i].opcode="event_whenthisspriteclicked")}},{key:"updateAssetName",value:function(A,e,i){var t;if("costume"===i)t=this._getCostumeField.bind(this);else if("sound"===i)t=this._getSoundField.bind(this);else if("backdrop"===i)t=this._getBackdropField.bind(this);else{if("sprite"!==i)return;t=this._getSpriteField.bind(this)}var o=this._blocks;for(var n in o){var a=t(n);a&&a.value===A&&(a.value=e)}}},{key:"updateSensingOfReference",value:function(A,e,i){var t=this._blocks,o=!1;for(var n in t){var a=t[n];if("sensing_of"===a.opcode&&a.fields.PROPERTY.value===A&&a.inputs.OBJECT.block===a.inputs.OBJECT.shadow)this.getBlock(a.inputs.OBJECT.block).fields.OBJECT.value===i&&(a.fields.PROPERTY.value=e,o=!0)}return o&&this.resetCache(),o}},{key:"_getCostumeField",value:function(A){var e=this.getBlock(A);return e&&e.fields.hasOwnProperty("COSTUME")?e.fields.COSTUME:null}},{key:"_getSoundField",value:function(A){var e=this.getBlock(A);return e&&e.fields.hasOwnProperty("SOUND_MENU")?e.fields.SOUND_MENU:null}},{key:"_getBackdropField",value:function(A){var e=this.getBlock(A);return e&&e.fields.hasOwnProperty("BACKDROP")?e.fields.BACKDROP:null}},{key:"_getSpriteField",value:function(A){var e=this.getBlock(A);if(!e)return null;for(var i=["TOWARDS","TO","OBJECT","VIDEOONMENU2","DISTANCETOMENU","TOUCHINGOBJECTMENU","CLONE_OPTION"],t=0;t<i.length;t++){var o=i[t];if(e.fields.hasOwnProperty(o))return e.fields[o]}return null}},{key:"toXML",value:function(A){var e=this;return this._scripts.map(function(i){return e.blockToXML(i,A)}).join()}},{key:"blockToXML",value:function(A,e){var i=this._blocks[A];if(i){var t=i.shadow?"shadow":"block",o="<".concat(t,'\n id="').concat(i.id,'"\n type="').concat(i.opcode,'"\n ').concat(i.topLevel?'x="'.concat(i.x,'" y="').concat(i.y,'"'):"","\n >"),n=i.comment;for(var a in n&&(e?e.hasOwnProperty(n)?o+=e[n].toXML():E.warn("Could not find comment with id: ".concat(n," in provided comment descriptions.")):E.warn("Cannot serialize comment with id: ".concat(n,"; no comment descriptions provided."))),i.mutation&&(o+=this.mutationToXML(i.mutation)),i.inputs)if(i.inputs.hasOwnProperty(a)){var r=i.inputs[a];(r.block||r.shadow)&&(o+='<value name="'.concat(r.name,'">'),r.block&&(o+=this.blockToXML(r.block,e)),r.shadow&&r.shadow!==r.block&&(o+=this.blockToXML(r.shadow,e)),o+="</value>")}for(var s in i.fields)if(i.fields.hasOwnProperty(s)){var l=i.fields[s];o+='<field name="'.concat(l.name,'"');var c=l.id;c&&(o+=' id="'.concat(c,'"'));var u=l.variableType;"string"==typeof u&&(o+=' variabletype="'.concat(u,'"'));var B=l.value;"string"==typeof B&&(B=g(l.value)),o+=">".concat(B,"</field>")}return i.next&&(o+="<next>".concat(this.blockToXML(i.next,e),"</next>")),o+="</".concat(t,">")}}},{key:"mutationToXML",value:function(A){var e="<".concat(A.tagName);for(var i in A)if("children"!==i&&"tagName"!==i){var t="string"==typeof A[i]?g(A[i]):A[i];"blockInfo"===i&&(t=g(JSON.stringify(A[i]))),e+=" ".concat(i,'="').concat(t,'"')}e+=">";for(var o=0;o<A.children.length;o++)e+=this.mutationToXML(A.children[o]);return e+="</".concat(A.tagName,">")}},{key:"_getBlockParams",value:function(A){var e={};for(var i in A.fields)e[i]=A.fields[i].value;for(var t in A.inputs){var o=this._blocks[A.inputs[t].block];for(var n in o.fields)e[n]=o.fields[n].value}return e}},{key:"_getCustomBlockInternal",value:function(A){if(A.inputs&&A.inputs.custom_block)return this._blocks[A.inputs.custom_block.block]}},{key:"_addScript",value:function(A){this._scripts.indexOf(A)>-1||(this._scripts.push(A),this._blocks[A].topLevel=!0)}},{key:"_deleteScript",value:function(A){var e=this._scripts.indexOf(A);e>-1&&this._scripts.splice(e,1),this._blocks[A]&&(this._blocks[A].topLevel=!1)}}],[{key:"BRANCH_INPUT_PREFIX",get:function(){return"SUBSTACK"}}]),A}();B.getCached=function(A,e,i){var t=A._cache._executeCached[e];if(void 0!==t)return t;var o=A.getBlock(e);return void 0===o?null:(t=void 0===i?{id:e,opcode:A.getOpcode(o),fields:A.getFields(o),inputs:A.getInputs(o),mutation:A.getMutation(o)}:new i(A,{id:e,opcode:A.getOpcode(o),fields:A.getFields(o),inputs:A.getInputs(o),mutation:A.getMutation(o)}),A._cache._executeCached[e]=t,t)};var m=d._RuntimeScriptCache;d.getScripts=function(A,e){var i=A._cache.scripts[e];if(!i){i=A._cache.scripts[e]=[];for(var t=A._scripts,o=0;o<t.length;o++){var n=t[o];A.getBlock(n).opcode===e&&i.push(new m(A,n))}}return i},A.exports=w},function(A,e,i){(function(e){function i(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}var t=function(){function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A.nowObj;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.startTime=0,this.nowObj=e}return function(A,e,t){e&&i(A.prototype,e),t&&i(A,t)}(A,[{key:"time",value:function(){return this.nowObj.now()}},{key:"relativeTime",value:function(){return this.nowObj.now()}},{key:"start",value:function(){this.startTime=this.nowObj.now()}},{key:"timeElapsed",value:function(){return this.nowObj.now()-this.startTime}},{key:"setTimeout",value:function(A,i){return e.setTimeout(A,i)}},{key:"clearTimeout",value:function(A){e.clearTimeout(A)}}],[{key:"USE_PERFORMANCE",get:function(){return!1}},{key:"legacyDateCode",get:function(){return{now:function(){return(new Date).getTime()}}}},{key:"nowObj",get:function(){return A.USE_PERFORMANCE&&"undefined"!=typeof self&&self.performance&&"now"in self.performance?self.performance:Date.now?Date:A.legacyDateCode}}]),A}();A.exports=t}).call(this,i(36))},function(A,e,i){"use strict";var t=i(243),o=Object.keys||function(A){var e=[];for(var i in A)e.push(i);return e};A.exports=c;var n=i(192);n.inherits=i(167);var a=i(486),r=i(324);n.inherits(c,a);for(var s=o(r.prototype),g=0;g<s.length;g++){var l=s[g];c.prototype[l]||(c.prototype[l]=r.prototype[l])}function c(A){if(!(this instanceof c))return new c(A);a.call(this,A),r.call(this,A),A&&!1===A.readable&&(this.readable=!1),A&&!1===A.writable&&(this.writable=!1),this.allowHalfOpen=!0,A&&!1===A.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",u)}function u(){this.allowHalfOpen||this._writableState.ended||t.nextTick(B,this)}function B(A){A.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(A){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=A,this._writableState.destroyed=A)}}),c.prototype._destroy=function(A,e){this.push(null),this.end(),t.nextTick(e,A)}},function(A,e){var i={}.hasOwnProperty;A.exports=function(A,e){return i.call(A,e)}},function(A,e,i){var t=i(130),o=i(253);A.exports=i(132)?function(A,e,i){return t.f(A,e,o(1,i))}:function(A,e,i){return A[e]=i,A}},function(A,e,i){var t=i(566),o=i(347);A.exports=function(A){return t(o(A))}},function(A,e,i){"use strict";i.d(e,"b",function(){return n}),i.d(e,"a",function(){return o}),i.d(e,"c",function(){return a});var t="scratch-gui/connection-modal/setId",o={extensionId:null},n=function(A,e){switch(void 0===A&&(A=o),e.type){case t:return Object.assign({},A,{extensionId:e.extensionId});default:return A}},a=function(A){return{type:t,extensionId:A}}},function(A,e,i){"use strict";function t(A,e){var i=Object.keys(A);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(A);e&&(t=t.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),i.push.apply(i,t)}return i}function o(A,e,i){return e in A?Object.defineProperty(A,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):A[e]=i,A}i.d(e,"a",function(){return a}),i.d(e,"c",function(){return n}),i.d(e,"d",function(){return r}),i.d(e,"b",function(){return s});var n={sprites:{},stage:{},highlightedTargetId:null,highlightedTargetTime:null},a=function(A,e){switch(void 0===A&&(A=n),e.type){case"scratch-gui/targets/UPDATE_TARGET_LIST":return Object.assign({},A,{sprites:e.targets.filter(function(A){return!A.isStage}).reduce(function(A,e,i){return Object.assign(A,o({},e.id,function(A){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?t(Object(i),!0).forEach(function(e){o(A,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(i,e))})}return A}({order:i},e)))},{}),stage:e.targets.filter(function(A){return A.isStage})[0]||{},editingTarget:e.editingTarget});case"scratch-gui/targets/HIGHLIGHT_TARGET":return Object.assign({},A,{highlightedTargetId:e.targetId,highlightedTargetTime:e.updateTime});default:return A}},r=function(A,e){return{type:"scratch-gui/targets/UPDATE_TARGET_LIST",targets:A,editingTarget:e}},s=function(A){return{type:"scratch-gui/targets/HIGHLIGHT_TARGET",targetId:A,updateTime:Date.now()}}},function(A,e,i){"undefined"!=typeof self&&self,A.exports=function(A){return function(A){function e(t){if(i[t])return i[t].exports;var o=i[t]={i:t,l:!1,exports:{}};return A[t].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var i={};return e.m=A,e.c=i,e.d=function(A,i,t){e.o(A,i)||Object.defineProperty(A,i,{configurable:!1,enumerable:!0,get:t})},e.n=function(A){var i=A&&A.__esModule?function(){return A.default}:function(){return A};return e.d(i,"a",i),i},e.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},e.p="",e(e.s=4)}([function(A,e,i){var t="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;A.exports=i(6)(function(A){return"object"==typeof A&&null!==A&&A.$$typeof===t},!0)},function(A,e,i){"use strict";A.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(A,e,i){"use strict";var t=/[A-Z]/g,o=/^ms-/,n={};A.exports=function(A){return A in n?n[A]:n[A]=A.replace(t,"-$&").toLowerCase().replace(o,"-ms-")}},function(A,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A},o=i(0),n=function(A){return A&&A.__esModule?A:{default:A}}(o),a=n.default.oneOfType([n.default.string,n.default.number]),r={orientation:n.default.oneOf(["portrait","landscape"]),scan:n.default.oneOf(["progressive","interlace"]),aspectRatio:n.default.string,deviceAspectRatio:n.default.string,height:a,deviceHeight:a,width:a,deviceWidth:a,color:n.default.bool,colorIndex:n.default.bool,monochrome:n.default.bool,resolution:a},s=t({minAspectRatio:n.default.string,maxAspectRatio:n.default.string,minDeviceAspectRatio:n.default.string,maxDeviceAspectRatio:n.default.string,minHeight:a,maxHeight:a,minDeviceHeight:a,maxDeviceHeight:a,minWidth:a,maxWidth:a,minDeviceWidth:a,maxDeviceWidth:a,minColor:n.default.number,maxColor:n.default.number,minColorIndex:n.default.number,maxColorIndex:n.default.number,minMonochrome:n.default.number,maxMonochrome:n.default.number,minResolution:a,maxResolution:a},r),g={all:n.default.bool,grid:n.default.bool,aural:n.default.bool,braille:n.default.bool,handheld:n.default.bool,print:n.default.bool,projection:n.default.bool,screen:n.default.bool,tty:n.default.bool,tv:n.default.bool,embossed:n.default.bool},l=t({},g,s);r.type=Object.keys(g),e.default={all:l,types:g,matchers:r,features:s},A.exports=e.default},function(A,e,i){"use strict";function t(A){return A&&A.__esModule?A:{default:A}}function o(A,e){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?A:e}function n(A,e){var i=r({},A);return e.forEach(function(A){return delete i[A]}),i}Object.defineProperty(e,"__esModule",{value:!0}),e.toQuery=e.default=void 0;var a=function(){function A(A,e){for(var i=0;i<e.length;i++){var t=e[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(A,t.key,t)}}return function(e,i,t){return i&&A(e.prototype,i),t&&A(e,t),e}}(),r=Object.assign||function(A){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(A[t]=i[t])}return A},s=i(5),g=t(s),l=i(0),c=t(l),u=i(9),B=t(u),d=i(2),E=t(d),h=i(3),C=t(h),w=i(11),m=t(w),p={component:c.default.node,query:c.default.string,values:c.default.shape(C.default.matchers),children:c.default.oneOfType([c.default.node,c.default.func]),onChange:c.default.func,onBeforeChange:c.default.func},I=Object.keys(C.default.all),f=Object.keys(p),Q=f.concat(I),D=function(A){function e(){var A,i,t;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var n=arguments.length,a=Array(n),r=0;r<n;r++)a[r]=arguments[r];return i=t=o(this,(A=e.__proto__||Object.getPrototypeOf(e)).call.apply(A,[this].concat(a))),t.state={matches:!1},t.updateMatches=function(){t._mql.matches!==t.state.matches&&t.setState({matches:t._mql.matches})},t.removeMql=function(){t._mql&&(t._mql.removeListener(t.updateMatches),t._mql.dispose())},o(t,i)}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(A,e):A.__proto__=e)}(e,A),a(e,[{key:"componentWillMount",value:function(){this.updateQuery(this.props)}},{key:"componentWillReceiveProps",value:function(A){this.updateQuery(A)}},{key:"updateQuery",value:function(A){var e=void 0,i=!1;if(A.query?this.query=A.query:this.query=(0,m.default)(n(A,f)),!this.query)throw new Error("Invalid or missing MediaQuery!");A.values&&(e=Object.keys(A.values).reduce(function(e,i){return e[(0,E.default)(i)]=A.values[i],e},{}),0!==Object.keys(e).length&&(i=!0)),this.removeMql(),this._mql=(0,B.default)(this.query,e,i),this._mql.addListener(this.updateMatches),this.updateMatches()}},{key:"componentWillUpdate",value:function(A,e){this.props.onBeforeChange&&this.state.matches!==e.matches&&this.props.onBeforeChange(this.state.matches)}},{key:"componentDidUpdate",value:function(A,e){this.props.onChange&&e.matches!==this.state.matches&&this.props.onChange(this.state.matches)}},{key:"componentWillUnmount",value:function(){this.removeMql()}},{key:"render",value:function(){if("function"==typeof this.props.children)return this.props.children(this.state.matches);if(!1===this.state.matches)return null;var A=n(this.props,Q),e=Object.keys(A).length>0,i=g.default.Children.count(this.props.children);return this.props.component||null==this.props.children||e&&i>1?g.default.createElement(this.props.component||"div",A,this.props.children):e?g.default.cloneElement(this.props.children,A):i?this.props.children:null}}]),e}(g.default.Component);D.displayName="MediaQuery",D.defaultProps={values:{}},e.default=D,e.toQuery=m.default},function(e,i){e.exports=A},function(A,e,i){"use strict";function t(){return null}var o=i(7),n=i(1),a=i(8),r=function(){};r=function(A){var e="Warning: "+A;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(A){}},A.exports=function(A,e){function i(A,e){return A===e?0!==A||1/A==1/e:A!=A&&e!=e}function s(A){this.message=A,this.stack=""}function g(A){function i(i,a,g,l,c,u,B){if(l=l||C,u=u||g,B!==n){if(e){var d=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 d.name="Invariant Violation",d}if("undefined"!=typeof console){var E=l+":"+g;!t[E]&&o<3&&(r("You are manually calling a React.PropTypes validation function for the `"+u+"` 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."),t[E]=!0,o++)}}return null==a[g]?i?new s(null===a[g]?"The "+c+" `"+u+"` is marked as required in `"+l+"`, but its value is `null`.":"The "+c+" `"+u+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:A(a,g,l,c,u)}var t={},o=0,a=i.bind(null,!1);return a.isRequired=i.bind(null,!0),a}function l(A){return g(function(e,i,t,o,n,a){var r=e[i];return u(r)!==A?new s("Invalid "+o+" `"+n+"` of type `"+B(r)+"` supplied to `"+t+"`, expected `"+A+"`."):null})}function c(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(c);if(null===e||A(e))return!0;var i=function(A){var e=A&&(E&&A[E]||A[h]);if("function"==typeof e)return e}(e);if(!i)return!1;var t,o=i.call(e);if(i!==e.entries){for(;!(t=o.next()).done;)if(!c(t.value))return!1}else for(;!(t=o.next()).done;){var n=t.value;if(n&&!c(n[1]))return!1}return!0;default:return!1}}function u(A){var e=typeof A;return Array.isArray(A)?"array":A instanceof RegExp?"object":function(A,e){return"symbol"===A||"Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol}(e,A)?"symbol":e}function B(A){if(void 0===A||null===A)return""+A;var e=u(A);if("object"===e){if(A instanceof Date)return"date";if(A instanceof RegExp)return"regexp"}return e}function d(A){var e=B(A);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}var E="function"==typeof Symbol&&Symbol.iterator,h="@@iterator",C="<<anonymous>>",w={array:l("array"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:g(t),arrayOf:function(A){return g(function(e,i,t,o,a){if("function"!=typeof A)return new s("Property `"+a+"` of component `"+t+"` has invalid PropType notation inside arrayOf.");var r=e[i];if(!Array.isArray(r))return new s("Invalid "+o+" `"+a+"` of type `"+u(r)+"` supplied to `"+t+"`, expected an array.");for(var g=0;g<r.length;g++){var l=A(r,g,t,o,a+"["+g+"]",n);if(l instanceof Error)return l}return null})},element:g(function(e,i,t,o,n){var a=e[i];return A(a)?null:new s("Invalid "+o+" `"+n+"` of type `"+u(a)+"` supplied to `"+t+"`, expected a single ReactElement.")}),instanceOf:function(A){return g(function(e,i,t,o,n){if(!(e[i]instanceof A)){var a=A.name||C;return new s("Invalid "+o+" `"+n+"` of type `"+function(A){return A.constructor&&A.constructor.name?A.constructor.name:C}(e[i])+"` supplied to `"+t+"`, expected instance of `"+a+"`.")}return null})},node:g(function(A,e,i,t,o){return c(A[e])?null:new s("Invalid "+t+" `"+o+"` supplied to `"+i+"`, expected a ReactNode.")}),objectOf:function(A){return g(function(e,i,t,o,a){if("function"!=typeof A)return new s("Property `"+a+"` of component `"+t+"` has invalid PropType notation inside objectOf.");var r=e[i],g=u(r);if("object"!==g)return new s("Invalid "+o+" `"+a+"` of type `"+g+"` supplied to `"+t+"`, expected an object.");for(var l in r)if(r.hasOwnProperty(l)){var c=A(r,l,t,o,a+"."+l,n);if(c instanceof Error)return c}return null})},oneOf:function(A){return Array.isArray(A)?g(function(e,t,o,n,a){for(var r=e[t],g=0;g<A.length;g++)if(i(r,A[g]))return null;return new s("Invalid "+n+" `"+a+"` of value `"+r+"` supplied to `"+o+"`, expected one of "+JSON.stringify(A)+".")}):(r("Invalid argument supplied to oneOf, expected an instance of array."),t)},oneOfType:function(A){if(!Array.isArray(A))return r("Invalid argument supplied to oneOfType, expected an instance of array."),t;for(var e=0;e<A.length;e++){var i=A[e];if("function"!=typeof i)return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+d(i)+" at index "+e+"."),t}return g(function(e,i,t,o,a){for(var r=0;r<A.length;r++)if(null==(0,A[r])(e,i,t,o,a,n))return null;return new s("Invalid "+o+" `"+a+"` supplied to `"+t+"`.")})},shape:function(A){return g(function(e,i,t,o,a){var r=e[i],g=u(r);if("object"!==g)return new s("Invalid "+o+" `"+a+"` of type `"+g+"` supplied to `"+t+"`, expected `object`.");for(var l in A){var c=A[l];if(c){var B=c(r,l,t,o,a+"."+l,n);if(B)return B}}return null})},exact:function(A){return g(function(e,i,t,a,r){var g=e[i],l=u(g);if("object"!==l)return new s("Invalid "+a+" `"+r+"` of type `"+l+"` supplied to `"+t+"`, expected `object`.");var c=o({},e[i],A);for(var B in c){var d=A[B];if(!d)return new s("Invalid "+a+" `"+r+"` key `"+B+"` supplied to `"+t+"`.\nBad object: "+JSON.stringify(e[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(A),null," "));var E=d(g,B,t,a,r+"."+B,n);if(E)return E}return null})}};return s.prototype=Error.prototype,w.checkPropTypes=a,w.PropTypes=w,w}},function(A,e,i){"use strict";
|
|
42
42
|
/*
|
|
43
43
|
object-assign
|
|
44
44
|
(c) Sindre Sorhus
|