Files
poc-provedor/html/blockly-games/pond/tutor/generated/pt-br/compressed.js

862 lines
422 KiB
JavaScript

// Automatically generated file. Do not edit!
'use strict';var b,h={g:{}};h.g.K=function(a,c){this.x=a;this.y=c};h.g.K.Ee=function(a,c){return a==c?!0:a&&c?a.x==c.x&&a.y==c.y:!1};h.g.K.bp=function(a,c){var d=a.x-c.x;a=a.y-c.y;return Math.sqrt(d*d+a*a)};h.g.K.QF=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};h.g.K.um=function(a,c){return new h.g.K(a.x-c.x,a.y-c.y)};h.g.K.sum=function(a,c){return new h.g.K(a.x+c.x,a.y+c.y)};h.g.K.prototype.scale=function(a){this.x*=a;this.y*=a;return this};
h.g.K.prototype.translate=function(a,c){this.x+=a;this.y+=c;return this};
h.NL={};h.Sv=40;h.dw=125;h.mB=5;h.vB=10;h.td=28;h.bB=h.td;h.eB=8;h.LB="#000000";h.Yn=250;h.Bq=10;h.ZA=30;h.$B=750;h.FC=100;h.nB=!0;h.HB=.45;h.IB=.65;h.ik={width:96,height:124,url:"sprites.png"};h.Wa=1;h.Te=2;h.jb=3;h.Ue=4;h.mg=5;h.xq=-1;h.jv=0;h.tl=1;h.rI=0;h.sI=1;h.pI=1;h.qI=2;h.fk=[];h.fk[h.Wa]=h.Te;h.fk[h.Te]=h.Wa;h.fk[h.jb]=h.Ue;h.fk[h.Ue]=h.jb;h.wg=0;h.kk=1;h.Yd=2;h.vg=3;h.Cv=null;h.Iq=1;h.Dv=2;h.vw="VARIABLE";h.WC="VARIABLE_DYNAMIC";h.ew="PROCEDURE";h.lw="RENAME_VARIABLE_ID";h.Ev="DELETE_VARIABLE_ID";h.g.global=function(){return"object"===typeof self?self:"object"===typeof window?window:"object"===typeof global?global:this}();
h.h={};h.g.global.Blockly||(h.g.global.Blockly={});h.g.global.Blockly.Msg||(h.g.global.Blockly.Msg=h.h);h.g.fb={};h.g.fb.startsWith=function(a,c){return 0==a.lastIndexOf(c,0)};h.g.fb.Mu=function(a){return a.length?a.reduce(function(c,d){return c.length<d.length?c:d}).length:0};h.g.fb.PD=function(a,c){if(!a.length)return 0;if(1==a.length)return a[0].length;var d=0;c=c||h.g.fb.Mu(a);for(var e=0;e<c;e++){for(var f=a[0][e],g=1;g<a.length;g++)if(f!=a[g][e])return d;" "==f&&(d=e+1)}for(g=1;g<a.length;g++)if((f=a[g][e])&&" "!=f)return d;return c};
h.g.fb.QD=function(a,c){if(!a.length)return 0;if(1==a.length)return a[0].length;var d=0;c=c||h.g.fb.Mu(a);for(var e=0;e<c;e++){for(var f=a[0].substr(-e-1,1),g=1;g<a.length;g++)if(f!=a[g].substr(-e-1,1))return d;" "==f&&(d=e+1)}for(g=1;g<a.length;g++)if((f=a[g].charAt(a[g].length-e-1))&&" "!=f)return d;return c};h.g.fb.wA=function(a,c){a=a.split("\n");for(var d=0;d<a.length;d++)a[d]=h.g.fb.CH(a[d],c);return a.join("\n")};
h.g.fb.CH=function(a,c){if(a.length<=c)return a;for(var d=a.trim().split(/\s+/),e=0;e<d.length;e++)d[e].length>c&&(c=d[e].length);e=-Infinity;var f=1;do{var g=e;var k=a;a=[];var l=d.length/f,m=1;for(e=0;e<d.length-1;e++)m<(e+1.5)/l?(m++,a[e]=!0):a[e]=!1;a=h.g.fb.xA(d,a,c);e=h.g.fb.dv(d,a,c);a=h.g.fb.DH(d,a);f++}while(e>g);return k};
h.g.fb.dv=function(a,c,d){for(var e=[0],f=[],g=0;g<a.length;g++)e[e.length-1]+=a[g].length,!0===c[g]?(e.push(0),f.push(a[g].charAt(a[g].length-1))):!1===c[g]&&e[e.length-1]++;a=Math.max.apply(Math,e);for(g=c=0;g<e.length;g++)c-=2*Math.pow(Math.abs(d-e[g]),1.5),c-=Math.pow(a-e[g],1.5),-1!=".?!".indexOf(f[g])?c+=d/3:-1!=",;)]}".indexOf(f[g])&&(c+=d/4);1<e.length&&e[e.length-1]<=e[e.length-2]&&(c+=.5);return c};
h.g.fb.xA=function(a,c,d){for(var e=h.g.fb.dv(a,c,d),f,g=0;g<c.length-1;g++)if(c[g]!=c[g+1]){var k=[].concat(c);k[g]=!k[g];k[g+1]=!k[g+1];var l=h.g.fb.dv(a,k,d);l>e&&(e=l,f=k)}return f?h.g.fb.xA(a,f,d):c};h.g.fb.DH=function(a,c){for(var d=[],e=0;e<a.length;e++)d.push(a[e]),void 0!==c[e]&&d.push(c[e]?"\n":" ");return d.join("")};h.g.Ve=function(a,c){this.width=a;this.height=c};h.g.Ve.Ee=function(a,c){return a==c?!0:a&&c?a.width==c.width&&a.height==c.height:!1};h.g.style={};h.g.style.Lg=function(a){if("none"!=h.g.style.oy(a,"display"))return h.g.style.ly(a);var c=a.style,d=c.display,e=c.visibility,f=c.position;c.visibility="hidden";c.position="absolute";c.display="inline";var g=a.offsetWidth;a=a.offsetHeight;c.display=d;c.position=f;c.visibility=e;return new h.g.Ve(g,a)};h.g.style.ly=function(a){return new h.g.Ve(a.offsetWidth,a.offsetHeight)};h.g.style.oy=function(a,c){return h.g.style.getComputedStyle(a,c)||h.g.style.PE(a,c)||a.style&&a.style[c]};
h.g.style.getComputedStyle=function(a,c){return document.defaultView&&document.defaultView.getComputedStyle&&(a=document.defaultView.getComputedStyle(a,null))?a[c]||a.getPropertyValue(c)||"":""};h.g.style.PE=function(a,c){return a.currentStyle?a.currentStyle[c]:null};h.g.style.pp=function(a){var c=new h.g.K(0,0);a=a.getBoundingClientRect();var d=document.documentElement;d=new h.g.K(window.pageXOffset||d.scrollLeft,window.pageYOffset||d.scrollTop);c.x=a.left+d.x;c.y=a.top+d.y;return c};
h.g.style.ty=function(){var a=document.body,c=document.documentElement;return new h.g.K(a.scrollLeft||c.scrollLeft,a.scrollTop||c.scrollTop)};h.g.style.Hu=function(a,c){a.style.display=c?"":"none"};h.g.style.Rk=function(){return"rtl"==h.g.style.oy(void 0,"direction")};
h.g.style.ME=function(a){var c=h.g.style.getComputedStyle(a,"borderLeftWidth"),d=h.g.style.getComputedStyle(a,"borderRightWidth"),e=h.g.style.getComputedStyle(a,"borderTopWidth");a=h.g.style.getComputedStyle(a,"borderBottomWidth");return{top:parseFloat(e),right:parseFloat(d),bottom:parseFloat(a),left:parseFloat(c)}};h.g.style.Eu=function(a,c){a=h.g.style.RE(a,c);c.scrollLeft=a.x;c.scrollTop=a.y};
h.g.style.RE=function(a,c){var d=h.g.style.pp(a),e=h.g.style.pp(c),f=h.g.style.ME(c),g=d.x-e.x-f.left;d=d.y-e.y-f.top;a=h.g.style.ly(a);e=c.clientHeight-a.height;f=c.scrollLeft;var k=c.scrollTop;f+=Math.min(g,Math.max(g-(c.clientWidth-a.width),0));k+=Math.min(d,Math.max(d-e,0));return new h.g.K(f,k)};h.g.userAgent={};
(function(a){function c(e){return-1!=d.indexOf(e.toUpperCase())}h.g.userAgent.raw=a;var d=h.g.userAgent.raw.toUpperCase();h.g.userAgent.og=c("Trident")||c("MSIE");h.g.userAgent.lo=c("Edge");h.g.userAgent.RB=c("JavaFX");h.g.userAgent.Fr=c("WebKit")&&!h.g.userAgent.lo;h.g.userAgent.Oq=c("Gecko")&&!h.g.userAgent.Fr&&!h.g.userAgent.og&&!h.g.userAgent.lo;h.g.userAgent.pi=c("Android");h.g.userAgent.qg=c("iPad");h.g.userAgent.Ov=c("iPod");h.g.userAgent.Rq=c("iPhone")&&!h.g.userAgent.qg&&!h.g.userAgent.Ov;
h.g.userAgent.cC=c("Macintosh");h.g.userAgent.OC=h.g.userAgent.qg||h.g.userAgent.pi&&!c("Mobile")||c("Silk");h.g.userAgent.Xv=!h.g.userAgent.OC&&(h.g.userAgent.Ov||h.g.userAgent.Rq||h.g.userAgent.pi||c("IEMobile"))})(h.g.global.navigator&&h.g.global.navigator.userAgent||"");
h.g.fG=function(a){a.preventDefault();a.stopPropagation()};h.g.Hp=function(a){return"textarea"==a.target.type||"text"==a.target.type||"number"==a.target.type||"email"==a.target.type||"password"==a.target.type||"search"==a.target.type||"tel"==a.target.type||"url"==a.target.type||a.target.isContentEditable};
h.g.He=function(a){var c=new h.g.K(0,0),d=a.getAttribute("x");d&&(c.x=parseInt(d,10));if(d=a.getAttribute("y"))c.y=parseInt(d,10);if(d=(d=a.getAttribute("transform"))&&d.match(h.g.He.bD))c.x+=Number(d[1]),d[3]&&(c.y+=Number(d[3]));(a=a.getAttribute("style"))&&-1<a.indexOf("translate")&&(a=a.match(h.g.He.cD))&&(c.x+=Number(a[1]),a[3]&&(c.y+=Number(a[3])));return c};
h.g.Gm=function(a){for(var c=0,d=0;a;){var e=h.g.He(a);c+=e.x;d+=e.y;if(-1!=(" "+(a.getAttribute("class")||"")+" ").indexOf(" injectionDiv "))break;a=a.parentNode}return new h.g.K(c,d)};h.g.He.bD=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/;h.g.He.cD=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/;h.g.mj=function(a){return a.ctrlKey&&h.g.userAgent.cC?!0:2==a.button};
h.g.fn=function(a,c,d){var e=c.createSVGPoint();e.x=a.clientX;e.y=a.clientY;d||(d=c.getScreenCTM().inverse());return e.matrixTransform(d)};h.g.ky=function(a){switch(a.deltaMode){case 0:return{x:a.deltaX,y:a.deltaY};case 1:return{x:a.deltaX*h.Sv,y:a.deltaY*h.Sv};case 2:return{x:a.deltaX*h.dw,y:a.deltaY*h.dw}}};h.g.kH=function(a){return h.g.Wu(a,!0)};h.g.le=function(a){if("string"!=typeof a)return a;a=h.g.Wu(a,!1);return a.length?a[0]:""};
h.g.Qw=function(a){for(var c=h.h,d=a.match(/%{BKY_[A-Z]\w*}/ig),e=0;e<d.length;e++)void 0==c[d[e].toUpperCase().slice(6,-1)]&&console.log("WARNING: No message string for "+d[e]+" in "+a)};
h.g.Wu=function(a,c){var d=[],e=a.split("");e.push("");var f=0;a=[];for(var g=null,k=0;k<e.length;k++){var l=e[k];0==f?"%"==l?((l=a.join(""))&&d.push(l),a.length=0,f=1):a.push(l):1==f?"%"==l?(a.push(l),f=0):c&&"0"<=l&&"9">=l?(f=2,g=l,(l=a.join(""))&&d.push(l),a.length=0):"{"==l?f=3:(a.push("%",l),f=0):2==f?"0"<=l&&"9">=l?g+=l:(d.push(parseInt(g,10)),k--,f=0):3==f&&(""==l?(a.splice(0,0,"%{"),k--,f=0):"}"!=l?a.push(l):(f=a.join(""),/[A-Z]\w*/i.test(f)?(l=f.toUpperCase(),(l=h.g.fb.startsWith(l,"BKY_")?
l.substring(4):null)&&l in h.h?(f=h.h[l],"string"==typeof f?Array.prototype.push.apply(d,h.g.Wu(f,c)):c?d.push(String(f)):d.push(f)):d.push("%{"+f+"}")):d.push("%{"+f+"}"),f=a.length=0))}(l=a.join(""))&&d.push(l);c=[];for(k=a.length=0;k<d.length;++k)"string"==typeof d[k]?a.push(d[k]):((l=a.join(""))&&c.push(l),a.length=0,c.push(d[k]));(l=a.join(""))&&c.push(l);a.length=0;return c};h.g.Jg=function(){for(var a=h.g.Jg.cA.length,c=[],d=0;20>d;d++)c[d]=h.g.Jg.cA.charAt(Math.random()*a);return c.join("")};
h.g.Jg.cA="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
h.g.hj=function(){if(void 0!==h.g.hj.Zr)return h.g.hj.Zr;if(!h.g.global.getComputedStyle)return!1;var a=document.createElement("p"),c="none",d={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(a,null);for(var e in d)if(void 0!==a.style[e]){a.style[e]="translate3d(1px,1px,1px)";c=h.g.global.getComputedStyle(a);if(!c)return document.body.removeChild(a),!1;c=c.getPropertyValue(d[e])}document.body.removeChild(a);
h.g.hj.Zr="none"!==c;return h.g.hj.Zr};h.g.Tz=function(a){if("object"!=typeof document)throw Error("Blockly.utils.runAfterPageLoad() requires browser document.");if("complete"==document.readyState)a();else var c=setInterval(function(){"complete"==document.readyState&&(clearInterval(c),a())},10)};h.g.bF=function(){var a=h.g.style.ty();return{right:document.documentElement.clientWidth+a.x,bottom:document.documentElement.clientHeight+a.y,top:a.y,left:a.x}};
h.g.Ko=function(a,c){c=a.indexOf(c);if(-1==c)return!1;a.splice(c,1);return!0};h.g.VE=function(){var a=document.documentElement,c=window;return h.g.userAgent.og&&c.pageYOffset!=a.scrollTop?new h.g.K(a.scrollLeft,a.scrollTop):new h.g.K(c.pageXOffset||a.scrollLeft,c.pageYOffset||a.scrollTop)};h.g.Us=function(a,c){var d=Object.create(null),e=p(a,!0);c&&(a=q(a))&&(a=e.indexOf(a),e.splice(a,e.length-a));for(a=0;c=e[a];a++)d[c.type]?d[c.type]++:d[c.type]=1;return d};
h.g.QG=function(a,c){var d=c.x;c=c.y;var e=ba(a).getBoundingClientRect();d=new h.g.K(d-e.left,c-e.top);c=h.g.Gm(a.pb);return h.g.K.um(d,c).scale(1/a.scale)};h.i={};h.i.xy="";h.i.Dc=!0;h.i.ws=0;h.i.fo="create";h.i.vl=h.i.fo;h.i.yl="delete";h.i.Wn=h.i.yl;h.i.si="change";h.i.QH=h.i.si;h.i.Hl="move";h.i.qv=h.i.Hl;h.i.ww="var_create";h.i.xw="var_delete";h.i.yw="var_rename";h.i.Io="ui";h.i.bo="comment_create";h.i.xv="comment_delete";h.i.wv="comment_change";h.i.co="comment_move";h.i.uB="finished_loading";h.i.RA=[h.i.vl,h.i.qv,h.i.bo,h.i.co];h.i.Al=[];h.i.Ka=function(a){h.i.isEnabled()&&(h.i.Al.length||setTimeout(h.i.FE,0),h.i.Al.push(a))};
h.i.FE=function(){for(var a=h.i.filter(h.i.Al,!0),c=h.i.Al.length=0,d;d=a[c];c++)if(d.tc){var e=h.Ib.Ws(d.tc);if(e){var f=d;if(f.Dc)for(e.Nj.push(f),e.on.length=0;e.Nj.length>e.Uv&&0<=e.Uv;)e.Nj.shift();for(var g=0;d=e.zd[g];g++)d(f)}}};
h.i.filter=function(a,c){a=a.slice();c||a.reverse();for(var d=[],e=Object.create(null),f=0,g;g=a[f];f++)if(!g.Pk()){var k=[g.type,g.wc,g.tc].join(" "),l=e[k],m=l?l.event:null;if(!l)e[k]={event:g,index:f},d.push(g);else if(g.type==h.i.Hl&&l.index==f-1)m.uj=g.uj,m.tj=g.tj,m.Vh=g.Vh,l.index=f;else if(g.type==h.i.si&&g.element==m.element&&g.name==m.name)m.newValue=g.newValue;else if(g.type!=h.i.Io||"click"!=g.element||"commentOpen"!=m.element&&"mutatorOpen"!=m.element&&"warningOpen"!=m.element)e[k]={event:g,
index:1},d.push(g)}a=d.filter(function(n){return!n.Pk()});c||a.reverse();for(f=1;g=a[f];f++)g.type==h.i.si&&"mutation"==g.element&&a.unshift(a.splice(f,1)[0]);return a};h.i.LD=function(){for(var a=0,c;c=h.i.Al[a];a++)c.Dc=!1};h.i.disable=function(){h.i.ws++};h.i.enable=function(){h.i.ws--};h.i.isEnabled=function(){return 0==h.i.ws};h.i.Zb=function(){return h.i.xy};h.i.$=function(a){h.i.xy="boolean"==typeof a?a?h.g.Jg():"":a};
h.i.$x=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++)c[d]=e.id;return c};
h.i.va=function(a){switch(a.type){case h.i.fo:var c=new h.i.Re(null);break;case h.i.yl:c=new h.i.wf(null);break;case h.i.si:c=new h.i.bh(null,"","","","");break;case h.i.Hl:c=new h.i.Bi(null);break;case h.i.ww:c=new h.i.ze(null);break;case h.i.xw:c=new h.i.We(null);break;case h.i.yw:c=new h.i.Bf(null,"");break;case h.i.Io:c=new h.i.ud(null,"","","");break;case h.i.bo:c=new h.i.kg(null);break;case h.i.wv:c=new h.i.Xj(null,"","");break;case h.i.co:c=new h.i.ti(null);break;case h.i.xv:c=new h.i.lg(null);
break;default:throw Error("Unknown event type.");}c.va(a);c.tc=(void 0).id;return c};h.i.oE=function(a){if((a.type==h.i.Hl||a.type==h.i.fo)&&a.tc){var c=h.Ib.Ws(a.tc);if(a=r(c,a.wc)){var d=a.getParent();if(d&&d.isEnabled())for(c=p(a,!1),a=0;d=c[a];a++)d.md(!0);else if((a.M||a.Z)&&!c.gc()){do a.md(!1),a=q(a);while(a)}}}};
h.i.Abstract=function(){this.tc=void 0;this.group=h.i.Zb();this.Dc=h.i.Dc};h.i.Abstract.prototype.Za=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};h.i.Abstract.prototype.va=function(a){this.group=a.group};h.i.Abstract.prototype.Pk=function(){return!1};h.i.Abstract.prototype.run=function(){};function v(a){if(a.tc)var c=h.Ib.Ws(a.tc);if(!c)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return c};h.g.object={};h.g.object.W=function(a,c){a.w=c.prototype;a.prototype=Object.create(c.prototype);a.prototype.constructor=a};h.g.object.rj=function(a,c){for(var d in c)a[d]=c[d]};h.g.object.values=function(a){return Object.values?Object.values(a):Object.keys(a).map(function(c){return a[c]})};h.i.ud=function(a,c,d,e){h.i.ud.w.constructor.call(this);this.wc=a?a.id:null;this.tc=a?a.v.id:void 0;this.element=c;this.oldValue=d;this.newValue=e;this.Dc=!1};h.g.object.W(h.i.ud,h.i.Abstract);h.i.ud.prototype.type=h.i.Io;h.i.ud.prototype.Za=function(){var a=h.i.ud.w.Za.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.wc&&(a.blockId=this.wc);return a};
h.i.ud.prototype.va=function(a){h.i.ud.w.va.call(this,a);this.element=a.element;this.newValue=a.newValue;this.wc=a.blockId};h.g.o={};h.g.o.Ql="http://www.w3.org/2000/svg";h.g.o.zi="http://www.w3.org/1999/xhtml";h.g.o.Mi="http://www.w3.org/1999/xlink";h.g.o.Node={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_POSITION_CONTAINED_BY:16};h.g.o.Pi=null;h.g.o.Xr=0;h.g.o.L=function(a,c,d){a=document.createElementNS(h.g.o.Ql,a);for(var e in c)a.setAttribute(e,c[e]);document.body.runtimeStyle&&(a.runtimeStyle=a.currentStyle=a.style);d&&d.appendChild(a);return a};
h.g.o.Cb=function(a,c){var d=a.getAttribute("class")||"";if(-1!=(" "+d+" ").indexOf(" "+c+" "))return!1;d&&(d+=" ");a.setAttribute("class",d+c);return!0};h.g.o.Ec=function(a,c){var d=a.getAttribute("class");if(-1==(" "+d+" ").indexOf(" "+c+" "))return!1;d=d.split(/\s+/);for(var e=0;e<d.length;e++)d[e]&&d[e]!=c||(d.splice(e,1),e--);d.length?a.setAttribute("class",d.join(" ")):a.removeAttribute("class");return!0};h.g.o.Ay=function(a,c){return-1!=(" "+a.getAttribute("class")+" ").indexOf(" "+c+" ")};
h.g.o.removeNode=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null};h.g.o.gj=function(a,c){var d=c.nextSibling;c=c.parentNode;if(!c)throw Error("Reference node has no parent.");d?c.insertBefore(a,d):c.appendChild(a)};h.g.o.containsNode=function(a,c){return!!(a.compareDocumentPosition(c)&h.g.o.Node.DOCUMENT_POSITION_CONTAINED_BY)};h.g.o.vn=function(a,c){a.style.transform=c;a.style["-webkit-transform"]=c};h.g.o.Dn=function(){h.g.o.Xr++;h.g.o.Pi||(h.g.o.Pi={})};
h.g.o.En=function(){h.g.o.Xr--;h.g.o.Xr||(h.g.o.Pi=null)};h.g.o.ct=function(a){var c=a.textContent+"\n"+a.className.baseVal,d;if(h.g.o.Pi&&(d=h.g.o.Pi[c]))return d;try{d=h.g.userAgent.og||h.g.userAgent.lo?a.getBBox().width:a.getComputedTextLength()}catch(e){return 8*a.textContent.length}h.g.o.Pi&&(h.g.o.Pi[c]=d);return d};h.vv=function(a){this.km=a;this.Oa()};b=h.vv.prototype;b.tb=null;b.df=null;b.km=null;b.gi=1;b.Fn=null;b.Oa=function(){this.tb||(this.tb=h.g.o.L("svg",{xmlns:h.g.o.Ql,"xmlns:html":h.g.o.zi,"xmlns:xlink":h.g.o.Mi,version:"1.1","class":"blocklyBlockDragSurface"},this.km),this.df=h.g.o.L("g",{},this.tb))};function ca(a,c){if(a.df.childNodes.length)throw Error("Already dragging a block.");a.df.appendChild(c);a.tb.style.display="block";a.Fn=new h.g.K(0,0)}
b.Mj=function(a,c){this.Fn=new h.g.K(a*this.gi,c*this.gi);a=this.Fn.x;c=this.Fn.y;a=a.toFixed(0);c=c.toFixed(0);this.tb.style.display="block";h.g.o.vn(this.tb,"translate3d("+a+"px, "+c+"px, 0px)")};b.bt=function(){var a=h.g.He(this.tb);return new h.g.K(a.x/this.gi,a.y/this.gi)};b.Zb=function(){return this.df};
b.Oo=function(a){a?a.appendChild(this.df.firstChild):this.df.removeChild(this.df.firstChild);this.tb.style.display="none";if(this.df.childNodes.length)throw Error("Drag group was not cleared.");this.Fn=null};h.g.so={};h.g.so.eG=0;h.g.so.ZE=function(){return"blockly:"+(h.g.so.eG++).toString(36)};h.uc=function(){this.Sz=h.uc.sx;this.Lk=null;this.Yc=!1;this.Qd=this.hb=null;this.kb=[];this.bs={}};h.uc.sx=!1;h.uc.Error={yq:"Component already rendered",hr:"Unable to set parent component",XA:"Child component index out of bounds"};b=h.uc.prototype;b.ua=function(){return this.Lk||(this.Lk=h.g.so.ZE())};b.ta=function(){return this.hb};
b.cl=function(a){if(this==a)throw Error(h.uc.Error.hr);var c;if(c=a&&this.Qd&&this.Lk)c=(c=this.Lk)?this.Qd.bs[c]||null:null;if(c&&this.Qd!=a)throw Error(h.uc.Error.hr);this.Qd=a};b.getParent=function(){return this.Qd};b.Oa=function(){this.hb=document.createElement("div")};b.za=function(a){this.Yf(a)};b.Yf=function(a,c){if(this.Yc)throw Error(h.uc.Error.yq);this.hb||this.Oa();a?a.insertBefore(this.hb,c||null):document.body.appendChild(this.hb);this.Qd&&!this.Qd.Yc||this.ff()};
b.ff=function(){this.Yc=!0;da(this,function(a){!a.Yc&&a.ta()&&a.ff()})};b.zh=function(){da(this,function(a){a.Yc&&a.zh()});this.Yc=!1};b.I=function(){this.tE||(this.tE=!0,this.vm())};b.vm=function(){this.Yc&&this.zh();da(this,function(a){a.I()});this.hb&&h.g.o.removeNode(this.hb);this.Qd=this.hb=this.bs=this.kb=null};
b.Zl=function(a,c,d){if(a.Yc&&(d||!this.Yc))throw Error(h.uc.Error.yq);if(0>c||c>this.kb.length)throw Error(h.uc.Error.XA);this.bs[a.ua()]=a;if(a.getParent()==this){var e=this.kb.indexOf(a);-1<e&&this.kb.splice(e,1)}a.cl(this);this.kb.splice(c,0,a);a.Yc&&this.Yc&&a.getParent()==this?(d=this.hb,c=d.childNodes[c]||null,c!=a.ta()&&d.insertBefore(a.ta(),c)):d?(this.hb||this.Oa(),c=this.kb[c+1]||null,a.Yf(this.hb,c?c.hb:null)):this.Yc&&!a.Yc&&a.hb&&a.hb.parentNode&&a.hb.parentNode.nodeType==h.g.o.Node.ELEMENT_NODE&&
a.ff()};b.Rk=function(){return this.Sz};function ea(a,c){if(a.Yc)throw Error(h.uc.Error.yq);a.Sz=c}function fa(a){return 0!=a.kb.length}function da(a,c,d){for(var e=0;e<a.kb.length;e++)c.call(d,a.kb[e],e)};h.Ed={};h.Ed.st=!1;h.Ed.register=function(a){if(h.Ed.st)throw Error("CSS already injected");Array.prototype.push.apply(h.Ed.Eq,a);a.length=0};h.Ed.Kh=function(a,c){if(!h.Ed.st){h.Ed.st=!0;var d=h.Ed.Eq.join("\n");h.Ed.Eq.length=0;a&&(a=c.replace(/[\\/]$/,""),d=d.replace(/<<<PATH>>>/g,a),a=document.createElement("style"),d=document.createTextNode(d),a.appendChild(d),document.head.insertBefore(a,document.head.firstChild))}};h.Ed.Fu=function(){console.warn("Deprecated call to Blockly.Css.setCursor. See https://github.com/google/blockly/issues/981 for context")};
h.Ed.Eq=[".blocklySvg {","background-color: #fff;","outline: none;","overflow: hidden;","position: absolute;","display: block;","}",".blocklyWidgetDiv {","display: none;","position: absolute;","z-index: 99999;","}",".injectionDiv {","height: 100%;","position: relative;","overflow: hidden;","touch-action: none;","}",".blocklyNonSelectable {","user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","}",".blocklyWsDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;",
"}",".blocklyWsDragSurface.blocklyOverflowVisible {","overflow: visible;","}",".blocklyBlockDragSurface {","display: none;","position: absolute;","top: 0;","left: 0;","right: 0;","bottom: 0;","overflow: visible !important;","z-index: 50;","}",".blocklyBlockCanvas.blocklyCanvasTransitioning,",".blocklyBubbleCanvas.blocklyCanvasTransitioning {","transition: transform .5s;","}",".blocklyTooltipDiv {","background-color: #ffffc7;","border: 1px solid #ddc;","box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);",
"color: #000;","display: none;","font-family: sans-serif;","font-size: 9pt;","opacity: .9;","padding: 2px;","position: absolute;","z-index: 100000;","}",".blocklyDropDownDiv {","position: fixed;","left: 0;","top: 0;","z-index: 1000;","display: none;","border: 1px solid;","border-radius: 2px;","padding: 4px;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownContent {","max-height: 300px;","overflow: auto;",
"overflow-x: hidden;","}",".blocklyDropDownArrow {","position: absolute;","left: 0;","top: 0;","width: 16px;","height: 16px;","z-index: -1;","background-color: inherit;","border-color: inherit;","}",".blocklyDropDownButton {","display: inline-block;","float: left;","padding: 0;","margin: 4px;","border-radius: 4px;","outline: none;","border: 1px solid;","transition: box-shadow .1s;","cursor: pointer;","}",".arrowTop {","border-top: 1px solid;","border-left: 1px solid;","border-top-left-radius: 4px;",
"border-color: inherit;","}",".arrowBottom {","border-bottom: 1px solid;","border-right: 1px solid;","border-bottom-right-radius: 4px;","border-color: inherit;","}",".blocklyResizeSE {","cursor: se-resize;","fill: #aaa;","}",".blocklyResizeSW {","cursor: sw-resize;","fill: #aaa;","}",".blocklyResizeLine {","stroke: #515A5A;","stroke-width: 1;","}",".blocklyHighlightedConnectionPath {","fill: none;","stroke: #fc3;","stroke-width: 4px;","}",".blocklyPathLight {","fill: none;","stroke-linecap: round;",
"stroke-width: 1;","}",".blocklySelected>.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",".blocklySelected>.blocklyPathLight {","display: none;","}",".blocklyDraggable {",'cursor: url("<<<PATH>>>/handopen.cur"), auto;',"cursor: grab;","cursor: -webkit-grab;","}",".blocklyDragging {",'cursor: url("<<<PATH>>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDraggable:active {",'cursor: url("<<<PATH>>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;",
"}",".blocklyBlockDragSurface .blocklyDraggable {",'cursor: url("<<<PATH>>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyDragging.blocklyDraggingDelete {",'cursor: url("<<<PATH>>>/handdelete.cur"), auto;',"}",".blocklyDragging>.blocklyPath,",".blocklyDragging>.blocklyPathLight {","fill-opacity: .8;","stroke-opacity: .8;","}",".blocklyDragging>.blocklyPathDark {","display: none;","}",".blocklyDisabled>.blocklyPath {","fill-opacity: .5;","stroke-opacity: .5;",
"}",".blocklyDisabled>.blocklyPathLight,",".blocklyDisabled>.blocklyPathDark {","display: none;","}",".blocklyInsertionMarker>.blocklyPath,",".blocklyInsertionMarker>.blocklyPathLight,",".blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: .2;","stroke: none","}",".blocklyReplaceable .blocklyPath {","fill-opacity: .5;","}",".blocklyReplaceable .blocklyPathLight,",".blocklyReplaceable .blocklyPathDark {","display: none;","}",".blocklyText {","cursor: default;","fill: #fff;","font-family: sans-serif;",
"font-size: 11pt;","}",".blocklyMultilineText {","font-family: monospace;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyNonEditableText>rect,",".blocklyEditableText>rect {","fill: #fff;","fill-opacity: .6;","}",".blocklyNonEditableText>text,",".blocklyEditableText>text {","fill: #000;","}",".blocklyEditableText:hover>rect {","stroke: #fff;","stroke-width: 2;","}",".blocklyBubbleText {","fill: #000;","}",".blocklyFlyout {","position: absolute;","z-index: 20;","}",".blocklySvg text, .blocklyBlockDragSurface text {",
"user-select: none;","-ms-user-select: none;","-webkit-user-select: none;","cursor: inherit;","}",".blocklyHidden {","display: none;","}",".blocklyFieldDropdown:not(.blocklyHidden) {","display: block;","}",".blocklyIconGroup {","cursor: default;","}",".blocklyIconGroup:not(:hover),",".blocklyIconGroupReadonly {","opacity: .6;","}",".blocklyIconShape {","fill: #00f;","stroke: #fff;","stroke-width: 1px;","}",".blocklyIconSymbol {","fill: #fff;","}",".blocklyMinimalBody {","margin: 0;","padding: 0;",
"}",".blocklyCommentForeignObject {","position: relative;","z-index: 0;","}",".blocklyCommentRect {","fill: #E7DE8E;","stroke: #bcA903;","stroke-width: 1px","}",".blocklyCommentTarget {","fill: transparent;","stroke: #bcA903;","}",".blocklyCommentTargetFocused {","fill: none;","}",".blocklyCommentHandleTarget {","fill: none;","}",".blocklyCommentHandleTargetFocused {","fill: transparent;","}",".blocklyFocused>.blocklyCommentRect {","fill: #B9B272;","stroke: #B9B272;","}",".blocklySelected>.blocklyCommentTarget {",
"stroke: #fc3;","stroke-width: 3px;","}",".blocklyCommentTextarea {","background-color: #fef49c;","border: 0;","outline: 0;","margin: 0;","padding: 3px;","resize: none;","display: block;","overflow: hidden;","}",".blocklyCommentDeleteIcon {","cursor: pointer;","fill: #000;","display: none","}",".blocklySelected > .blocklyCommentDeleteIcon {","display: block","}",".blocklyDeleteIconShape {","fill: #000;","stroke: #000;","stroke-width: 1px;","}",".blocklyDeleteIconShape.blocklyDeleteIconHighlighted {",
"stroke: #fc3;","}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","font-family: sans-serif;","height: 100%;","margin: 0;","outline: none;","padding: 0;","width: 100%;","text-align: center;","}",".blocklyHtmlInput::-ms-clear {","display: none;","}",".blocklyMainBackground {","stroke-width: 1;","stroke: #c6c6c6;","}",".blocklyMutatorBackground {","fill: #fff;","stroke: #ddd;","stroke-width: 1;","}",".blocklyFlyoutBackground {","fill: #ddd;","fill-opacity: .8;","}",".blocklyMainWorkspaceScrollbar {",
"z-index: 20;","}",".blocklyFlyoutScrollbar {","z-index: 30;","}",".blocklyScrollbarHorizontal, .blocklyScrollbarVertical {","position: absolute;","outline: none;","}",".blocklyScrollbarBackground {","opacity: 0;","}",".blocklyScrollbarHandle {","fill: #ccc;","}",".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",".blocklyScrollbarHandle:hover {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarHandle {","fill: #bbb;","}",".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,",
".blocklyFlyout .blocklyScrollbarHandle:hover {","fill: #aaa;","}",".blocklyInvalidInput {","background: #faa;","}",".blocklyContextMenu {","border-radius: 4px;","max-height: 100%;","}",".blocklyDropdownMenu {","border-radius: 2px;","padding: 0 !important;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem {","padding-left: 28px;","}",".blocklyWidgetDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl,",".blocklyDropDownDiv .blocklyDropdownMenu .goog-menuitem.goog-menuitem-rtl {",
"padding-left: 5px;","padding-right: 28px;","}",".blocklyVerticalCursor {","stroke-width: 3px;","fill: rgba(255,255,255,.5);","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px;","}",".blocklyWidgetDiv .goog-menu {","background: #fff;",
"border-color: transparent;","border-style: solid;","border-width: 1px;","cursor: default;","font: normal 13px Arial, sans-serif;","margin: 0;","outline: none;","padding: 4px 0;","position: absolute;","overflow-y: auto;","overflow-x: hidden;","max-height: 100%;","z-index: 20000;","box-shadow: 0px 0px 3px 1px rgba(0,0,0,.3);","}",".blocklyWidgetDiv .goog-menu.focused {","box-shadow: 0px 0px 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv .goog-menu {","cursor: default;",'font: normal 13px "Helvetica Neue", Helvetica, sans-serif;',
"outline: none;","z-index: 20000;","}",".blocklyWidgetDiv .goog-menuitem,",".blocklyDropDownDiv .goog-menuitem {","color: #000;","font: normal 13px Arial, sans-serif;","list-style: none;","margin: 0;","min-width: 7em;","border: none;","padding: 6px 15px;","white-space: nowrap;","cursor: pointer;","}",".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem,",".blocklyDropDownDiv .goog-menu-nocheckbox .goog-menuitem,",".blocklyDropDownDiv .goog-menu-noicon .goog-menuitem {",
"padding-left: 12px;","}",".blocklyWidgetDiv .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-content {","font: normal 13px Arial, sans-serif;","}",".blocklyWidgetDiv .goog-menuitem-content {","color: #000;","}",".blocklyDropDownDiv .goog-menuitem-content {","color: #000;","}",".blocklyWidgetDiv .goog-menuitem-disabled,",".blocklyDropDownDiv .goog-menuitem-disabled {","cursor: inherit;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-content {",
"color: #ccc !important;","}",".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-disabled .goog-menuitem-icon {","opacity: .3;","filter: alpha(opacity=30);","}",".blocklyWidgetDiv .goog-menuitem-highlight ,",".blocklyDropDownDiv .goog-menuitem-highlight {","background-color: rgba(0,0,0,.1);","}",".blocklyWidgetDiv .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-icon {",
"background-repeat: no-repeat;","height: 16px;","left: 6px;","position: absolute;","right: auto;","vertical-align: middle;","width: 16px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","left: auto;","right: 6px;","}",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon,",
".blocklyDropDownDiv .goog-option-selected .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-option-selected .goog-menuitem-icon {","position: static;","float: left;","margin-left: -24px;","}",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-checkbox,",".blocklyDropDownDiv .goog-menuitem-rtl .goog-menuitem-icon {","float: right;","margin-right: -24px;","}"];h.g.Ha={};h.g.Ha.nd=function(a){return a*Math.PI/180};h.g.Ha.ll=function(a){return 180*a/Math.PI};h.g.Ha.Ef=function(a,c,d){if(d<a){var e=d;d=a;a=e}return Math.max(a,Math.min(c,d))};
h.D=function(){};h.D.se=null;h.D.Ur=null;h.D.ld=null;h.D.Up=null;h.D.Vn=16;h.D.uv=1;h.D.ov=12;h.D.cw=16;h.D.zq=.25;h.D.Av="#dadce0";h.D.Bv="#fff";h.D.Kr=null;h.D.xj=null;
h.D.Oa=function(){if(!h.D.se){var a=document.createElement("div");a.className="blocklyDropDownDiv";a.style.backgroundColor=h.D.Bv;a.style.borderColor=h.D.Av;document.body.appendChild(a);h.D.se=a;var c=document.createElement("div");c.className="blocklyDropDownContent";a.appendChild(c);h.D.af=c;c=document.createElement("div");c.className="blocklyDropDownArrow";a.appendChild(c);h.D.Xe=c;h.D.se.style.opacity=0;h.D.se.style.transition="transform "+h.D.zq+"s, opacity "+h.D.zq+"s";a.addEventListener("focusin",
function(){h.g.o.Cb(a,"focused")});a.addEventListener("focusout",function(){h.g.o.Ec(a,"focused")})}};h.D.Vz=function(a){h.D.Ur=a};h.D.Zx=function(){return h.D.af};h.D.KD=function(){h.D.af.innerHTML="";h.D.af.style.width=""};h.D.Fc=function(a,c){h.D.se.style.backgroundColor=a;h.D.se.style.borderColor=c};h.D.pM=function(a){h.D.se.setAttribute("data-category",a)};
h.D.rM=function(a,c,d,e){var f=c.v.scale,g=c.width,k=c.height;g*=f;k*=f;f=c.ya().getBoundingClientRect();g=f.left+g/2;k=f.top+k;f=f.top;e&&(f+=e);h.D.Vz(x(c.v).parentNode);return h.D.show(a,c.G,g,k,g,f,d)};h.D.bA=function(a,c){var d=a.ya().getBoundingClientRect(),e=d.left+d.width/2,f=d.bottom;d=d.top;var g=a.B;h.D.Up=!0;h.D.Vz(x(g.v).parentNode);h.D.show(a,g.G,e,f,e,d,c)};
h.D.show=function(a,c,d,e,f,g,k){h.D.ld=a;h.D.xj=k||null;a=h.D.jy(d,e,f,g);a.Mr?(h.D.Xe.style.display="",h.D.Xe.style.transform="translate("+a.am+"px,"+a.Hw+"px) rotate(45deg)",h.D.Xe.setAttribute("class",a.Lr?"blocklyDropDownArrow arrowTop":"blocklyDropDownArrow arrowBottom")):h.D.Xe.style.display="none";h.D.se.style.direction=c?"rtl":"ltr";h.D.ln(a.yp,a.zp,a.hp,a.ip);return a.Lr};
h.D.NE=function(){var a=h.D.Ur.getBoundingClientRect(),c=h.g.style.Lg(h.D.Ur);return{left:a.left,right:a.left+c.width,top:a.top,bottom:a.top+c.height,width:c.width,height:c.height}};h.D.jy=function(a,c,d,e){var f=h.D.NE(),g=h.g.style.Lg(h.D.se);return c+g.height<f.bottom?h.D.iy(a,c,f,g):e-g.height>f.top?h.D.gy(d,e,f,g):c+g.height<document.documentElement.clientHeight?h.D.iy(a,c,f,g):e-g.height>document.documentElement.clientTop?h.D.gy(d,e,f,g):h.D.$E(a,f,g)};
h.D.iy=function(a,c,d,e){a=h.D.$s(a,d.left,d.right,e.width);return{yp:a.Ak,zp:c,hp:a.Ak,ip:c+h.D.cw,am:a.am,Hw:-(h.D.Vn/2+h.D.uv),Lr:!0,Mr:!0}};h.D.gy=function(a,c,d,e){a=h.D.$s(a,d.left,d.right,e.width);return{yp:a.Ak,zp:c-e.height,hp:a.Ak,ip:c-e.height-h.D.cw,am:a.am,Hw:e.height-2*h.D.uv-h.D.Vn/2,Lr:!1,Mr:!0}};h.D.$E=function(a,c,d){a=h.D.$s(a,c.left,c.right,d.width);return{yp:a.Ak,zp:0,hp:a.Ak,ip:0,Mr:!1}};
h.D.$s=function(a,c,d,e){var f=a;a=h.g.Ha.Ef(c,a-e/2,d-e);f-=h.D.Vn/2;c=h.g.Ha.Ef(h.D.ov,f-a,e-h.D.ov-h.D.Vn);return{am:c,Ak:a}};h.D.isVisible=function(){return!!h.D.ld};h.D.Hk=function(a,c){h.D.ld===a&&(c?h.D.Ik():h.D.Ca())};h.D.Ca=function(){var a=h.D.se;a.style.transform="translate(0, 0)";a.style.opacity=0;h.D.Kr=setTimeout(function(){h.D.Ik()},1E3*h.D.zq);h.D.xj&&(h.D.xj(),h.D.xj=null)};
h.D.Ik=function(){if(h.D.isVisible()){h.D.Kr&&clearTimeout(h.D.Kr);var a=h.D.se;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor=h.D.Bv;a.style.borderColor=h.D.Av;h.D.xj&&(h.D.xj(),h.D.xj=null);h.D.KD();h.D.ld=null}};
h.D.ln=function(a,c,d,e){a=Math.floor(a);c=Math.floor(c);d=Math.floor(d);e=Math.floor(e);var f=h.D.se;f.style.left=a+"px";f.style.top=c+"px";f.style.display="block";f.style.opacity=1;f.style.transform="translate("+(d-a)+"px,"+(e-c)+"px)"};
h.D.kM=function(){if(h.D.ld){var a=h.D.ld.B,c=a.v.scale,d=h.D.Up?h.D.ld.bc.width:a.width,e=h.D.Up?h.D.ld.bc.height:a.height;d*=c;e*=c;a=h.D.Up?h.D.ld.gf.getBoundingClientRect():a.ya().getBoundingClientRect();d=a.left+d/2;e=h.D.jy(d,a.top+e,d,a.top);h.D.ln(e.yp,e.zp,e.hp,e.ip)}else h.D.Ca()};
h.yi=function(a,c){this.Fk=a;this.Ou=c.spacing;this.Xy=c.length;this.LF=(this.Gt=a.firstChild)&&this.Gt.nextSibling;this.ZG=c.snap};h.yi.prototype.gi=1;h.yi.prototype.I=function(){this.Fk=null};h.yi.prototype.update=function(a){this.gi=a;var c=this.Ou*a||100;this.Fk.setAttribute("width",c);this.Fk.setAttribute("height",c);c=Math.floor(this.Ou/2)+.5;var d=c-this.Xy/2,e=c+this.Xy/2;c*=a;d*=a;e*=a;ha(this.Gt,a,d,e,c,c);ha(this.LF,a,c,c,d,e)};
function ha(a,c,d,e,f,g){a&&(a.setAttribute("stroke-width",c),a.setAttribute("x1",d),a.setAttribute("y1",f),a.setAttribute("x2",e),a.setAttribute("y2",g))}h.yi.prototype.moveTo=function(a,c){this.Fk.setAttribute("x",a);this.Fk.setAttribute("y",c);(h.g.userAgent.og||h.g.userAgent.lo)&&this.update(this.gi)};
h.yi.Oa=function(a,c,d){a=h.g.o.L("pattern",{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},d);0<c.length&&0<c.spacing?(h.g.o.L("line",{stroke:c.colour},a),1<c.length&&h.g.o.L("line",{stroke:c.colour},a)):h.g.o.L("line",{},a);return a};h.g.xml={};h.g.xml.lC="https://developers.google.com/blockly/xml";h.g.xml.document=function(){return document};h.g.xml.createElement=function(a){return h.g.xml.document().createElementNS(h.g.xml.lC,a)};h.g.xml.createTextNode=function(a){return h.g.xml.document().createTextNode(a)};h.g.xml.hH=function(a){return(new DOMParser).parseFromString(a,"text/xml")};h.g.xml.Md=function(a){return(new XMLSerializer).serializeToString(a)};h.i.vf=function(a){h.i.vf.w.constructor.call(this);this.wc=a.id;this.tc=a.v.id};h.g.object.W(h.i.vf,h.i.Abstract);h.i.vf.prototype.Za=function(){var a=h.i.vf.w.Za.call(this);a.blockId=this.wc;return a};h.i.vf.prototype.va=function(a){h.i.vf.w.va.call(this,a);this.wc=a.blockId};h.i.bh=function(a,c,d,e,f){a&&(h.i.bh.w.constructor.call(this,a),this.element=c,this.name=d,this.oldValue=e,this.newValue=f)};h.g.object.W(h.i.bh,h.i.vf);h.i.hg=h.i.bh;b=h.i.bh.prototype;b.type=h.i.si;
b.Za=function(){var a=h.i.bh.w.Za.call(this);a.element=this.element;this.name&&(a.name=this.name);a.newValue=this.newValue;return a};b.va=function(a){h.i.bh.w.va.call(this,a);this.element=a.element;this.name=a.name;this.newValue=a.newValue};b.Pk=function(){return this.oldValue==this.newValue};
b.run=function(a){var c=r(v(this),this.wc);if(c)switch(c.Pd&&c.Pd.Vb(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(c=y(c,this.name))?c.setValue(a):console.warn("Can't set non-existent field: "+this.name);break;case "comment":c.$f(a||null);break;case "collapsed":c.Wg(!!a);break;case "disabled":c.md(!a);break;case "inline":c.$c(!!a);break;case "mutation":var d="";c.eb&&(d=(d=c.eb())&&h.R.Md(d));if(c.zb){var e=h.R.li(a||"<mutation/>");c.zb(e)}h.i.Ka(new h.i.bh(c,"mutation",null,d,a));
break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.wc)};h.i.Re=function(a){a&&(h.i.Re.w.constructor.call(this,a),this.xml=a.v.ba?h.R.Sr(a):h.R.qh(a),this.Gh=h.i.$x(a))};h.g.object.W(h.i.Re,h.i.vf);h.i.$n=h.i.Re;h.i.Re.prototype.type=h.i.fo;h.i.Re.prototype.Za=function(){var a=h.i.Re.w.Za.call(this);a.xml=h.R.Md(this.xml);a.ids=this.Gh;return a};
h.i.Re.prototype.va=function(a){h.i.Re.w.va.call(this,a);this.xml=h.R.li(a.xml);this.Gh=a.ids};h.i.Re.prototype.run=function(a){var c=v(this);if(a)a=h.g.xml.createElement("xml"),a.appendChild(this.xml),h.R.xh(a,c);else{a=0;for(var d;d=this.Gh[a];a++){var e=r(c,d);e?e.I(!1):d==this.wc&&console.warn("Can't uncreate non-existent block: "+d)}}};
h.i.wf=function(a){if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");h.i.wf.w.constructor.call(this,a);this.bu=a.v.ba?h.R.Sr(a):h.R.qh(a);this.Gh=h.i.$x(a)}};h.g.object.W(h.i.wf,h.i.vf);h.i.SA=h.i.wf;h.i.wf.prototype.type=h.i.yl;h.i.wf.prototype.Za=function(){var a=h.i.wf.w.Za.call(this);a.ids=this.Gh;return a};h.i.wf.prototype.va=function(a){h.i.wf.w.va.call(this,a);this.Gh=a.ids};
h.i.wf.prototype.run=function(a){var c=v(this);if(a){a=0;for(var d;d=this.Gh[a];a++){var e=r(c,d);e?e.I(!1):d==this.wc&&console.warn("Can't delete non-existent block: "+d)}}else a=h.g.xml.createElement("xml"),a.appendChild(this.bu),h.R.xh(a,c)};h.i.Bi=function(a){a&&(h.i.Bi.w.constructor.call(this,a),a=ia(this),this.oz=a.Cz,this.nz=a.My,this.Zt=a.jx)};h.g.object.W(h.i.Bi,h.i.vf);h.i.wl=h.i.Bi;b=h.i.Bi.prototype;b.type=h.i.Hl;
b.Za=function(){var a=h.i.Bi.w.Za.call(this);this.uj&&(a.newParentId=this.uj);this.tj&&(a.newInputName=this.tj);this.Vh&&(a.newCoordinate=Math.round(this.Vh.x)+","+Math.round(this.Vh.y));return a};b.va=function(a){h.i.Bi.w.va.call(this,a);this.uj=a.newParentId;this.tj=a.newInputName;a.newCoordinate&&(a=a.newCoordinate.split(","),this.Vh=new h.g.K(Number(a[0]),Number(a[1])))};b.Aj=function(){var a=ia(this);this.uj=a.Cz;this.tj=a.My;this.Vh=a.jx};
function ia(a){var c=r(v(a),a.wc);a={};var d=c.getParent();if(d){a.Cz=d.id;a:{for(var e=0,f;f=d.T[e];e++)if(f.connection&&z(f.connection)==c){c=f;break a}c=null}c&&(a.My=c.name)}else a.jx=c.Qa();return a}b.Pk=function(){return this.oz==this.uj&&this.nz==this.tj&&h.g.K.Ee(this.Zt,this.Vh)};
b.run=function(a){var c=v(this),d=r(c,this.wc);if(d){var e=a?this.uj:this.oz,f=a?this.tj:this.nz;a=a?this.Vh:this.Zt;var g=null;if(e&&(g=r(c,e),!g)){console.warn("Can't connect to non-existent block: "+e);return}d.getParent()&&A(d);if(a)f=d.Qa(),d.moveBy(a.x-f.x,a.y-f.y);else{d=d.M||d.Z;if(f){if(c=B(g,f))var k=c.connection}else d.type==h.Ue&&(k=g.X);k?d.connect(k):console.warn("Can't connect to non-existent input: "+f)}}else console.warn("Can't move non-existent block: "+this.wc)};h.i.Bl=function(a){this.tc=a.id;this.group=h.i.Zb();this.Dc=!1};h.g.object.W(h.i.Bl,h.i.Abstract);h.i.Bl.prototype.type=h.i.uB;h.i.Bl.prototype.Za=function(){var a={type:this.type};this.group&&(a.group=this.group);this.tc&&(a.workspaceId=this.tc);return a};h.i.Bl.prototype.va=function(a){this.tc=a.workspaceId;this.group=a.group};h.i.xg=function(a){h.i.xg.w.constructor.call(this);this.mi=a.ua();this.tc=a.v.id};h.g.object.W(h.i.xg,h.i.Abstract);h.i.xg.prototype.Za=function(){var a=h.i.xg.w.Za.call(this);a.varId=this.mi;return a};h.i.xg.prototype.va=function(a){h.i.xg.w.Za.call(this);this.mi=a.varId};h.i.ze=function(a){a&&(h.i.ze.w.constructor.call(this,a),this.Qj=a.type,this.Pj=a.name)};h.g.object.W(h.i.ze,h.i.xg);h.i.ze.prototype.type=h.i.ww;
h.i.ze.prototype.Za=function(){var a=h.i.ze.w.Za.call(this);a.varType=this.Qj;a.varName=this.Pj;return a};h.i.ze.prototype.va=function(a){h.i.ze.w.va.call(this,a);this.Qj=a.varType;this.Pj=a.varName};h.i.ze.prototype.run=function(a){var c=v(this);a?c.Ld(this.Pj,this.Qj,this.mi):c.Kf(this.mi)};h.i.We=function(a){a&&(h.i.We.w.constructor.call(this,a),this.Qj=a.type,this.Pj=a.name)};h.g.object.W(h.i.We,h.i.xg);h.i.We.prototype.type=h.i.xw;
h.i.We.prototype.Za=function(){var a=h.i.We.w.Za.call(this);a.varType=this.Qj;a.varName=this.Pj;return a};h.i.We.prototype.va=function(a){h.i.We.w.va.call(this,a);this.Qj=a.varType;this.Pj=a.varName};h.i.We.prototype.run=function(a){var c=v(this);a?c.Kf(this.mi):c.Ld(this.Pj,this.Qj,this.mi)};h.i.Bf=function(a,c){a&&(h.i.Bf.w.constructor.call(this,a),this.au=a.name,this.Vt=c)};h.g.object.W(h.i.Bf,h.i.xg);h.i.Bf.prototype.type=h.i.yw;
h.i.Bf.prototype.Za=function(){var a=h.i.Bf.w.Za.call(this);a.oldName=this.au;a.newName=this.Vt;return a};h.i.Bf.prototype.va=function(a){h.i.Bf.w.va.call(this,a);this.au=a.oldName;this.Vt=a.newName};h.i.Bf.prototype.run=function(a){var c=v(this);a?c.ei(this.mi,this.Vt):c.ei(this.mi,this.au)};h.R={};h.R.vA=function(a){var c=C,d=h.g.xml.createElement("xml"),e=h.R.wH(h.O.Gw(c));e.hasChildNodes()&&d.appendChild(e);var f=ja(c,!0);e=0;for(var g;g=f[e];e++)d.appendChild(g.Vu(a));c=D(c,!0);for(e=0;f=c[e];e++)d.appendChild(h.R.Sr(f,a));return d};h.R.wH=function(a){for(var c=h.g.xml.createElement("variables"),d=0,e;e=a[d];d++){var f=h.g.xml.createElement("variable");f.appendChild(h.g.xml.createTextNode(e.name));e.type&&f.setAttribute("type",e.type);f.id=e.ua();c.appendChild(f)}return c};
h.R.Sr=function(a,c){var d;a.v.G&&(d=a.v.Qf());c=h.R.qh(a,c);var e=a.Qa();c.setAttribute("x",Math.round(a.v.G?d-e.x:e.x));c.setAttribute("y",Math.round(e.y));return c};h.R.DE=function(a){var c=!1;a.name&&(a.Hi?c=!0:a.ng&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),c=!0));return c?(c=h.g.xml.createElement("field"),c.setAttribute("name",a.name),a.kA(c)):null};
h.R.mD=function(a,c){for(var d=0,e;e=a.T[d];d++)for(var f=0,g;g=e.Pa[f];f++)(g=h.R.DE(g))&&c.appendChild(g)};
h.R.qh=function(a,c){var d=h.g.xml.createElement(a.cb?"shadow":"block");d.setAttribute("type",a.type);c||(d.id=a.id);if(a.eb){var e=a.eb();e&&(e.hasChildNodes()||e.hasAttributes())&&d.appendChild(e)}h.R.mD(a,d);if(e=a.Be.text){var f=a.Be.size,g=a.Be.pu,k=h.g.xml.createElement("comment");k.appendChild(h.g.xml.createTextNode(e));k.setAttribute("pinned",g);k.setAttribute("h",f.height);k.setAttribute("w",f.width);d.appendChild(k)}a.data&&(e=h.g.xml.createElement("data"),e.appendChild(h.g.xml.createTextNode(a.data)),
d.appendChild(e));for(f=0;g=a.T[f];f++){var l;k=!0;if(g.type!=h.mg){var m=z(g.connection);g.type==h.Wa?l=h.g.xml.createElement("value"):g.type==h.jb&&(l=h.g.xml.createElement("statement"));e=g.connection.pf;!e||m&&m.cb||l.appendChild(h.R.Sw(e,c));m&&(l.appendChild(h.R.qh(m,c)),k=!1);l.setAttribute("name",g.name);k||d.appendChild(l)}}void 0!=a.Pg&&a.Pg!=a.CF&&d.setAttribute("inline",a.Pg);a.isCollapsed()&&d.setAttribute("collapsed",!0);a.isEnabled()||d.setAttribute("disabled",!0);a.je()||a.cb||d.setAttribute("deletable",
!1);a.kd()||a.cb||d.setAttribute("movable",!1);a.jd()||d.setAttribute("editable",!1);if(f=q(a))l=h.g.xml.createElement("next"),l.appendChild(h.R.qh(f,c)),d.appendChild(l);e=a.X&&a.X.pf;!e||f&&f.cb||l.appendChild(h.R.Sw(e,c));return d};
h.R.Sw=function(a,c){for(var d=a=a.cloneNode(!0),e;d;)if(c&&"shadow"==d.nodeName&&d.removeAttribute("id"),d.firstChild)d=d.firstChild;else{for(;d&&!d.nextSibling;)e=d,d=d.parentNode,e.nodeType==h.g.o.Node.TEXT_NODE&&""==e.data.trim()&&d.firstChild!=e&&h.g.o.removeNode(e);d&&(e=d,d=d.nextSibling,e.nodeType==h.g.o.Node.TEXT_NODE&&""==e.data.trim()&&h.g.o.removeNode(e))}return a};
h.R.Md=function(a){a=h.g.xml.Md(a);var c=/(<[^/](?:[^>]*[^/])?>[^<]*)\n([^<]*<\/)/;do{var d=a;a=a.replace(c,"$1&#10;$2")}while(a!=d);return a};h.R.OL=function(a){a=h.R.Md(a).split("<");for(var c="",d=1;d<a.length;d++){var e=a[d];"/"==e[0]&&(c=c.substring(2));a[d]=c+"<"+e;"/"!=e[0]&&"/>"!=e.slice(-2)&&(c+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1</$2>");return a.replace(/^\n/,"")};
h.R.li=function(a){var c=h.g.xml.hH(a);if(!c||!c.documentElement||c.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return c.documentElement};h.R.KL=function(a,c){c.Gc(!1);c.clear();a=h.R.xh(a,c);c.Gc(!0);return a};
h.R.xh=function(a,c){if(a instanceof h.Ib){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var e;c.G&&(e=c.Qf());d=[];h.g.o.Dn();var f=a.childNodes.length,g=h.i.Zb();g||h.i.$(!0);c.Gc&&c.Gc(!1);var k=!0;try{for(var l=0;l<f;l++){var m=a.childNodes[l],n=m.nodeName.toLowerCase();if("block"==n||"shadow"==n&&!h.i.Dc){var t=h.R.Zi(m,c);d.push(t.id);var u=m.hasAttribute("x")?parseInt(m.getAttribute("x"),10):10,w=m.hasAttribute("y")?parseInt(m.getAttribute("y"),
10):10;isNaN(u)||isNaN(w)||t.moveBy(c.G?e-u:u,w);k=!1}else{if("shadow"==n)throw TypeError("Shadow block cannot be a top-level block.");if("comment"==n)c.ba?h.mk?h.mk.Cm(m):console.warn("Missing require for Blockly.WorkspaceCommentSvg, ignoring workspace comment."):h.aD?h.aD.Cm(m):console.warn("Missing require for Blockly.WorkspaceComment, ignoring workspace comment.");else if("variables"==n){if(k)h.R.wE(m,c);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");
k=!1}}}}finally{g||h.i.$(!1),h.g.o.En()}c.Gc&&c.Gc(!0);h.i.Ka(new h.i.Bl(c));return d};h.R.HL=function(a,c){if(c.hasOwnProperty("scale")){var d=h.wa.mh;try{h.wa.mh=0;var e=ka(c)}finally{h.wa.mh=d}}a=h.R.xh(a,c);if(e&&e.top!=e.bottom){d=e.bottom;var f=e.left;var g=Infinity,k=Infinity;for(e=0;e<a.length;e++){var l=r(c,a[e]).Qa();l.y<k&&(k=l.y);l.x<g&&(g=l.x)}d=d-k+h.wa.BC;f-=g;var m;c.G&&(m=c.Qf());for(e=0;e<a.length;e++)r(c,a[e]).moveBy(c.G?m-f:f,d)}return a};
h.R.Zi=function(a,c){if(a instanceof h.Ib){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToBlock, swap the arguments.")}h.i.disable();d=c.Kg();try{var e=h.R.Bs(a,c),f=p(e,!1);if(c.ba){la(e,!0);for(var g=f.length-1;0<=g;g--)f[g].Ke();for(g=f.length-1;0<=g;g--)f[g].za(!1);setTimeout(function(){e.v&&la(e,!1)},1);ma(e);na(c)}else for(g=f.length-1;0<=g;g--)f[g].fj()}finally{h.i.enable()}if(h.i.isEnabled()){a=h.O.Xx(c,d);for(g=0;g<a.length;g++)h.i.Ka(new h.i.ze(a[g]));h.i.Ka(new h.i.$n(e))}return e};
h.R.wE=function(a,c){for(var d=0,e;e=a.childNodes[d];d++)if(e.nodeType==h.g.o.Node.ELEMENT_NODE){var f=e.getAttribute("type"),g=e.getAttribute("id");c.Ld(e.textContent,f,g)}};
h.R.Bs=function(a,c){var d=null,e=a.getAttribute("type");if(!e)throw TypeError("Block type unspecified: "+a.outerHTML);var f=a.getAttribute("id");d=c.Uh(e,f);var g=null;f=0;for(var k;k=a.childNodes[f];f++)if(k.nodeType!=h.g.o.Node.TEXT_NODE){for(var l=g=null,m=0,n;n=k.childNodes[m];m++)n.nodeType==h.g.o.Node.ELEMENT_NODE&&("block"==n.nodeName.toLowerCase()?g=n:"shadow"==n.nodeName.toLowerCase()&&(l=n));!g&&l&&(g=l);m=k.getAttribute("name");switch(k.nodeName.toLowerCase()){case "mutation":d.zb&&(d.zb(k),
d.Ke&&d.Ke());break;case "comment":if(!h.Comment){console.warn("Missing require for Blockly.Comment, ignoring block comment.");break}g=k.textContent;l="true"==k.getAttribute("pinned");m=parseInt(k.getAttribute("w"),10);k=parseInt(k.getAttribute("h"),10);d.$f(g);d.Be.pu=l;isNaN(m)||isNaN(k)||(d.Be.size=new h.g.Ve(m,k));l&&d.QE&&!d.$b&&setTimeout(function(){d.Ff.Vb(!0)},1);break;case "data":d.data=k.textContent;break;case "title":case "field":h.R.vE(d,m,k);break;case "value":case "statement":k=B(d,
m);if(!k){console.warn("Ignoring non-existent input "+m+" in block "+e);break}l&&(k.connection.pf=l);if(g)if(g=h.R.Bs(g,c),g.M)k.connection.connect(g.M);else if(g.Z)k.connection.connect(g.Z);else throw TypeError("Child block does not have output or previous statement.");break;case "next":l&&d.X&&(d.X.pf=l);if(g){if(!d.X)throw TypeError("Next statement does not exist.");if(d.X.isConnected())throw TypeError("Next statement is already connected.");g=h.R.Bs(g,c);if(!g.Z)throw TypeError("Next block does not have previous statement.");
d.X.connect(g.Z)}break;default:console.warn("Ignoring unknown tag: "+k.nodeName)}}(f=a.getAttribute("inline"))&&d.$c("true"==f);(f=a.getAttribute("disabled"))&&d.md("true"!=f&&"disabled"!=f);if(f=a.getAttribute("deletable"))d.ps="true"==f;(f=a.getAttribute("movable"))&&d.gq("true"==f);(f=a.getAttribute("editable"))&&d.Gu("true"==f);(f=a.getAttribute("collapsed"))&&d.Wg("true"==f);if("shadow"==a.nodeName.toLowerCase()){a=d.Ah(!1);for(f=0;c=a[f];f++)if(!c.cb)throw TypeError("Shadow block not allowed non-shadow child.");
if(d.Mg().length)throw TypeError("Shadow blocks cannot have variable references.");d.Ku(!0)}return d};h.R.vE=function(a,c,d){var e=y(a,c);e?e.Cm(d):console.warn("Ignoring non-existent field "+c+" in block "+a.type)};h.R.kE=function(a){for(var c=0,d;d=a.childNodes[c];c++)if("next"==d.nodeName.toLowerCase()){a.removeChild(d);break}};h.xe=function(a){var c=!!a.readOnly;if(c)var d=null,e=!1,f=!1,g=!1,k=!1,l=!1,m=!1;else{d=h.xe.CG(a.toolbox||null);e=!(!d||!d.getElementsByTagName("category").length);f=a.trashcan;void 0===f&&(f=e);var n=a.maxTrashcanContents;f?void 0===n&&(n=32):n=0;g=a.collapse;void 0===g&&(g=e);k=a.comments;void 0===k&&(k=e);l=a.disable;void 0===l&&(l=e);m=a.sounds;void 0===m&&(m=!0)}var t=!!a.rtl,u=a.horizontalLayout;void 0===u&&(u=!1);var w=a.toolboxPosition;w="end"===w?!1:!0;w=u?w?h.wg:h.kk:w==t?h.vg:h.Yd;var F=
a.css;void 0===F&&(F=!0);var U="https://blockly-demo.appspot.com/static/media/";a.media?U=a.media:a.path&&(U=a.path+"media/");var aa=void 0===a.oneBasedIndex?!0:!!a.oneBasedIndex,za=a.theme,pe=a.keyMap||h.qb.ob.WD(),qe=a.renderer||"geras";this.G=t;this.Ne=aa;this.collapse=g;this.hm=k;this.disable=l;this.readOnly=c;this.Ot=a.maxBlocks||Infinity;this.Pt=a.maxInstances;this.ai=U;this.zy=e;this.Bc=h.xe.BG(a,e);this.Dy=f;this.Mp=n;this.sF=m;this.qF=F;this.ie=u;this.Sk=d;this.vy=h.xe.AG(a);this.Hb=h.xe.DG(a);
this.Ia=w;this.jH=za;this.ob=pe;this.Tg=qe};h.xe.prototype.Nb=null;h.xe.prototype.ii=null;h.xe.prototype.Uc=null;h.xe.BG=function(a,c){var d=a.move||{},e={};e.scrollbars=void 0===d.scrollbars&&void 0===a.scrollbars?c:!!d.scrollbars||!!a.scrollbars;e.Rj=e.scrollbars&&void 0!==d.wheel?!!d.wheel:!1;e.yh=e.scrollbars?void 0===d.drag?!0:!!d.drag:!1;return e};
h.xe.DG=function(a){a=a.zoom||{};var c={};c.controls=void 0===a.controls?!1:!!a.controls;c.Rj=void 0===a.wheel?!1:!!a.wheel;c.eH=void 0===a.startScale?1:Number(a.startScale);c.$m=void 0===a.maxScale?3:Number(a.maxScale);c.cn=void 0===a.minScale?.3:Number(a.minScale);c.PG=void 0===a.scaleSpeed?1.2:Number(a.scaleSpeed);return c};h.xe.AG=function(a){a=a.grid||{};var c={};c.spacing=Number(a.spacing)||0;c.Lb=a.colour||"#888";c.length=Number(a.length)||1;c.sM=0<c.spacing&&!!a.snap;return c};
h.xe.CG=function(a){if(a){if("string"!=typeof a&&(h.g.userAgent.og&&a.outerHTML?a=a.outerHTML:a instanceof Element||(a=null)),"string"==typeof a&&(a=h.R.li(a),"xml"!=a.nodeName.toLowerCase()))throw TypeError("Toolbox should be an <xml> document.");}else a=null;return a};h.Touch={};h.Touch.uw="ontouchstart"in h.g.global||!!(h.g.global.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!h.g.global.navigator||!h.g.global.navigator.maxTouchPoints&&!h.g.global.navigator.msMaxTouchPoints);h.Touch.Kn=null;h.Touch.Af={};
h.g.global.PointerEvent?h.Touch.Af={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]}:h.Touch.uw&&(h.Touch.Af={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]});h.Kp=0;
h.OF=function(a,c){h.Sh();a.changedTouches&&1!=a.changedTouches.length||(h.Kp=setTimeout(function(){a.changedTouches&&(a.button=2,a.clientX=a.changedTouches[0].clientX,a.clientY=a.changedTouches[0].clientY);c&&oa(c,a)},h.$B))};h.Sh=function(){h.Kp&&(clearTimeout(h.Kp),h.Kp=0)};h.Touch.em=function(){h.Touch.Kn=null};h.Touch.Nu=function(a){return!h.Touch.HF(a)||h.Touch.ID(a)};
h.Touch.sp=function(a){return void 0!=a.pointerId?a.pointerId:a.changedTouches&&a.changedTouches[0]&&void 0!==a.changedTouches[0].identifier&&null!==a.changedTouches[0].identifier?a.changedTouches[0].identifier:"mouse"};h.Touch.ID=function(a){var c=h.Touch.sp(a);return void 0!==h.Touch.Kn&&null!==h.Touch.Kn?h.Touch.Kn==c:"mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type?(h.Touch.Kn=c,!0):!1};
h.Touch.TG=function(a){if(h.g.fb.startsWith(a.type,"touch")){var c=a.changedTouches[0];a.clientX=c.clientX;a.clientY=c.clientY}};h.Touch.HF=function(a){return h.g.fb.startsWith(a.type,"touch")||h.g.fb.startsWith(a.type,"mouse")||h.g.fb.startsWith(a.type,"pointer")};h.Touch.Jp=function(a){return h.g.fb.startsWith(a.type,"touch")||h.g.fb.startsWith(a.type,"pointer")};
h.Touch.$G=function(a){var c=[];if(a.changedTouches)for(var d=0;d<a.changedTouches.length;d++)c[d]={type:a.type,changedTouches:[a.changedTouches[d]],target:a.target,stopPropagation:function(){a.stopPropagation()},preventDefault:function(){a.preventDefault()}};else c.push(a);return c};
h.jk=function(a){this.s=a;this.fe=new h.Ua(a,!0,!0,"blocklyMainWorkspaceScrollbar");this.re=new h.Ua(a,!1,!0,"blocklyMainWorkspaceScrollbar");this.lm=h.g.o.L("rect",{height:h.Ua.Zc,width:h.Ua.Zc,"class":"blocklyScrollbarBackground"},null);h.g.o.gj(this.lm,a.Zg)};h.jk.prototype.Fb=null;h.jk.prototype.I=function(){h.g.o.removeNode(this.lm);this.Fb=this.s=this.lm=null;this.fe.I();this.fe=null;this.re.I();this.re=null};
h.jk.prototype.resize=function(){var a=this.s.Uc();if(a){var c=!1,d=!1;this.Fb&&this.Fb.Bb==a.Bb&&this.Fb.Pb==a.Pb&&this.Fb.fd==a.fd&&this.Fb.Pc==a.Pc?(this.Fb&&this.Fb.Hf==a.Hf&&this.Fb.dc==a.dc&&this.Fb.Rc==a.Rc||(c=!0),this.Fb&&this.Fb.ce==a.ce&&this.Fb.lc==a.lc&&this.Fb.xc==a.xc||(d=!0)):d=c=!0;c&&this.fe.resize(a);d&&this.re.resize(a);this.Fb&&this.Fb.Bb==a.Bb&&this.Fb.Pc==a.Pc||this.lm.setAttribute("x",this.re.Vf.x);this.Fb&&this.Fb.Pb==a.Pb&&this.Fb.fd==a.fd||this.lm.setAttribute("y",this.fe.Vf.y);
this.Fb=a}};h.jk.prototype.set=function(a,c){var d={};a*=this.fe.Cc;c*=this.re.Cc;var e=this.re.Pe,f=a/this.fe.Pe;d.x=isNaN(f)?0:f;e=c/e;d.y=isNaN(e)?0:e;this.s.ii(d);pa(this.fe,a);pa(this.re,c)};
h.Ua=function(a,c,d,e){this.s=a;this.Vk=d||!1;this.ej=c;this.Fb=null;this.mm(e);this.Vf=new h.g.K(0,0);a=h.Ua.Zc;c?(this.Hc.setAttribute("height",a),this.Tf.setAttribute("height",a),this.Sd.setAttribute("height",a-5),this.Sd.setAttribute("y",2.5),this.Wm="width",this.Fz="x"):(this.Hc.setAttribute("width",a),this.Tf.setAttribute("width",a),this.Sd.setAttribute("width",a-5),this.Sd.setAttribute("x",2.5),this.Wm="height",this.Fz="y");this.yz=h.ma(this.Hc,"mousedown",this,this.sG);this.zz=h.ma(this.Sd,
"mousedown",this,this.tG)};b=h.Ua.prototype;b.ju=new h.g.K(0,0);b.eA=0;b.Pe=0;b.Eh=0;b.Km=0;b.Qh=!0;b.Ri=!0;h.Ua.Zc=15;h.Touch.uw&&(h.Ua.Zc=25);h.Ua.RF=function(a,c){return a&&c&&a.Bb==c.Bb&&a.Pb==c.Pb&&a.dc==c.dc&&a.lc==c.lc&&a.fd==c.fd&&a.Pc==c.Pc&&a.Hf==c.Hf&&a.ce==c.ce&&a.Rc==c.Rc&&a.xc==c.xc?!0:!1};
h.Ua.prototype.I=function(){qa();h.$a(this.yz);this.yz=null;h.$a(this.zz);this.zz=null;h.g.o.removeNode(this.Tf);this.Hc=this.N=this.Tf=null;this.Sd&&(this.s.jc.unsubscribe(this.Sd),this.Sd=null);this.s=null};function pa(a,c){a.Km=c;a.Sd.setAttribute(a.Fz,a.Km)}function ra(a,c){a.Pe=c;a.Tf.setAttribute(a.Wm,a.Pe);a.Hc.setAttribute(a.Wm,a.Pe)}h.jk.prototype.Bj=function(a){this.fe.Bj(a);this.re.Bj(a)};
function sa(a,c,d){a.Vf.x=c;a.Vf.y=d;h.g.o.vn(a.Tf,"translate("+(a.Vf.x+a.ju.x)+"px,"+(a.Vf.y+a.ju.y)+"px)")}b=h.Ua.prototype;b.resize=function(a){if(!a&&(a=this.s.Uc(),!a))return;h.Ua.RF(a,this.Fb)||(this.Fb=a,this.ej?ta(this,a):ua(this,a),va(this))};function ta(a,c){var d=c.Bb-1;a.Vk&&(d-=h.Ua.Zc);ra(a,Math.max(0,d));d=c.Pc+.5;a.Vk&&a.s.G&&(d+=h.Ua.Zc);sa(a,d,c.fd+c.Pb-h.Ua.Zc-.5);wa(a,c)}
function wa(a,c){a.Vk||a.Vb(a.Pe<c.Hf);a.Cc=a.Pe/c.Hf;if(-Infinity==a.Cc||Infinity==a.Cc||isNaN(a.Cc))a.Cc=0;a.Eh=Math.max(0,c.Bb*a.Cc);a.Sd.setAttribute(a.Wm,a.Eh);pa(a,xa(a,(c.dc-c.Rc)*a.Cc))}function ua(a,c){var d=c.Pb-1;a.Vk&&(d-=h.Ua.Zc);ra(a,Math.max(0,d));d=c.Pc+.5;a.s.G||(d+=c.Bb-h.Ua.Zc-1);sa(a,d,c.fd+.5);ya(a,c)}
function ya(a,c){a.Vk||a.Vb(a.Pe<c.ce);a.Cc=a.Pe/c.ce;if(-Infinity==a.Cc||Infinity==a.Cc||isNaN(a.Cc))a.Cc=0;a.Eh=Math.max(0,c.Pb*a.Cc);a.Sd.setAttribute(a.Wm,a.Eh);pa(a,xa(a,(c.lc-c.xc)*a.Cc))}
b.mm=function(a){var c="blocklyScrollbar"+(this.ej?"Horizontal":"Vertical");a&&(c+=" "+a);this.Tf=h.g.o.L("svg",{"class":c},null);this.N=h.g.o.L("g",{},this.Tf);this.Hc=h.g.o.L("rect",{"class":"blocklyScrollbarBackground"},this.N);a=Math.floor((h.Ua.Zc-5)/2);this.Sd=h.g.o.L("rect",{"class":"blocklyScrollbarHandle",rx:a,ry:a},this.N);this.s.jc.subscribe(this.Sd,"scrollbar","fill");this.s.jc.subscribe(this.Sd,"scrollbarOpacity","fill-opacity");h.g.o.gj(this.Tf,x(this.s))};b.isVisible=function(){return this.Qh};
b.Bj=function(a){var c=a!=this.Ri;this.Ri=a;c&&this.On()};b.Vb=function(a){var c=a!=this.isVisible();if(this.Vk)throw Error("Unable to toggle visibility of paired scrollbars.");this.Qh=a;c&&this.On()};b.On=function(){this.Ri&&this.isVisible()?this.Tf.setAttribute("display","block"):this.Tf.setAttribute("display","none")};
b.sG=function(a){Aa(this.s);h.Touch.em();qa();if(h.g.mj(a))a.stopPropagation();else{var c=h.g.fn(a,x(this.s),Ba(this.s));c=this.ej?c.x:c.y;var d=h.g.Gm(this.Sd);d=this.ej?d.x:d.y;var e=this.Km,f=.95*this.Eh;c<=d?e-=f:c>=d+this.Eh&&(e+=f);pa(this,xa(this,e));va(this);a.stopPropagation();a.preventDefault()}};
b.tG=function(a){Aa(this.s);qa();h.g.mj(a)?a.stopPropagation():(this.bH=this.Km,Ca(this.s),this.eA=this.ej?a.clientX:a.clientY,h.Ua.Zh=h.ma(document,"mouseup",this,this.yG),h.Ua.Yh=h.ma(document,"mousemove",this,this.uG),a.stopPropagation(),a.preventDefault())};b.uG=function(a){pa(this,xa(this,this.bH+((this.ej?a.clientX:a.clientY)-this.eA)));va(this)};b.yG=function(){Da(this.s);h.Touch.em();qa()};function qa(){h.oc(!0);h.Ua.Zh&&(h.$a(h.Ua.Zh),h.Ua.Zh=null);h.Ua.Yh&&(h.$a(h.Ua.Yh),h.Ua.Yh=null)}
function xa(a,c){return c=0>=c||isNaN(c)||a.Pe<a.Eh?0:Math.min(c,a.Pe-a.Eh)}function va(a){var c=a.Km/a.Pe;isNaN(c)&&(c=0);var d={};a.ej?d.x=c:d.y=c;a.s.ii(d)}b.set=function(a){pa(this,xa(this,a*this.Cc));va(this)};h.H={};h.H.visible=!1;h.H.rk=!1;h.H.UB=50;h.H.iz=0;h.H.zn=0;h.H.Dt=0;h.H.Et=0;h.H.hb=null;h.H.Tp=null;h.H.Zv=0;h.H.$v=10;h.H.vC=10;h.H.GB=750;h.H.Vq=5;h.H.Fa=null;h.H.Oa=function(){h.H.Fa||(h.H.Fa=document.createElement("div"),h.H.Fa.className="blocklyTooltipDiv",document.body.appendChild(h.H.Fa))};h.H.qk=function(a){h.gd(a,"mouseover",null,h.H.xG);h.gd(a,"mouseout",null,h.H.wG);a.addEventListener("mousemove",h.H.vG,!1)};
h.H.xG=function(a){if(!h.H.rk){for(a=a.currentTarget;"string"!=typeof a.sf&&"function"!=typeof a.sf;)a=a.sf;h.H.hb!=a&&(h.H.Ca(),h.H.Tp=null,h.H.hb=a);clearTimeout(h.H.iz)}};h.H.wG=function(){h.H.rk||(h.H.iz=setTimeout(function(){h.H.hb=null;h.H.Tp=null;h.H.Ca()},1),clearTimeout(h.H.zn))};
h.H.vG=function(a){if(h.H.hb&&h.H.hb.sf&&!h.H.rk)if(h.H.visible){var c=h.H.Dt-a.pageX;a=h.H.Et-a.pageY;Math.sqrt(c*c+a*a)>h.H.vC&&h.H.Ca()}else h.H.Tp!=h.H.hb&&(clearTimeout(h.H.zn),h.H.Dt=a.pageX,h.H.Et=a.pageY,h.H.zn=setTimeout(h.H.XG,h.H.GB))};h.H.Ca=function(){h.H.visible&&(h.H.visible=!1,h.H.Fa&&(h.H.Fa.style.display="none"));h.H.zn&&clearTimeout(h.H.zn)};h.H.block=function(){h.H.Ca();h.H.rk=!0};h.H.pH=function(){h.H.rk=!1};
h.H.XG=function(){if(!h.H.rk&&(h.H.Tp=h.H.hb,h.H.Fa)){h.H.Fa.innerHTML="";for(var a=h.H.hb.sf;"function"==typeof a;)a=a();a=h.g.fb.wA(a,h.H.UB);a=a.split("\n");for(var c=0;c<a.length;c++){var d=document.createElement("div");d.appendChild(document.createTextNode(a[c]));h.H.Fa.appendChild(d)}a=h.H.hb.G;c=document.documentElement.clientWidth;d=document.documentElement.clientHeight;h.H.Fa.style.direction=a?"rtl":"ltr";h.H.Fa.style.display="block";h.H.visible=!0;var e=h.H.Dt;e=a?e-(h.H.Zv+h.H.Fa.offsetWidth):
e+h.H.Zv;var f=h.H.Et+h.H.$v;f+h.H.Fa.offsetHeight>d+window.scrollY&&(f-=h.H.Fa.offsetHeight+2*h.H.$v);a?e=Math.max(h.H.Vq-window.scrollX,e):e+h.H.Fa.offsetWidth>c+window.scrollX-2*h.H.Vq&&(e=c-h.H.Fa.offsetWidth-2*h.H.Vq);h.H.Fa.style.top=f+"px";h.H.Fa.style.left=e+"px"}};h.Bw=function(a){this.km=a;this.Oa()};b=h.Bw.prototype;b.tb=null;b.df=null;b.km=null;b.Oa=function(){this.tb||(this.tb=h.g.o.L("svg",{xmlns:h.g.o.Ql,"xmlns:html":h.g.o.zi,"xmlns:xlink":h.g.o.Mi,version:"1.1","class":"blocklyWsDragSurface blocklyOverflowVisible"},null),this.km.appendChild(this.tb))};b.Mj=function(a,c){a=a.toFixed(0);c=c.toFixed(0);this.tb.style.display="block";h.g.o.vn(this.tb,"translate3d("+a+"px, "+c+"px, 0px)")};b.bt=function(){return h.g.He(this.tb)};
b.Oo=function(a){if(!a)throw Error("Couldn't clear and hide the drag surface: missing new surface.");var c=this.tb.childNodes[0],d=this.tb.childNodes[1];if(!(c&&d&&h.g.o.Ay(c,"blocklyBlockCanvas")&&h.g.o.Ay(d,"blocklyBubbleCanvas")))throw Error("Couldn't clear and hide the drag surface. A node was missing.");null!=this.Zk?h.g.o.gj(c,this.Zk):a.insertBefore(c,a.firstChild);h.g.o.gj(d,c);this.tb.style.display="none";if(this.tb.childNodes.length)throw Error("Drag surface was not cleared.");h.g.o.vn(this.tb,
"");this.Zk=null};h.J=Object.create(null);h.sa=function(a,c){this.B=a;this.type=c};h.sa.ao=0;h.sa.hw=1;h.sa.kw=2;h.sa.jw=3;h.sa.fw=4;h.sa.gw=5;h.sa.iw=6;b=h.sa.prototype;b.ca=null;b.Ze=null;b.pf=null;b.Wb=0;b.ab=0;
b.$e=function(a){var c=this,d=c.B,e=a.B;a.isConnected()&&a.disconnect();if(c.isConnected()){var f=z(c),g=c.pf;c.pf=null;if(f.cb)g=h.R.qh(f),f.I(),f=null;else if(c.type==h.Wa){if(!f.M)throw Error("Orphan block does not have an output connection.");var k=h.sa.Uy(e,f);k&&(f.M.connect(k),f=null)}else if(c.type==h.jb){if(!f.Z)throw Error("Orphan block does not have a previous connection.");for(k=e;k.X;){var l=q(k);if(l&&!l.cb)k=l;else{Ea(f.Z,k.X)&&(k.X.connect(f.Z),f=null);break}}}if(f&&(c.disconnect(),
h.i.Dc)){var m=h.i.Zb();setTimeout(function(){f.v&&!f.getParent()&&(h.i.$(m),f.M?f.M.Pp(c):f.Z&&f.Z.Pp(c),h.i.$(!1))},h.Yn)}c.pf=g}var n;h.i.isEnabled()&&(n=new h.i.wl(e));h.sa.TD(c,a);e.cl(d);n&&(n.Aj(),h.i.Ka(n))};b.I=function(){if(this.isConnected()){this.pf=null;var a=z(this);a.cb?a.I():A(a)}};function E(a){return a.type==h.Wa||a.type==h.jb}b.isConnected=function(){return!!this.ca};
function Fa(a,c){if(!c)return h.sa.jw;if(E(a))var d=a.B,e=c.B;else e=a.B,d=c.B;return d&&d==e?h.sa.hw:c.type!=h.fk[a.type]?h.sa.kw:d&&e&&d.v!==e.v?h.sa.gw:Ea(a,c)?d.cb&&!e.cb?h.sa.iw:h.sa.ao:h.sa.fw}
function Ga(a,c){switch(Fa(a,c)){case h.sa.ao:break;case h.sa.hw:throw Error("Attempted to connect a block to itself.");case h.sa.gw:throw Error("Blocks not on same workspace.");case h.sa.kw:throw Error("Attempt to connect incompatible types.");case h.sa.jw:throw Error("Target connection is null.");case h.sa.fw:throw Error("Connection checks failed. "+(a+" expected "+a.Ze+", found "+c.Ze));case h.sa.iw:throw Error("Connecting non-shadow to shadow block.");default:throw Error("Unknown connection failure: this should never happen!");
}}b.Cp=function(a){if(a.B.Mh()||Fa(this,a)!=h.sa.ao)return!1;switch(a.type){case h.Ue:return this.ca||-1!=h.wm.indexOf(a)?a=!1:a.ca?(a=z(a),a=a.Mh()?!(a.Z&&z(a.Z)):!1):a=!0,a;case h.Te:if(a.isConnected()&&!z(a).Mh()||this.isConnected())return!1;break;case h.Wa:if(a.isConnected()&&!z(a).kd()&&!z(a).cb)return!1;break;case h.jb:if(a.isConnected()&&!this.B.X&&!z(a).cb&&z(a).X)return!1;break;default:throw Error("Unknown connection type in isConnectionAllowed");}return-1!=h.wm.indexOf(a)?!1:!0};b.Pp=function(){};
b.connect=function(a){if(this.ca!=a){Ga(this,a);var c=h.i.Zb();c||h.i.$(!0);E(this)?this.$e(a):a.$e(this);c||h.i.$(!1)}};h.sa.TD=function(a,c){if(!a||!c)throw Error("Cannot connect null connections.");a.ca=c;c.ca=a};h.sa.YG=function(a,c){for(var d=!1,e=0;e<a.T.length;e++){var f=a.T[e].connection;if(f&&f.type==h.Wa&&Ea(c.M,f)){if(d)return null;d=f}}return d};h.sa.Uy=function(a,c){for(var d;d=h.sa.YG(a,c);)if(a=z(d),!a||a.cb)return d;return null};b=h.sa.prototype;
b.disconnect=function(){var a=this.ca;if(!a)throw Error("Source connection not connected.");if(a.ca!=this)throw Error("Target connection not connected to source connection.");if(E(this)){var c=this.B;var d=a.B;a=this}else c=a.B,d=this.B;var e=h.i.Zb();e||h.i.$(!0);this.xs(c,d);a.Bu();e||h.i.$(!1)};b.xs=function(a,c){var d;h.i.isEnabled()&&(d=new h.i.wl(c));this.ca=this.ca.ca=null;c.cl(null);d&&(d.Aj(),h.i.Ka(d))};
b.Bu=function(){var a=this.B,c=this.pf;if(a.v&&c&&h.i.Dc)if(a=h.R.Zi(c,a.v),a.M)this.connect(a.M);else if(a.Z)this.connect(a.Z);else throw Error("Child block does not have output or previous statement.");};function z(a){return a.isConnected()?a.ca.B:null}function Ea(a,c){if(!a.Ze||!c.Ze)return!0;for(var d=0;d<a.Ze.length;d++)if(-1!=c.Ze.indexOf(a.Ze[d]))return!0;return!1}b.sz=function(){this.isConnected()&&!Ea(this,this.ca)&&A(E(this)?z(this):this.B)};
b.vb=function(a){a?(Array.isArray(a)||(a=[a]),this.Ze=a,this.sz()):this.Ze=null;return this};b.lz=function(){return[]};b.Pf=function(){for(var a=null,c=this.B,d=c.T,e=0;e<c.T.length;e++)if(d[e].connection===this){a=d[e];break}return a};
b.toString=function(){var a=this.B;if(a)if(a.M==this)var c="Output Connection of ";else if(a.Z==this)c="Previous Connection of ";else if(a.X==this)c="Next Connection of ";else{c=null;for(var d=0,e;e=a.T[d];d++)if(e.connection==this){c=e;break}if(c)c='Input "'+c.name+'" connection on ';else return console.warn("Connection not actually connected to sourceBlock_"),"Orphan Connection"}else return"Orphan Connection";d=a.type?'"'+a.type+'" block':"Block";a.id&&(d+=' (id="'+a.id+'")');return c+d};h.Y={};h.Y.ul={};h.Y.register=function(a,c){if("string"!=typeof a||""==a.trim())throw Error('Error: Invalid extension name "'+a+'"');if(h.Y.ul[a])throw Error('Error: Extension "'+a+'" is already registered.');if("function"!=typeof c)throw Error('Error: Extension "'+a+'" must be a function');h.Y.ul[a]=c};h.Y.Xp=function(a,c){if(!c||"object"!=typeof c)throw Error('Error: Mixin "'+a+'" must be a object');h.Y.register(a,function(){this.rj(c)})};
h.Y.wu=function(a,c,d,e){var f='Error when registering mutator "'+a+'": ';h.Y.Pw(f,c.zb,"domToMutation");h.Y.Pw(f,c.eb,"mutationToDom");var g=h.Y.Rw(c,f);if(d&&"function"!=typeof d)throw Error('Extension "'+a+'" is not a function');h.Y.register(a,function(){if(g){if(!h.Qb)throw Error(f+"Missing require for Blockly.Mutator");this.ji(new h.Qb(e))}this.rj(c);d&&d.apply(this)})};h.Y.unregister=function(a){h.Y.ul[a]?delete h.Y.ul[a]:console.warn('No extension mapping for name "'+a+'" found to unregister')};
h.Y.apply=function(a,c,d){var e=h.Y.ul[a];if("function"!=typeof e)throw Error('Error: Extension "'+a+'" not found.');if(d)h.Y.HD(a,c);else var f=h.Y.Zs(c);e.apply(c);if(d)h.Y.FD('Error after applying mutator "'+a+'": ',c);else if(!h.Y.aG(f,c))throw Error('Error when applying extension "'+a+'": mutation properties changed when applying a non-mutator extension.');};
h.Y.Pw=function(a,c,d){if(!c)throw Error(a+'missing required property "'+d+'"');if("function"!=typeof c)throw Error(a+'" required property "'+d+'" must be a function');};h.Y.HD=function(a,c){if(h.Y.Zs(c).length)throw Error('Error: tried to apply mutation "'+a+'" to a block that already has mutator functions. Block id: '+c.id);};
h.Y.Rw=function(a,c){var d=void 0!==a.Dg,e=void 0!==a.Gg;if(d&&e){if("function"!=typeof a.Dg)throw Error(c+"compose must be a function.");if("function"!=typeof a.Gg)throw Error(c+"decompose must be a function.");return!0}if(d||e)throw Error(c+'Must have both or neither of "compose" and "decompose"');return!1};
h.Y.FD=function(a,c){if("function"!=typeof c.zb)throw Error(a+'Applying a mutator didn\'t add "domToMutation"');if("function"!=typeof c.eb)throw Error(a+'Applying a mutator didn\'t add "mutationToDom"');h.Y.Rw(c,a)};h.Y.Zs=function(a){var c=[];void 0!==a.zb&&c.push(a.zb);void 0!==a.eb&&c.push(a.eb);void 0!==a.Dg&&c.push(a.Dg);void 0!==a.Gg&&c.push(a.Gg);return c};h.Y.aG=function(a,c){c=h.Y.Zs(c);if(c.length!=a.length)return!1;for(var d=0;d<c.length;d++)if(a[d]!=c[d])return!1;return!0};
h.Y.Lo=function(a,c){var d=[];"object"==typeof document&&h.g.Tz(function(){for(var e in c)h.g.Qw(c[e])});return function(){this.type&&-1==d.indexOf(this.type)&&(h.Y.GD(this,a,c),d.push(this.type));this.Ra(function(){var e=G(this,a),f=c[e];null==f?-1==d.indexOf(this.type)&&(e="No tooltip mapping for value "+e+" of field "+a,null!=this.type&&(e+=" of block type "+this.type),console.warn(e+".")):f=h.g.le(f);return f}.bind(this))}};
h.Y.GD=function(a,c,d){var e=y(a,c);if("function"!=typeof e.qj){e=e.getOptions();for(var f=0;f<e.length;++f){var g=e[f][1];null==d[g]&&console.warn("No tooltip mapping for value "+g+" of field "+c+" of block type "+a.type)}}};h.Y.Wr=function(a){"object"==typeof document&&h.g.Tz(function(){h.g.Qw(a)});return function(){this.Ra(function(){var c=y(this,"VAR");return h.g.le(a).replace("%1",c?c.Tb():"")}.bind(this))}};
h.Y.CE=function(){this.mH=this.sf;this.Ra(function(){var a=this.getParent();return a&&Ha(a)&&a.sf||this.mH}.bind(this))};h.Y.register("parent_tooltip_when_inline",h.Y.CE);h.mb={};h.mb.ys=0;h.mb.Zo=null;h.mb.sE=function(a){var c=a.v,d=a.ya();c.oh.play("delete");a=Ia(c,d);d=d.cloneNode(!0);d.nH=a.x;d.oH=a.y;d.setAttribute("transform","translate("+a.x+","+a.y+")");x(c).appendChild(d);d.Iw=d.getBBox();h.mb.Bx(d,c.G,new Date,c.scale)};h.mb.Bx=function(a,c,d,e){var f=(new Date-d)/150;1<f?h.g.o.removeNode(a):(a.setAttribute("transform","translate("+(a.nH+(c?-1:1)*a.Iw.width*e/2*f)+","+(a.oH+a.Iw.height*e*f)+") scale("+(1-f)*e+")"),setTimeout(h.mb.Bx,10,a,c,d,e))};
h.mb.UD=function(a){var c=a.v,d=c.scale;c.oh.play("click");if(!(1>d)){var e=Ia(c,a.ya());a.M?(e.x+=(a.G?3:-3)*d,e.y+=13*d):a.Z&&(e.x+=(a.G?-23:23)*d,e.y+=3*d);a=h.g.o.L("circle",{cx:e.x,cy:e.y,r:0,fill:"none",stroke:"#888","stroke-width":10},x(c));h.mb.ex(a,new Date,d)}};h.mb.ex=function(a,c,d){var e=(new Date-c)/150;1<e?h.g.o.removeNode(a):(a.setAttribute("r",25*e*d),a.style.opacity=1-e,h.mb.ys=setTimeout(h.mb.ex,10,a,c,d))};
h.mb.rE=function(a){a.v.oh.play("disconnect");if(!(1>a.v.scale)){var c=H(a).height;c=Math.atan(10/c)/Math.PI*180;a.G||(c*=-1);h.mb.zx(a.ya(),c,new Date)}};h.mb.zx=function(a,c,d){var e=(new Date-d)/200;1<e?a.An="":(a.An="skewX("+Math.round(Math.sin(e*Math.PI*3)*(1-e)*c)+")",h.mb.Zo=a,h.mb.ys=setTimeout(h.mb.zx,10,a,c,d));a.setAttribute("transform",a.Ln+a.An)};h.mb.zs=function(){if(h.mb.Zo){clearTimeout(h.mb.ys);var a=h.mb.Zo;a.An="";a.setAttribute("transform",a.Ln);h.mb.Zo=null}};h.to=function(a){this.tf=h.selected=a;this.s=a.v;this.nj=this.Bt=null;this.Bk=Ja(this,this.tf);this.Ac=this.Db=null;this.gg=!1;this.pj=null;this.ot=!1;this.Jk=null;a=this.tf.Fe(!1);var c;a:{for(c=this.tf.X;c;){var d=z(c);if(!d)break a;c=d.X}c=null}c&&c!=this.tf.X&&(a.push(c),this.Bt=c,this.nj=Ja(this,c.B));this.Pr=a};
h.to.prototype.I=function(){this.s=this.tf=null;this.Pr.length=0;this.Ac=this.Db=null;h.i.disable();try{this.Bk&&(this.Bk.I(),this.Bk=null),this.nj&&(this.nj.I(),this.nj=null)}finally{h.i.enable()}this.Jk=null};
h.to.prototype.update=function(a,c){var d=this.Db&&this.Ac?h.bB:h.td;for(var e=null,f=null,g=0;g<this.Pr.length;g++){var k=this.Pr[g],l=k.closest(d,a);l.connection&&(e=l.connection,f=k,d=l.Vp)}e=(d={closest:e,local:f,Vp:d},!!d.closest)&&c!=h.Dv;if((this.gg=!!c&&!this.tf.getParent()&&this.tf.je()&&!e)||Ka(this,d,a)){h.i.disable();d.closest?(a=this.Db!=d.closest,c=this.Ac!=d.local,this.Db&&this.Ac&&(a||c||this.gg)&&La(this)):La(this);this.Ac=this.Db=this.pj=null;if(!this.gg&&(a=d.closest,c=d.local,
a))if(a==this.Db||a.B.Mh())console.log("Trying to connect to an insertion marker");else{this.Db=a;this.Ac=c;a=this.Db;c=this.Ac;if(c.type==h.Te)a=a.isConnected()&&!h.sa.Uy(this.tf,a.ca.B);else{a:{for(d=0;e=c.B.T[d];d++)if(e.connection&&e.connection.type==h.jb){d=e.connection;break a}d=null}a=c==d?0:!this.tf.X&&c.type==h.Ue&&a.isConnected()}if(a)a=this.Db,c=this.Ac,z(a)?(this.Jk=z(a),Ma(z(a),!0)):c.type==h.Te&&(this.Jk=a.B,a.B.uF(a,!0)),this.ot=!0;else{d=this.Ac;a=this.Db;c=this.Bt&&d==this.Bt?this.nj:
this.Bk;a:{f=d.B;e=c.Fe(!0);f=f.Fe(!0);if(e.length!=f.length)throw Error("Connection lists did not match in length.");for(g=0;g<f.length;g++)if(f[g]==d){d=e[g];break a}d=null}if(d==this.pj)throw Error("Made it to connectMarker_ even though the marker isn't changing");c.za();c.ba=!0;c.ya().setAttribute("visibility","visible");d.type!=h.jb&&d.type!=h.Wa||c.moveBy(a.Wb-d.Wb,a.ab-d.ab);d.connect(a);this.pj=d}this.Db&&this.Db.Iy()}h.i.enable()}};
function Ja(a,c){var d=c.type;h.i.disable();try{var e=a.s.Uh(d);e.Xz(!0);e.Wg(c.isCollapsed());if(c.eb){var f=c.eb();f&&e.zb(f)}for(a=0;a<c.T.length;a++){var g=c.T[a],k=e.T[a];for(d=0;d<g.Pa.length;d++)k.Pa[d].setValue(g.Pa[d].getValue())}e.Ke();e.ya().setAttribute("visibility","hidden")}finally{h.i.enable()}return e}
function Ka(a,c,d){var e=c.local,f=c.closest;c=c.Vp;if(e&&f){if(a.Ac&&a.Db){if(a.Db==f&&a.Ac==e)return!1;e=a.Ac.Wb+d.x-a.Db.Wb;a=a.Ac.ab+d.y-a.Db.ab;a=Math.sqrt(e*e+a*a);return!(f&&c>a-h.eB)}if(a.Ac||a.Db)console.error("Only one of localConnection_ and closestConnection_ was set.");else return!0}else return!(!a.Ac||!a.Db);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0}
function La(a){a.Db&&(h.g.o.removeNode(h.sa.Jy),delete h.sa.Jy);if(a.ot){var c=a.Db;c.type!=h.Wa||c.isConnected()?Ma(a.Jk,!1):a.Jk.uF(c,!1);a.Jk=null;a.ot=!1}else if(a.pj)if(a.pj){c=a.pj;var d=c.B,e=d.X,f=d.Z,g=d.M;g=c.type==h.Wa&&!(g&&g.ca);!(c!=e||f&&f.ca)||g?A(z(c),!1):c.type==h.jb&&c!=e?(e=c.ca,A(e.B,!1),f=f?f.ca:null,A(d,!0),f&&f.connect(e)):A(d,!0);if(c.ca)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");a.pj=null;d.ya().setAttribute("visibility","hidden")}else console.log("No insertion marker connection to disconnect")}
h.to.prototype.Dk=function(){var a=[];this.Bk&&a.push(this.Bk);this.nj&&a.push(this.nj);return a};h.ri=function(a,c){this.Eb=a;this.s=c;this.Mf=new h.to(this.Eb);this.Xi=null;this.gg=!1;this.eg=this.Eb.Qa();this.cp=h.ri.zF(a)};h.ri.prototype.I=function(){this.qc=this.s=this.Eb=null;this.cp.length=0;this.Mf&&(this.Mf.I(),this.Mf=null)};h.ri.zF=function(a){var c=[];a=p(a,!1);for(var d=0,e;e=a[d];d++){e=Na(e);for(var f=0;f<e.length;f++)c.push({location:e[f].Kk,icon:e[f]})}return c};
function Oa(a,c,d){d=a.Wk(d);var e=h.g.K.sum(a.eg,d);a.Eb.St(e);for(e=0;e<a.cp.length;e++){var f=a.cp[e];Pa(f.icon,h.g.K.sum(f.location,d))}a.Xi=Qa(a.s,c);a.Mf.update(d,a.Xi);a.gg=a.Mf.gg;c=a.s.ad;a.gg?(Ra(a.Eb,!0),a.Xi==h.Iq&&c&&Sa(c,!0)):(Ra(a.Eb,!1),c&&Sa(c,!1))}
function Ta(a,c,d){Oa(a,c,d);a.cp=[];h.g.o.En();h.mb.zs();c=a.Wk(d);d=h.g.K.sum(a.eg,c);var e=a.Eb;e.Tn&&(e.translate(d.x,d.y),e.v.$d.Oo(e.v.pb));d=a.s.ad;a.gg?(d&&setTimeout(d.close.bind(d),100),a.Am(),a.Eb.I(!1,!0)):d&&d.close();a.gg||(Ua(a.Eb,c.x,c.y),a.Eb.Cj(!1),a.Am(),a.Mf.Db?(c=a.Mf,c.Db&&(h.i.disable(),La(c),h.i.enable(),c.Ac.connect(c.Db),c.tf.ba&&(h.mb.UD((E(c.Ac)?c.Db:c.Ac).B),Va(I(c.tf))))):a.Eb.za(),Wa(a.Eb));a.s.Gc(!0);(c=a.s.ra)&&h.g.o.Ec(c.vc,a.Eb.je()?"blocklyToolboxDelete":"blocklyToolboxGrab");
h.i.$(!1)}h.ri.prototype.Am=function(){var a=new h.i.wl(this.Eb);a.Zt=this.eg;a.Aj();h.i.Ka(a)};h.ri.prototype.Wk=function(a){a=new h.g.K(a.x/this.s.scale,a.y/this.s.scale);this.s.lj&&a.scale(1/this.s.options.Nb.scale);return a};h.ri.prototype.Dk=function(){return this.Mf&&this.Mf.Dk?this.Mf.Dk():[]};h.jo=function(){this.zc=this.Sb=null};function J(a,c){a.Sb=c;a.zc&&a.zc.draw(a.Sb)}b=h.jo.prototype;b.Ca=function(){this.zc&&this.zc.Ca()};b.next=function(){var a=this.Sb;if(!a)return null;for(a=a.next();a&&a.next()&&(a.Mb()==h.F.types.we||a.Mb()==h.F.types.Wd);)a=a.next();a&&J(this,a);return a};b.Mm=function(){var a=this.Sb;if(!a)return null;if(a.Mb()==h.F.types.ye||a.Mb()==h.F.types.hk)a=a.next();(a=a.Mm())&&J(this,a);return a};
b.Wf=function(){var a=this.Sb;if(!a)return null;for(a=a.Wf();a&&a.Wf()&&(a.Mb()==h.F.types.we||a.Mb()==h.F.types.Wd);)a=a.Wf();a&&J(this,a);return a};b.jn=function(){var a=this.Sb;if(!a)return null;(a=a.jn())&&a.Mb()==h.F.types.Wd&&(a=a.Wf()||a);a&&J(this,a);return a};h.fh=function(){h.fh.w.constructor.call(this)};h.g.object.W(h.fh,h.jo);h.fh.prototype.next=function(){return null};h.fh.prototype.Mm=function(){return null};h.fh.prototype.Wf=function(){return null};h.fh.prototype.jn=function(){return null};h.SC=function(){var a=h.Ii.Wj.BD;this.wD=h.Ii.Wj.gE;this.CD=a;this.RD=Object.create(null)};function Xa(a,c){return(c=a.RD[c])&&"string"==typeof propertyValue&&Xa(a,c)?Xa(a,c):c?String(c):null};h.Sl=function(a){this.lq=a;this.jq=[];this.uh=Object.create(null)};h.Sl.prototype.rp=function(){return this.lq};h.Sl.prototype.subscribe=function(a,c,d){this.uh[c]||(this.uh[c]=[]);this.uh[c].push({element:a,propertyName:d});a.style[d]=this.lq&&Xa(this.lq,c)||""};h.Sl.prototype.unsubscribe=function(a){if(a)for(var c=Object.keys(this.uh),d=0,e;e=c[d];d++){for(var f=this.uh[e],g=f.length-1;0<=g;g--)f[g].element===a&&f.splice(g,1);this.uh[e].length||delete this.uh[e]}};
h.Sl.prototype.I=function(){this.uh=this.jq=this.lq=this.ld=null};h.Ii={};h.Ii.Wj={};h.Ii.Wj.gE={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}};
h.Ii.Wj.BD={colour_category:{colour:"20"},list_category:{colour:"260"},logic_category:{colour:"210"},loop_category:{colour:"120"},math_category:{colour:"230"},procedure_category:{colour:"290"},text_category:{colour:"160"},variable_category:{colour:"330"},variable_dynamic_category:{colour:"310"}};h.Ii.Wj=new h.SC;h.Er=function(a){this.Sa=Object.create(null);this.v=a};b=h.Er.prototype;b.clear=function(){this.Sa=Object.create(null)};b.$p=function(a,c){var d=this.Vc(c,a.type),e=K(this.v,!1);h.i.$(!0);try{if(d&&d.ua()!=a.ua()){var f=a.type;c!=d.name&&Ya(d,c,e);for(c=0;c<e.length;c++)e[c].Zp(a.ua(),d.ua());h.i.Ka(new h.i.We(a));this.Sa[f].splice(this.Im(f).indexOf(a),1)}else Ya(a,c,e)}finally{h.i.$(!1)}};
b.ei=function(a,c){var d=this.hf(a);if(!d)throw Error("Tried to rename a variable that didn't exist. ID: "+a);this.$p(d,c)};function Ya(a,c,d){h.i.Ka(new h.i.Bf(a,c));a.name=c;for(c=0;c<d.length;c++)d[c].pq(a)}
b.Ld=function(a,c,d){var e=this.Vc(a,c);if(e){if(d&&e.ua()!=d)throw Error('Variable "'+a+'" is already in use and its id is "'+e.ua()+'" which conflicts with the passed in id, "'+d+'".');return e}if(d&&this.hf(d))throw Error('Variable id, "'+d+'", is already in use.');e=d||h.g.Jg();c=c||"";e=new h.Ul(this.v,a,c,e);a=this.Sa[c]||[];a.push(e);delete this.Sa[c];this.Sa[c]=a;return e};
b.Kf=function(a){var c=this.hf(a);if(c){var d=c.name,e=this.gt(a);a=0;for(var f;f=e[a];a++)if("procedures_defnoreturn"==f.type||"procedures_defreturn"==f.type){a=G(f,"NAME");d=h.h.CANNOT_DELETE_VARIABLE_PROCEDURE.replace("%1",d).replace("%2",a);h.alert(d);return}var g=this;1<e.length?(d=h.h.DELETE_VARIABLE_CONFIRMATION.replace("%1",String(e.length)).replace("%2",d),h.confirm(d,function(k){k&&g.Xo(c,e)})):g.Xo(c,e)}else console.warn("Can't delete non-existent variable: "+a)};
b.Xo=function(a,c){var d=h.i.Zb();d||h.i.$(!0);try{for(var e=0;e<c.length;e++)c[e].I(!0,!1);var f=this.Sa[a.type];c=0;for(var g;g=f[c];c++)if(g.ua()==a.ua()){f.splice(c,1);h.i.Ka(new h.i.We(a));break}}finally{d||h.i.$(!1)}};b.Vc=function(a,c){if(c=this.Sa[c||""])for(var d=0,e;e=c[d];d++)if(h.Xd.Ee(e.name,a))return e;return null};b.hf=function(a){for(var c=Object.keys(this.Sa),d=0;d<c.length;d++)for(var e=c[d],f=0,g;g=this.Sa[e][f];f++)if(g.ua()==a)return g;return null};
b.Im=function(a){return(a=this.Sa[a||""])?a.slice():[]};b.ft=function(a){var c=[];a&&a.bi&&(c=Object.keys(a.bi.Sa));a=Object.keys(this.Sa).concat(c);c=!1;for(var d=0;d<a.length;d++)""==a[d]&&(c=!0);c||a.push("");return a};b.Kg=function(){var a=[],c;for(c in this.Sa)a=a.concat(this.Sa[c]);return a};b.gt=function(a){for(var c=[],d=K(this.v,!1),e=0;e<d.length;e++){var f=d[e].Mg();if(f)for(var g=0;g<f.length;g++)f[g].ua()==a&&c.push(d[e])}return c};h.Ib=function(a){this.id=h.g.Jg();h.Ib.Wl[this.id]=this;this.options=a||{};this.G=!!this.options.G;this.ie=!!this.options.ie;this.Ia=this.options.Ia;this.ol=[];this.mq=[];this.So=Object.create(null);this.zd=[];this.Nj=[];this.on=[];this.Rr=Object.create(null);this.$g=Object.create(null);this.Sa=new h.Er(this);this.bi=null;this.Xa=new h.jo;this.ac=new h.fh;this.jc=this.options.Nb?this.options.Nb.jc:new h.Sl(this.options.jH||h.Ii.Wj);this.jc.jq.push(this)};b=h.Ib.prototype;b.ba=!1;b.vt=!1;b.Uv=1024;
b.Uo=null;b.Fu=function(a){this.Xa=a};b.Yz=function(a){this.ac=a};b.rp=function(){return this.jc.rp()};b.I=function(){this.zd.length=0;this.clear();delete h.Ib.Wl[this.id];if(this.jc){var a=this.jc,c=a.jq.indexOf(this);if(0>c)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");a.jq.splice(c,1);this.jc.unsubscribe(this.Hc);this.options.Nb||(this.jc.I(),this.jc=null)}};h.Ib.mw=3;b=h.Ib.prototype;
b.dg=function(a,c){a=a.Qa();c=c.Qa();return a.y+h.Ib.prototype.dg.offset*a.x-(c.y+h.Ib.prototype.dg.offset*c.x)};function Za(a,c){if(!h.g.Ko(a.ol,c))throw Error("Block not present in workspace's list of top-most blocks.");}function D(a,c){var d=[].concat(a.ol);c&&1<d.length&&(a.dg.offset=Math.sin(h.g.Ha.nd(h.Ib.mw)),a.G&&(a.dg.offset*=-1),d.sort(a.dg));return d}
function ja(a,c){var d=[].concat(a.mq);c&&1<d.length&&(a.dg.offset=Math.sin(h.g.Ha.nd(h.Ib.mw)),a.G&&(a.dg.offset*=-1),d.sort(a.dg));return d}function K(a,c){if(c){a=D(a,!0);c=[];for(var d=0;d<a.length;d++)c.push.apply(c,p(a[d],!0))}else for(c=D(a,!1),d=0;d<c.length;d++)c.push.apply(c,c[d].Ah(!1));return c.filter(function(e){return!e.Mh()})}
b.clear=function(){this.vt=!0;try{var a=h.i.Zb();for(a||h.i.$(!0);this.ol.length;)this.ol[0].I();for(;this.mq.length;)this.mq[this.mq.length-1].I();a||h.i.$(!1);this.Sa.clear();this.bi&&this.bi.clear()}finally{this.vt=!1}};b.ei=function(a,c){this.Sa.ei(a,c)};b.Ld=function(a,c,d){return this.Sa.Ld(a,c,d)};b.gt=function(a){return this.Sa.gt(a)};b.Kf=function(a){this.Sa.Kf(a)};b.Xo=function(a,c){this.Sa.Xo(a,c)};b.Vc=function(a,c){return this.Sa.Vc(a,c)};b.hf=function(a){return this.Sa.hf(a)};b.Im=function(a){return this.Sa.Im(a)};
b.ft=function(){return this.Sa.ft(this)};b.Kg=function(){return this.Sa.Kg()};b.Qf=function(){return 0};b.Uh=function(a,c){return new h.Zn(this,a,c)};function $a(a){return isNaN(a.options.Ot)?Infinity:a.options.Ot-K(a).length}function ab(a,c){if(!bb(a))return!0;var d=0,e;for(e in c){var f=c[e];if(a.options.Pt){var g=a.options.Pt[e]||Infinity;var k=a.$g[e]?a.$g[e].slice(0):[];g-=k.length}else g=Infinity;if(f>g)return!1;d+=c[e]}return d>$a(a)?!1:!0}
function bb(a){return Infinity!=a.options.Ot||!!a.options.Pt}b.$u=function(a){var c=a?this.on:this.Nj,d=a?this.Nj:this.on,e=c.pop();if(e){for(var f=[e];c.length&&e.group&&e.group==c[c.length-1].group;)f.push(c.pop());for(c=0;e=f[c];c++)d.push(e);f=h.i.filter(f,a);h.i.Dc=!1;try{for(c=0;e=f[c];c++)e.run(a)}finally{h.i.Dc=!0}}};function cb(a,c){a.zd.push(c)}function db(a,c){h.g.Ko(a.zd,c)}function r(a,c){return a.Rr[c]||null}h.Ib.Wl=Object.create(null);h.Ib.Ws=function(a){return h.Ib.Wl[a]||null};
h.Ib.getAll=function(){var a=[],c;for(c in h.Ib.Wl)a.push(h.Ib.Wl[c]);return a};h.oa=function(a,c,d,e,f,g){this.s=a;this.af=c;this.$z=d;d=h.oa.KA;this.s.G&&(d=-d);this.pD=h.g.Ha.nd(d);a.Zg.appendChild(this.mm(c,!(!f||!g)));this.ec=e;this.xu&&eb(this);f&&g||(c=this.af.getBBox(),f=c.width+2*h.oa.cd,g=c.height+2*h.oa.cd);this.un(f,g);eb(this);fb(this);this.xu=!0;a.options.readOnly||(h.ma(this.bm,"mousedown",this,this.xD),this.Zf&&h.ma(this.Zf,"mousedown",this,this.LG))};h.oa.cd=6;h.oa.LA=5;h.oa.KA=20;h.oa.mv=4;h.oa.IA=8;h.oa.Zh=null;h.oa.Yh=null;h.oa.prototype.zu=null;
h.oa.Zu=function(){h.oa.Zh&&(h.$a(h.oa.Zh),h.oa.Zh=null);h.oa.Yh&&(h.$a(h.oa.Yh),h.oa.Yh=null)};h.oa.yD=function(){h.Touch.em();h.oa.Zu()};b=h.oa.prototype;b.xu=!1;b.ec=null;b.Sg=0;b.di=0;b.rb=0;b.Wc=0;b.Or=!0;
b.mm=function(a,c){this.ae=h.g.o.L("g",{},null);var d={filter:"url(#"+this.s.options.Ix+")"};h.g.userAgent.RB&&(d={});d=h.g.o.L("g",d,this.ae);this.Vr=h.g.o.L("path",{},d);this.bm=h.g.o.L("rect",{"class":"blocklyDraggable",x:0,y:0,rx:h.oa.cd,ry:h.oa.cd},d);c?(this.Zf=h.g.o.L("g",{"class":this.s.G?"blocklyResizeSW":"blocklyResizeSE"},this.ae),c=2*h.oa.cd,h.g.o.L("polygon",{points:"0,x x,x x,0".replace(/x/g,c.toString())},this.Zf),h.g.o.L("line",{"class":"blocklyResizeLine",x1:c/3,y1:c-1,x2:c-1,y2:c/
3},this.Zf),h.g.o.L("line",{"class":"blocklyResizeLine",x1:2*c/3,y1:c-1,x2:c-1,y2:2*c/3},this.Zf)):this.Zf=null;this.ae.appendChild(a);return this.ae};b.ya=function(){return this.ae};function gb(a,c){a.ae.dataset&&(a.ae.dataset.blockId=c)}b.xD=function(a){var c=this.s.Ch(a);if(c){if(c.dj)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");c.oe||(c.oe=this);c.nf=a}};b.yn=function(){};b.je=function(){return!1};
b.LG=function(a){hb(this);h.oa.Zu();h.g.mj(a)||(this.s.Qu(a,new h.g.K(this.s.G?-this.rb:this.rb,this.Wc)),h.oa.Zh=h.ma(document,"mouseup",this,h.oa.yD),h.oa.Yh=h.ma(document,"mousemove",this,this.MG),h.oc());a.stopPropagation()};b.MG=function(a){this.Or=!1;var c=this.s;a=h.g.fn(a,x(c),Ba(c));a.x/=c.scale;a.y/=c.scale;c=h.g.K.sum(c.Fx,a);this.un(this.s.G?-c.x:c.x,c.y);this.s.G&&eb(this)};function hb(a){var c=a.ae.parentNode;return c.lastChild!==a.ae?(c.appendChild(a.ae),!0):!1}
function ib(a,c,d){var e=a.s.G?a.ec.x-c.x-a.rb:c.x+a.ec.x;c=c.y+a.ec.y;return Math.max(0,Math.min(1,(Math.min(e+a.rb,d.dc+d.Bb)-Math.max(e,d.dc))*(Math.min(c+a.Wc,d.lc+d.Pb)-Math.max(c,d.lc))/(a.rb*a.Wc)))}function eb(a){var c=a.ec.x;c=a.s.G?c-(a.Sg+a.rb):c+a.Sg;a.moveTo(c,a.di+a.ec.y)}b.moveTo=function(a,c){this.ae.setAttribute("transform","translate("+a+","+c+")")};b.Vs=function(){return new h.g.Ve(this.rb,this.Wc)};
b.un=function(a,c){var d=2*h.oa.cd;a=Math.max(a,d+45);c=Math.max(c,d+20);this.rb=a;this.Wc=c;this.bm.setAttribute("width",a);this.bm.setAttribute("height",c);this.Zf&&(this.s.G?this.Zf.setAttribute("transform","translate("+2*h.oa.cd+","+(c-d)+") scale(-1 1)"):this.Zf.setAttribute("transform","translate("+(a-d)+","+(c-d)+")"));if(this.Or){a=this.s.Uc();a.dc/=this.s.scale;a.Bb/=this.s.scale;a.lc/=this.s.scale;a.Pb/=this.s.scale;c=-this.rb/4;if(!(this.rb>a.Bb)){if(this.s.G){d=this.ec.x-c;var e=d-this.rb;
var f=a.dc+a.Bb,g=a.dc+h.Ua.Zc/this.s.scale}else e=c+this.ec.x,d=e+this.rb,g=a.dc,f=a.dc+a.Bb-h.Ua.Zc/this.s.scale;this.s.G?e<g?c=-(g-this.ec.x+this.rb):d>f&&(c=-(f-this.ec.x)):e<g?c=g-this.ec.x:d>f&&(c=f-this.ec.x-this.rb)}e=c;c=-this.Wc/4;if(!(this.Wc>a.Pb)){d=this.ec.y+c;f=d+this.Wc;g=a.lc;var k=a.lc+a.Pb-h.Ua.Zc/this.s.scale,l=this.ec.y;d<g?c=g-l:f>k&&(c=k-l-this.Wc)}g=c;f=this.$z.getBBox();c={x:e,y:-this.Wc-h.wa.Yq};d={x:-this.rb-30,y:g};g={x:f.width,y:g};k={x:e,y:f.height};e=f.width<f.height?
g:k;f=f.width<f.height?k:g;g=ib(this,c,a);k=ib(this,d,a);l=ib(this,e,a);a=Math.max(g,k,l,ib(this,f,a));g==a?(this.Sg=c.x,this.di=c.y):k==a?(this.Sg=d.x,this.di=d.y):l==a?(this.Sg=e.x,this.di=e.y):(this.Sg=f.x,this.di=f.y)}eb(this);fb(this);this.zu&&this.zu()};
function fb(a){var c=[],d=a.rb/2,e=a.Wc/2,f=-a.Sg,g=-a.di;if(d==f&&e==g)c.push("M "+d+","+e);else{g-=e;f-=d;a.s.G&&(f*=-1);var k=Math.sqrt(g*g+f*f),l=Math.acos(f/k);0>g&&(l=2*Math.PI-l);var m=l+Math.PI/2;m>2*Math.PI&&(m-=2*Math.PI);var n=Math.sin(m),t=Math.cos(m),u=a.Vs();m=(u.width+u.height)/h.oa.LA;m=Math.min(m,u.width,u.height)/4;u=1-h.oa.IA/k;f=d+u*f;g=e+u*g;u=d+m*t;var w=e+m*n;d-=m*t;e-=m*n;n=l+a.pD;n>2*Math.PI&&(n-=2*Math.PI);l=Math.sin(n)*k/h.oa.mv;k=Math.cos(n)*k/h.oa.mv;c.push("M"+u+","+
w);c.push("C"+(u+k)+","+(w+l)+" "+f+","+g+" "+f+","+g);c.push("C"+f+","+g+" "+(d+k)+","+(e+l)+" "+d+","+e)}c.push("z");a.Vr.setAttribute("d",c.join(" "))}b.Fc=function(a){this.bm.setAttribute("fill",a);this.Vr.setAttribute("fill",a)};b.I=function(){h.oa.Zu();h.g.o.removeNode(this.ae);this.$z=this.af=this.s=this.Zf=this.bm=this.Vr=this.ae=null};b.St=function(a,c){a?a.Mj(c.x,c.y):this.moveTo(c.x,c.y);this.Sg=this.s.G?this.ec.x-c.x-this.rb:c.x-this.ec.x;this.di=c.y-this.ec.y;fb(this)};
b.Qa=function(){return new h.g.K(this.ec.x+this.Sg,this.ec.y+this.di)};h.i.jg=function(a){this.Gf=a.id;this.tc=a.v.id;this.group=h.i.Zb();this.Dc=h.i.Dc};h.g.object.W(h.i.jg,h.i.Abstract);h.i.jg.prototype.Za=function(){var a=h.i.jg.w.Za.call(this);this.Gf&&(a.commentId=this.Gf);return a};h.i.jg.prototype.va=function(a){h.i.jg.w.va.call(this,a);this.Gf=a.commentId};h.i.Xj=function(a,c,d){a&&(h.i.Xj.w.constructor.call(this,a),this.mz=c,this.Op=d)};h.g.object.W(h.i.Xj,h.i.jg);b=h.i.Xj.prototype;b.type=h.i.wv;
b.Za=function(){var a=h.i.Xj.w.Za.call(this);a.newContents=this.Op;return a};b.va=function(a){h.i.Xj.w.va.call(this,a);this.Op=a.newValue};b.Pk=function(){return this.mz==this.Op};b.run=function(a){var c;(c=v(this).So[this.Gf]||null)?c.qM(a?this.Op:this.mz):console.warn("Can't change non-existent comment: "+this.Gf)};h.i.kg=function(a){a&&(h.i.kg.w.constructor.call(this,a),this.xml=a.Vu())};h.g.object.W(h.i.kg,h.i.jg);h.i.kg.prototype.type=h.i.bo;
h.i.kg.prototype.Za=function(){var a=h.i.kg.w.Za.call(this);a.xml=h.R.Md(this.xml);return a};h.i.kg.prototype.va=function(a){h.i.kg.w.va.call(this,a);this.xml=h.R.li(a.xml)};h.i.kg.prototype.run=function(a){h.i.zv(this,a)};h.i.zv=function(a,c){var d=v(a);c?(c=h.g.xml.createElement("xml"),c.appendChild(a.xml),h.R.xh(c,d)):(d=d.So[a.Gf]||null)?d.I(!1,!1):console.warn("Can't uncreate non-existent comment: "+a.Gf)};h.i.lg=function(a){a&&(h.i.lg.w.constructor.call(this,a),this.xml=a.Vu())};
h.g.object.W(h.i.lg,h.i.jg);h.i.lg.prototype.type=h.i.xv;h.i.lg.prototype.Za=function(){return h.i.lg.w.Za.call(this)};h.i.lg.prototype.va=function(a){h.i.lg.w.va.call(this,a)};h.i.lg.prototype.run=function(a){h.i.zv(this,!a)};h.i.ti=function(a){a&&(h.i.ti.w.constructor.call(this,a),this.gs=a,this.$t=a.uy(),this.sj=null)};h.g.object.W(h.i.ti,h.i.jg);b=h.i.ti.prototype;
b.Aj=function(){if(!this.gs)throw Error("Tried to record the new position of a comment on the same event twice.");this.sj=this.gs.uy();this.gs=null};b.type=h.i.co;b.Za=function(){var a=h.i.ti.w.Za.call(this);this.sj&&(a.newCoordinate=Math.round(this.sj.x)+","+Math.round(this.sj.y));return a};b.va=function(a){h.i.ti.w.va.call(this,a);a.newCoordinate&&(a=a.newCoordinate.split(","),this.sj=new h.g.K(Number(a[0]),Number(a[1])))};b.Pk=function(){return h.g.K.Ee(this.$t,this.sj)};
b.run=function(a){var c;if(c=v(this).So[this.Gf]||null){a=a?this.sj:this.$t;var d=c.uy();c.moveBy(a.x-d.x,a.y-d.y)}else console.warn("Can't move non-existent comment: "+this.Gf)};h.xl=function(a,c){this.nc=a;this.s=c;this.Xi=null;this.tq=!1;this.eg=this.nc.Qa();this.$i=h.g.hj()&&c.$d?c.$d:null};h.xl.prototype.I=function(){this.$i=this.s=this.nc=null};function jb(a,c,d){d=a.Wk(d);d=h.g.K.sum(a.eg,d);a.nc.St(a.$i,d);a.nc.je()&&(a.Xi=Qa(a.s,c),a.tq=a.Xi!=h.Cv,c=a.s.ad,a.tq?(Ra(a.nc,!0),a.Xi==h.Iq&&c&&Sa(c,!0)):(Ra(a.nc,!1),c&&Sa(c,!1)))}
function kb(a,c,d){jb(a,c,d);c=a.Wk(d);c=h.g.K.sum(a.eg,c);a.nc.moveTo(c.x,c.y);c=a.s.ad;a.tq?(c&&setTimeout(c.close.bind(c),100),a.Am(),a.nc.I(!1,!0)):c&&c.close();a.tq||(a.$i&&a.$i.Oo(a.s.Zg),a.nc.Cj&&a.nc.Cj(!1),a.Am());a.s.Gc(!0);a.s.ra&&h.g.o.Ec(a.s.ra.vc,a.nc.je()?"blocklyToolboxDelete":"blocklyToolboxGrab");h.i.$(!1)}h.xl.prototype.Am=function(){if(this.nc.Qy){var a=new h.i.ti(this.nc);a.$t=this.eg;a.Aj();h.i.Ka(a)}};
h.xl.prototype.Wk=function(a){a=new h.g.K(a.x/this.s.scale,a.y/this.s.scale);this.s.lj&&a.scale(1/this.s.options.Nb.scale);return a};h.xl.prototype.Ut=function(){this.nc.moveTo(0,0);this.$i.Mj(this.eg.x,this.eg.y);ca(this.$i,this.nc.ya())};h.Xl=function(a){this.s=a;this.gA=new h.g.K(a.scrollX,a.scrollY)};h.Xl.prototype.I=function(){this.s=null};h.Xl.prototype.Qu=function(){h.selected&&lb(h.selected);Ca(this.s)};h.Xl.prototype.yh=function(a){a=h.g.K.sum(this.gA,a);this.s.scroll(a.x,a.y)};h.no=function(a){h.no.w.constructor.call(this,a.Ek());this.pc=a.pc;this.kf=a.kf};h.g.object.W(h.no,h.Xl);h.no.prototype.yh=function(a){a=h.g.K.sum(this.gA,a);this.kf?this.pc.set(-a.x):this.pc.set(-a.y)};h.Zj=function(a,c){this.qc=this.rc=this.Ej=this.Fj=this.oe=this.vd=this.hz=null;this.ls=c;this.Pm=this.jj=this.Qm=this.bj=!1;this.nf=a;this.P=this.oi=this.Ye=this.zg=this.Rp=this.Qp=null;this.Ep=this.dj=this.Nw=!1;this.Ey=!h.nB};b=h.Zj.prototype;b.I=function(){h.Touch.em();h.H.pH();this.ls.yc=null;this.Qp&&h.$a(this.Qp);this.Rp&&h.$a(this.Rp);this.P=this.qc=this.rc=this.Ej=this.Fj=null;this.Ye&&(this.Ye.I(),this.Ye=null);this.oi&&(this.oi.I(),this.oi=null);this.zg&&(this.zg.I(),this.zg=null)};
function mb(a,c){a.vd=h.g.K.um(new h.g.K(c.clientX,c.clientY),a.hz);if(a.bj)var d=!1;else a.bj=h.g.K.QF(a.vd)>(a.P?h.vB:h.mB),d=a.bj;if(d){if(a.Nw)throw Error("updateIsDragging_ should only be called once per gesture.");a.Nw=!0;if(a.oe){a.Pm=!0;a.zg=new h.xl(a.oe,a.qc);d=a.zg;h.i.Zb()||h.i.$(!0);d.s.Gc(!1);d.nc.Or=!1;d.$i&&d.Ut();d.nc.Cj&&d.nc.Cj(!0);var e=d.s.ra;e&&h.g.o.Cb(e.vc,d.nc.je()?"blocklyToolboxDelete":"blocklyToolboxGrab");jb(a.zg,a.nf,a.vd);d=!0}else d=!1;if(!d){if(a.rc)if(a.P?(a.P.Py(a.rc)?
((d=!nb(a.P))||(d=a.vd,d=Math.atan2(d.y,d.x)/Math.PI*180,e=a.P.xE,d=d<e&&d>-e||d<-180+e||d>180-e?!0:!1),d?(a.qc=a.P.Ob,ob(a.qc),h.i.Zb()||h.i.$(!0),a.Ej=null,a.rc=pb(a.P,a.rc),a.rc.select(),d=!0):d=!1):d=!1,a.jj=d):a.rc.kd()&&(a.jj=!0),a.jj){a.Ye=new h.ri(a.rc,a.qc);d=a.Ye;e=a.vd;var f=a.Ey;h.i.Zb()||h.i.$(!0);d.s.lj&&Va(d.Eb);h.g.o.Dn();d.s.Gc(!1);h.mb.zs();if(d.Eb.getParent()||f&&d.Eb.X&&z(d.Eb.X))A(d.Eb,f),e=d.Wk(e),e=h.g.K.sum(d.eg,e),d.Eb.translate(e.x,e.y),h.mb.rE(d.Eb);d.Eb.Cj(!0);d.Eb.Ut();
(e=d.s.ra)&&h.g.o.Cb(e.vc,d.Eb.je()?"blocklyToolboxDelete":"blocklyToolboxGrab");Oa(a.Ye,a.nf,a.vd);d=!0}else d=!1;else d=!1;if(d=!d)if(a.P)d=nb(a.P);else if(d=a.qc)d=a.qc,d=d.options.Bc&&d.options.Bc.yh;d&&(a.oi=a.P?new h.no(a.P):new h.Xl(a.qc),a.Qm=!0,a.oi.Qu())}h.Sh()}a.nf=c}
b.As=function(a){h.g.Hp(a)?this.cancel():(this.dj=!0,h.mb.zs(),ob(this.qc),this.qc.lj&&this.qc.resize(),Aa(this.qc),this.nf=a,h.oc(!!this.P),h.H.block(),this.rc&&(!this.rc.$b&&a.shiftKey?(h.navigation.Ns(),J(this.ls.Xa,h.navigation.et(this.rc))):this.rc.select()),h.g.mj(a)?oa(this,a):("touchstart"!=a.type.toLowerCase()&&"pointerdown"!=a.type.toLowerCase()||"mouse"==a.pointerType||h.OF(a,this),this.hz=new h.g.K(a.clientX,a.clientY),this.Ey=a.altKey||a.ctrlKey||a.metaKey,this.qk(a)))};
b.qk=function(a){this.Qp=h.ma(document,"mousemove",null,this.Jm.bind(this));this.Rp=h.ma(document,"mouseup",null,this.tp.bind(this));a.preventDefault();a.stopPropagation()};b.Jm=function(a){mb(this,a);this.Qm?this.oi.yh(this.vd):this.jj?Oa(this.Ye,this.nf,this.vd):this.Pm&&jb(this.zg,this.nf,this.vd);a.preventDefault();a.stopPropagation()};
b.tp=function(a){mb(this,a);h.Sh();if(this.Ep)console.log("Trying to end a gesture recursively.");else{this.Ep=!0;if(this.Pm)kb(this.zg,a,this.vd);else if(this.jj)Ta(this.Ye,a,this.vd);else if(this.Qm){var c=this.oi;c.yh(this.vd);Da(c.s)}else if(this.oe&&!this.bj)this.oe.UG&&this.oe.UG(),this.oe.select&&this.oe.select();else if(qb(this))this.Fj.qf(),rb(this);else if(this.Ej&&!this.bj&&!qb(this))this.P&&this.P.pk?this.rc.isEnabled()&&(h.i.Zb()||h.i.$(!0),Wa(pb(this.P,this.rc))):h.i.Ka(new h.i.ud(this.Ej,
"click",void 0,void 0)),rb(this),h.i.$(!1);else if(!(this.Ej||this.oe||this.Fj||this.bj))if(c=this.ls,a.shiftKey){h.navigation.Ns();var d=h.g.QG(c,new h.g.K(a.clientX,a.clientY));d=h.F.pm(c,d);J(c.Xa,d)}else h.selected&&lb(h.selected);a.preventDefault();a.stopPropagation();this.I()}};b.cancel=function(){if(!this.Ep){h.Sh();if(this.Pm)kb(this.zg,this.nf,this.vd);else if(this.jj)Ta(this.Ye,this.nf,this.vd);else if(this.Qm){var a=this.oi;a.yh(this.vd);Da(a.s)}this.I()}};
function oa(a,c){a.rc?(rb(a),h.oc(a.P),a.rc.yn(c)):a.oe?a.oe.yn(c):a.qc&&!a.P&&(h.oc(),a.qc.yn(c));c.preventDefault();c.stopPropagation();a.I()}function sb(a,c,d){if(a.dj)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");a.qc||(a.qc=d);a.nf=c;a.As(c);h.Le&&h.navigation.Gb(h.navigation.Pl)}function tb(a,c,d){if(a.dj)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");a.P||(a.P=d);sb(a,c,d.Ek())}
function rb(a){a.rc&&!a.P&&Va(a.rc)}function ub(a,c){a.Ej||a.oe||(a.Ej=c,c.$b&&c!=I(c)?vb(a,I(c)):vb(a,c))}function vb(a,c){c.cb?vb(a,c.getParent()):a.rc=c}function qb(a){if(a.Fj){var c=a.Fj;c=!!c.B&&c.B.jd()&&!!c.qf&&"function"===typeof c.qf}else c=!1;return c&&!a.bj&&(!a.P||!a.P.pk)}b.gc=function(){return this.Qm||this.jj||this.Pm};b.Dk=function(){return this.Ye?this.Ye.Dk():[]};h.Zj.rt=function(){for(var a=h.Ib.getAll(),c=0,d;d=a[c];c++)if(d.yc)return!0;return!1};h.Na=function(a,c,d){this.mA=this.Oj=this.cc=null;this.bc=new h.g.Ve(0,0);this.Sc=null;d&&this.Kd(d);this.setValue(a);c&&(this.Oj=c)};h.Na.tv=16;h.Na.sw=12.5;h.Na.Yl=10;h.Na.FL=10;h.Na.wi=h.Na.Yl/2;b=h.Na.prototype;b.name=void 0;b.ez=50;b.B=null;b.Sf=!0;b.ni=!0;b.Po=null;h.Na.Yv="\u00a0";b=h.Na.prototype;b.ng=!0;b.Hi=!1;b.Kd=function(a){var c=a.tooltip;"string"==typeof c&&(c=h.g.le(a.tooltip));c&&this.Ra(c)};b.Lu=function(a){if(this.B)throw Error("Field already bound to a block.");this.B=a};
b.S=function(){this.gf||(this.gf=h.g.o.L("g",{},null),this.isVisible()||(this.gf.style.display="none"),this.B.ya().appendChild(this.gf),this.Jh(),this.ah(),this.Ra(this.mA),h.H.qk(this.Po||this.ya()),this.gz=h.ma(this.Po||this.ya(),"mousedown",this,this.Xh),this.fj())};b.Jh=function(){this.bc.height=Math.max(this.bc.height,h.Na.tv);this.bc.width=Math.max(this.bc.width,h.Na.Yl);this.Oi=h.g.o.L("rect",{rx:4,ry:4,x:0,y:0,height:this.bc.height,width:this.bc.width},this.gf);wb(this)};b.fj=function(){};
function wb(a){a.ic=h.g.o.L("text",{"class":"blocklyText",y:h.Na.sw,x:a.Oi?h.Na.wi:0},a.gf);a.Kj=document.createTextNode("");a.ic.appendChild(a.Kj)}b.Cm=function(a){this.setValue(a.textContent)};b.kA=function(a){a.textContent=this.getValue();return a};b.I=function(){h.D.Hk(this);h.aa.Hk(this);this.gz&&h.$a(this.gz);h.g.o.removeNode(this.gf)};
b.ah=function(){var a=this.Po||this.ya();this.ng&&a&&(this.B.jd()?(h.g.o.Cb(a,"blocklyEditableText"),h.g.o.Ec(a,"blocklyNonEditableText"),a.style.cursor=this.Hq):(h.g.o.Cb(a,"blocklyNonEditableText"),h.g.o.Ec(a,"blocklyEditableText"),a.style.cursor=""))};b.isVisible=function(){return this.ni};b.Vb=function(a){if(this.ni!=a){this.ni=a;var c=this.ya();c&&(c.style.display=a?"block":"none")}};function xb(a,c){a.Oj=c}b.sy=function(){return this.Oj};b.ya=function(){return this.gf};b.Qe=function(){};
b.Yf=function(){if(this.Kj){this.Kj.nodeValue=yb(this);var a=h.g.o.ct(this.ic);this.Oi&&(a+=h.Na.Yl,this.Oi.setAttribute("width",a));this.bc.width=a}};b.Lg=function(){if(!this.isVisible())return new h.g.Ve(0,0);this.Sf?(this.Yf(),this.Sf=!1):this.ni&&0==this.bc.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.Yf());return this.bc};
function yb(a){var c=a.Tb();if(!c)return h.Na.Yv;c.length>a.ez&&(c=c.substring(0,a.ez-2)+"\u2026");c=c.replace(/\s/g,h.Na.Yv);a.B&&a.B.G&&(c+="\u200f");return c}b.Tb=function(){if(this.dt){var a=this.dt.call(this);if(null!==a)return String(a)}return String(this.getValue())};b.dl=function(){throw Error("setText method is deprecated");};b.Zm=function(){this.Sf=!0};function zb(a){a.Sf=!0;a.B&&a.B.ba&&(a.B.za(),a.B.Kb())}
b.setValue=function(a){if(null!==a){var c=this.wh(a);a=Ab(this,a,c);if(!(a instanceof Error)){if(c=this.sy())if(c=c.call(this,a),a=Ab(this,a,c),a instanceof Error)return;c=this.getValue();c!==a&&(this.B&&h.i.isEnabled()&&h.i.Ka(new h.i.hg(this.B,"field",this.name||null,c,a)),this.Yi(a),this.Sf&&zb(this))}}};function Ab(a,c,d){if(null===d)return a.Ex(),a.Sf&&zb(a),Error();void 0!==d&&(c=d);return c}b.getValue=function(){return this.cc};b.wh=function(a){return null===a||void 0===a?null:a};
b.Yi=function(a){this.cc=a;this.Sf=!0};b.Ex=function(){};b.Xh=function(a){if(this.B&&this.B.v&&(a=this.B.v.Ch(a))){if(a.dj)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");a.Fj||(a.Fj=this)}};b.Ra=function(a){var c=this.Po||this.ya();c?c.sf=a||""===a?a:this.B:this.mA=a};b.pn=function(){return!1};b.Pf=function(){for(var a=null,c=this.B,d=c.T,e=0;e<c.T.length;e++)for(var f=d[e],g=f.Pa,k=0;k<g.length;k++)if(g[k]===this){a=f;break}return a};b.Sy=function(){return!1};
b.Wh=function(){return!1};b.wn=function(a){a?(this.gf.appendChild(a),this.Sc=a):this.Sc=null};b.xn=function(a){a&&this.gf.appendChild(a)};h.Tc={};h.Tc.Mn={};h.Tc.register=function(a,c){if("string"!=typeof a||""==a.trim())throw Error('Invalid field type "'+a+'". The type must be a non-empty string.');if(h.Tc.Mn[a])throw Error('Error: Field "'+a+'" is already registered.');if(!c||"function"!=typeof c.va)throw Error('Field "'+c+'" must have a fromJson function');a=a.toLowerCase();h.Tc.Mn[a]=c};h.Tc.unregister=function(a){h.Tc.Mn[a]?delete h.Tc.Mn[a]:console.warn('No field mapping for type "'+a+'" found to unregister')};
h.Tc.va=function(a){var c=h.Tc.Mn[a.type.toLowerCase()];return c?c.va(a):(console.warn("Blockly could not create a field of type "+a.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null)};h.Fd=function(a,c,d){this.No=null;null==a&&(a="");h.Fd.w.constructor.call(this,a,null,d);d||(this.No=c||null);this.bc=new h.g.Ve(0,h.Na.sw)};h.g.object.W(h.Fd,h.Na);h.Fd.va=function(a){var c=h.g.le(a.text);return new h.Fd(c,void 0,a)};h.Fd.prototype.ng=!1;h.Fd.prototype.Kd=function(a){h.Fd.w.Kd.call(this,a);this.No=a["class"]};h.Fd.prototype.Jh=function(){wb(this);this.ic.setAttribute("y",this.bc.height);this.No&&h.g.o.Cb(this.ic,this.No)};
h.Fd.prototype.wh=function(a){return null===a||void 0===a?null:String(a)};h.Tc.register("field_label",h.Fd);h.Pv=function(a,c,d,e){if(a!=h.mg&&!c)throw Error("Value inputs and statement inputs must have non-empty name.");this.type=a;this.name=c;this.B=d;this.connection=e;this.Pa=[]};b=h.Pv.prototype;b.align=h.xq;b.ni=!0;function L(a,c,d){Bb(a,a.Pa.length,c,d);return a}
function Bb(a,c,d,e){if(0>c||c>a.Pa.length)throw Error("index "+c+" out of bounds.");if(!(d||""==d&&e))return c;"string"==typeof d&&(d=new h.Fd(d));d.Lu(a.B);a.B.ba&&d.S();d.name=e;d.qu&&(c=Bb(a,c,d.qu));a.Pa.splice(c,0,d);++c;d.Tu&&(c=Bb(a,c,d.Tu));a.B.ba&&(a.B.za(),a.B.Kb());return c}function Cb(a,c){for(var d=0,e;e=a.Pa[d];d++)if(e.name===c){e.I();a.Pa.splice(d,1);a.B.ba&&(a.B.za(),a.B.Kb());return}throw Error('Field "%s" not found.',c);}b.isVisible=function(){return this.ni};
b.Vb=function(a){var c=[];if(this.ni==a)return c;for(var d=(this.ni=a)?"block":"none",e=0,f;f=this.Pa[e];e++)f.Vb(a);if(this.connection){if(a)c=Db(this.connection);else if(e=this.connection,Eb(e,!0),e.ca)for(e=p(z(e),!1),f=0;f<e.length;f++){for(var g=e[f],k=g.Fe(!0),l=0;l<k.length;l++)Eb(k[l],!0);g=Na(g);for(l=0;l<g.length;l++)g[l].Vb(!1)}if(e=z(this.connection))e.ya().style.display=d,a||(e.ba=!1)}return c};b.Zm=function(){for(var a=0,c;c=this.Pa[a];a++)c.Zm()};
b.vb=function(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.vb(a);return this};function Fb(a,c){a.align=c;a.B.ba&&a.B.za();return a}b.S=function(){if(this.B.v.ba)for(var a=0;a<this.Pa.length;a++)this.Pa[a].S()};b.I=function(){for(var a=0,c;c=this.Pa[a];a++)c.I();this.connection&&this.connection.I();this.B=null};h.g.Lb={};h.g.Lb.parse=function(a){a=String(a).toLowerCase().trim();var c=h.g.Lb.names[a];if(c)return c;c="#"==a[0]?a:"#"+a;if(/^#[0-9a-f]{6}$/.test(c))return c;if(/^#[0-9a-f]{3}$/.test(c))return["#",c[1],c[1],c[2],c[2],c[3],c[3]].join("");var d=a.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return d&&(a=Number(d[1]),c=Number(d[2]),d=Number(d[3]),0<=a&&256>a&&0<=c&&256>c&&0<=d&&256>d)?h.g.Lb.Cu(a,c,d):null};
h.g.Lb.Cu=function(a,c,d){c=a<<16|c<<8|d;return 16>a?"#"+(16777216|c).toString(16).substr(1):"#"+c.toString(16)};h.g.Lb.Fy=function(a){a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]};
h.g.Lb.vF=function(a){var c=h.HB,d=255*h.IB,e=0,f=0,g=0;if(0==c)g=f=e=d;else{var k=Math.floor(a/60),l=a/60-k;a=d*(1-c);var m=d*(1-c*l);c=d*(1-c*(1-l));switch(k){case 1:e=m;f=d;g=a;break;case 2:e=a;f=d;g=c;break;case 3:e=a;f=m;g=d;break;case 4:e=c;f=a;g=d;break;case 5:e=d;f=a;g=m;break;case 6:case 0:e=d,f=c,g=a}}return h.g.Lb.Cu(Math.floor(e),Math.floor(f),Math.floor(g))};
h.g.Lb.Qr=function(a,c,d){a=h.g.Lb.Fy(h.g.Lb.parse(a));c=h.g.Lb.Fy(h.g.Lb.parse(c));return h.g.Lb.Cu(Math.round(c[0]+d*(a[0]-c[0])),Math.round(c[1]+d*(a[1]-c[1])),Math.round(c[2]+d*(a[2]-c[2])))};h.g.Lb.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"};h.Zn=function(a,c,d){if(h.Generator&&"undefined"!=typeof h.Generator.prototype[c])throw Error('Block prototypeName "'+c+'" conflicts with Blockly.Generator members.');this.id=d&&!r(a,d)?d:h.g.Jg();a.Rr[this.id]=this;this.Z=this.X=this.M=null;this.T=[];this.Pg=void 0;this.disabled=!1;this.sf="";this.contextMenu=!0;this.Uf=null;this.Bg=[];this.Hx=this.jz=this.ps=!0;this.Cg=this.cb=!1;this.vk=null;this.Be={text:null,pu:!1,size:new h.g.Ve(160,80)};this.BA=new h.g.K(0,0);this.v=a;this.$b=a.ke;this.G=a.G;
this.Tm=!1;this.Ng=void 0;if(c){this.type=c;d=h.J[c];if(!d||"object"!=typeof d)throw TypeError("Unknown block type: "+c);h.g.object.rj(this,d)}a.ol.push(this);a.$g[this.type]||(a.$g[this.type]=[]);a.$g[this.type].push(this);"function"==typeof this.S&&this.S();this.CF=this.Pg;if(h.i.isEnabled()){(a=h.i.Zb())||h.i.$(!0);try{h.i.Ka(new h.i.$n(this))}finally{a||h.i.$(!1)}}if("function"==typeof this.onchange){if((a=this.onchange)&&"function"!=typeof a)throw Error("onchange must be a function.");this.hn&&
db(this.v,this.hn);if(this.onchange=a)this.hn=a.bind(this),cb(this.v,this.hn)}};b=h.Zn.prototype;b.data=null;b.sh="#000000";b.Xw=null;b.Yw=null;
b.I=function(a){if(this.v){this.hn&&db(this.v,this.hn);h.Le&&h.navigation.kz(this);A(this,a);h.i.isEnabled()&&h.i.Ka(new h.i.SA(this));h.i.disable();try{if(this.v){Za(this.v,this);var c=this.v;c.$g[this.type].splice(c.$g[this.type].indexOf(this),1);c.$g[this.type].length||delete c.$g[this.type];delete this.v.Rr[this.id];this.v=null}h.selected==this&&(h.selected=null);for(var d=this.Bg.length-1;0<=d;d--)this.Bg[d].I(!1);d=0;for(var e;e=this.T[d];d++)e.I();this.T.length=0;var f=this.Fe(!0);d=0;for(var g;g=
f[d];d++)g.I()}finally{h.i.enable()}}};b.fj=function(){for(var a=0,c;c=this.T[a];a++)for(var d=0,e;e=c.Pa[d];d++)e.fj&&e.fj()};
function A(a,c){if(a.M){var d=null;a.M.isConnected()&&(d=a.M.ca,a.M.disconnect());if(d&&c){a:{c=null;for(var e=0;e<a.T.length;e++){var f=a.T[e].connection;if(f&&f.type==h.Wa&&f.ca){if(c){a=null;break a}c=f}}a=c}a&&a.isConnected()&&!z(a).cb&&(a=a.ca,a.disconnect(),Ea(a,d)?d.connect(a):a.Pp(d))}}else a.Z&&(d=null,a.Z.isConnected()&&(d=a.Z.ca,a.Z.disconnect()),e=q(a),c&&e&&!e.cb&&(a=a.X.ca,a.disconnect(),d&&Ea(d,a)&&d.connect(a)))}
b.Fe=function(){var a=[];this.M&&a.push(this.M);this.Z&&a.push(this.Z);this.X&&a.push(this.X);for(var c=0,d;d=this.T[c];c++)d.connection&&a.push(d.connection);return a};b.Kb=function(){console.warn("Not expected to reach Block.bumpNeighbours function. BlockSvg.bumpNeighbours was expected to be called instead.")};b.getParent=function(){return this.Uf};function Gb(a){do{var c=a;a=a.getParent();if(!a)return null}while(q(a)==c);return a}function q(a){return a.X&&z(a.X)}
function I(a){var c=a;do a=c,c=a.Uf;while(c);return a}b.Ah=function(a){if(!a)return this.Bg;a=[];for(var c=0,d;d=this.T[c];c++)d.connection&&(d=z(d.connection))&&a.push(d);(c=q(this))&&a.push(c);return a};b.cl=function(a){if(a!=this.Uf){if(this.Uf){h.g.Ko(this.Uf.Bg,this);if(this.Z&&this.Z.isConnected())throw Error("Still connected to previous block.");if(this.M&&this.M.isConnected())throw Error("Still connected to parent block.");this.Uf=null}else Za(this.v,this);(this.Uf=a)?a.Bg.push(this):this.v.ol.push(this)}};
function p(a,c){var d=[a];a=a.Ah(c);for(var e,f=0;e=a[f];f++)d.push.apply(d,p(e,c));return d}b.je=function(){return this.ps&&!this.cb&&!(this.v&&this.v.options.readOnly)};b.kd=function(){return this.jz&&!this.cb&&!(this.v&&this.v.options.readOnly)};b.gq=function(a){this.jz=a};b.Ku=function(a){this.cb=a};b.Mh=function(){return this.Tm};b.Xz=function(a){this.Tm=a};b.jd=function(){return this.Hx&&!(this.v&&this.v.options.readOnly)};
b.Gu=function(a){this.Hx=a;a=0;for(var c;c=this.T[a];a++)for(var d=0,e;e=c.Pa[d];d++)e.ah()};b.Ra=function(a){this.sf=a};function Hb(a){var c=a.Xw;return c?c:h.g.Lb.Qr("#fff",a.sh,.6)}function Ib(a){var c=a.Yw;if(c)return{Ro:c,fs:null,Ww:null};a=a.sh;return{Ro:null,fs:h.g.Lb.Qr("#fff",a,.3),Ww:h.g.Lb.Qr("#000",a,.2)}}
b.Fc=function(a){var c="string"==typeof a?h.g.le(a):a,d=Number(c);if(!isNaN(d)&&0<=d&&360>=d)this.sh=h.Ky(d);else if(d=h.g.Lb.parse(c))this.sh=d;else throw d='Invalid colour: "'+c+'"',a!=c&&(d+=' (from "'+a+'")'),Error(d);};function M(a,c){var d=a.v.rp().wD[c];if(d)a.Xw=d.colourSecondary,a.Yw=d.colourTertiary,a.Ng=d.Ng,a.Fc(d.colourPrimary);else throw Error("Invalid style name: "+c);}function y(a,c){for(var d=0,e;e=a.T[d];d++)for(var f=0,g;g=e.Pa[f];f++)if(g.name==c)return g;return null}
b.ht=function(){for(var a=[],c=0,d;d=this.T[c];c++)for(var e=0,f;f=d.Pa[e];e++)f.pn()&&a.push(f.getValue());return a};b.Mg=function(){for(var a=[],c=0,d;d=this.T[c];c++)for(var e=0,f;f=d.Pa[e];e++)f.pn()&&(f=this.v.hf(f.getValue()))&&a.push(f);return a};b.pq=function(a){for(var c=0,d;d=this.T[c];c++)for(var e=0,f;f=d.Pa[e];e++)f.pn()&&a.ua()==f.getValue()&&zb(f)};b.Zp=function(a,c){for(var d=0,e;e=this.T[d];d++)for(var f=0,g;g=e.Pa[f];f++)g.pn()&&a==g.getValue()&&g.setValue(c)};
function G(a,c){return(a=y(a,c))?a.getValue():null}function Jb(a,c,d){a=y(a,d);if(!a)throw Error('Field "'+d+'" not found.');a.setValue(c)}b.ne=function(a,c){if(a){void 0===c&&(c=null);if(!this.Z){if(this.M)throw Error("Remove output connection prior to adding previous connection.");this.Z=this.Ym(h.Ue)}this.Z.vb(c)}else if(this.Z){if(this.Z.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.Z.I();this.Z=null}};
b.me=function(a,c){if(a)void 0===c&&(c=null),this.X||(this.X=this.Ym(h.jb)),this.X.vb(c);else if(this.X){if(this.X.isConnected())throw Error("Must disconnect next statement before removing connection.");this.X.I();this.X=null}};
b.Ad=function(a,c){if(a){void 0===c&&(c=null);if(!this.M){if(this.Z)throw Error("Remove previous connection prior to adding output connection.");this.M=this.Ym(h.Te)}this.M.vb(c)}else if(this.M){if(this.M.isConnected())throw Error("Must disconnect output value before removing connection.");this.M.I();this.M=null}};b.$c=function(a){this.Pg!=a&&(h.i.Ka(new h.i.hg(this,"inline",null,this.Pg,a)),this.Pg=a)};
function Ha(a){if(void 0!=a.Pg)return a.Pg;for(var c=1;c<a.T.length;c++)if(a.T[c-1].type==h.mg&&a.T[c].type==h.mg)return!1;for(c=1;c<a.T.length;c++)if(a.T[c-1].type==h.Wa&&a.T[c].type==h.mg)return!0;return!1}b.isEnabled=function(){return!this.disabled};b.md=function(a){this.isEnabled()!=a&&(h.i.Ka(new h.i.hg(this,"disabled",null,this.disabled,!a)),this.disabled=!a)};function Kb(a){for(a=Gb(a);a;){if(a.disabled)return!0;a=Gb(a)}return!1}b.isCollapsed=function(){return this.Cg};
b.Wg=function(a){this.Cg!=a&&(h.i.Ka(new h.i.hg(this,"collapsed",null,this.Cg,a)),this.Cg=a)};b.toString=function(a,c){var d=[],e=c||"?";if(this.Cg)d.push(B(this,"_TEMP_COLLAPSED_INPUT").Pa[0].Tb());else for(var f=0,g;g=this.T[f];f++){for(var k=0,l;l=g.Pa[k];k++)d.push(l.Tb());g.connection&&((g=z(g.connection))?d.push(g.toString(void 0,c)):d.push(e))}d=d.join(" ").trim()||"???";a&&d.length>a&&(d=d.substring(0,a-3)+"...");return d};function N(a,c){return a.$l(h.Wa,c)}
function Lb(a,c){return a.$l(h.jb,c)}function O(a,c){return a.$l(h.mg,c||"")}
function P(a,c){var d=c.type?'Block "'+c.type+'": ':"";if(c.output&&c.previousStatement)throw Error(d+"Must not have both an output and a previousStatement.");c.style&&c.style.Ng&&(a.Ng=c.style.Ng,c.style=null);if(c.style&&c.colour)throw Error(d+"Must not have both a colour and a style.");if(c.style){var e=c.style;try{M(a,e)}catch(F){console.warn(d+"Style does not exist: ",e)}}else if("colour"in c)if(void 0===c.colour)console.warn(d+"Undefined colour value.");else{e=c.colour;try{a.Fc(e)}catch(F){console.warn(d+
"Illegal colour value: ",e)}}for(e=0;void 0!==c["message"+e];){for(var f=a,g=c["args"+e]||[],k=c["lastDummyAlign"+e],l=h.g.kH(c["message"+e]),m=[],n=0,t=[],u=0;u<l.length;u++){var w=l[u];if("number"==typeof w){if(0>=w||w>g.length)throw Error('Block "'+f.type+'": Message index %'+w+" out of range.");if(m[w])throw Error('Block "'+f.type+'": Message index %'+w+" duplicated.");m[w]=!0;n++;t.push(g[w-1])}else(w=w.trim())&&t.push(w)}if(n!=g.length)throw Error('Block "'+f.type+'": Message does not reference all '+
g.length+" arg(s).");t.length&&("string"==typeof t[t.length-1]||h.g.fb.startsWith(t[t.length-1].type,"field_"))&&(u={type:"input_dummy"},k&&(u.align=k),t.push(u));k={LEFT:h.xq,RIGHT:h.tl,CENTRE:h.jv};g=[];for(u=0;u<t.length;u++)if(m=t[u],"string"==typeof m)g.push([m,void 0]);else{l=n=null;do if(w=!1,"string"==typeof m)n=new h.Fd(m);else switch(m.type){case "input_value":l=N(f,m.name);break;case "input_statement":l=Lb(f,m.name);break;case "input_dummy":l=O(f,m.name);break;default:n=h.Tc.va(m),!n&&
m.alt&&(m=m.alt,w=!0)}while(w);if(n)g.push([n,m.name]);else if(l){m.check&&l.vb(m.check);m.align&&Fb(l,k[m.align]);for(m=0;m<g.length;m++)L(l,g[m][0],g[m][1]);g.length=0}}e++}void 0!==c.inputsInline&&a.$c(c.inputsInline);void 0!==c.output&&a.Ad(!0,c.output);void 0!==c.previousStatement&&a.ne(!0,c.previousStatement);void 0!==c.nextStatement&&a.me(!0,c.nextStatement);void 0!==c.tooltip&&(e=c.tooltip,e=h.g.le(e),a.Ra(e));void 0!==c.enableContextMenu&&(e=c.enableContextMenu,a.contextMenu=!!e);void 0!==
c.helpUrl&&(e=c.helpUrl,e=h.g.le(e),a.ub=e);"string"==typeof c.extensions&&(console.warn(d+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+c.type+"' block."),c.extensions=[c.extensions]);void 0!==c.mutator&&h.Y.apply(c.mutator,a,!0);if(Array.isArray(c.extensions))for(c=c.extensions,d=0;d<c.length;++d)h.Y.apply(c[d],a,!1)}
b.rj=function(a,c){if(void 0!==c&&"boolean"!=typeof c)throw Error("opt_disableCheck must be a boolean if provided");if(!c){c=[];for(var d in a)void 0!==this[d]&&c.push(d);if(c.length)throw Error("Mixin will overwrite block members: "+JSON.stringify(c));}h.g.object.rj(this,a)};b.$l=function(a,c){var d=null;if(a==h.Wa||a==h.jb)d=this.Ym(a);a=new h.Pv(a,c,this,d);this.T.push(a);return a};
function Mb(a,c,d){if(c!=d){for(var e=-1,f=d?-1:a.T.length,g=0,k;k=a.T[g];g++)if(k.name==c){if(e=g,-1!=f)break}else if(d&&k.name==d&&(f=g,-1!=e))break;if(-1==e)throw Error('Named input "'+c+'" not found.');if(-1==f)throw Error('Reference input "'+d+'" not found.');a.Tt(e,f)}}
b.Tt=function(a,c){if(a==c)throw Error("Can't move input to itself.");if(a>=this.T.length)throw RangeError("Input index "+a+" out of bounds.");if(c>this.T.length)throw RangeError("Reference input "+c+" out of bounds.");var d=this.T[a];this.T.splice(a,1);a<c&&c--;this.T.splice(c,0,d)};b.ib=function(a,c){for(var d=0,e;e=this.T[d];d++)if(e.name==a){e.I();this.T.splice(d,1);return}if(!c)throw Error("Input not found: "+a);};function B(a,c){for(var d=0,e;e=a.T[d];d++)if(e.name==c)return e;return null}
function Nb(a,c){return(a=B(a,c))&&a.connection&&z(a.connection)}b.$f=function(a){this.Be.text!=a&&(h.i.Ka(new h.i.hg(this,"comment",null,this.Be.text,a)),this.vk=this.Be.text=a)};b.Yg=function(){};b.ji=function(){};b.Qa=function(){return this.BA};b.moveBy=function(a,c){if(this.Uf)throw Error("Block has parent.");var d=new h.i.wl(this);this.BA.translate(a,c);d.Aj();h.i.Ka(d)};b.Ym=function(a){return new h.sa(this,a)};h.m={};h.m.hJ=function(){};h.m.Ei=function(a){this.Ij=a;this.hl=h.g.o.L("path",{"class":"blocklyPath"},this.Ij);this.Jn=h.g.o.L("path",{"class":"blocklyPathLight"},this.Ij);this.Hn=h.g.o.L("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.Ij)};h.m.Ei.prototype.Iu=function(a){this.hl.setAttribute("d",a);this.Jn.style.display="none";this.Hn.style.display="none"};h.m.Ei.prototype.Qs=function(){this.hl.setAttribute("transform","scale(-1 1)")};h.g.V={};h.g.V.JA="aria-";h.g.V.nr="role";
h.g.V.Fi={FH:"alert",GH:"alertdialog",IH:"application",JH:"article",PH:"banner",SH:"button",UH:"checkbox",ZH:"columnheader",$H:"combobox",bI:"complementary",cI:"contentinfo",iI:"definition",lI:"dialog",mI:"directory",oI:"document",TI:"form",XI:"grid",YI:"gridcell",DB:"group",bJ:"heading",eJ:"img",nJ:"link",oJ:"list",pJ:"listbox",qJ:"listitem",sJ:"log",yJ:"main",zJ:"marquee",AJ:"math",gC:"menu",CJ:"menubar",hC:"menuitem",iC:"menuitemcheckbox",DJ:"menuitemradio",HJ:"navigation",KJ:"note",eK:"option",
uC:"presentation",GK:"progressbar",JK:"radio",KK:"radiogroup",MK:"region",pr:"row",SK:"rowgroup",TK:"rowheader",VK:"scrollbar",XK:"search",ZK:"separator",dL:"slider",gL:"spinbutton",hL:"status",qw:"tab",iL:"table",jL:"tablist",kL:"tabpanel",lL:"textbox",mL:"textinfo",pL:"timer",qL:"toolbar",rL:"tooltip",QC:"tree",sL:"treegrid",RC:"treeitem"};
h.g.V.State={iv:"activedescendant",KH:"atomic",MH:"autocomplete",RH:"busy",VH:"checked",YH:"colindex",eI:"controls",kI:"describedby",nI:"disabled",tI:"dropeffect",Nq:"expanded",SI:"flowto",WI:"grabbed",$I:"haspopup",cJ:"hidden",gJ:"invalid",kJ:"label",Rv:"labelledby",TB:"level",rJ:"live",EJ:"multiline",FJ:"multiselectable",qC:"orientation",wK:"owns",tC:"posinset",EK:"pressed",LK:"readonly",NK:"relevant",QK:"required",UK:"rowindex",Nl:"selected",CC:"setsize",eL:"sort",UC:"valuemax",VC:"valuemin",vL:"valuenow",
wL:"valuetext"};h.g.V.ag=function(a,c){c?a.setAttribute(h.g.V.nr,c):h.g.V.KG(a)};h.g.V.VL=function(a){return a.getAttribute(h.g.V.nr)||null};h.g.V.KG=function(a){a.removeAttribute(h.g.V.nr)};h.g.V.Gb=function(a,c,d){Array.isArray(d)&&(d=d.join(" "));a.setAttribute(h.g.V.KE(c),d)};h.g.V.KE=function(a){return h.g.V.JA+a};h.Ai=function(){h.uc.call(this);this.Og=-1};h.g.object.W(h.Ai,h.uc);b=h.Ai.prototype;b.Oa=function(){var a=document.createElement("div");a.id=this.ua();this.hb=a;a.className="goog-menu goog-menu-vertical blocklyNonSelectable";a.tabIndex=0;h.g.V.ag(a,this.Du||h.g.V.Fi.gC)};b.focus=function(){var a=this.ta();a&&(a.focus(),h.g.o.Cb(a,"focused"))};b.blur=function(){var a=this.ta();a&&(a.blur(),h.g.o.Ec(a,"focused"))};b.ag=function(a){this.Du=a};
b.ff=function(){h.Ai.w.ff.call(this);da(this,function(a){if(a.Yc){var c=a.ta();c=c.id||(c.id=a.ua());this.tk||(this.tk={});this.tk[c]=a}},this);this.Nr()};b.zh=function(){Ob(this,-1);h.Ai.w.zh.call(this)};b.vm=function(){h.Ai.w.vm.call(this);this.rs()};b.Nr=function(){var a=this.ta();this.WF=h.ma(a,"mouseover",this,this.nF,!0);this.MD=h.ma(a,"click",this,this.fF,!0);this.TF=h.ma(a,"mouseenter",this,this.kF,!0);this.UF=h.ma(a,"mouseleave",this,this.mF,!0);this.gu=h.ma(a,"keydown",this,this.jt)};
b.rs=function(){h.$a(this.WF);h.$a(this.MD);h.$a(this.TF);h.$a(this.UF);h.$a(this.gu)};b.tk=null;function Pb(a,c){if(a.tk)for(var d=a.ta();c&&c!==d;){var e=c.id;if(e in a.tk)return a.tk[e];c=c.parentNode}return null}function Qb(a){(a=a.kb[a.Og]||null)&&a.Xg(!1)}function Ob(a,c){var d=a.kb[c]||null;d?(d.Xg(!0),a.Og=c):-1<a.Og&&((a.kb[a.Og]||null).Xg(!1),a.Og=-1);d&&h.g.style.Eu(d.ta(),a.ta())}b.Xg=function(a){Ob(this,this.kb.indexOf(a))};
function Rb(a){Qb(a);Sb(a,function(c,d){return(c+1)%d},a.Og)}function Tb(a){Qb(a);Sb(a,function(c,d){c--;return 0>c?d-1:c},a.Og)}function Sb(a,c,d){var e=a.kb.length;d=c.call(a,0>d?-1:d,e);for(var f=0;f<=e;){var g=a.kb[d]||null;if(g&&g.isEnabled()){Ob(a,d);break}f++;d=c.call(a,d,e)}}b.nF=function(a){(a=Pb(this,a.target))&&a.isEnabled()&&(this.kb[this.Og]||null)!==a&&(Qb(this),this.Xg(a))};b.fF=function(a){var c=Pb(this,a.target),d;if(d=c)c.isEnabled()&&(c.Xg(!0),Ub(c)),d=void 0;d&&a.preventDefault()};
b.kF=function(){this.focus()};b.mF=function(){this.ta()&&(this.blur(),Qb(this),Ob(this,-1))};b.jt=function(a){return 0!=this.kb.length&&Vb(this,a)?(a.preventDefault(),a.stopPropagation(),!0):!1};function Vb(a,c){var d=a.kb[a.Og]||null;if(d&&"function"==typeof d.jt&&d.jt(c))return!0;if(c.shiftKey||c.ctrlKey||c.metaKey||c.altKey)return!1;switch(c.keyCode){case h.g.Ba.Kq:d&&Ub(d);break;case h.g.Ba.Tl:Tb(a);break;case h.g.Ba.zl:Rb(a);break;default:return!1}return!0};h.wo=function(a,c){h.uc.call(this);this.af=a;this.setValue(c);this.ep=!0};h.g.object.W(h.wo,h.uc);b=h.wo.prototype;
b.Oa=function(){var a=document.createElement("div");a.id=this.ua();this.hb=a;a.className="goog-menuitem goog-option "+(this.ep?"":"goog-menuitem-disabled ")+(this.$r?"goog-option-selected ":"")+(this.Rk()?"goog-menuitem-rtl ":"");var c=document.createElement("div");c.className="goog-menuitem-content";a.appendChild(c);if(this.dm){var d=document.createElement("div");d.className="goog-menuitem-checkbox"}else d=null;d&&c.appendChild(d);c.appendChild(Wb(this));h.g.V.ag(a,this.Du||(this.dm?h.g.V.Fi.iC:
h.g.V.Fi.hC));h.g.V.Gb(a,h.g.V.State.Nl,this.dm&&this.$r||!1)};function Wb(a){a=a.af;"string"===typeof a&&(a=document.createTextNode(a));return a}b.setValue=function(a){this.cc=a};b.getValue=function(){return this.cc};b.ag=function(a){this.Du=a};function Xb(a,c){if(a.dm){a.$r=c;var d=a.ta();d&&a.isEnabled()&&(c?(h.g.o.Cb(d,"goog-option-selected"),h.g.V.Gb(d,h.g.V.State.Nl,!0)):(h.g.o.Ec(d,"goog-option-selected"),h.g.V.Gb(d,h.g.V.State.Nl,!1)))}}
b.Xg=function(a){var c=this.ta();c&&this.isEnabled()&&(a?h.g.o.Cb(c,"goog-menuitem-highlight"):h.g.o.Ec(c,"goog-menuitem-highlight"))};b.isEnabled=function(){return this.ep};b.md=function(a){this.ep=a;(a=this.ta())&&(this.ep?h.g.o.Ec(a,"goog-menuitem-disabled"):h.g.o.Cb(a,"goog-menuitem-disabled"))};function Ub(a){a.dm&&Xb(a,!a.$r);a.Ew&&a.Ew.call(a.iD,a)}function Yb(a,c,d){a.Ew=c;a.iD=d};h.g.nq={};h.g.nq.Lg=function(a){a=a.ta();var c=h.g.style.Lg(a);c.height=a.scrollHeight;return c};h.g.nq.kD=function(a,c,d){c.left+=d.width;c.right+=d.width;a.left+=d.width;a.right+=d.width};h.Ea={};h.Ea.Wo=null;h.Ea.Kx=null;h.Ea.show=function(a,c,d){h.aa.show(h.Ea,d,null);if(c.length){var e=h.Ea.EG(c,d);h.Ea.Vf(e,a,d);setTimeout(function(){e.ta().focus()},1);h.Ea.Wo=null}else h.Ea.Ca()};h.Ea.EG=function(a,c){var d=new h.Ai;ea(d,c);for(var e=0,f;f=a[e];e++){var g=new h.wo(f.text);ea(g,c);d.Zl(g,d.kb.length,!0);g.md(f.enabled);f.enabled&&Yb(g,function(){h.Ea.Ca();this.yb()},f)}return d};
h.Ea.Vf=function(a,c,d){var e=h.g.bF();c={top:c.clientY+e.top,bottom:c.clientY+e.top,left:c.clientX+e.left,right:c.clientX+e.left};h.Ea.$D(a);var f=h.g.nq.Lg(a);d&&h.g.nq.kD(e,c,f);h.aa.FG(e,c,f,d);a.ta().focus()};h.Ea.$D=function(a){a.za(h.aa.Fa);var c=a.ta();h.g.o.Cb(c,"blocklyContextMenu");h.ma(c,"contextmenu",null,h.g.fG);a.focus()};h.Ea.Ca=function(){h.aa.Hk(h.Ea);h.Ea.Wo=null;h.Ea.Kx&&h.$a(h.Ea.Kx)};
h.Ea.Mo=function(a,c){return function(){h.i.disable();try{var d=h.R.Zi(c,a.v),e=a.Qa();e.x=a.G?e.x-h.td:e.x+h.td;e.y+=2*h.td;d.moveBy(e.x,e.y)}finally{h.i.enable()}h.i.isEnabled()&&!d.cb&&h.i.Ka(new h.i.$n(d));d.select()}};h.Ea.tD=function(a){var c=p(a,!1).length,d=q(a);d&&(c-=p(d,!1).length);return{text:1==c?h.h.DELETE_BLOCK:h.h.DELETE_X_BLOCKS.replace("%1",String(c)),enabled:!0,yb:function(){h.i.$(!0);a.I(!0,!0);h.i.$(!1)}}};
h.Ea.vD=function(a){return{enabled:!("function"==typeof a.ub?!a.ub():!a.ub),text:h.h.HELP,yb:function(){var c="function"==typeof a.ub?a.ub():a.ub;c&&window.open(c)}}};h.Ea.uD=function(a){var c=bb(a.v)?ab(a.v,h.g.Us(a,!0)):!0;return{text:h.h.DUPLICATE_BLOCK,enabled:c,yb:function(){h.Gx(a)}}};h.Ea.sD=function(a){var c={enabled:!h.g.userAgent.og};a.vk?(c.text=h.h.REMOVE_COMMENT,c.yb=function(){a.$f(null)}):(c.text=h.h.ADD_COMMENT,c.yb=function(){a.$f("")});return c};
h.Ea.LL=function(a){return{text:h.h.OK,enabled:!0,yb:function(){h.i.$(!0);a.I(!0,!0);h.i.$(!1)}}};h.Ea.ML=function(a){return{text:h.h.uI,enabled:!0,yb:function(){h.Gx(a)}}};
h.Ea.zM=function(a,c){if(!h.mk)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var d={enabled:!h.g.userAgent.og};d.text=h.h.EH;d.yb=function(){var e=new h.mk(a,h.h.DL,h.mk.kB,h.mk.kB),f=ba(a).getBoundingClientRect();f=new h.g.K(c.clientX-f.left,c.clientY-f.top);var g=h.g.Gm(a.pb);f=h.g.K.um(f,g);f.scale(1/a.scale);e.moveBy(f.x,f.y);a.ba&&(e.Ke(),e.za(),e.select())};return d};h.tg=function(a,c){h.tg.w.constructor.call(this,a,c);this.Jf=a.v.Uo[c];this.px=a.v.Uo[h.fk[c]];this.vj=new h.g.K(0,0);this.Ih=!1;this.Hy=!this.Jf};h.g.object.W(h.tg,h.sa);b=h.tg.prototype;b.I=function(){h.tg.w.I.call(this);this.Ih&&Zb(this.Jf,this)};function $b(a,c){var d=a.Wb-c.Wb;a=a.ab-c.ab;return Math.sqrt(d*d+a*a)}
function ac(a,c){if(!a.B.v.gc()){var d=I(a.B);if(!d.$b){var e=!1;if(!d.kd()){d=I(c.B);if(!d.kd())return;c=a;e=!0}var f=h.selected==d;f||d.Jo();var g=c.Wb+h.td+Math.floor(Math.random()*h.Bq)-a.Wb,k=c.ab+h.td+Math.floor(Math.random()*h.Bq)-a.ab;e&&(k=-k);d.G&&(g=c.Wb-h.td-Math.floor(Math.random()*h.Bq)-a.Wb);d.moveBy(g,k);f||d.qn()}}}b.moveTo=function(a,c){this.Ih&&Zb(this.Jf,this);this.Wb=a;this.ab=c;this.Hy||bc(this.Jf,this)};b.moveBy=function(a,c){this.moveTo(this.Wb+a,this.ab+c)};
function cc(a,c){a.moveTo(c.x+a.vj.x,c.y+a.vj.y)}function dc(a,c,d){a.vj.x=c;a.vj.y=d}function ec(a){var c=a.ca.Wb-a.Wb,d=a.ca.ab-a.ab;if(0!=c||0!=d){a=z(a);var e=a.ya();if(!e)throw Error("block is not rendered.");e=h.g.He(e);a.ya().setAttribute("transform","translate("+(e.x-c)+","+(e.y-d)+")");Ua(a,-c,-d)}}
b.closest=function(a,c){var d=this.px;if(d.fc.length){var e=this.ab,f=this.Wb;this.Wb=f+c.x;this.ab=e+c.y;var g=fc(d,this);c=null;for(var k=a,l,m=g-1;0<=m&&Math.abs(d.fc[m].ab-this.ab)<=a;)l=d.fc[m],this.Cp(l,k)&&(c=l,k=$b(l,this)),m--;for(;g<d.fc.length&&Math.abs(d.fc[g].ab-this.ab)<=a;)l=d.fc[g],this.Cp(l,k)&&(c=l,k=$b(l,this)),g++;this.Wb=f;this.ab=e;a={connection:c,Vp:k}}else a={connection:null,Vp:a};return a};
b.Iy=function(){var a=this.B.v.Ug.C;a=this.type==h.Wa||this.type==h.Te?h.g.A.moveBy(0,-5)+h.g.A.ea("v",5)+a.Di.Oe+h.g.A.ea("v",5):h.g.A.moveBy(-5,0)+h.g.A.ea("h",5)+a.ek.$h+h.g.A.ea("h",5);var c=this.B.Qa();h.sa.Jy=h.g.o.L("path",{"class":"blocklyHighlightedConnectionPath",d:a,transform:"translate("+(this.Wb-c.x)+","+(this.ab-c.y)+")"+(this.B.G?" scale(-1 1)":"")},this.B.ya())};
function Db(a){Eb(a,!1);var c=[];if(a.type!=h.Wa&&a.type!=h.jb)return c;if(a=z(a)){if(a.isCollapsed()){var d=[];a.M&&d.push(a.M);a.X&&d.push(a.X);a.Z&&d.push(a.Z)}else d=a.Fe(!0);for(var e=0;e<d.length;e++)c.push.apply(c,Db(d[e]));c.length||(c[0]=a)}return c}function Eb(a,c){(a.Hy=c)&&a.Ih?Zb(a.Jf,a):c||a.Ih||bc(a.Jf,a)}b.Cp=function(a,c){return $b(this,a)>c?!1:h.tg.w.Cp.call(this,a)};b.Pp=function(a){ac(this,a)};b.xs=function(a,c){h.tg.w.xs.call(this,a,c);a.ba&&a.za();c.ba&&(ma(c),c.za())};
b.Bu=function(){var a=this.B,c=this.pf;if(a.v&&c&&h.i.Dc){h.tg.w.Bu.call(this);c=z(this);if(!c)throw Error("Couldn't respawn the shadow block that should exist here.");c.Ke();c.za(!1);a.ba&&a.za()}};b.lz=function(a){return gc(this.px,this,a)};b.$e=function(a){h.tg.w.$e.call(this,a);var c=this.B;a=a.B;c.ba&&ma(c);a.ba&&ma(a);c.ba&&a.ba&&(this.type==h.jb||this.type==h.Ue?a.za():c.za())};b.sz=function(){this.isConnected()&&!Ea(this,this.ca)&&(A(E(this)?z(this):this.B),this.B.Kb())};h.g.Rect=function(a,c,d,e){this.top=a;this.bottom=c;this.left=d;this.right=e};h.g.Rect.prototype.contains=function(a,c){return a>=this.left&&a<=this.right&&c>=this.top&&c<=this.bottom};h.Id=function(a){this.U=a};b=h.Id.prototype;b.Vw=!0;b.Eo=17;b.Yb=null;b.Kk=null;function hc(a){a.Od||(a.Od=h.g.o.L("g",{"class":"blocklyIconGroup"},null),a.U.$b&&h.g.o.Cb(a.Od,"blocklyIconGroupReadonly"),a.Es(a.Od),a.U.ya().appendChild(a.Od),h.ma(a.Od,"mouseup",a,a.qt),a.ah())}b.I=function(){h.g.o.removeNode(this.Od);this.Od=null;this.Vb(!1);this.U=null};b.ah=function(){};b.isVisible=function(){return!!this.Yb};b.qt=function(a){this.U.v.gc()||this.U.$b||h.g.mj(a)||this.Vb(!this.isVisible())};
b.Qe=function(){this.isVisible()&&this.Yb.Fc(this.U.sh)};function Pa(a,c){a.Kk=c;a.isVisible()&&(a=a.Yb,a.ec=c,a.xu&&eb(a))}function ic(a){var c=a.U.Qa(),d=h.g.He(a.Od);c=new h.g.K(c.x+d.x+a.Eo/2,c.y+d.y+a.Eo/2);h.g.K.Ee(a.Kk,c)||Pa(a,c)};h.Cf=function(a){h.Cf.w.constructor.call(this,a);hc(this);this.kl={}};h.g.object.W(h.Cf,h.Id);h.Cf.prototype.Vw=!1;h.Cf.prototype.Es=function(a){h.g.o.L("path",{"class":"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"},a);h.g.o.L("path",{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},a);h.g.o.L("rect",{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},a)};
h.Cf.iH=function(a){var c=h.g.o.L("text",{"class":"blocklyText blocklyBubbleText",y:h.oa.cd},null);a=a.split("\n");for(var d=0;d<a.length;d++){var e=h.g.o.L("tspan",{dy:"1em",x:h.oa.cd},c),f=document.createTextNode(a[d]);e.appendChild(f)}return c};b=h.Cf.prototype;b.Vb=function(a){a!=this.isVisible()&&(h.i.Ka(new h.i.ud(this.U,"warningOpen",!a,a)),a?this.kx():this.Ax())};
b.kx=function(){this.yj=h.Cf.iH(this.Tb());this.Yb=new h.oa(this.U.v,this.yj,this.U.Td,this.Kk,null,null);gb(this.Yb,this.U.id);if(this.U.G)for(var a=this.yj.getBBox().width,c=0,d;d=this.yj.childNodes[c];c++)d.setAttribute("text-anchor","end"),d.setAttribute("x",a+h.oa.cd);this.Qe()};b.Ax=function(){this.Yb.I();this.yj=this.Yb=null};b.dl=function(a,c){this.kl[c]!=a&&(a?this.kl[c]=a:delete this.kl[c],this.isVisible()&&(this.Vb(!1),this.Vb(!0)))};
b.Tb=function(){var a=[],c;for(c in this.kl)a.push(this.kl[c]);return a.join("\n")};b.I=function(){this.U.bd=null;h.Id.prototype.I.call(this)};h.wa=function(a,c,d){this.N=h.g.o.L("g",{},null);this.N.Ln="";this.zj=a.Ug.cz(this.N);this.In=this.zj.Hn||null;this.Td=this.zj.hl||null;this.Hj=this.zj.Jn||null;this.Td.sf=this;this.ba=!1;this.Tn=h.g.hj()&&!!a.$d;h.H.qk(this.Td);h.wa.w.constructor.call(this,a,c,d);this.N.dataset&&(this.N.dataset.id=this.id);this.Sc=null};h.g.object.W(h.wa,h.Zn);h.wa.prototype.height=0;h.wa.prototype.width=0;h.wa.prototype.Vd=null;h.wa.fJ=-1;h.wa.Cq="TEMP_COLLAPSED_WARNING_";h.wa.BC=10;h.wa.Yq=25;h.wa.mh=8;
h.wa.ug=!1;b=h.wa.prototype;b.Ke=function(){if(!this.v.ba)throw TypeError("Workspace is headless.");for(var a=0,c;c=this.T[a];a++)c.S();c=Na(this);for(a=0;a<c.length;a++)hc(c[a]);this.Qe();jc(this);this.v.options.readOnly||this.AE||h.ma(this.ya(),"mousedown",this,this.Xh);this.AE=!0;this.ya().parentNode||this.v.pb.appendChild(this.ya())};
b.select=function(){if(this.cb&&this.getParent())this.getParent().select();else if(h.selected!=this){var a=null;if(h.selected){a=h.selected.id;h.i.disable();try{lb(h.selected)}finally{h.i.enable()}}a=new h.i.ud(null,"selected",a,this.id);a.tc=this.v.id;h.i.Ka(a);h.selected=this;this.Jo()}};function lb(a){if(h.selected==a){var c=new h.i.ud(null,"selected",a.id,null);c.tc=a.v.id;h.i.Ka(c);h.selected=null;a.qn()}}b.Pd=null;b.vk=null;b.Ff=null;b.bd=null;
function Na(a){var c=[];a.Pd&&c.push(a.Pd);a.Ff&&c.push(a.Ff);a.bd&&c.push(a.bd);return c}b.cl=function(a){var c=this.Uf;if(a!=c){h.g.o.Dn();h.wa.w.cl.call(this,a);h.g.o.En();var d=this.ya();if(!this.v.vt&&d){var e=this.Qa();a?(a.ya().appendChild(d),a=this.Qa(),Ua(this,a.x-e.x,a.y-e.y)):c&&(this.v.pb.appendChild(d),this.translate(e.x,e.y))}}};
b.Qa=function(){var a=0,c=0,d=this.Tn?this.v.$d.Zb():null,e=this.ya();if(e){do{var f=h.g.He(e);a+=f.x;c+=f.y;this.Tn&&this.v.$d.df.firstChild==e&&(f=this.v.$d.bt(),a+=f.x,c+=f.y);e=e.parentNode}while(e&&e!=this.v.pb&&e!=d)}return new h.g.K(a,c)};b.moveBy=function(a,c){if(this.Uf)throw Error("Block has parent.");var d=h.i.isEnabled();if(d)var e=new h.i.wl(this);var f=this.Qa();this.translate(f.x+a,f.y+c);Ua(this,a,c);d&&(e.Aj(),h.i.Ka(e));na(this.v)};
b.translate=function(a,c){this.ya().setAttribute("transform","translate("+a+","+c+")")};b.Ut=function(){if(this.Tn){var a=this.Qa();this.ya().removeAttribute("transform");this.v.$d.Mj(a.x,a.y);ca(this.v.$d,this.ya())}};b.moveTo=function(a){var c=this.Qa();this.moveBy(a.x-c.x,a.y-c.y)};b.St=function(a){this.Tn?this.v.$d.Mj(a.x,a.y):(this.N.Ln="translate("+a.x+","+a.y+")",this.N.setAttribute("transform",this.N.Ln+this.N.An))};
function kc(a){if(a.v&&!a.v.gc()&&!a.getParent()&&!a.$b){var c=a.v.Je;if(c&&c.ZG){var d=c.Ou,e=d/2,f=a.Qa();c=Math.round((f.x-e)/d)*d+e-f.x;d=Math.round((f.y-e)/d)*d+e-f.y;c=Math.round(c);d=Math.round(d);0==c&&0==d||a.moveBy(c,d)}}}function lc(a){var c=a.Qa(),d=a.M?h.wa.mh:0,e=H(a),f=c.y,g=c.y+e.height;a.G?(a=c.x-(e.width-d),c=c.x+d):(a=c.x-d,c=c.x+e.width-d);return new h.g.Rect(f,g,a,c)}b.Zm=function(){for(var a=0,c;c=this.T[a];a++)c.Zm()};
b.Wg=function(a){if(this.Cg!=a){for(var c=[],d=0,e;e=this.T[d];d++)c.push.apply(c,e.Vb(!a));if(a){e=Na(this);for(d=0;d<e.length;d++)e[d].Vb(!1);d=this.toString(h.ZA);L(O(this,"_TEMP_COLLAPSED_INPUT"),d).S();e=p(this,!0);if(d=q(this))d=e.indexOf(d),e.splice(d,e.length-d);d=1;for(var f;f=e[d];d++)if(f.bd){this.Yg(h.h.COLLAPSED_WARNINGS_WARNING,h.wa.Cq);break}}else this.ib("_TEMP_COLLAPSED_INPUT"),this.bd&&(this.bd.dl("",h.wa.Cq),Object.keys(this.bd.kl).length||this.Yg(null));h.wa.w.Wg.call(this,a);
c.length||(c[0]=this);if(this.ba)for(d=0;f=c[d];d++)f.za()}};function mc(a,c,d){for(var e=[],f=0,g;g=a.T[f];f++){for(var k=0,l;l=g.Pa[k];k++)l.Sy()&&l.isVisible()&&e.push(l);g.connection&&(g=z(g.connection))&&e.push(g)}c=e.indexOf(c);-1==c&&(c=d?-1:e.length);(e=e[d?c+1:c-1])?e instanceof h.Na?e.qf():mc(e,null,d):(e=a.getParent())&&mc(e,a,d)}
b.Xh=function(a){var c=this.v&&this.v.Ch(a);if(c){if(c.dj)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");ub(c,this);c.nf=a}};
function nc(a){if(a.v.options.readOnly||!a.contextMenu)return null;var c=[];if(!a.$b){a.je()&&a.kd()&&c.push(h.Ea.uD(a));a.v.options.hm&&!a.Cg&&a.jd()&&c.push(h.Ea.sD(a));if(a.kd())if(a.Cg)a.v.options.collapse&&(d={enabled:!0},d.text=h.h.EXPAND_BLOCK,d.yb=function(){a.Wg(!1)},c.push(d));else{for(var d=1;d<a.T.length;d++)if(a.T[d-1].type!=h.jb&&a.T[d].type!=h.jb){d={enabled:!0};var e=Ha(a);d.text=e?h.h.EXTERNAL_INPUTS:h.h.INLINE_INPUTS;d.yb=function(){a.$c(!e)};c.push(d);break}a.v.options.collapse&&
(d={enabled:!0},d.text=h.h.COLLAPSE_BLOCK,d.yb=function(){a.Wg(!0)},c.push(d))}a.v.options.disable&&a.jd()&&(d={text:a.isEnabled()?h.h.DISABLE_BLOCK:h.h.ENABLE_BLOCK,enabled:!Kb(a),yb:function(){var f=h.i.Zb();f||h.i.$(!0);a.md(!a.isEnabled());f||h.i.$(!1)}},c.push(d));a.je()&&c.push(h.Ea.tD(a))}c.push(h.Ea.vD(a));a.Fg&&a.Fg(c);return c}b.yn=function(a){var c=nc(this);c&&c.length&&(h.Ea.show(a,c,this.G),h.Ea.Wo=this)};
function Ua(a,c,d){if(a.ba){for(var e=a.Fe(!1),f=0;f<e.length;f++)e[f].moveBy(c,d);e=Na(a);for(f=0;f<e.length;f++)ic(e[f]);for(f=0;f<a.Bg.length;f++)Ua(a.Bg[f],c,d)}}b.Cj=function(a){if(a){var c=this.ya();c.Ln="";c.An="";h.wm=h.wm.concat(this.Fe(!0));h.g.o.Cb(this.N,"blocklyDragging")}else h.wm=[],h.g.o.Ec(this.N,"blocklyDragging");for(c=0;c<this.Bg.length;c++)this.Bg[c].Cj(a)};function jc(a){a.kd()?h.g.o.Cb(a.N,"blocklyDraggable"):h.g.o.Ec(a.N,"blocklyDraggable")}
b.gq=function(a){h.wa.w.gq.call(this,a);jc(this)};b.Gu=function(a){h.wa.w.Gu.call(this,a);a=Na(this);for(var c=0;c<a.length;c++)a[c].ah()};b.Ku=function(a){h.wa.w.Ku.call(this,a);this.Qe()};b.Xz=function(a){this.Tm!=a&&(this.Tm=a)&&(this.Fc(h.LB),h.g.o.Cb(this.N,"blocklyInsertionMarker"))};b.ya=function(){return this.N};
b.I=function(a,c){if(this.v){h.H.Ca();h.g.o.Dn();var d=this.v;if(h.selected==this){lb(this);var e=this.v;e.yc&&e.yc.cancel()}h.Ea.Wo==this&&h.Ea.Ca();h.Le&&h.navigation.kz(this);c&&this.ba&&(A(this,a),h.mb.sE(this));this.ba=!1;if(this.Vd){for(var f in this.Vd)clearTimeout(this.Vd[f]);this.Vd=null}c=Na(this);for(e=0;e<c.length;e++)c[e].I();h.wa.w.I.call(this,a);h.g.o.removeNode(this.N);na(d);this.In=this.Hj=this.Td=this.N=null;h.g.o.En()}};
b.Qe=function(){if(this.isEnabled()){if(this.cb){var a=Hb(this);this.Hj.style.display="none";this.In.setAttribute("fill",a);this.Td.setAttribute("stroke","none");this.Td.setAttribute("fill",a)}else a=Ib(this),a.Ro?(this.Hj.style.display="none",this.In.style.display="none",this.Td.setAttribute("stroke",a.Ro)):(this.Hj.style.display="",this.In.style.display="",this.Td.setAttribute("stroke","none"),this.Hj.setAttribute("stroke",a.fs),this.In.setAttribute("fill",a.Ww)),this.Td.setAttribute("fill",this.sh);
a=Na(this);for(var c=0;c<a.length;c++)a[c].Qe();for(a=0;c=this.T[a];a++)for(var d=0,e;e=c.Pa[d];d++)e.Qe()}};function ma(a){!a.isEnabled()||Kb(a)?h.g.o.Cb(a.N,"blocklyDisabled")&&a.Td.setAttribute("fill","url(#"+a.v.options.Ig+")"):h.g.o.Ec(a.N,"blocklyDisabled")&&a.Qe();a=a.Ah(!1);for(var c=0,d;d=a[c];c++)ma(d)}b.QE=function(){return this.Ff};
b.$f=function(a){if(!h.Comment)throw Error("Missing require for Blockly.Comment");this.Be.text!=a&&(h.wa.w.$f.call(this,a),a=null!=a,!!this.Ff==a?oc(this.Ff):(a?this.vk=this.Ff=new h.Comment(this):(this.Ff.I(),this.vk=this.Ff=null),this.ba&&(this.za(),this.Kb())))};
b.Yg=function(a,c){this.Vd||(this.Vd=Object.create(null));var d=c||"";if(d)this.Vd[d]&&(clearTimeout(this.Vd[d]),delete this.Vd[d]);else for(var e in this.Vd)clearTimeout(this.Vd[e]),delete this.Vd[e];if(this.v.gc()){var f=this;this.Vd[d]=setTimeout(function(){f.v&&(delete f.Vd[d],f.Yg(a,d))},100)}else{this.$b&&(a=null);c=Gb(this);for(e=null;c;)c.isCollapsed()&&(e=c),c=Gb(c);e&&e.Yg(h.h.COLLAPSED_WARNINGS_WARNING,h.wa.Cq);c=!1;"string"==typeof a?(this.bd||(this.bd=new h.Cf(this),c=!0),this.bd.dl(a,
d)):this.bd&&!d?(this.bd.I(),c=!0):this.bd&&(c=this.bd.Tb(),this.bd.dl("",d),(e=this.bd.Tb())||this.bd.I(),c=c!=e);c&&this.ba&&(this.za(),this.Kb())}};b.ji=function(a){this.Pd&&this.Pd!==a&&this.Pd.I();a&&(a.U=this,this.Pd=a,hc(a))};b.md=function(a){this.isEnabled()!=a&&(h.wa.w.md.call(this,a),this.ba&&ma(this))};b.Xg=function(a){this.ba&&(a?(this.Td.setAttribute("filter","url(#"+this.v.options.Ix+")"),this.Hj.style.display="none"):(this.Td.setAttribute("filter","none"),this.Hj.style.display="inline"))};
b.Jo=function(){h.g.o.Cb(this.N,"blocklySelected")};b.qn=function(){h.g.o.Ec(this.N,"blocklySelected")};function Ra(a,c){c?h.g.o.Cb(a.N,"blocklyDraggingDelete"):h.g.o.Ec(a.N,"blocklyDraggingDelete")}b.Fc=function(a){h.wa.w.Fc.call(this,a);this.ba&&this.Qe()};function Va(a){do{var c=a.ya();c.parentNode.appendChild(c);a=a.getParent()}while(a)}b.ne=function(a,c){h.wa.w.ne.call(this,a,c);this.ba&&(this.za(),this.Kb())};b.me=function(a,c){h.wa.w.me.call(this,a,c);this.ba&&(this.za(),this.Kb())};
b.Ad=function(a,c){h.wa.w.Ad.call(this,a,c);this.ba&&(this.za(),this.Kb())};b.$c=function(a){h.wa.w.$c.call(this,a);this.ba&&(this.za(),this.Kb())};b.ib=function(a,c){h.wa.w.ib.call(this,a,c);this.ba&&(this.za(),this.Kb())};b.Tt=function(a,c){h.wa.w.Tt.call(this,a,c);this.ba&&(this.za(),this.Kb())};b.$l=function(a,c){a=h.wa.w.$l.call(this,a,c);this.ba&&(this.za(),this.Kb());return a};
function la(a,c){if(!c&&a.isCollapsed()){if(a.M&&Eb(a.M,c),a.Z&&Eb(a.Z,c),a.X){Eb(a.X,c);var d=z(a.X);d&&la(d,c)}}else{a=a.Fe(!0);for(var e=0;d=a[e];e++)Eb(d,c),E(d)&&(d=z(d))&&la(d,c)}}b.Fe=function(a){var c=[];if(a||this.ba)if(this.M&&c.push(this.M),this.Z&&c.push(this.Z),this.X&&c.push(this.X),a||!this.Cg){a=0;for(var d;d=this.T[a];a++)d.connection&&c.push(d.connection)}return c};b.Ym=function(a){return new h.tg(this,a)};
b.Kb=function(){if(this.v&&!this.v.gc()){var a=I(this);if(!a.$b)for(var c=this.Fe(!1),d=0,e;e=c[d];d++){e.isConnected()&&E(e)&&z(e).Kb();for(var f=e.lz(h.td),g=0,k;k=f[g];g++)e.isConnected()&&k.isConnected()||I(k.B)!=a&&(E(e)?ac(k,e):ac(e,k))}}};function Wa(a){var c=h.i.Zb();setTimeout(function(){h.i.$(c);kc(a);h.i.$(!1)},h.Yn/2);setTimeout(function(){h.i.$(c);a.Kb();h.i.$(!1)},h.Yn)}
b.za=function(a){h.g.o.Dn();this.ba=!0;this.v.Ug.za(this);var c=this.Qa();this.Z&&cc(this.Z,c);this.M&&cc(this.M,c);for(var d=0;d<this.T.length;d++){var e=this.T[d].connection;e&&(cc(e,c),e.isConnected()&&ec(e))}this.X&&(cc(this.X,c),this.X.isConnected()&&ec(this.X));!1!==a&&((a=this.getParent())?a.za(!0):na(this.v));h.g.o.En()};b.wn=function(a){a?(this.N.appendChild(a),this.Sc=a):this.Sc=null};b.xn=function(a){a&&(this.Sc?this.N.insertBefore(a,this.Sc):this.N.appendChild(a))};
function H(a){var c=a.height,d=a.width;if(a=q(a))a=H(a),c+=a.height-4,d=Math.max(d,a.width);return{height:c,width:d}}function Ma(a,c){c?h.g.o.Cb(a.N,"blocklyReplaceable"):h.g.o.Ec(a.N,"blocklyReplaceable")};h.m.al={};h.m.Sn=!1;h.m.register=function(a,c){if(h.m.al[a])throw Error("Renderer has already been registered.");h.m.al[a]=c};h.m.unregister=function(a){h.m.al[a]?delete h.m.al[a]:console.warn('No renderer mapping for name "'+a+'" found to unregister')};h.m.tM=function(){h.m.Sn=!0};h.m.uM=function(){h.m.Sn=!1};h.m.S=function(a){function c(){c.w.constructor.call(this)}if(!h.m.al[a])throw Error("Renderer not registered: ",a);h.g.object.W(c,h.m.al[a]);a=new c;a.S();return a};h.Yj=function(){this.fc=[]};function bc(a,c){if(c.Ih)throw Error("Connection already in database.");c.B.$b||(a.fc.splice(fc(a,c),0,c),c.Ih=!0)}function pc(a,c){if(!a.fc.length)return-1;var d=fc(a,c);if(d>=a.fc.length)return-1;for(var e=c.ab,f=d;0<=f&&a.fc[f].ab==e;){if(a.fc[f]==c)return f;f--}for(;d<a.fc.length&&a.fc[d].ab==e;){if(a.fc[d]==c)return d;d++}return-1}
function fc(a,c){if(!a.fc.length)return 0;for(var d=0,e=a.fc.length;d<e;){var f=Math.floor((d+e)/2);if(a.fc[f].ab<c.ab)d=f+1;else if(a.fc[f].ab>c.ab)e=f;else{d=f;break}}return d}function Zb(a,c){if(!c.Ih)throw Error("Connection not in database.");var d=pc(a,c);if(-1==d)throw Error("Unable to find connection in connectionDB.");c.Ih=!1;a.fc.splice(d,1)}
function gc(a,c,d){function e(n){var t=g-f[n].Wb,u=k-f[n].ab;Math.sqrt(t*t+u*u)<=d&&m.push(f[n]);return u<d}var f=a.fc,g=c.Wb,k=c.ab;a=0;for(var l=c=f.length-2;a<l;)f[l].ab<k?a=l:c=l,l=Math.floor((a+c)/2);var m=[];c=a=l;if(f.length){for(;0<=a&&e(a);)a--;do c++;while(c<f.length&&e(c))}return m}h.Yj.S=function(){var a=[];a[h.Wa]=new h.Yj;a[h.Te]=new h.Yj;a[h.jb]=new h.Yj;a[h.Ue]=new h.Yj;return a};h.Zd=function(a,c){h.Zd.w.constructor.call(this,a,c);this.Gp=!1;this.Ae={};this.dA=this.mn=0;this.iu=null};h.g.object.W(h.Zd,h.Zj);h.Zd.eD=5;h.Zd.fD=6;b=h.Zd.prototype;b.As=function(a){h.Zd.w.As.call(this,a);!this.Ep&&h.Touch.Jp(a)&&qc(this,a)};b.qk=function(a){this.iu=h.ma(document,"mousedown",null,this.pF.bind(this),!0);this.Qp=h.ma(document,"mousemove",null,this.Jm.bind(this),!0);this.Rp=h.ma(document,"mouseup",null,this.tp.bind(this),!0);a.preventDefault();a.stopPropagation()};
b.pF=function(a){!this.gc()&&h.Touch.Jp(a)&&(qc(this,a),this.Gp&&h.Sh())};b.Jm=function(a){if(this.gc())h.Touch.Nu(a)&&h.Zd.w.Jm.call(this,a);else if(this.Gp){if(h.Touch.Jp(a)){this.Ae[h.Touch.sp(a)]=rc(this,a);var c=Object.keys(this.Ae);if(2==c.length){c=h.g.K.bp(this.Ae[c[0]],this.Ae[c[1]])/this.dA;if(0<this.mn&&Infinity>this.mn){var d=c-this.mn;d=0<d?d*h.Zd.eD:d*h.Zd.fD;var e=this.qc,f=h.g.fn(a,x(e),Ba(e));e.zoom(f.x,f.y,d)}this.mn=c;a.preventDefault()}}h.Sh()}else h.Zd.w.Jm.call(this,a)};
b.tp=function(a){if(h.Touch.Jp(a)&&!this.gc()){var c=h.Touch.sp(a);this.Ae[c]&&delete this.Ae[c];2>Object.keys(this.Ae).length&&(this.Ae={},this.mn=0)}!this.Gp||this.gc()?h.Touch.Nu(a)&&h.Zd.w.tp.call(this,a):(a.preventDefault(),a.stopPropagation(),this.I())};b.I=function(){h.Zd.w.I.call(this);this.iu&&h.$a(this.iu)};function qc(a,c){a.Ae[h.Touch.sp(c)]=rc(a,c);var d=Object.keys(a.Ae);2==d.length&&(a.dA=h.g.K.bp(a.Ae[d[0]],a.Ae[d[1]]),a.Gp=!0,c.preventDefault())}
function rc(a,c){return a.qc?new h.g.K(c.pageX?c.pageX:c.changedTouches[0].pageX,c.pageY?c.pageY:c.changedTouches[0].pageY):null};h.Aw=function(a){this.mu=a;this.Ol=Object.create(null)};b=h.Aw.prototype;b.Ct=null;b.I=function(){this.Ol=this.mu=null};b.load=function(a,c){if(a.length){try{var d=new h.g.global.Audio}catch(l){return}for(var e,f=0;f<a.length;f++){var g=a[f],k=g.match(/\.(\w+)$/);if(k&&d.canPlayType("audio/"+k[1])){e=new h.g.global.Audio(g);break}}e&&e.play&&(this.Ol[c]=e)}};
b.preload=function(){for(var a in this.Ol){var c=this.Ol[a];c.volume=.01;var d=c.play();void 0!==d?d.then(c.pause).catch(function(){}):c.pause();if(h.g.userAgent.qg||h.g.userAgent.Rq)break}};b.play=function(a,c){var d=this.Ol[a];d?(a=new Date,null!=this.Ct&&a-this.Ct<h.FC||(this.Ct=a,d=h.g.userAgent.qg||h.g.userAgent.pi?d:d.cloneNode(),d.volume=void 0===c?1:c,d.play())):this.mu&&this.mu.oh.play(a,c)};
h.lb=function(a,c,d){h.lb.w.constructor.call(this,a);this.Uc=a.Uc||h.lb.aF;this.ii=a.ii||h.lb.WG;this.Uo=h.Yj.S();c&&(this.$d=c);d&&(this.Sj=d);this.qq=this.Sj&&h.g.hj();this.Lm=[];this.oh=new h.Aw(a.Nb);this.Je=this.options.wy?new h.yi(a.wy,a.vy):null;this.Sc=null;h.O&&h.O.aj&&sc(this,h.vw,h.O.aj);h.zw&&h.zw.aj&&sc(this,h.WC,h.zw.aj);h.Ga&&h.Ga.aj&&sc(this,h.ew,h.Ga.aj);this.Ug=h.m.S(this.options.Tg||"geras")};h.g.object.W(h.lb,h.Ib);b=h.lb.prototype;b.bq=null;b.ba=!0;b.Qh=!0;b.ke=!1;b.lj=!1;
b.Au=!0;b.scrollX=0;b.scrollY=0;b.Fx=null;b.scale=1;b.ad=null;b.Ub=null;b.P=null;b.ra=null;b.yc=null;b.$d=null;b.Sj=null;b.qq=!1;b.Dp=!1;b.tt=null;b.Vy=null;b.Px={};b.Xu={};b.$w=null;b.Jj=null;b.Oy=null;b.ut=!0;b.Fu=function(a){this.Xa&&this.Xa.zc&&this.Xa.zc.I();if(this.Xa=a)this.Xa.zc=new h.Aa(this,!1),this.wn(this.Xa.zc.Oa())};b.Yz=function(a){this.ac&&this.ac.zc&&this.ac.zc.I();if(this.ac=a)this.ac.zc=new h.Aa(this,!0),this.xn(this.ac.zc.Oa())};
b.wn=function(a){a?this.pb&&(this.pb.appendChild(a),this.Sc=a):this.Sc=null};b.xn=function(a){a&&this.pb&&(this.Sc?this.pb.insertBefore(a,this.Sc):this.pb.appendChild(a))};function Ba(a){if(a.ut){var c=x(a).getScreenCTM();c&&(a.Oy=c.inverse(),a.ut=!1)}return a.Oy}b.Pn=function(){this.ut=!0};b.isVisible=function(){return this.Qh};
function Ia(a,c){var d=0,e=0,f=1;if(h.g.o.containsNode(a.pb,c)||h.g.o.containsNode(a.Zg,c))f=a.scale;do{var g=h.g.He(c);if(c==a.pb||c==a.Zg)f=1;d+=g.x*f;e+=g.y*f;c=c.parentNode}while(c&&c!=x(a));return new h.g.K(d,e)}function ba(a){if(!a.tt)for(var c=a.N;c;){if(-1!=(" "+(c.getAttribute("class")||"")+" ").indexOf(" injectionDiv ")){a.tt=c;break}c=c.parentNode}return a.tt}
b.Oa=function(a){this.N=h.g.o.L("g",{"class":"blocklyWorkspace"},null);a&&(this.Hc=h.g.o.L("rect",{height:"100%",width:"100%","class":a},this.N),"blocklyMainBackground"==a&&this.Je?this.Hc.style.fill="url(#"+this.Je.Fk.id+")":this.jc.subscribe(this.Hc,"workspace","fill"));this.pb=h.g.o.L("g",{"class":"blocklyBlockCanvas"},this.N);this.Zg=h.g.o.L("g",{"class":"blocklyBubbleCanvas"},this.N);this.ke||(h.ma(this.N,"mousedown",this,this.Xh,!1,!0),h.ma(this.N,"wheel",this,this.zG));if(this.options.zy){if(!h.Ji)throw Error("Missing require for Blockly.Toolbox");
this.ra=new h.Ji(this)}this.Je&&this.Je.update(this.scale);tc(this);this.Xa.zc=new h.Aa(this,!1);a=this.Xa.zc.Oa();this.N.appendChild(a);this.ac.zc=new h.Aa(this,!0);a=this.ac.zc.Oa();this.N.appendChild(a);return this.N};
b.I=function(){this.ba=!1;this.yc&&this.yc.cancel();this.N&&(h.g.o.removeNode(this.N),this.N=null);this.Zg=this.pb=null;this.ra&&(this.ra.I(),this.ra=null);this.P&&(this.P.I(),this.P=null);this.ad&&(this.ad.I(),this.ad=null);this.Ub&&(this.Ub.I(),this.Ub=null);this.Tj&&(this.Tj.I(),this.Tj=null);this.ac&&this.ac.zc.I();this.Xa&&this.Xa.zc.I();this.oh&&(this.oh.I(),this.oh=null);this.Je&&(this.Je.I(),this.Je=null);this.jc&&this.jc.unsubscribe(this.Hc);h.lb.w.I.call(this);this.Px=this.Xu=this.Uo=null;
if(!this.options.Nb){var a=x(this).parentNode;a&&h.g.o.removeNode(a)}this.bq&&(h.$a(this.bq),this.bq=null)};b.Uh=function(a,c){return new h.wa(this,a,c)};function uc(a){if(!h.Cr)throw Error("Missing require for Blockly.Trashcan");a.ad=new h.Cr(a);var c=a.ad.Oa();a.N.insertBefore(c,a.pb)}function vc(a){if(!h.gD)throw Error("Missing require for Blockly.ZoomControls");a.Tj=new h.gD(a);var c=a.Tj.Oa();a.N.appendChild(c)}
function wc(a,c){var d={Ig:a.options.Ig,Nb:a,G:a.G,Ne:a.options.Ne,ie:a.ie,Ia:a.options.Ia,Tg:a.options.Tg};if(a.ie){if(!h.El)throw Error("Missing require for Blockly.HorizontalFlyout");a.P=new h.El(d)}else{if(!h.yg)throw Error("Missing require for Blockly.VerticalFlyout");a.P=new h.yg(d)}a.P.pk=!1;return a.P.Oa(c)}function xc(a){return a.P?a.P:a.ra?a.ra.P:null}function na(a){if(a.Au&&a.ba){if(a.Ub){var c=a.Uc();wa(a.Ub.fe,c);ya(a.Ub.re,c)}a.Pn()}}
b.resize=function(){this.ra&&this.ra.position();this.P&&this.P.position();this.ad&&this.ad.position();this.Tj&&this.Tj.position();this.Ub&&this.Ub.resize();this.Pn();tc(this)};function ob(a){var c=h.g.VE();h.g.K.Ee(a.Vy,c)||(a.Vy=c,a.Pn(),tc(a))}function x(a){if(a.Kw)return a.Kw;for(var c=a.N;c;){if("svg"==c.tagName)return a.Kw=c;c=c.parentNode}return null}
b.translate=function(a,c){if(this.qq&&this.Dp)this.Sj.Mj(a,c);else{var d="translate("+a+","+c+") scale("+this.scale+")";this.pb.setAttribute("transform",d);this.Zg.setAttribute("transform",d)}if(this.$d){d=this.$d;var e=this.scale;d.gi=e;d.df.setAttribute("transform","translate("+a.toFixed(0)+","+c.toFixed(0)+") scale("+e+")")}this.Je&&this.Je.moveTo(a,c)};
function Da(a){if(a.qq){a.Dp=!1;var c=a.Sj.bt();a.Sj.Oo(a.N);c="translate("+c.x+","+c.y+") scale("+a.scale+")";a.pb.setAttribute("transform",c);a.Zg.setAttribute("transform",c)}}
function Ca(a){if(a.qq&&!a.Dp){a.Dp=!0;var c=a.pb.previousSibling,d=parseInt(x(a).getAttribute("width"),10),e=parseInt(x(a).getAttribute("height"),10),f=h.g.He(a.pb),g=a.Sj,k=a.pb,l=a.Zg,m=a.scale;if(g.tb.childNodes.length)throw Error("Already dragging a block.");g.Zk=c;k.setAttribute("transform","translate(0, 0) scale("+m+")");l.setAttribute("transform","translate(0, 0) scale("+m+")");g.tb.setAttribute("width",d);g.tb.setAttribute("height",e);g.tb.appendChild(k);g.tb.appendChild(l);g.tb.style.display=
"block";a.Sj.Mj(f.x,f.y)}}b.Qf=function(){var a=this.Uc();return a?a.Bb/this.scale:0};b.Vb=function(a){this.Ub&&this.Ub.Bj(a);xc(this)&&xc(this).Bj(a);x(this).style.display=a?"block":"none";this.ra&&(this.ra.vc.style.display=a?"block":"none");if(a){for(var c=K(this,!1),d=c.length-1;0<=d;d--)c[d].Zm();this.za();this.ra&&this.ra.position()}else h.oc(!0);this.Qh=a};b.za=function(){for(var a=K(this,!1),c=a.length-1;0<=c;c--)a[c].za(!1);if(this.yc)for(a=this.yc.Dk(),c=0;c<a.length;c++)a[c].za(!1)};
function yc(a){var c=h.fm;if(a.ba&&!(c.getElementsByTagName("block").length>=$a(a)))if(a.yc&&a.yc.cancel(),"comment"==c.tagName.toLowerCase()){h.i.disable();try{var d=h.mk.Cm(c),e=parseInt(c.getAttribute("x"),10),f=parseInt(c.getAttribute("y"),10);isNaN(e)||isNaN(f)||(a.G&&(e=-e),d.moveBy(e+50,f+50))}finally{h.i.enable()}d.select()}else a:{h.i.disable();try{var g=h.R.Zi(c,a),k=a.ac.Sb;if(h.Le&&k){h.navigation.Ny(g,k.qa);break a}var l=parseInt(c.getAttribute("x"),10),m=parseInt(c.getAttribute("y"),
10);if(!isNaN(l)&&!isNaN(m)){a.G&&(l=-l);do{c=!1;var n=K(a,!1);d=0;for(var t;t=n[d];d++){var u=t.Qa();if(1>=Math.abs(l-u.x)&&1>=Math.abs(m-u.y)){c=!0;break}}if(!c){var w=g.Fe(!1);d=0;for(var F;F=w[d];d++)if(F.closest(h.td,new h.g.K(l,m)).connection){c=!0;break}}c&&(l=a.G?l-h.td:l+h.td,m+=2*h.td)}while(c);g.moveBy(l,m)}}finally{h.i.enable()}h.i.isEnabled()&&!g.cb&&h.i.Ka(new h.i.$n(g));g.select()}}
function zc(a){if((a=a.ke?a.Jj:a)&&!a.yc&&a.ra&&a.ra.P){a=a.ra;var c=a.Bd.Rd;c&&c.Df&&a.P.show(c.Df)}}b.ei=function(a,c){h.lb.w.ei.call(this,a,c);zc(this)};b.Kf=function(a){h.lb.w.Kf.call(this,a);zc(this)};b.Ld=function(a,c,d){a=h.lb.w.Ld.call(this,a,c,d);zc(this);return a};function tc(a){a.ux=a.ad&&a.N.parentNode?a.ad.Em():null;a.tx=a.P?a.P.Em():a.ra?a.ra.Em():null}function Qa(a,c){return a.ux&&a.ux.contains(c.clientX,c.clientY)?h.Iq:a.tx&&a.tx.contains(c.clientX,c.clientY)?h.Dv:h.Cv}
b.Xh=function(a){var c=this.Ch(a);c&&sb(c,a,this)};b.Qu=function(a,c){a=h.g.fn(a,x(this),Ba(this));a.x/=this.scale;a.y/=this.scale;this.Fx=h.g.K.um(c,a)};b.gc=function(){return null!=this.yc&&this.yc.gc()};function Ac(a){return a.options.Bc&&a.options.Bc.scrollbars||a.options.Bc&&a.options.Bc.Rj||a.options.Bc&&a.options.Bc.yh||a.options.Hb&&a.options.Hb.controls||a.options.Hb&&a.options.Hb.Rj}
b.kd=function(){return this.options.Bc&&this.options.Bc.scrollbars||this.options.Bc&&this.options.Bc.Rj||this.options.Bc&&this.options.Bc.yh||this.options.Hb&&this.options.Hb.Rj};
b.zG=function(a){if(h.Zj.rt())a.preventDefault(),a.stopPropagation();else{var c=this.options.Hb&&this.options.Hb.Rj,d=this.options.Bc&&this.options.Bc.Rj;if(c||d){var e=h.g.ky(a);!c||!a.ctrlKey&&d?(c=this.scrollX-e.x,d=this.scrollY-e.y,a.shiftKey&&!e.x&&(c=this.scrollX-e.y,d=this.scrollY),this.scroll(c,d)):(e=-e.y/50,c=h.g.fn(a,x(this),Ba(this)),this.zoom(c.x,c.y,e));a.preventDefault()}}};
function ka(a){var c=D(a,!1);a=ja(a,!1);c=c.concat(a);if(!c.length)return new h.g.Rect(0,0,0,0);a=lc(c[0]);for(var d=1;d<c.length;d++){var e=lc(c[d]);e.top<a.top&&(a.top=e.top);e.bottom>a.bottom&&(a.bottom=e.bottom);e.left<a.left&&(a.left=e.left);e.right>a.right&&(a.right=e.right)}return a}b.JD=function(){this.Gc(!1);h.i.$(!0);for(var a=D(this,!0),c=0,d=0,e;e=a[d];d++)if(e.kd()){var f=e.Qa();e.moveBy(-f.x,c-f.y);kc(e);c=e.Qa().y+H(e).height+h.wa.Yq}h.i.$(!1);this.Gc(!0)};
b.yn=function(a){function c(F){if(F.je())w=w.concat(p(F,!1));else{F=F.Ah(!1);for(var U=0;U<F.length;U++)c(F[U])}}function d(){h.i.$(g);var F=w.shift();F&&(F.v?(F.I(!1,!0),setTimeout(d,10)):d());h.i.$(!1)}if(!this.options.readOnly&&!this.ke){var e=[],f=D(this,!0),g=h.g.Jg(),k=this,l={};l.text=h.h.UNDO;l.enabled=0<this.Nj.length;l.yb=this.$u.bind(this,!1);e.push(l);l={};l.text=h.h.REDO;l.enabled=0<this.on.length;l.yb=this.$u.bind(this,!0);e.push(l);this.kd()&&(l={},l.text=h.h.CLEAN_UP,l.enabled=1<f.length,
l.yb=this.JD.bind(this),e.push(l));if(this.options.collapse){for(var m=l=!1,n=0;n<f.length;n++)for(var t=f[n];t;)t.isCollapsed()?l=!0:m=!0,t=q(t);var u=function(F){for(var U=0,aa=0;aa<f.length;aa++)for(var za=f[aa];za;)setTimeout(za.Wg.bind(za,F),U),za=q(za),U+=10};m={enabled:m};m.text=h.h.COLLAPSE_ALL;m.yb=function(){u(!0)};e.push(m);l={enabled:l};l.text=h.h.EXPAND_ALL;l.yb=function(){u(!1)};e.push(l)}var w=[];for(n=0;n<f.length;n++)c(f[n]);l={text:1==w.length?h.h.DELETE_BLOCK:h.h.DELETE_X_BLOCKS.replace("%1",
String(w.length)),enabled:0<w.length,yb:function(){k.yc&&k.yc.cancel();2>w.length?d():h.confirm(h.h.DELETE_ALL_BLOCKS.replace("%1",w.length),function(F){F&&d()})}};e.push(l);this.$w&&this.$w(e);h.Ea.show(a,e,this.G)}};function Aa(a){if(a.options.Nb)Aa(a.options.Nb);else{h.Xm=a;document.activeElement&&document.activeElement.blur();try{x(a).focus()}catch(c){try{x(a).parentNode.setActive()}catch(d){x(a).parentNode.focus()}}}}
b.zoom=function(a,c,d){if(!this.ke&&!this.lj){d=Math.pow(this.options.Hb.PG,d);var e=this.scale*d;if(this.scale!=e){e>this.options.Hb.$m?d=this.options.Hb.$m/this.scale:e<this.options.Hb.cn&&(d=this.options.Hb.cn/this.scale);var f=this.pb.getCTM(),g=x(this).createSVGPoint();g.x=a;g.y=c;g=g.matrixTransform(f.inverse());a=g.x;c=g.y;f=f.translate(a*(1-d),c*(1-d)).scale(d);this.scrollX=f.e;this.scrollY=f.f;this.setScale(e)}}};
b.setScale=function(a){this.options.Hb.$m&&a>this.options.Hb.$m?a=this.options.Hb.$m:this.options.Hb.cn&&a<this.options.Hb.cn&&(a=this.options.Hb.cn);this.scale=a;h.oc(!1);this.P&&(this.P.vu(),tc(this));this.Je&&this.Je.update(this.scale);a=this.Uc();this.scrollX-=a.Pc;this.scrollY-=a.fd;a.dc+=a.Pc;a.lc+=a.fd;this.scroll(this.scrollX,this.scrollY);this.Ub&&(this.P?(ta(this.Ub.fe,a),ua(this.Ub.re,a)):(wa(this.Ub.fe,a),ya(this.Ub.re,a)))};
b.scroll=function(a,c){h.oc(!0);var d=this.Uc(),e=d.Hf+d.Rc-d.Bb,f=d.ce+d.xc-d.Pb;a=Math.min(a,-d.Rc);c=Math.min(c,-d.xc);a=Math.max(a,-e);c=Math.max(c,-f);this.scrollX=a;this.scrollY=c;this.Ub&&(pa(this.Ub.fe,-(a+d.Rc)*this.Ub.fe.Cc),pa(this.Ub.re,-(c+d.xc)*this.Ub.re.Cc));a+=d.Pc;c+=d.fd;this.translate(a,c)};h.lb.ay=function(a){var c=0,d=0;a&&(c=a.Qf(),d=a.ey());return{width:c,height:d}};h.lb.TE=function(a,c){return Ac(a)?h.lb.SE(a,c):h.lb.Yx(a)};
h.lb.Yx=function(a){var c=ka(a),d=a.scale;a=c.top*d;var e=c.bottom*d,f=c.left*d;c=c.right*d;return{top:a,bottom:e,left:f,right:c,width:c-f,height:e-a}};h.lb.SE=function(a,c){a=h.lb.Yx(a);var d=c.width;c=c.height;var e=d/2,f=c/2,g=Math.min(a.left-e,a.right-d),k=Math.min(a.top-f,a.bottom-c);return{left:g,top:k,height:Math.max(a.bottom+f,a.top+c)-k,width:Math.max(a.right+e,a.left+d)-g}};
h.lb.aF=function(){var a=h.lb.ay(this.ra),c=h.lb.ay(this.P),d=h.iA(x(this)),e={height:d.height,width:d.width};if(this.ra)if(this.Ia==h.wg||this.Ia==h.kk)e.height-=a.height;else{if(this.Ia==h.Yd||this.Ia==h.vg)e.width-=a.width}else if(this.P)if(this.Ia==h.wg||this.Ia==h.kk)e.height-=c.height;else if(this.Ia==h.Yd||this.Ia==h.vg)e.width-=c.width;var f=h.lb.TE(this,e),g=0;this.ra&&this.Ia==h.Yd?g=a.width:this.P&&this.Ia==h.Yd&&(g=c.width);var k=0;this.ra&&this.Ia==h.wg?k=a.height:this.P&&this.Ia==h.wg&&
(k=c.height);return{ce:f.height,Hf:f.width,xc:f.top,Rc:f.left,Pb:e.height,Bb:e.width,lc:-this.scrollY,dc:-this.scrollX,fd:k,Pc:g,wM:d.height,xM:d.width,lA:a.width,yM:a.height,RL:c.width,QL:c.height,Ia:this.Ia}};h.lb.WG=function(a){var c=this.Uc();"number"==typeof a.x&&(this.scrollX=-c.Hf*a.x-c.Rc);"number"==typeof a.y&&(this.scrollY=-c.ce*a.y-c.xc);this.translate(this.scrollX+c.Pc,this.scrollY+c.fd)};h.lb.prototype.Gc=function(a){var c=!this.Au&&a;this.Au=a;c&&na(this)};
h.lb.prototype.clear=function(){this.Gc(!1);h.lb.w.clear.call(this);this.Gc(!0)};function Bc(a,c){if("function"!=typeof c)throw TypeError("Button callbacks must be functions.");a.Px.CREATE_VARIABLE=c}function sc(a,c,d){if("function"!=typeof d)throw TypeError("Toolbox category callbacks must be functions.");a.Xu[c]=d}
h.lb.prototype.Ch=function(a){var c="mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type,d=this.yc;return d?c&&d.dj?(console.warn("Tried to start the same gesture twice."),d.cancel(),null):d:c?this.yc=new h.Zd(a,this):null};h.Kh=function(a,c){h.ED();"string"==typeof a&&(a=document.getElementById(a)||document.querySelector(a));if(!h.g.o.containsNode(document,a))throw Error("Error: container is not in current document.");c=new h.xe(c||{});var d=document.createElement("div");d.className="injectionDiv";a.appendChild(d);a=h.mm(d,c);var e=new h.vv(d);d=new h.Bw(d);d=h.XD(a,c,e,d);h.qb.ob.VG(c.ob);h.BF(d);h.Xm=d;h.il(d);return d};
h.mm=function(a,c){a.setAttribute("dir","LTR");h.uc.sx=c.G;h.Ed.Kh(c.qF,c.ai);a=h.g.o.L("svg",{xmlns:h.g.o.Ql,"xmlns:html":h.g.o.zi,"xmlns:xlink":h.g.o.Mi,version:"1.1","class":"blocklySvg"},a);var d=h.g.o.L("defs",{},a),e=String(Math.random()).substring(2),f=h.g.o.L("filter",{id:"blocklyEmbossFilter"+e},d);h.g.o.L("feGaussianBlur",{"in":"SourceAlpha",stdDeviation:1,result:"blur"},f);var g=h.g.o.L("feSpecularLighting",{"in":"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",
result:"specOut"},f);h.g.o.L("fePointLight",{x:-5E3,y:-1E4,z:2E4},g);h.g.o.L("feComposite",{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},f);h.g.o.L("feComposite",{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},f);c.Ix=f.id;f=h.g.o.L("pattern",{id:"blocklyDisabledPattern"+e,patternUnits:"userSpaceOnUse",width:10,height:10},d);h.g.o.L("rect",{width:10,height:10,fill:"#aaa"},f);h.g.o.L("path",{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},f);c.Ig=f.id;
c.wy=h.yi.Oa(e,c.vy,d);return a};
h.XD=function(a,c,d,e){c.Nb=null;var f=new h.lb(c,d,e);f.scale=c.Hb.eH;a.appendChild(f.Oa("blocklyMainBackground"));!c.zy&&c.Sk&&(d=wc(f,"svg"),h.g.o.gj(d,a));c.Dy&&uc(f);c.Hb&&c.Hb.controls&&vc(f);f.jc.subscribe(a,"workspace","background-color");f.translate(0,0);h.Xm=f;c.readOnly||f.kd()||cb(f,function(g){if(!f.gc()&&!f.kd()&&-1!=h.i.RA.indexOf(g.type)){var k=Object.create(null),l=f.Uc(),m=f.scale;k.G=f.G;k.dc=l.dc/m;k.lc=l.lc/m;k.tA=(l.dc+l.Bb)/m;k.sA=(l.lc+l.Pb)/m;Ac(f)?(l=ka(f),k.Rc=l.left,k.xc=
l.top,k.ix=l.right,k.gx=l.bottom):(k.Rc=l.Rc/m,k.xc=l.xc/m,k.ix=(l.Rc+l.Hf)/m,k.gx=(l.xc+l.ce)/m);if(k.xc<k.lc||k.gx>k.sA||k.Rc<k.dc||k.ix>k.tA){l=null;g&&(l=h.i.Zb(),h.i.$(g.group));switch(g.type){case h.i.vl:case h.i.qv:var n=r(f,g.wc);n=I(n);break;case h.i.bo:case h.i.co:n=f.So[g.Gf]||null}if(n){m=lc(n);m.height=m.bottom-m.top;m.width=m.right-m.left;var t=k.lc,u=k.sA-m.height;u=Math.max(t,u);t=h.g.Ha.Ef(t,m.top,u)-m.top;u=k.dc;var w=k.tA-m.width;k.G?u=Math.min(w,u):w=Math.max(u,w);n.moveBy(h.g.Ha.Ef(u,
m.left,w)-m.left,t)}g&&(g.group||console.log("WARNING: Moved object in bounds but there was no event group. This may break undo."),null!==l&&h.i.$(l))}}});h.il(f);h.aa.Oa();h.D.Oa();h.H.Oa();return f};
h.BF=function(a){var c=a.options,d=x(a);h.ma(d.parentNode,"contextmenu",null,function(e){h.g.Hp(e)||e.preventDefault()});d=h.ma(window,"resize",null,function(){h.oc(!0);h.il(a)});a.bq=d;h.Kh.rD();c.Sk&&(a.ra?a.ra.S(a):a.P&&(a.P.S(a),a.P.show(c.Sk.childNodes),a.P.pc.set(0)));d=h.Ua.Zc;c.Dy&&(d=a.ad.S(d));c.Hb&&c.Hb.controls&&a.Tj.S(d);c.Bc&&c.Bc.scrollbars?(a.Ub=new h.jk(a),a.Ub.resize()):a.ii({x:.5,y:.5});c.sF&&h.Kh.MF(c.ai,a)};
h.Kh.rD=function(){h.uE||(h.ma(document,"scroll",null,function(){for(var a=h.Ib.getAll(),c=0,d;d=a[c];c++)d.Pn&&d.Pn()}),h.ma(document,"keydown",null,h.pG),h.gd(document,"touchend",null,h.Sh),h.gd(document,"touchcancel",null,h.Sh),h.g.userAgent.qg&&h.ma(window,"orientationchange",document,function(){h.il(h.Ab())}));h.uE=!0};
h.Kh.MF=function(a,c){function d(){for(;f.length;)h.$a(f.pop());e.preload()}var e=c.oh;e.load([a+"click.mp3",a+"click.wav",a+"click.ogg"],"click");e.load([a+"disconnect.wav",a+"disconnect.mp3",a+"disconnect.ogg"],"disconnect");e.load([a+"delete.mp3",a+"delete.ogg",a+"delete.wav"],"delete");var f=[];f.push(h.ma(document,"mousemove",null,d,!0));f.push(h.ma(document,"touchstart",null,d,!0))};h.uf=function(a){this.name=a};h.F=function(a,c,d){if(!c)throw Error("Cannot create a node without a location.");this.Nn=a;this.Om=h.F.FF(a);this.qa=c;(a=d||null)&&a.zA&&(this.AA=a.zA)};h.F.types={te:"field",Wd:"block",pg:"input",hk:"output",we:"next",ye:"previous",zf:"stack",Li:"workspace"};h.F.jB=-20;h.F.FF=function(a){switch(a){case h.F.types.ye:case h.F.types.we:case h.F.types.pg:case h.F.types.hk:return!0}return!1};h.F.nm=function(a){return new h.F(h.F.types.te,a)};
h.F.If=function(a){return a?a.type==h.Wa||a.type==h.jb&&a.Pf()?h.F.Ti(a.Pf()):a.type==h.jb?new h.F(h.F.types.we,a):a.type==h.Te?new h.F(h.F.types.hk,a):a.type==h.Ue?new h.F(h.F.types.ye,a):null:null};h.F.Ti=function(a){return a?new h.F(h.F.types.pg,a.connection):null};h.F.Eg=function(a){return new h.F(h.F.types.Wd,a)};h.F.om=function(a){return new h.F(h.F.types.zf,a)};h.F.pm=function(a,c){return new h.F(h.F.types.Li,a,{zA:c})};b=h.F.prototype;b.Mb=function(){return this.Nn};
function Cc(a,c){a=a.qa;a instanceof h.Zn||(a=a.B);if(!a||!a.v)return null;var d=I(a);a=D(d.v,!0);for(var e=0,f;f=a[e];e++)if(d.id==f.id)return c=e+(c?1:-1),-1==c||c==a.length?null:h.F.om(a[c]);throw Error("Couldn't find "+(c?"next":"previous")+" stack?!");}function Dc(a){if(!a)return null;do var c=a.Z&&z(a.Z);while(c&&q(c)==a&&(a=c));return(c=a.Z||a.M)&&c.ca&&c.ca.Pf()?h.F.Ti(c.ca.Pf()):h.F.om(a)}
b.next=function(){switch(this.Nn){case h.F.types.zf:return Cc(this,!0);case h.F.types.hk:return h.F.Eg(this.qa.B);case h.F.types.te:a:{var a=this.qa,c=a.Pf();var d=a.B;a=c.Pa.indexOf(a)+1;c=d.T.indexOf(c);for(var e;e=d.T[c];c++){for(var f=e.Pa;a<f.length;){if(f[a].ng){d=h.F.nm(f[a]);break a}a++}a=0;if(e.connection){d=h.F.Ti(e);break a}}d=null}return d;case h.F.types.pg:a:{a=this.qa.Pf();d=a.B;for(a=d.T.indexOf(a)+1;c=d.T[a];a++){e=c.Pa;f=0;for(var g;g=e[f];f++)if(g.ng){d=h.F.nm(g);break a}if(c.connection){d=
h.F.Ti(c);break a}}d=null}return d;case h.F.types.Wd:if(d=this.qa.X)return h.F.If(d);break;case h.F.types.ye:return h.F.Eg(this.qa.B);case h.F.types.we:if(d=this.qa.ca)return h.F.If(d)}return null};
b.Mm=function(){switch(this.Nn){case h.F.types.Li:var a=D(this.qa,!0);if(0<a.length)return h.F.om(a[0]);break;case h.F.types.zf:a=this.qa;var c=a.Z||a.M;return c?h.F.If(c):h.F.Eg(a);case h.F.types.Wd:a:{a=this.qa.T;c=0;for(var d;d=a[c];c++){for(var e=d.Pa,f=0,g;g=e[f];f++)if(g.ng){a=h.F.nm(g);break a}if(d.connection){a=h.F.Ti(d);break a}}a=null}return a;case h.F.types.pg:if(a=this.qa.ca)return h.F.If(a)}return null};
b.Wf=function(){switch(this.Nn){case h.F.types.zf:return Cc(this,!1);case h.F.types.te:a:{var a=this.qa;var c=a.Pf();var d=a.B;a=c.Pa.indexOf(a)-1;for(var e=d.T.indexOf(c),f;f=d.T[e];e--){if(f.connection&&f!==c){c=h.F.Ti(f);break a}for(f=f.Pa;-1<a;){if(f[a].ng){c=h.F.nm(f[a]);break a}a--}0<=e-1&&(a=d.T[e-1].Pa.length-1)}c=null}return c;case h.F.types.pg:a:{c=this.qa.Pf();d=c.B;for(a=d.T.indexOf(c);e=d.T[a];a--){if(e.connection&&e!==c){c=h.F.Ti(e);break a}e=e.Pa;f=e.length-1;for(var g;g=e[f];f--)if(g.ng){c=
h.F.nm(g);break a}}c=null}return c;case h.F.types.Wd:c=this.qa.M;if(c=this.qa.Z||c)return h.F.If(c);break;case h.F.types.ye:if((c=this.qa.ca)&&!c.Pf())return h.F.If(c);break;case h.F.types.we:return h.F.Eg(this.qa.B)}return null};
b.jn=function(){switch(this.Nn){case h.F.types.zf:var a=this.qa.Qa();return h.F.pm(this.qa.v,new h.g.K(a.x,a.y+h.F.jB));case h.F.types.hk:return(a=this.qa.ca)?h.F.If(a):h.F.om(this.qa.B);case h.F.types.te:return h.F.Eg(this.qa.B);case h.F.types.pg:return h.F.Eg(this.qa.B);case h.F.types.Wd:return Dc(this.qa);case h.F.types.ye:return Dc(this.qa.B);case h.F.types.we:return Dc(this.qa.B)}return null};h.g.Ba={BL:0,uJ:3,NA:8,qw:9,MJ:12,Kq:13,DC:16,fI:17,HA:18,AK:19,TH:20,Lq:27,fL:32,zK:33,yK:34,wI:35,dJ:36,uo:37,Tl:38,Co:39,zl:40,DK:43,FK:44,Qq:45,yl:46,ZERO:48,ONE:49,tL:50,nL:51,UI:52,RI:53,bL:54,$K:55,vI:56,IJ:57,OI:59,MI:61,LI:173,NI:163,HK:63,LH:64,CA:65,NH:66,TA:67,iB:68,E:69,yI:70,VI:71,ZI:72,JB:73,iJ:74,SB:75,jJ:76,tJ:77,GJ:78,bK:79,xK:80,Q:81,IK:82,AC:83,NC:84,uL:85,TC:86,XC:87,Cw:88,EL:89,dD:90,jC:91,CL:92,dI:93,aK:96,UJ:97,$J:98,ZJ:99,QJ:100,PJ:101,YJ:102,XJ:103,OJ:104,TJ:105,SJ:106,WJ:107,
RJ:109,VJ:110,NJ:111,zI:112,DI:113,EI:114,FI:115,GI:116,HI:117,II:118,JI:119,KI:120,AI:121,BI:122,CI:123,LJ:144,WK:145,QI:166,lJ:183,YK:186,gI:189,xI:187,aI:188,BK:190,cL:191,HH:192,oL:192,aL:222,cK:219,OH:220,XH:221,AL:224,vJ:224,wJ:91,xJ:93,zL:229,yL:252,CK:255};h.qb={};h.qb.ob={};h.qb.ob.oj={};h.qb.ob.Qt={DC:"Shift",dB:"Control",HA:"Alt",jC:"Meta"};h.qb.ob.oM=function(a,c){var d=h.qb.ob.YE(c);d&&delete h.qb.ob.oj[d];h.qb.ob.oj[a]=c};h.qb.ob.VG=function(a){h.qb.ob.oj=a};h.qb.ob.TL=function(){var a={};h.g.object.rj(a,h.qb.ob.oj);return a};h.qb.ob.JE=function(a){return h.qb.ob.oj[a]};h.qb.ob.YE=function(a){for(var c=Object.keys(h.qb.ob.oj),d=0,e;e=c[d];d++)if(h.qb.ob.oj[e].name===a.name)return e;return null};
h.qb.ob.SG=function(a){for(var c=h.g.object.values(h.qb.ob.Qt),d="",e=0,f;f=c[e];e++)a.getModifierState(f)&&(d+=f);return d+=a.keyCode};h.qb.ob.YD=function(){for(var a=h.g.Ba.SB,c=[h.qb.ob.Qt.dB],d="",e=h.g.object.values(h.qb.ob.Qt),f=0,g;g=c[f];f++)if(-1<e.indexOf(g))d+=g;else throw Error(g+" is not a valid modifier key.");return d+a};
h.qb.ob.WD=function(){var a={},c=h.qb.ob.YD();a[h.g.Ba.XC]=h.navigation.wq;a[h.g.Ba.CA]=h.navigation.gv;a[h.g.Ba.AC]=h.navigation.vq;a[h.g.Ba.iB]=h.navigation.fv;a[h.g.Ba.JB]=h.navigation.EA;a[h.g.Ba.Kq]=h.navigation.FA;a[h.g.Ba.Cw]=h.navigation.DA;a[h.g.Ba.NC]=h.navigation.GA;a[h.g.Ba.E]=h.navigation.uq;a[h.g.Ba.Lq]=h.navigation.uq;a[c]=h.navigation.hv;return a};h.navigation={};h.navigation.Uk=null;h.navigation.pw=1;h.navigation.Pl=2;h.navigation.xr=3;h.navigation.Ui=h.navigation.Pl;h.navigation.bb={ye:"previous",we:"next",po:"in",Bo:"out",Qq:"insert",Wq:"mark",Fv:"disconnect",tw:"toolbox",Mq:"exit",zr:"toggle_keyboard_nav"};h.navigation.Sx=function(){var a=h.Ab(),c=a.ra;c&&(h.navigation.Ui=h.navigation.xr,h.navigation.Qz(!1),a.ac.Sb||h.navigation.Nt(),c.Bd.Rd||(a=c.Bd,(c=a.Ie())&&a.Ox&&Ec(c,a.Ox)))};
h.navigation.Rx=function(){h.navigation.Ui=h.navigation.pw;var a=h.Ab();var c=a.ra;c=c?c.P:xc(a);a.ac.Sb||h.navigation.Nt();c&&c.Ek()&&(a=D(c.Ek(),!0),0<a.length&&(a=a[0],a=h.F.om(a),J(h.navigation.Bh(),a)))};h.navigation.jp=function(){h.oc();var a=h.Ab(),c=a.Xa,d=!!a.ra,e=D(a,!0);h.navigation.Qz(d);h.navigation.Ui=h.navigation.Pl;0<e.length?J(c,h.navigation.et(e[0])):(a=h.F.pm(a,new h.g.K(100,100)),J(c,a))};
h.navigation.Bh=function(){var a=h.Ab(),c=null;a.ba&&(c=(a=(c=a.ra)?c.P:xc(a))?a.s.Xa:null);return c};h.navigation.DF=function(){var a=h.Ab(),c=xc(a);if(c&&c.isVisible()){var d=h.navigation.Bh().Sb.qa;d.isEnabled()?(c=pb(c,d),c.za(),la(c,!1),J(a.Xa,h.F.Eg(c)),h.navigation.fz()||h.navigation.od("Something went wrong while inserting a block from the flyout."),h.navigation.jp(),J(a.Xa,h.navigation.et(c)),h.navigation.JG()):h.navigation.od("Can't insert a disabled block.")}else h.navigation.od("Trying to insert from the flyout when the flyout does not exist or is not visible")};
h.navigation.Qz=function(a){h.navigation.Bh()&&(h.navigation.Bh().Ca(),a&&xc(h.Ab()).Ca())};
h.navigation.SF=function(){var a=h.Ab().ac.Sb,c=h.Ab().Xa.Sb;if(!a)return h.navigation.od("Cannot insert with no marked node."),!1;if(!c)return h.navigation.od("Cannot insert with no cursor node."),!1;a=a.Mb();c=c.Mb();return a==h.F.types.te?(h.navigation.od("Should not have been able to mark a field."),!1):a==h.F.types.Wd?(h.navigation.od("Should not have been able to mark a block."),!1):a==h.F.types.zf?(h.navigation.od("Should not have been able to mark a stack."),!1):c==h.F.types.te?(h.navigation.od("Cannot attach a field to anything else."),
!1):c==h.F.types.Li?(h.navigation.od("Cannot attach a workspace to anything else."),!1):!0};h.navigation.YF=function(a,c){if(a.cb)return h.navigation.od("Cannot move a shadow block to the workspace."),!1;a.getParent()&&A(a,!1);a.moveTo(c.AA);return!0};
h.navigation.fz=function(){var a=h.Ab().ac.Sb,c=h.Ab().Xa.Sb;if(!h.navigation.SF())return!1;var d=a.Mb(),e=c.Mb(),f=c.qa,g=a.qa;if(a.Om&&c.Om)return h.navigation.$e(f,g);if(a.Om&&(e==h.F.types.Wd||e==h.F.types.zf))return h.navigation.Ny(f,g);if(d==h.F.types.Li)return c=h.navigation.at(c),h.navigation.YF(c,a);h.navigation.od("Unexpected state in Blockly.navigation.modify_.");return!1};h.navigation.qE=function(a,c){var d=a.B,e=c.B;I(d)==I(e)&&(-1<p(d,!1).indexOf(e)?h.navigation.np(c).disconnect():h.navigation.np(a).disconnect())};
h.navigation.Rt=function(a,c){if(!a||!c)return!1;var d=a.B;return Fa(c,a)==h.sa.ao?(h.navigation.qE(a,c),E(c)||a.type!=h.jb&&a.type!=h.Wa||I(d).moveBy(c.Wb-a.Wb,c.ab-a.ab),c.connect(a),!0):!1};h.navigation.np=function(a){var c=a.B;return E(a)?c.Z?c.Z:c.M?c.M:null:a};h.navigation.py=function(a){return E(a)?a:a.ca?a.ca:null};
h.navigation.$e=function(a,c){if(!a||!c)return!1;var d=h.navigation.np(a),e=h.navigation.py(c),f=h.navigation.py(a),g=h.navigation.np(c);if(d&&e&&h.navigation.Rt(d,e)||f&&g&&h.navigation.Rt(f,g)||h.navigation.Rt(a,c))return!0;try{Ga(c,a)}catch(k){h.navigation.od("Connection failed with error: "+k)}return!1};
h.navigation.Ny=function(a,c){switch(c.type){case h.Ue:if(h.navigation.$e(a.X,c))return!0;break;case h.jb:if(h.navigation.$e(a.Z,c))return!0;break;case h.Wa:if(h.navigation.$e(a.M,c))return!0;break;case h.Te:for(var d=0;d<a.T.length;d++){var e=a.T[d].connection;if(e&&e.type===h.Wa&&h.navigation.$e(e,c))return!0}if(a.M&&h.navigation.$e(a.M,c))return!0}h.navigation.od("This block can not be inserted at the marked location.");return!1};
h.navigation.pE=function(){var a=h.Ab(),c=a.Xa.Sb;if(c.Om){var d=c.qa;d.isConnected()?(c=E(d)?d:d.ca,d=E(d)?d.ca:d,d.B.cb?h.navigation.It("Cannot disconnect a shadow block"):(c.disconnect(),ac(d,c),Va(I(c.B)),c=h.F.If(c),J(a.Xa,c))):h.navigation.It("Cannot disconnect unconnected connection")}else h.navigation.It("Cannot disconnect blocks when the cursor is not on a connection")};h.navigation.Nt=function(){var a=h.Ab();J(a.ac,a.Xa.Sb)};h.navigation.JG=function(){var a=h.Ab();J(a.ac,null);a.ac.Ca()};
h.navigation.Gb=function(a){h.navigation.Ui=a};h.navigation.at=function(a){return a?a.Mb()===h.F.types.Wd?a.qa:a.Mb()===h.F.types.zf?a.qa:a.Mb()===h.F.types.Li?null:a.qa.B:null};h.navigation.et=function(a){var c=a.Z||a.M;return c?h.F.If(c):h.F.Eg(a)};h.navigation.kz=function(a){var c=h.Ab();if(c&&(c=c.Xa)){var d=h.navigation.at(c.Sb);d===a?d.getParent()?(a=d.Z||d.M)&&J(c,h.F.If(a.ca)):J(c,h.F.pm(d.v,d.Qa())):-1<a.Ah(!1).indexOf(d)&&J(c,h.F.pm(d.v,d.Qa()))}};
h.navigation.ZF=function(a){var c=h.Ab().Xa;if(c){var d=h.navigation.at(c.Sb);d===a&&J(c,h.F.Eg(d))}};h.navigation.Ns=function(){h.Le||(h.Le=!0,h.navigation.jp())};h.navigation.nE=function(){if(h.Le){var a=h.Ab();h.Le=!1;a.Xa.Ca();a.ac.Ca();h.navigation.Bh()&&h.navigation.Bh().Ca()}};h.navigation.It=function(a){h.navigation.Uk?h.navigation.Uk("log",a):console.log(a)};h.navigation.od=function(a){h.navigation.Uk?h.navigation.Uk("warn",a):console.warn(a)};
h.navigation.PL=function(a){h.navigation.Uk?h.navigation.Uk("error",a):console.error(a)};h.navigation.wz=function(a){a=h.qb.ob.SG(a);return(a=h.qb.ob.JE(a))?h.navigation.Wh(a):!1};h.navigation.Wh=function(a){var c=h.Ab().options.readOnly,d=!1;h.Le?c?-1<h.navigation.wC.indexOf(a)&&(d=h.navigation.yy(a)):d=h.navigation.yy(a):a.name===h.navigation.bb.zr&&(h.navigation.Ns(),d=!0);return d};
h.navigation.yy=function(a){var c=h.Ab();if(a.name===h.navigation.bb.zr)return h.navigation.nE(),!0;if(a.name===h.navigation.bb.tw)return c.ra?h.navigation.Sx():h.navigation.Rx(),!0;if(h.navigation.Ui===h.navigation.Pl){c=c.Xa.Sb;var d=!1;c&&c.Mb()===h.F.types.te&&(d=c.qa.Wh(a));d||(d=h.navigation.BH(a));return d}return h.navigation.Ui===h.navigation.pw?h.navigation.IE(a):h.navigation.Ui===h.navigation.xr?h.navigation.lH(a):!1};
h.navigation.BH=function(a){var c=h.Ab();switch(a.name){case h.navigation.bb.ye:return c.Xa.Wf(),!0;case h.navigation.bb.Bo:return c.Xa.jn(),!0;case h.navigation.bb.we:return c.Xa.next(),!0;case h.navigation.bb.po:return c.Xa.Mm(),!0;case h.navigation.bb.Qq:return h.navigation.fz(),!0;case h.navigation.bb.Wq:return h.navigation.gF(),!0;case h.navigation.bb.Fv:return h.navigation.pE(),!0;default:return!1}};
h.navigation.IE=function(a){switch(a.name){case h.navigation.bb.ye:return h.navigation.Bh().Wf(),!0;case h.navigation.bb.Bo:return h.navigation.Sx(),!0;case h.navigation.bb.we:return h.navigation.Bh().next(),!0;case h.navigation.bb.Wq:return h.navigation.DF(),!0;case h.navigation.bb.Mq:return h.navigation.jp(),!0;default:return!1}};
h.navigation.lH=function(a){if(a.name===h.navigation.bb.Mq)return h.navigation.jp(),!0;var c=h.Ab().ra.Wh(a);return c||a.name!==h.navigation.bb.po?c:(h.navigation.Rx(),!0)};h.navigation.gF=function(){var a=h.Ab().Xa.Sb,c=a.Mb();c==h.F.types.te?a.qa.qf():a.Om||c==h.F.types.Li?h.navigation.Nt():c==h.F.types.Wd?h.navigation.od("Cannot mark a block."):c==h.F.types.zf&&h.navigation.od("Cannot mark a stack.")};h.navigation.wq=new h.uf(h.navigation.bb.ye);h.navigation.gv=new h.uf(h.navigation.bb.Bo);
h.navigation.vq=new h.uf(h.navigation.bb.we);h.navigation.fv=new h.uf(h.navigation.bb.po);h.navigation.EA=new h.uf(h.navigation.bb.Qq);h.navigation.FA=new h.uf(h.navigation.bb.Wq);h.navigation.DA=new h.uf(h.navigation.bb.Fv);h.navigation.GA=new h.uf(h.navigation.bb.tw);h.navigation.uq=new h.uf(h.navigation.bb.Mq);h.navigation.hv=new h.uf(h.navigation.bb.zr);h.navigation.wC=[h.navigation.wq,h.navigation.gv,h.navigation.fv,h.navigation.vq,h.navigation.hv];h.Xd=function(a,c){this.rA=c||"";this.Pz=Object.create(null);if(a)for(a=a.split(","),c=0;c<a.length;c++)this.Pz[a[c]]=!0;this.reset()};h.Xd.Jq="DEVELOPER_VARIABLE";h.Xd.prototype.reset=function(){this.Jf=Object.create(null);this.qx=Object.create(null);this.Sa=null};
function Q(a,c){var d=h.j.Cd;if(c==h.O.sb){var e=a;d.Sa?e=(e=d.Sa.hf(e))?e.name:null:(console.log("Deprecated call to Blockly.Names.prototype.getName without defining a variable map. To fix, add the folowing code in your generator's init() function:\nBlockly.YourGeneratorName.variableDB_.setVariableMap(workspace.getVariableMap());"),e=null);e&&(a=e)}e=a.toLowerCase()+"_"+c;var f=c==h.O.sb||c==h.Xd.Jq?d.rA:"";if(e in d.Jf)return f+d.Jf[e];a=Fc(d,a,c);d.Jf[e]=a.substr(f.length);return a}
function Fc(a,c,d){c?(c=encodeURI(c.replace(/ /g,"_")).replace(/[^\w]/g,"_"),-1!="0123456789".indexOf(c[0])&&(c="my_"+c)):c=h.h.UNNAMED_KEY||"unnamed";for(var e="";a.qx[c+e]||c+e in a.Pz;)e=e?e+1:2;c+=e;a.qx[c]=!0;return(d==h.O.sb||d==h.Xd.Jq?a.rA:"")+c}h.Xd.Ee=function(a,c){return a.toLowerCase()==c.toLowerCase()};h.Ga={};h.Ga.sb=h.ew;h.Ga.nD=function(a){a=K(a,!1);for(var c=[],d=[],e=0;e<a.length;e++)if(a[e].Dh){var f=a[e].Dh();f&&(f[2]?c.push(f):d.push(f))}d.sort(h.Ga.Lz);c.sort(h.Ga.Lz);return[d,c]};h.Ga.Lz=function(a,c){return a[0].toLowerCase().localeCompare(c[0].toLowerCase())};h.Ga.EE=function(a,c){if(c.$b)return a;for(a=a||h.h.UNNAMED_KEY||"unnamed";!h.Ga.GF(a,c.v,c);){var d=a.match(/^(.*?)(\d+)$/);a=d?d[1]+(parseInt(d[2],10)+1):a+"2"}return a};h.Ga.GF=function(a,c,d){return!h.Ga.IF(a,c,d)};
h.Ga.IF=function(a,c,d){c=K(c,!1);for(var e=0;e<c.length;e++)if(c[e]!=d&&c[e].Dh){var f=c[e].Dh();if(h.Xd.Ee(f[0],a))return!0}return!1};h.Ga.Yp=function(a){a=a.trim();var c=h.Ga.EE(a,this.B),d=this.getValue();if(d!=a&&d!=c){a=K(this.B.v,!1);for(var e=0;e<a.length;e++)a[e].rn&&a[e].rn(d,c)}return c};
h.Ga.aj=function(a){function c(g,k){for(var l=0;l<g.length;l++){var m=g[l][0],n=g[l][1],t=h.g.xml.createElement("block");t.setAttribute("type",k);t.setAttribute("gap",16);var u=h.g.xml.createElement("mutation");u.setAttribute("name",m);t.appendChild(u);for(m=0;m<n.length;m++){var w=h.g.xml.createElement("arg");w.setAttribute("name",n[m]);u.appendChild(w)}d.push(t)}}var d=[];if(h.J.procedures_defnoreturn){var e=h.g.xml.createElement("block");e.setAttribute("type","procedures_defnoreturn");e.setAttribute("gap",
16);var f=h.g.xml.createElement("field");f.setAttribute("name","NAME");f.appendChild(h.g.xml.createTextNode(h.h.PROCEDURES_DEFNORETURN_PROCEDURE));e.appendChild(f);d.push(e)}h.J.procedures_defreturn&&(e=h.g.xml.createElement("block"),e.setAttribute("type","procedures_defreturn"),e.setAttribute("gap",16),f=h.g.xml.createElement("field"),f.setAttribute("name","NAME"),f.appendChild(h.g.xml.createTextNode(h.h.PROCEDURES_DEFRETURN_PROCEDURE)),e.appendChild(f),d.push(e));h.J.procedures_ifreturn&&(e=h.g.xml.createElement("block"),
e.setAttribute("type","procedures_ifreturn"),e.setAttribute("gap",16),d.push(e));d.length&&d[d.length-1].setAttribute("gap",24);a=h.Ga.nD(a);c(a[0],"procedures_callnoreturn");c(a[1],"procedures_callreturn");return d};h.Ga.OE=function(a,c){var d=[];c=K(c,!1);for(var e=0;e<c.length;e++)if(c[e].ee){var f=c[e].ee();f&&h.Xd.Ee(f,a)&&d.push(c[e])}return d};
h.Ga.gn=function(a){var c=h.i.Dc,d=a.Dh()[0],e=a.eb(!0);a=h.Ga.OE(d,a.v);d=0;for(var f;f=a[d];d++){var g=f.eb();g=g&&h.R.Md(g);f.zb(e);var k=f.eb();k=k&&h.R.Md(k);g!=k&&(h.i.Dc=!1,h.i.Ka(new h.i.hg(f,"mutation",null,g,k)),h.i.Dc=c)}};h.Ga.Fm=function(a,c){c=D(c,!1);for(var d=0;d<c.length;d++)if(c[d].Dh){var e=c[d].Dh();if(e&&h.Xd.Ee(e[0],a))return c[d]}return null};h.Ul=function(a,c,d,e){this.v=a;this.name=c;this.type=d||"";this.Lk=e||h.g.Jg();h.i.Ka(new h.i.ze(this))};h.Ul.prototype.ua=function(){return this.Lk};h.Ul.Zw=function(a,c){a=a.name.toLowerCase();c=c.name.toLowerCase();return a<c?-1:a==c?0:1};h.O={};h.O.sb=h.vw;h.O.Gw=function(a){var c=K(a,!1);a=Object.create(null);for(var d=0;d<c.length;d++){var e=c[d].Mg();if(e)for(var f=0;f<e.length;f++){var g=e[f],k=g.ua();k&&(a[k]=g)}}c=[];for(k in a)c.push(a[k]);return c};h.O.GL=function(){console.warn("Deprecated call to Blockly.Variables.allUsedVariables. Use Blockly.Variables.allUsedVarModels instead.\nIf this is a major issue please file a bug on GitHub.")};h.O.kv={};
h.O.lD=function(a){a=K(a,!1);for(var c=Object.create(null),d=0,e;e=a[d];d++){var f=e.SL;!f&&e.UE&&(f=e.UE,h.O.kv[e.type]||(console.warn("Function getDeveloperVars() deprecated. Use getDeveloperVariables() (block type '"+e.type+"')"),h.O.kv[e.type]=!0));if(f)for(e=f(),f=0;f<e.length;f++)c[e[f]]=!0}return Object.keys(c)};
h.O.aj=function(a){var c=[],d=document.createElement("button");d.setAttribute("text","%{BKY_NEW_VARIABLE}");d.setAttribute("callbackKey","CREATE_VARIABLE");Bc(a,function(e){h.O.lx(e.WL())});c.push(d);a=h.O.HE(a);return c=c.concat(a)};
h.O.HE=function(a){a=a.Im("");var c=[];if(0<a.length){var d=a[a.length-1];if(h.J.variables_set){var e=h.g.xml.createElement("block");e.setAttribute("type","variables_set");e.setAttribute("gap",h.J.math_change?8:24);e.appendChild(h.O.Dm(d));c.push(e)}h.J.math_change&&(e=h.g.xml.createElement("block"),e.setAttribute("type","math_change"),e.setAttribute("gap",h.J.variables_get?20:8),e.appendChild(h.O.Dm(d)),d=h.R.li('<value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value>'),
e.appendChild(d),c.push(e));if(h.J.variables_get){a.sort(h.Ul.Zw);d=0;for(var f;f=a[d];d++)e=h.g.xml.createElement("block"),e.setAttribute("type","variables_get"),e.setAttribute("gap",8),e.appendChild(h.O.Dm(f)),c.push(e)}}return c};
h.O.Wx=function(a){a=a.Kg();var c="";if(a.length)for(var d=1,e=0,f="ijkmnopqrstuvwxyzabcdefgh".charAt(e);!c;){for(var g=!1,k=0;k<a.length;k++)if(a[k].name.toLowerCase()==f){g=!0;break}g?(e++,25==e&&(e=0,d++),f="ijkmnopqrstuvwxyzabcdefgh".charAt(e),1<d&&(f+=d)):c=f}else c="i";return c};
h.O.lx=function(a,c,d){function e(g){h.O.Mz(h.h.NEW_VARIABLE_TITLE,g,function(k){if(k){var l=h.O.bG(k,a);if(l){var m=k.toLowerCase();if(l.type==f)var n=h.h.VARIABLE_ALREADY_EXISTS.replace("%1",m);else n=h.h.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE,n=n.replace("%1",m).replace("%2",l.type);h.alert(n,function(){e(k)})}else a.Ld(k,f),c&&c(k)}else c&&c(null)})}var f=d||"";e("")};h.O.Ld=h.O.lx;
h.O.$p=function(a,c){function d(e){var f=h.h.RENAME_VARIABLE_TITLE.replace("%1",c.name);h.O.Mz(f,e,function(g){if(g){var k=h.O.cG(g,c.type,a);k?(k=h.h.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE.replace("%1",g.toLowerCase()).replace("%2",k.type),h.alert(k,function(){d(g)})):a.ei(c.ua(),g)}})}d("")};h.O.Mz=function(a,c,d){h.prompt(a,c,function(e){e&&(e=e.replace(/[\s\xa0]+/g," ").trim(),e==h.h.RENAME_VARIABLE||e==h.h.NEW_VARIABLE)&&(e=null);d(e)})};
h.O.cG=function(a,c,d){d=d.Sa.Kg();a=a.toLowerCase();for(var e=0,f;f=d[e];e++)if(f.name.toLowerCase()==a&&f.type!=c)return f;return null};h.O.bG=function(a,c){c=c.Sa.Kg();a=a.toLowerCase();for(var d=0,e;e=c[d];d++)if(e.name.toLowerCase()==a)return e;return null};h.O.Dm=function(a){var c=h.g.xml.createElement("field");c.setAttribute("name","VAR");c.setAttribute("id",a.ua());c.setAttribute("variabletype",a.type);a=h.g.xml.createTextNode(a.name);c.appendChild(a);return c};
h.O.op=function(a,c,d,e){var f=h.O.Vc(a,c,d,e);f||(f=h.O.ZD(a,c,d,e));return f};h.O.Vc=function(a,c,d,e){var f=a.bi;if(c){var g=a.hf(c);!g&&f&&(g=f.hf(c));if(g)return g}if(d){if(void 0==e)throw Error("Tried to look up a variable by name without a type");g=a.Vc(d,e);!g&&f&&(g=f.Vc(d,e))}return g};h.O.ZD=function(a,c,d,e){var f=a.bi;d||(d=h.O.Wx(a.ke?a.Jj:a));return f?f.Ld(d,e,c):a.Ld(d,e,c)};
h.O.Xx=function(a,c){a=a.Kg();var d=[];if(c.length!=a.length)for(var e=0;e<a.length;e++){var f=a[e];-1==c.indexOf(f)&&d.push(f)}return d};h.aa={};h.aa.Fa=null;h.aa.ld=null;h.aa.ap=null;h.aa.Oa=function(){h.aa.Fa||(h.aa.Fa=document.createElement("div"),h.aa.Fa.className="blocklyWidgetDiv",document.body.appendChild(h.aa.Fa))};h.aa.show=function(a,c,d){h.aa.Ca();h.aa.ld=a;h.aa.ap=d;h.aa.Fa.style.top=h.g.style.ty().y+"px";h.aa.Fa.style.direction=c?"rtl":"ltr";h.aa.Fa.style.display="block"};
h.aa.Ca=function(){h.aa.ld&&(h.aa.ld=null,h.aa.Fa.style.display="none",h.aa.Fa.style.left="",h.aa.Fa.style.top="",h.aa.ap&&h.aa.ap(),h.aa.ap=null,h.aa.Fa.innerHTML="")};h.aa.isVisible=function(){return!!h.aa.ld};h.aa.Hk=function(a){h.aa.ld==a&&h.aa.Ca()};h.aa.ln=function(a,c,d){h.aa.Fa.style.left=a+"px";h.aa.Fa.style.top=c+"px";h.aa.Fa.style.height=d+"px"};h.aa.FG=function(a,c,d,e){var f=h.aa.AD(a,c,d);a=h.aa.zD(a,c,d,e);0>f?h.aa.ln(a,0,d.height+f):h.aa.ln(a,f,d.height)};
h.aa.zD=function(a,c,d,e){if(e)return c=Math.max(c.right-d.width,a.left),Math.min(c,a.right-d.width);c=Math.min(c.left,a.right-d.width);return Math.max(c,a.left)};h.aa.AD=function(a,c,d){return c.bottom+d.height>=a.bottom?c.top-d.height:c.bottom};h.VERSION="uncompiled";h.Xm=null;h.selected=null;h.cursor=null;h.Le=!1;h.wm=[];h.fm=null;h.Qo=null;h.ds=null;h.JL=null;h.iA=function(a){return{width:a.Lw,height:a.Jw}};h.lM=function(a){na(a)};h.il=function(a){for(;a.options.Nb;)a=a.options.Nb;var c=x(a),d=c.parentNode;if(d){var e=d.offsetWidth;d=d.offsetHeight;c.Lw!=e&&(c.setAttribute("width",e+"px"),c.Lw=e);c.Jw!=d&&(c.setAttribute("height",d+"px"),c.Jw=d);a.resize()}};
h.pG=function(a){var c=h.Xm;if(!(h.g.Hp(a)||c.ba&&!c.isVisible()))if(c.options.readOnly)h.navigation.wz(a);else{var d=!1;if(a.keyCode==h.g.Ba.Lq)h.oc(),h.navigation.Wh(h.navigation.uq);else{if(h.navigation.wz(a))return;if(a.keyCode==h.g.Ba.NA||a.keyCode==h.g.Ba.yl){a.preventDefault();if(h.Zj.rt())return;h.selected&&h.selected.je()&&(d=!0)}else if(a.altKey||a.ctrlKey||a.metaKey){if(h.Zj.rt())return;h.selected&&h.selected.je()&&h.selected.kd()&&(a.keyCode==h.g.Ba.TA?(h.oc(),h.js(h.selected)):a.keyCode!=
h.g.Ba.Cw||h.selected.v.ke||(h.js(h.selected),d=!0));a.keyCode==h.g.Ba.TC?h.fm&&(a=h.Qo,a.ke&&(a=a.Jj),h.ds&&ab(a,h.ds)&&(h.i.$(!0),yc(a),h.i.$(!1))):a.keyCode==h.g.Ba.dD&&(h.oc(),c.$u(a.shiftKey))}}d&&!h.selected.v.ke&&(h.i.$(!0),h.oc(),h.selected.I(!0,!0),h.i.$(!1))}};h.js=function(a){if(a.Qy)var c=a.Vu();else{c=h.R.qh(a,!0);h.R.kE(c);var d=a.Qa();c.setAttribute("x",a.G?-d.x:d.x);c.setAttribute("y",d.y)}h.fm=c;h.Qo=a.v;h.ds=a.Qy?null:h.g.Us(a,!0)};
h.Gx=function(a){var c=h.fm,d=h.Qo;h.js(a);yc(a.v);h.fm=c;h.Qo=d};h.jM=function(a){h.g.Hp(a)||a.preventDefault()};h.oc=function(a){h.H.Ca();h.aa.Ca();h.D.Ik();a||(a=h.Ab(),a.ad&&a.ad.P&&a.ad.P.Ca(),a.ra&&a.ra.P&&a.ra.P.pk&&Ec(a.ra.Bd,null))};h.Ab=function(){return h.Xm};h.alert=function(a,c){alert(a);c&&c()};h.confirm=function(a,c){c(confirm(a))};h.prompt=function(a,c,d){d(prompt(a,c))};h.KF=function(a){return function(){P(this,a)}};
h.zk=function(a){for(var c=0;c<a.length;c++){var d=a[c];if(d){var e=d.type;null==e||""===e?console.warn("Block definition #"+c+" in JSON array is missing a type attribute. Skipping."):(h.J[e]&&console.warn("Block definition #"+c+' in JSON array overwrites prior definition of "'+e+'".'),h.J[e]={S:h.KF(d)})}else console.warn("Block definition #"+c+" in JSON array is "+d+". Skipping.")}};
h.ma=function(a,c,d,e,f,g){function k(w){var F=!f;w=h.Touch.$G(w);for(var U=0,aa;aa=w[U];U++)if(!F||h.Touch.Nu(aa))h.Touch.TG(aa),d?e.call(d,aa):e(aa),l=!0}var l=!1,m=[];if(h.g.global.PointerEvent&&c in h.Touch.Af)for(var n=0,t;t=h.Touch.Af[c][n];n++)a.addEventListener(t,k,!1),m.push([a,t,k]);else if(a.addEventListener(c,k,!1),m.push([a,c,k]),c in h.Touch.Af){var u=function(w){k(w);var F=!g;l&&F&&w.preventDefault()};for(n=0;t=h.Touch.Af[c][n];n++)a.addEventListener(t,u,!1),m.push([a,t,u])}return m};
h.gd=function(a,c,d,e){function f(n){d?e.call(d,n):e(n)}var g=[];if(h.g.global.PointerEvent&&c in h.Touch.Af)for(var k=0,l;l=h.Touch.Af[c][k];k++)a.addEventListener(l,f,!1),g.push([a,l,f]);else if(a.addEventListener(c,f,!1),g.push([a,c,f]),c in h.Touch.Af){var m=function(n){if(n.changedTouches&&1==n.changedTouches.length){var t=n.changedTouches[0];n.clientX=t.clientX;n.clientY=t.clientY}f(n);n.preventDefault()};for(k=0;l=h.Touch.Af[c][k];k++)a.addEventListener(l,m,!1),g.push([a,l,m])}return g};
h.$a=function(a){for(;a.length;){var c=a.pop();c[0].removeEventListener(c[1],c[2],!1)}};h.Ph=function(a){return/^\s*-?\d+(\.\d+)?\s*$/.test(a)};h.Ky=function(a){return h.g.Lb.vF(a)};
h.ED=function(){h.hd("LOGIC_HUE",["Blocks","logic","HUE"],void 0);h.hd("LOGIC_HUE",["Constants","Logic","HUE"],210);h.hd("LOOPS_HUE",["Blocks","loops","HUE"],void 0);h.hd("LOOPS_HUE",["Constants","Loops","HUE"],120);h.hd("MATH_HUE",["Blocks","math","HUE"],void 0);h.hd("MATH_HUE",["Constants","Math","HUE"],230);h.hd("TEXTS_HUE",["Blocks","texts","HUE"],void 0);h.hd("TEXTS_HUE",["Constants","Text","HUE"],160);h.hd("LISTS_HUE",["Blocks","lists","HUE"],void 0);h.hd("LISTS_HUE",["Constants","Lists","HUE"],
260);h.hd("COLOUR_HUE",["Blocks","colour","HUE"],void 0);h.hd("COLOUR_HUE",["Constants","Colour","HUE"],20);h.hd("VARIABLES_HUE",["Blocks","variables","HUE"],void 0);h.hd("VARIABLES_HUE",["Constants","Variables","HUE"],330);h.hd("VARIABLES_DYNAMIC_HUE",["Constants","VariablesDynamic","HUE"],310);h.hd("PROCEDURES_HUE",["Blocks","procedures","HUE"],void 0)};
h.hd=function(a,c,d){for(var e="Blockly",f=h,g=0;g<c.length;++g)e+="."+c[g],f&&(f=f[c[g]]);f&&f!==d&&(a=(void 0===d?'%1 has been removed. Use Blockly.Msg["%2"].':'%1 is deprecated and unused. Override Blockly.Msg["%2"].').replace("%1",e).replace("%2",a),console.warn(a))};var Gc={ar:"\u0627\u0644\u0639\u0631\u0628\u064a\u0629",be:"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0456","be-tarask":"Tara\u0161kievica",bg:"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a",bn:"\u09ac\u09be\u0982\u09b2\u09be",br:"Brezhoneg",cs:"\u010cesky",da:"Dansk",de:"Deutsch",el:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac",en:"English",es:"Espa\u00f1ol",eu:"Euskara",fa:"\u0641\u0627\u0631\u0633\u06cc",fi:"Suomi",fr:"Fran\u00e7ais",gl:"Galego",ha:"Hausa",
he:"\u05e2\u05d1\u05e8\u05d9\u05ea",hi:"\u0939\u093f\u0928\u094d\u0926\u0940",hu:"Magyar",hy:"\u0570\u0561\u0575\u0565\u0580\u0567\u0576",ia:"Interlingua",id:"Bahasa Indonesia",ig:"As\u1ee5s\u1ee5 Igbo",is:"\u00cdslenska",it:"Italiano",ja:"\u65e5\u672c\u8a9e",kab:"Taqbaylit",ko:"\ud55c\uad6d\uc5b4",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",ms:"Bahasa Melayu",my:"\u1019\u103c\u1014\u103a\u1019\u102c\u1005\u102c",nb:"Norsk Bokm\u00e5l",nl:"Nederlands, Vlaams",pl:"Polski",pms:"Piemont\u00e8is",pt:"Portugu\u00eas",
"pt-br":"Portugu\u00eas Brasileiro",ro:"Rom\u00e2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439",sc:"Sardu",sk:"Sloven\u010dina",sl:"Sloven\u0161\u010dina",sq:"Shqip",sr:"\u0421\u0440\u043f\u0441\u043a\u0438",sv:"Svenska",th:"\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22",tr:"T\u00fcrk\u00e7e",uk:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",ur:"\u0627\u064f\u0631\u062f\u064f\u0648\u202c",vi:"Ti\u1ebfng Vi\u1ec7t",yo:"\u00c8d\u00e8 Yor\u00f9b\u00e1","zh-hans":"\u7b80\u4f53\u4e2d\u6587",
"zh-hant":"\u6b63\u9ad4\u4e2d\u6587"},Hc="ace ar fa he mzn ps ur".split(" "),Ic=window.BlocklyGamesLang,Jc=window.BlocklyGamesLanguages,Kc=".html"==window.location.pathname.substr(-5),C=null,R,Lc=Number,Mc,Nc=window.location.search.match(/[?&]level=([^&]+)/);Mc=Nc?decodeURIComponent(Nc[1].replace(/\+/g,"%20")):"NaN";var Oc=Lc(Mc);R=isNaN(Oc)?1:h.g.Ha.Ef(1,Oc,10);
function Pc(){document.title=document.getElementById("title").textContent;document.dir=-1!=Hc.indexOf(Ic)?"rtl":"ltr";document.head.parentElement.setAttribute("lang",Ic);var a=document.getElementById("languageMenu");if(a){for(var c=[],d=0;d<Jc.length;d++){var e=Jc[d];c.push([Gc[e],e])}c.sort(function(g,k){return g[0]>k[0]?1:g[0]<k[0]?-1:0});for(d=a.options.length=0;d<c.length;d++){var f=c[d];e=f[1];f=new Option(f[0],e);e==Ic&&(f.selected=!0);a.options.add(f)}1>=a.options.length&&(a.style.display=
"none")}for(d=1;10>=d;d++)a=document.getElementById("level"+d),c=!!Qc(d),a&&c&&(a.className+=" level_done");(d=document.querySelector('meta[name="viewport"]'))&&725>screen.availWidth&&d.setAttribute("content","width=725, initial-scale=.35, user-scalable=no");setTimeout(Rc,1)}function Qc(a){var c=Sc;try{var d=window.localStorage[c+a]}catch(e){}return d}function S(a){var c;(c=document.getElementById(a))?(c=c.textContent,c=c.replace(/\\n/g,"\n")):c=null;return null===c?"[Unknown message: "+a+"]":c}
function Tc(a,c){if(!a)throw TypeError("Element not found: "+a);"string"==typeof a&&(a=document.getElementById(a));a.addEventListener("click",c,!0);a.addEventListener("touchend",c,!0)}function Uc(a){a%=360;0>a&&(a+=360);return a}
function Rc(){if(!Kc){window.GoogleAnalyticsObject="GoogleAnalyticsFunction";var a=function(d){(a.q=a.q||[]).push(arguments)};window.GoogleAnalyticsFunction=a;a.l=1*new Date;var c=document.createElement("script");c.async=1;c.src="//www.google-analytics.com/analytics.js";document.head.appendChild(c);a("create","UA-50448074-1","auto");a("send","pageview")}};h.g.A={};h.g.A.Va=function(a,c){return" "+a+","+c+" "};h.g.A.curve=function(a,c){return" "+a+c.join("")};h.g.A.moveTo=function(a,c){return" M "+a+","+c+" "};h.g.A.moveBy=function(a,c){return" m "+a+","+c+" "};h.g.A.lineTo=function(a,c){return" l "+a+","+c+" "};h.g.A.line=function(a){return" l"+a.join("")};h.g.A.ea=function(a,c){return" "+a+" "+c+" "};h.g.A.arc=function(a,c,d,e){return a+" "+d+" "+d+" "+c+e};h.m.ui=function(){this.yf=0;this.EC=3;this.xf=5;this.Vv=8;this.sd=10;this.rw=this.xf;this.yr=15;this.Rl=5;this.mh=8;this.nC=15;this.mC=4;this.kC=12;this.pB=16;this.wb=8;this.xo=15;this.LC=0;this.MC=20;this.OA=4;this.HC=15;this.IC=100;this.GC=15;this.Xq=24;this.rB=14.5;this.qB=this.yr+11;this.tB=2;this.sB=this.Xq;this.nw=h.g.A.moveBy(0,0);this.PB=12;this.QB=6};b=h.m.ui.prototype;
b.S=function(){this.bk=this.Jt();this.ek=this.Kt();this.ug=this.Mt();this.Di=this.Lt();var a=this.wb,c=h.g.A.arc("a","0 0,0",a,h.g.A.Va(-a,a)),d=h.g.A.arc("a","0 0,0",a,h.g.A.Va(a,a));this.Fl={width:a,height:a,nu:c,Sp:d};c=this.wb;a=h.g.A.moveBy(0,c)+h.g.A.arc("a","0 0,1",c,h.g.A.Va(c,-c));c=h.g.A.arc("a","0 0,1",c,h.g.A.Va(-c,-c));this.bw={Yu:a,Tr:c}};b.Jt=function(){var a=this.PB,c=this.QB,d=h.g.A.line([h.g.A.Va(6,3),h.g.A.Va(-12,6),h.g.A.Va(6,3)]);return{height:a,width:c,path:d}};
b.Mt=function(){var a=this.HC,c=this.IC,d=h.g.A.curve("c",[h.g.A.Va(30,-a),h.g.A.Va(70,-a),h.g.A.Va(c,0)]);return{height:a,width:c,path:d}};b.Lt=function(){function a(g){g=g?-1:1;var k=-g,l=d/2,m=h.g.A.Va(c,g*l);return h.g.A.curve("c",[h.g.A.Va(0,g*(l+2.5)),h.g.A.Va(-c,k*(l+.5)),h.g.A.Va(-c,g*l)])+h.g.A.curve("s",[h.g.A.Va(c,2.5*k),m])}var c=this.mh,d=this.yr,e=a(!0),f=a(!1);return{width:c,height:d,Oe:f,kn:e}};
b.Kt=function(){function a(k){return h.g.A.line([h.g.A.Va(k*e,d),h.g.A.Va(3*k,0),h.g.A.Va(k*e,-d)])}var c=this.nC,d=this.mC,e=(c-3)/2,f=a(1),g=a(-1);return{width:c,height:d,$h:f,Dz:g}};h.m.u={NONE:0,te:1,Hv:2,Jv:4,rr:8,pv:16,Nv:32,Gv:64,pg:128,Lv:256,ow:512,cB:1024,ir:2048,Zq:4096,rC:8192,Gq:16384,Uq:32768,Tq:65536,mr:131072,lr:262144,Qv:524288,pr:1048576,Br:2097152,Aq:4194304,Mv:8388608};h.m.u.mJ=h.m.u.Uq|h.m.u.Tq;h.m.u.RK=h.m.u.mr|h.m.u.lr;h.m.u.Yt=16777216;h.m.u.Mb=function(){h.m.u.hasOwnProperty(void 0)||(h.m.u[void 0]=h.m.u.Yt,h.m.u.Yt<<=1);return h.m.u[void 0]};h.m.u.Sm=function(a){return a.type&h.m.u.te};h.m.u.kj=function(a){return a.type&h.m.u.Hv};
h.m.u.Ok=function(a){return a.type&h.m.u.Jv};h.m.u.mf=function(a){return a.type&h.m.u.rr};h.m.u.$L=function(a){return a.type&h.m.u.Nv};h.m.u.lf=function(a){return a.type&h.m.u.pg};h.m.u.Rm=function(a){return a.type&h.m.u.Gv};h.m.u.Lh=function(a){return a.type&h.m.u.Lv};h.m.u.Vm=function(a){return a.type&h.m.u.ow};h.m.u.Qk=function(a){return a.type&h.m.u.ir};h.m.u.Oh=function(a){return a.type&h.m.u.Zq};h.m.u.JF=function(a){return a.type&(h.m.u.ir|h.m.u.Zq)};h.m.u.Nh=function(a){return a.type&h.m.u.Tq};
h.m.u.bM=function(a){return a.type&h.m.u.lr};h.m.u.Um=function(a){return a.type&h.m.u.Uq};h.m.u.cM=function(a){return a.type&h.m.u.mr};h.m.u.ZL=function(a){return a.type&h.m.u.Gq};h.m.u.Ry=function(a){return a.type&h.m.u.Qv};h.m.u.dM=function(a){return a.type&h.m.u.pr};h.m.u.YL=function(a){return a.type&h.m.u.pv};h.m.u.Ip=function(a){return a.type&h.m.u.Br};h.m.u.Bp=function(a){return a.type&h.m.u.Aq};h.m.u.eM=function(a){return a.type&(h.m.u.Br|h.m.u.Aq)};h.m.u.aM=function(a){return a.type&h.m.u.Mv};h.m.gh=function(a){this.height=this.width=0;this.type=h.m.u.NONE;this.rh=this.Ta=0;this.C=a;this.Me=this.C.xo};h.m.sa=function(a,c){h.m.sa.w.constructor.call(this,a);this.hs=c;a:switch(a=this.C,c.type){case h.Wa:case h.Te:c=a.Di;break a;case h.Ue:case h.jb:c=a.ek;break a;default:throw Error("Unknown connection type");}this.shape=c;this.type|=h.m.u.cB};h.g.object.W(h.m.sa,h.m.gh);h.m.gr=function(a,c){h.m.gr.w.constructor.call(this,a,c);this.type|=h.m.u.rC;this.height=this.shape.height;this.width=this.shape.width;this.Ce=this.C.Rl;this.pe=this.width};h.g.object.W(h.m.gr,h.m.sa);
h.m.jr=function(a,c){h.m.jr.w.constructor.call(this,a,c);this.type|=h.m.u.ir;this.height=this.shape.height;this.width=this.shape.width};h.g.object.W(h.m.jr,h.m.sa);h.m.$q=function(a,c){h.m.$q.w.constructor.call(this,a,c);this.type|=h.m.u.Zq;this.height=this.shape.height;this.width=this.shape.width};h.g.object.W(h.m.$q,h.m.sa);h.m.Gl=function(a,c){h.m.Gl.w.constructor.call(this,a,c.connection);this.type|=h.m.u.pg;this.input=c;this.align=c.align;(this.Qi=c.connection&&z(c.connection)?z(c.connection):null)?(a=H(this.Qi),this.im=a.width,this.To=a.height):this.To=this.im=0;this.connection=c.connection;this.Ce=0};h.g.object.W(h.m.Gl,h.m.sa);
h.m.dh=function(a,c){h.m.dh.w.constructor.call(this,a,c);this.type|=h.m.u.Lv;this.Qi?(this.width=this.im,this.height=this.To):(this.height=this.C.qB,this.width=this.shape.width+this.C.rB);this.Ce=this.C.Rl;this.jm=this.shape.height;this.vh=this.shape.width};h.g.object.W(h.m.dh,h.m.Gl);h.m.lh=function(a,c){h.m.lh.w.constructor.call(this,a,c);this.type|=h.m.u.ow;this.height=this.Qi?this.To+this.C.LC:this.C.sB;this.width=this.C.xo+this.shape.width};h.g.object.W(h.m.lh,h.m.Gl);
h.m.mo=function(a,c){h.m.mo.w.constructor.call(this,a,c);this.type|=h.m.u.Gv;this.height=this.Qi?this.To-2*this.C.Rl:this.shape.height;this.width=this.shape.width+this.C.tB;this.Ce=this.C.Rl;this.jm=this.shape.height;this.vh=this.shape.width};h.g.object.W(h.m.mo,h.m.Gl);h.m.Id=function(a,c){h.m.Id.w.constructor.call(this,a);this.icon=c;this.isVisible=c.isVisible();this.type|=h.m.u.Jv;a=new h.g.Ve(h.Id.prototype.Eo,h.Id.prototype.Eo-2);this.height=a.height;this.width=a.width};h.g.object.W(h.m.Id,h.m.gh);h.m.Sq=function(a){h.m.Sq.w.constructor.call(this,a);this.type|=h.m.u.Qv;this.height=this.C.bk.height;this.width=this.C.bk.width};h.g.object.W(h.m.Sq,h.m.gh);
h.m.Na=function(a,c){h.m.Na.w.constructor.call(this,a);this.Lx=c;this.jd=c.ng&&!!c.B&&c.B.jd();this.GE=!1;this.type|=h.m.u.te;a=this.Lx.Lg();this.height=a.height;this.width=a.width};h.g.object.W(h.m.Na,h.m.gh);h.m.Pq=function(a){h.m.Pq.w.constructor.call(this,a);this.type|=h.m.u.Hv;this.height=this.C.ug.height;this.width=this.C.ug.width;this.nk=this.height};h.g.object.W(h.m.Pq,h.m.gh);
h.m.Ho=function(a,c){h.m.Ho.w.constructor.call(this,a);this.type=(c&&"left"!=c?h.m.u.mr:h.m.u.Uq)|h.m.u.Gq;this.width=this.height=this.C.yf};h.g.object.W(h.m.Ho,h.m.gh);h.m.Do=function(a,c){h.m.Do.w.constructor.call(this,a);this.type=(c&&"left"!=c?h.m.u.lr:h.m.u.Tq)|h.m.u.Gq;this.width=this.C.wb;this.height=this.C.wb/2};h.g.object.W(h.m.Do,h.m.gh);h.m.$j=function(a,c){h.m.$j.w.constructor.call(this,a);this.type=this.type|h.m.u.rr|h.m.u.Nv;this.width=c;this.height=this.C.GC};h.g.object.W(h.m.$j,h.m.gh);h.m.Gi=function(a){this.type=h.m.u.pr;this.elements=[];this.Ta=this.Jc=this.fg=this.minWidth=this.minHeight=this.width=this.height=0;this.By=this.up=this.mt=this.wd=this.cj=!1;this.C=a;this.Me=this.C.xo};h.m.Gi.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.");};function Vc(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(h.m.u.lf(d))return d;return null}h.m.Gi.prototype.Ru=function(){return!0};h.m.Gi.prototype.Jx=function(){return!0};
function Wc(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(h.m.u.mf(d))return d;return null}h.m.lk=function(a){h.m.lk.w.constructor.call(this,a);this.type|=h.m.u.Br;this.nk=this.Ag=0;this.rF=!1;this.connection=null};h.g.object.W(h.m.lk,h.m.Gi);h.m.lk.prototype.nt=function(a){var c=a.Ng?"cap"===a.Ng:h.wa.ug,d=a.Z&&z(a.Z);return!!a.M||c||(d?q(d)==a:!1)};
h.m.lk.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.m.u.mf(f)||(h.m.u.kj(f)?d=Math.max(d,f.nk):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.Ag=this.nk=d;this.fg=this.width};h.m.lk.prototype.Ru=function(){return!1};h.m.Uj=function(a){h.m.Uj.w.constructor.call(this,a);this.type|=h.m.u.Aq;this.Cy=!1;this.connection=null;this.Ni=this.tm=0};h.g.object.W(h.m.Uj,h.m.Gi);
h.m.Uj.prototype.nt=function(a){return!!a.M||!!q(a)};h.m.Uj.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.m.u.mf(f)||(h.m.u.Oh(f)?d=Math.max(d,f.height):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.tm=d;this.fg=this.width};h.m.Uj.prototype.Ru=function(){return!1};
h.m.Go=function(a,c,d){h.m.Go.w.constructor.call(this,a);this.type=this.type|h.m.u.rr|h.m.u.pv;this.width=d;this.height=c;this.Ux=!1;this.fg=0;this.elements=[new h.m.$j(this.C,d)]};h.g.object.W(h.m.Go,h.m.Gi);h.m.Go.prototype.measure=function(){};h.m.ak=function(a){h.m.ak.w.constructor.call(this,a);this.type|=h.m.u.Mv;this.bx=0};h.g.object.W(h.m.ak,h.m.Gi);
h.m.ak.prototype.measure=function(){this.width=this.minWidth;this.height=this.minHeight;for(var a=0,c=0,d;d=this.elements[c];c++)this.width+=d.width,h.m.u.lf(d)&&(h.m.u.Vm(d)?a+=d.im:h.m.u.Rm(d)&&0!=d.im&&(a+=d.im-d.vh)),h.m.u.mf(d)||(this.height=Math.max(this.height,d.height));this.bx=a;this.fg=this.width+a};h.m.ak.prototype.Jx=function(){return!this.cj&&!this.wd};h.m.jh=function(a,c){this.U=c;this.Ug=a;this.C=this.Ug.C;this.M=c.M?new h.m.gr(this.C,c.M):null;this.wt=Ha(c)&&!c.isCollapsed();this.isCollapsed=c.isCollapsed();this.Mh=c.Mh();this.G=c.G;this.Gj=this.width=this.ql=this.height=0;this.rows=[];this.Gy=[];this.kc=new h.m.lk(this.C);this.Jb=new h.m.Uj(this.C);this.iq=this.pe=0};b=h.m.jh.prototype;
b.measure=function(){var a=this.U.Ng?"cap"===this.U.Ng:h.wa.ug,c=!!this.U.Z;this.kc.nt(this.U)?this.kc.elements.push(new h.m.Ho(this.C)):this.kc.elements.push(new h.m.Do(this.C));a?(a=new h.m.Pq(this.C),this.kc.elements.push(a),this.kc.Ag=a.nk):c&&(this.kc.rF=!0,this.kc.connection=new h.m.jr(this.C,this.U.Z),this.kc.elements.push(this.kc.connection));this.U.T.length&&this.U.T[0].type==h.jb&&!this.U.isCollapsed()?this.kc.minHeight=this.C.sd:this.kc.minHeight=this.C.xf;this.rows.push(this.kc);a=new h.m.ak(this.C);
var d=Na(this.U);if(d.length){c=0;for(var e;e=d[c];c++){var f=new h.m.Id(this.C,e);this.isCollapsed&&e.Vw?this.Gy.push(f):a.elements.push(f)}}e=null;for(c=0;d=this.U.T[c];c++)if(d.isVisible()){!e||d.type!=h.jb&&e.type!=h.jb&&(d.type!=h.Wa&&d.type!=h.mg||this.wt)||(this.rows.push(a),a=new h.m.ak(this.C));for(e=0;f=d.Pa[e];e++)a.elements.push(new h.m.Na(this.C,f,d));this.Fw(d,a);e=d}this.isCollapsed&&(a.By=!0,a.elements.push(new h.m.Sq(this.C)));(a.elements.length||a.up)&&this.rows.push(a);this.Jb.Cy=
!!this.U.X;this.Jb.minHeight=this.U.T.length&&this.U.T[this.U.T.length-1].type==h.jb?this.C.sd:this.C.xf-1;this.Jb.nt(this.U)?this.Jb.elements.push(new h.m.Ho(this.C)):this.Jb.elements.push(new h.m.Do(this.C));this.Jb.Cy&&(this.Jb.connection=new h.m.$q(this.C,this.U.X),this.Jb.elements.push(this.Jb.connection));this.rows.push(this.Jb);for(a=0;c=this.rows[a];a++){d=c.elements;c.elements=[];c.Ru()&&c.elements.push(new h.m.$j(this.C,this.mp(null,d[0])));for(e=0;e<d.length-1;e++)c.elements.push(d[e]),
c.elements.push(new h.m.$j(this.C,this.mp(d[e],d[e+1])));c.elements.push(d[d.length-1]);c.Jx()&&c.elements.push(new h.m.$j(this.C,this.mp(d[d.length-1],null)))}for(e=d=c=a=0;f=this.rows[e];e++)f.measure(),c=Math.max(c,f.width),f.wd&&(a=Math.max(a,f.width-Vc(f).width)),d=Math.max(d,f.fg);this.Gj=a;this.width=c;for(e=0;f=this.rows[e];e++)f.wd&&(f.Gj=this.Gj);this.ql=Math.max(c,d);this.M&&(this.pe=this.M.width,this.width+=this.M.width,this.ql+=this.M.width);for(a=0;c=this.rows[a];a++)c.wd?(d=Vc(c),e=
c.width-d.width,f=this.Gj-this.pe,(e=f-e)&&this.Hr(c,e),e=c.width,f=this.width-this.pe-(this.C.Fl.mM||0),d.width+=f-e,c.width+=f-e,c.fg=Math.max(c.width,this.Gj+c.bx)):(d=this.width-this.pe-c.width)&&this.Hr(c,d);a=this.rows;this.rows=[];for(c=0;c<a.length;c++)this.rows.push(a[c]),c!=a.length-1&&this.rows.push(Xc(this,a[c],a[c+1]));this.Mx()};
b.Fw=function(a,c){this.wt&&a.type==h.Wa?(c.elements.push(new h.m.dh(this.C,a)),c.mt=!0):a.type==h.jb?(c.elements.push(new h.m.lh(this.C,a)),c.wd=!0):a.type==h.Wa?(c.elements.push(new h.m.mo(this.C,a)),c.cj=!0):a.type==h.mg&&(c.up=!0)};b.mp=function(a,c){if(a&&h.m.u.lf(a)&&!c){if(h.m.u.Rm(a))return this.C.yf;if(h.m.u.Lh(a))return this.C.sd;if(h.m.u.Vm(a))return this.C.yf}return a&&h.m.u.Um(a)&&c&&(h.m.u.Qk(c)||h.m.u.Oh(c))?c.Me:a&&h.m.u.Nh(a)&&c&&(h.m.u.Qk(c)||h.m.u.Oh(c))?c.Me-this.C.wb:this.C.xf};
b.Hr=function(a,c){var d=Wc(a);d&&(d.width+=c,a.width+=c)};function Xc(a,c,d){a=new h.m.Go(a.C,a.ny(c,d),a.width-a.pe);c.wd&&(a.Ux=!0);return a}b.ny=function(){return this.C.xf};b.by=function(a,c){return h.m.u.mf(c)?a.Jc+c.height/2:h.m.u.Bp(a)?(a=a.Jc+a.height-a.tm,h.m.u.Oh(c)?a+c.height/2:a-c.height/2):h.m.u.Ip(a)?h.m.u.kj(c)?a.Ag-c.height/2:a.Ag+c.height/2:a.Jc+a.height/2};
function Yc(a,c){for(var d=c.Ta,e=0,f;f=c.elements[e];e++)h.m.u.mf(f)&&(f.height=c.height),f.Ta=d,f.rh=a.by(c,f),d+=f.width}b.Mx=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++)e.Jc=c,e.Ta=this.pe,c+=e.height,a=Math.max(a,e.fg),Yc(this,e);this.ql=a+this.pe;this.height=c;this.iq=this.kc.Ag;this.Jb.Ni=c-this.Jb.tm};h.m.dd=function(a,c){this.U=a;this.pa=c;a.Qa();this.Ap=this.Ma="";this.C=c.Ug.C};b=h.m.dd.prototype;b.draw=function(){Zc(this);$c(this);ad(this);this.U.zj.Iu(this.Ma+"\n"+this.Ap);this.pa.G&&this.U.zj.Qs();h.m.Sn&&this.U.yu.yE(this.U,this.pa);bd(this)};function bd(a){a.U.height=a.pa.height;a.U.width=a.pa.ql}function Zc(a){for(var c=0,d;d=a.pa.Gy[c];c++)d.icon.Od.setAttribute("display","none")}
function $c(a){a.Js();for(var c=1;c<a.pa.rows.length-1;c++){var d=a.pa.rows[c];d.By?a.xm(d):d.wd?a.Is(d):d.cj?a.Ks(d):a.Hs(d)}a.Ds();a.Gs()}b.Js=function(){var a=this.pa.kc,c=a.elements,d=this.pa.kc;if(d.connection){var e=d.Ta+d.Me;dc(d.connection.hs,this.pa.G?-e:e,0)}this.Ma+=h.g.A.moveBy(a.Ta,this.pa.iq);for(d=0;e=c[d];d++)h.m.u.Nh(e)?this.Ma+=this.C.bw.Yu:h.m.u.Qk(e)?this.Ma+=e.shape.$h:h.m.u.kj(e)?this.Ma+=this.C.ug.path:h.m.u.mf(e)&&(this.Ma+=h.g.A.ea("h",e.width));this.Ma+=h.g.A.ea("v",a.height)};
b.xm=function(a){this.Ma+=this.C.bk.path+h.g.A.ea("v",a.height-this.C.bk.height)};b.Ks=function(a){var c=Vc(a);this.Gz(a);var d="function"==typeof c.shape.Oe?c.shape.Oe(c.height):c.shape.Oe;this.Ma+=h.g.A.ea("H",c.Ta+c.width)+d+h.g.A.ea("v",a.height-c.jm)};b.Is=function(a){var c=Vc(a);this.Ma+=h.g.A.ea("H",c.Ta+c.Me+c.shape.width)+(c.shape.Dz+h.g.A.ea("h",-(c.Me-this.C.Fl.width))+this.C.Fl.nu)+h.g.A.ea("v",a.height-2*this.C.Fl.height)+this.C.Fl.Sp+h.g.A.ea("H",a.Ta+a.width);this.Jz(a)};
b.Hs=function(a){this.Ma+=h.g.A.ea("V",a.Jc+a.height)};b.Ds=function(){var a=this.pa.Jb,c=a.elements;this.Iz();this.Ma+=h.g.A.ea("V",a.Ni);for(var d=c.length-1,e;e=c[d];d--)h.m.u.Oh(e)?this.Ma+=e.shape.Dz:h.m.u.Um(e)?this.Ma+=h.g.A.ea("H",a.Ta):h.m.u.Nh(e)?this.Ma+=this.C.bw.Tr:h.m.u.mf(e)&&(this.Ma+=h.g.A.ea("h",-1*e.width))};
b.Gs=function(){var a=this.pa.M;if(this.pa.M){var c=this.pa.pe;dc(this.U.M,this.pa.G?-c:c,this.pa.M.Ce)}a&&(c=a.Ce+a.height,a="function"==typeof a.shape.kn?a.shape.kn(a.height):a.shape.kn,this.Ma+=h.g.A.ea("V",c)+a);this.Ma+="z"};
function ad(a){for(var c=0,d;d=a.pa.rows[c];c++)for(var e=0,f;f=d.elements[e];e++)if(h.m.u.Lh(f))a.Fs(f);else if(h.m.u.Ok(f)||h.m.u.Sm(f)){var g=a;if(h.m.u.Sm(f))var k=f.Lx.ya();else h.m.u.Ok(f)&&(k=f.icon.Od);var l=f.rh-f.height/2,m=f.Ta,n="";g.pa.G&&(m=-(m+f.width),f.GE&&(m+=f.width,n="scale(-1 1)"));h.m.u.Ok(f)?(k.setAttribute("display","block"),k.setAttribute("transform","translate("+m+","+l+")"),ic(f.icon)):k.setAttribute("transform","translate("+m+","+l+")"+n);g.pa.Mh&&k.setAttribute("display",
"none")}}b.Fs=function(a){var c=a.width,d=a.height,e=a.Ce,f=a.jm+e;this.Ap+=h.g.A.moveTo(a.Ta+a.vh,a.rh-d/2)+h.g.A.ea("v",e)+a.shape.Oe+h.g.A.ea("v",d-f)+h.g.A.ea("h",c-a.vh)+h.g.A.ea("v",-d)+"z";this.Hz(a)};b.Hz=function(a){var c=a.rh-a.height/2;if(a.connection){var d=a.Ta+a.vh;this.pa.G&&(d*=-1);dc(a.connection,d,c+a.Ce)}};b.Jz=function(a){var c=Vc(a);if(c.connection){var d=a.Ta+a.Gj+c.Me;this.pa.G&&(d*=-1);dc(c.connection,d,a.Jc)}};
b.Gz=function(a){var c=Vc(a);if(c.connection){var d=a.Ta+a.width;this.pa.G&&(d*=-1);dc(c.connection,d,a.Jc)}};b.Iz=function(){var a=this.pa.Jb;if(a.connection){a=a.connection;var c=a.Ta;dc(a.hs,this.pa.G?-c:c,a.rh-a.height/2)}};h.Aa=function(a,c){this.s=a;this.Fp=c;this.Qd=null;this.C=a.Ug.C};h.Aa.io=5;h.Aa.Vj=100;h.Aa.JJ=24;h.Aa.xL=5;h.Aa.Fo=10;h.Aa.rv=2;h.Aa.FB=.75;h.Aa.ho="#cc0a0a";h.Aa.fC="#4286f4";h.Aa.fB="blocklyCursor";h.Aa.eC="blocklyMarker";b=h.Aa.prototype;b.rm=null;b.ya=function(){return this.N};
b.Oa=function(){this.N=h.g.o.L("g",{"class":this.Fp?h.Aa.eC:h.Aa.fB},null);var a=this.Fp?h.Aa.fC:h.Aa.ho;this.Sc=h.g.o.L("g",{width:h.Aa.Vj,height:h.Aa.io},this.N);this.xk=h.g.o.L("rect",{x:"0",y:"0",fill:a,width:h.Aa.Vj,height:h.Aa.io,style:"display: none;"},this.Sc);this.yk=h.g.o.L("rect",{"class":"blocklyVerticalCursor",x:"0",y:"0",rx:"10",ry:"10",style:"display: none;",stroke:a},this.Sc);this.sm=h.g.o.L("path",{width:h.Aa.Vj,height:h.Aa.io,transform:"",style:"display: none;",fill:a},this.Sc);
this.Vi=h.g.o.L("path",{width:h.Aa.Vj,height:h.Aa.io,transform:"",style:"display: none;",fill:"none",stroke:a,"stroke-width":"4"},this.Sc);this.Fp||(h.g.o.L("animate",{attributeType:"XML",attributeName:"fill",dur:"1s",values:h.Aa.ho+";transparent;transparent;",repeatCount:"indefinite"},this.xk),h.g.o.L("animate",{attributeType:"XML",attributeName:"fill",dur:"1s",values:h.Aa.ho+";transparent;transparent;",repeatCount:"indefinite"},this.sm),h.g.o.L("animate",{attributeType:"XML",attributeName:"stroke",
dur:"1s",values:h.Aa.ho+";transparent;transparent;",repeatCount:"indefinite"},this.Vi));return this.N};function cd(a,c){a.Fp?(a.Qd&&a.Qd.xn(null),c.xn(a.ya())):(a.Qd&&a.Qd.wn(null),c.wn(a.ya()));a.Qd=c}
function dd(a,c){if(c){var d=c.width,e=c.height,f=e*h.Aa.FB;c.Z?(e=h.Aa.rv,d=h.g.A.moveBy(-1*e,f)+h.g.A.ea("V",-1*e)+h.g.A.ea("H",a.C.xo)+a.C.ek.$h+h.g.A.ea("H",d+2*e)+h.g.A.ea("V",f),a.Vi.setAttribute("d",d)):c.M?(d=h.g.A.moveBy(d,0)+h.g.A.ea("h",-1*(d-a.C.Di.width))+h.g.A.ea("v",a.C.Rl)+a.C.Di.Oe+h.g.A.ea("V",e)+h.g.A.ea("H",d),a.Vi.setAttribute("d",d)):(e=h.Aa.rv,d=h.g.A.moveBy(-1*e,f)+h.g.A.ea("V",-1*e)+h.g.A.ea("H",d+2*e)+h.g.A.ea("V",f),a.Vi.setAttribute("d",d));a.s.G&&a.Vi.setAttribute("transform",
"scale(-1 1)");a.rm=a.Vi;cd(a,c);ed(a)}}function ed(a){a.Ca();a.rm.style.display=""}function fd(a,c,d,e){a.xk.setAttribute("x",c);a.xk.setAttribute("y",d);a.xk.setAttribute("width",e);a.rm=a.xk}function gd(a,c,d,e,f){a.yk.setAttribute("x",c);a.yk.setAttribute("y",d);a.yk.setAttribute("width",e);a.yk.setAttribute("height",f);a.rm=a.yk}b.Ca=function(){this.xk.style.display="none";this.yk.style.display="none";this.sm.style.display="none";this.Vi.style.display="none"};
b.draw=function(a){if(a)if(a.Mb()===h.F.types.Wd)dd(this,a.qa);else if(a.Mb()===h.F.types.hk)dd(this,a.qa.B);else if(a.qa.type===h.Wa){var c=a.qa;a=c.B;var d=c.vj.x;c=c.vj.y;var e=h.g.A.moveTo(0,0)+this.C.Di.Oe;this.sm.setAttribute("d",e);this.sm.setAttribute("transform","translate("+d+","+c+")"+(this.s.G?" scale(-1 1)":""));this.rm=this.sm;cd(this,a);ed(this)}else if(a.qa.type===h.jb)c=a.qa,a=c.B,d=0,c=c.vj.y,e=H(a).width,this.s.G&&(d=-e),fd(this,d,c,e),cd(this,a),ed(this);else if(a.Mb()===h.F.types.ye)dd(this,
a.qa.B);else if(a.Mb()===h.F.types.te)a=a.qa,d=a.Lg().width,c=a.Lg().height,gd(this,0,0,d,c),cd(this,a),ed(this);else if(a.Mb()===h.F.types.Li)d=a.AA,a=d.x,d=d.y,this.s.G&&(a-=h.Aa.Vj),fd(this,a,d,h.Aa.Vj),cd(this,this.s),ed(this);else{if(a.Mb()===h.F.types.zf){a=a.qa;c=H(a);d=c.width+h.Aa.Fo;c=c.height+h.Aa.Fo;var f=e=-1*h.Aa.Fo/2,g=-1*h.Aa.Fo/2;this.s.G&&(f=-(d+e));gd(this,f,g,d,c);cd(this,a);ed(this)}}else this.Ca()};b.I=function(){this.N&&h.g.o.removeNode(this.N)};h.m.kh=function(){this.C=null};b=h.m.kh.prototype;b.S=function(){this.C=this.az();this.C.S()};b.az=function(){return new h.m.ui};b.dz=function(a){return new h.m.jh(this,a)};b.bz=function(a,c){return new h.m.dd(a,c)};b.cz=function(a){return new h.m.Ei(a)};b.za=function(a){if(h.m.Sn&&!a.yu){if(!h.m.oB)throw Error("Missing require for Blockly.blockRendering.Debug");var c=new h.m.oB;a.yu=c}c=this.dz(a);c.measure();this.bz(a,c).draw()};h.na={};h.na.ui=function(){h.na.ui.w.constructor.call(this);this.qd=1};h.g.object.W(h.na.ui,h.m.ui);h.na.Iv=function(a){this.pa=a;this.Nm=this.ga="";this.Nc=this.pa.G;a=a.Ug;this.C=a.C;this.jf=a.jf;this.xd=this.jf.hh;this.ku=this.jf.sC;this.Mk=this.jf.MB;this.nn=this.jf.Di;this.gG=this.jf.ek;this.dH=this.jf.ug;this.Ty=this.jf.bk};h.na.Iv.prototype.xm=function(a){this.pa.G&&(this.ga+=h.g.A.ea("H",a.width-this.xd),this.ga+=this.Ty.$h,this.ga+=h.g.A.ea("v",a.height-this.Ty.height-this.xd))};
function hd(a,c){var d=c.Ta+c.width-a.xd;c.Ux&&(a.ga+=h.g.A.ea("H",d));a.Nc&&(a.ga+=h.g.A.ea("H",d),c.height>a.xd&&(a.ga+=h.g.A.ea("V",c.Jc+c.height-a.xd)))};h.na.Ei=function(a){this.Ij=a;this.Hn=h.g.o.L("path",{"class":"blocklyPathDark",transform:"translate(1,1)"},this.Ij);this.hl=h.g.o.L("path",{"class":"blocklyPath"},this.Ij);this.Jn=h.g.o.L("path",{"class":"blocklyPathLight"},this.Ij)};h.na.Ei.prototype.Iu=function(a,c){this.hl.setAttribute("d",a);this.Hn.setAttribute("d",a);this.Jn.setAttribute("d",c)};
h.na.Ei.prototype.Qs=function(){this.hl.setAttribute("transform","scale(-1 1)");this.Jn.setAttribute("transform","scale(-1 1)");this.Hn.setAttribute("transform","translate(1,1) scale(-1 1)")};h.na.dh=function(a,c){h.na.dh.w.constructor.call(this,a,c);this.Qi&&(this.width+=this.C.qd,this.height+=this.C.qd)};h.g.object.W(h.na.dh,h.m.dh);h.na.lh=function(a,c){h.na.lh.w.constructor.call(this,a,c);this.Qi&&(this.height+=this.C.qd)};h.g.object.W(h.na.lh,h.m.lh);h.na.jh=function(a,c){h.na.jh.w.constructor.call(this,a,c)};h.g.object.W(h.na.jh,h.m.jh);b=h.na.jh.prototype;b.Fw=function(a,c){this.wt&&a.type==h.Wa?(c.elements.push(new h.na.dh(this.C,a)),c.mt=!0):a.type==h.jb?(c.elements.push(new h.na.lh(this.C,a)),c.wd=!0):a.type==h.Wa?(c.elements.push(new h.m.mo(this.C,a)),c.cj=!0):a.type==h.mg&&(c.up=!0)};
b.mp=function(a,c){if(!a)return c&&h.m.u.Sm(c)&&c.jd?this.C.xf:c&&h.m.u.Lh(c)?this.C.Vv:c&&h.m.u.Vm(c)?this.C.MC:this.C.sd;if(!h.m.u.lf(a)&&!c)return h.m.u.Sm(a)&&a.jd?this.C.xf:h.m.u.Ok(a)?2*this.C.sd+1:h.m.u.kj(a)?this.C.yf:h.m.u.JF(a)?this.C.sd:h.m.u.Nh(a)?this.C.kC:h.m.u.Ry(a)?this.C.yf:this.C.sd;if(h.m.u.lf(a)&&!c){if(h.m.u.Rm(a))return this.C.yf;if(h.m.u.Lh(a))return this.C.sd;if(h.m.u.Vm(a))return this.C.yf}if(!h.m.u.lf(a)&&c&&h.m.u.lf(c)){if(a.jd){if(h.m.u.Lh(c)||h.m.u.Rm(c))return this.C.EC}else{if(h.m.u.Lh(c)||
h.m.u.Rm(c))return this.C.Vv;if(h.m.u.Vm(c))return this.C.sd}return this.C.sd-1}if(h.m.u.Ok(a)&&c&&!h.m.u.lf(c))return this.C.sd;if(h.m.u.Lh(a)&&c&&!h.m.u.lf(c))return c.jd?this.C.xf:this.C.sd;if(h.m.u.Um(a)&&c){if(h.m.u.kj(c))return this.C.yf;if(h.m.u.Qk(c))return c.Me;if(h.m.u.Oh(c))return a=(this.G?1:-1)*this.C.qd/2,c.Me+a}if(h.m.u.Nh(a)&&c){if(h.m.u.Qk(c))return c.Me-this.C.wb;if(h.m.u.Oh(c))return a=(this.G?1:-1)*this.C.qd/2,c.Me-this.C.wb+a}return!h.m.u.lf(a)&&c&&!h.m.u.lf(c)&&a.jd==c.jd||c&&
h.m.u.Ry(c)?this.C.sd:this.C.xf};b.Hr=function(a,c){a:{var d=0;for(var e;e=a.elements[d];d++)if(h.m.u.mf(e)){d=e;break a}d=null}e=Wc(a);if(a.cj||a.wd)a.fg+=c;var f=Vc(a);f?f.align==h.xq?e.width+=c:f.align==h.jv?(d.width+=c/2,e.width+=c/2):f.align==h.tl&&(d.width+=c):e.width+=c;a.width+=c};b.ny=function(a,c){return h.m.u.Ip(a)&&h.m.u.Bp(c)?this.C.pB:h.m.u.Ip(a)||h.m.u.Bp(c)?this.C.yf:a.cj&&c.cj?this.C.sd:!a.wd&&c.wd?this.C.OA:a.wd&&c.wd||!a.wd&&c.up?this.C.sd:this.C.xf};
b.by=function(a,c){if(h.m.u.mf(c))return a.Jc+c.height/2;if(h.m.u.Bp(a))return a=a.Jc+a.height-a.tm,h.m.u.Oh(c)?a+c.height/2:a-c.height/2;if(h.m.u.Ip(a))return h.m.u.kj(c)?a.Ag-c.height/2:a.Ag+c.height/2;var d=a.Jc;h.m.u.Sm(c)||h.m.u.Ok(c)?(d+=c.height/2,(a.mt||a.wd)&&c.height+this.C.rw<=a.height&&(d+=this.C.rw)):d=h.m.u.Lh(c)?d+c.height/2:d+a.height/2;return d};
b.Mx=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++){e.Jc=c;e.Ta=this.pe;c+=e.height;a=Math.max(a,e.fg);var f=c-this.kc.nk;e==this.Jb&&f<this.C.Xq&&(f=this.C.Xq-f,this.Jb.height+=f,c+=f);Yc(this,e)}this.Jb.Ni=c-this.Jb.tm;this.ql=a+this.pe+this.C.qd;this.width+=this.C.qd;this.height=c+this.C.qd;this.iq=this.kc.Ag};h.na.dd=function(a,c){h.na.dd.w.constructor.call(this,a,c);this.Rf=new h.na.Iv(c)};h.g.object.W(h.na.dd,h.m.dd);b=h.na.dd.prototype;b.draw=function(){Zc(this);$c(this);ad(this);var a=this.Rf;this.U.zj.Iu(this.Ma+"\n"+this.Ap,a.ga+"\n"+a.Nm);this.pa.G&&this.U.zj.Qs();h.m.Sn&&this.U.yu.yE(this.U,this.pa);bd(this)};
b.Js=function(){var a=this.Rf,c=this.pa.kc;a.ga+=h.g.A.moveBy(c.Ta,a.pa.iq);for(var d=0,e;e=c.elements[d];d++)h.m.u.Um(e)?a.ga+=a.jf.nw:h.m.u.Nh(e)?a.ga+=a.ku.Yu(a.Nc):h.m.u.Qk(e)?a.ga+=a.gG.$h:h.m.u.kj(e)?a.ga+=a.dH.path(a.Nc):h.m.u.mf(e)&&0!=e.width&&(a.ga+=h.g.A.ea("H",e.Ta+e.width-a.xd));a.ga+=h.g.A.ea("H",c.Ta+c.width-a.xd);hd(this.Rf,this.pa.kc);h.na.dd.w.Js.call(this)};b.xm=function(a){this.Rf.xm(a);h.na.dd.w.xm.call(this,a)};
b.Ks=function(a){var c=this.Rf,d=Vc(a);if(c.Nc){var e=a.height-d.jm;c.ga+=h.g.A.moveTo(d.Ta+d.width-c.xd,a.Jc)+c.nn.Oe(c.Nc)+h.g.A.ea("v",e)}else c.ga+=h.g.A.moveTo(d.Ta+d.width,a.Jc)+c.nn.Oe(c.Nc);h.na.dd.w.Ks.call(this,a)};
b.Is=function(a){var c=this.Rf,d=Vc(a);if(c.Nc){var e=a.height-2*c.Mk.height;c.ga+=h.g.A.moveTo(d.Ta,a.Jc)+c.Mk.nu(c.Nc)+h.g.A.ea("v",e)+c.Mk.Sp(c.Nc)+h.g.A.lineTo(a.width-d.Ta-c.Mk.width,0)}else c.ga+=h.g.A.moveTo(d.Ta,a.Jc+a.height)+c.Mk.Sp(c.Nc)+h.g.A.lineTo(a.width-d.Ta-c.Mk.width,0);h.na.dd.w.Is.call(this,a)};b.Hs=function(a){hd(this.Rf,a);h.na.dd.w.Hs.call(this,a)};
b.Ds=function(){var a=this.Rf,c=this.pa.Jb;if(a.Nc)a.ga+=h.g.A.ea("V",c.Ni-a.xd);else{var d=a.pa.Jb.elements[0];h.m.u.Um(d)?a.ga+=h.g.A.moveTo(c.Ta+a.xd,c.Ni-a.xd):h.m.u.Nh(d)&&(a.ga+=h.g.A.moveTo(c.Ta,c.Ni),a.ga+=a.ku.Tr())}h.na.dd.w.Ds.call(this)};
b.Gs=function(){var a=this.Rf,c=a.pa.M;c&&(c=c.Ce+c.height,a.Nc?a.ga+=h.g.A.moveTo(a.pa.pe,c):(a.ga+=h.g.A.moveTo(a.pa.pe+a.xd,a.pa.Jb.Ni-a.xd),a.ga+=h.g.A.ea("V",c)),a.ga+=a.nn.kn(a.Nc));a.Nc||(c=a.pa.kc,a.ga=h.m.u.Nh(c.elements[0])?a.ga+h.g.A.ea("V",a.ku.height):a.ga+h.g.A.ea("V",c.Ag+a.xd));h.na.dd.w.Gs.call(this)};
b.Fs=function(a){var c=this.Rf,d=c.xd,e=a.Ta+a.vh,f=a.rh-a.height/2,g=a.width-a.vh,k=f+d;if(c.Nc){f=a.Ce-d;var l=a.height-(a.Ce+a.jm)+d;c.Nm+=h.g.A.moveTo(e-d,k)+h.g.A.ea("v",f)+c.nn.Oe(c.Nc)+h.g.A.ea("v",l)+h.g.A.ea("h",g)}else c.Nm+=h.g.A.moveTo(a.Ta+a.width+d,k)+h.g.A.ea("v",a.height)+h.g.A.ea("h",-g)+h.g.A.moveTo(e,f+a.Ce)+c.nn.Oe(c.Nc);h.na.dd.w.Fs.call(this,a)};b.Hz=function(a){var c=a.rh-a.height/2;if(a.connection){var d=a.Ta+a.vh+this.C.qd;this.pa.G&&(d*=-1);dc(a.connection,d,c+a.Ce+this.C.qd)}};
b.Jz=function(a){var c=Vc(a);if(c.connection){var d=a.Ta+a.Gj+c.Me;d=this.pa.G?-1*d:d+this.C.qd;dc(c.connection,d,a.Jc+this.C.qd)}};b.Gz=function(a){var c=Vc(a);if(c.connection){var d=a.Ta+a.width+this.C.qd;this.pa.G&&(d*=-1);dc(c.connection,d,a.Jc)}};b.Iz=function(){var a=this.pa.Jb;if(a.connection){a=a.connection;var c=a.Ta;dc(a.hs,(this.pa.G?-c:c)+this.C.qd/2,a.rh-a.height/2+this.C.qd)}};h.na.Dl=function(a){this.wk=a;this.hh=.5;this.nw=h.g.A.moveBy(this.hh,this.hh);this.MB=id(this);this.sC=jd(this);this.Di=this.Lt();this.ek=this.Kt();this.bk=this.Jt();this.ug=this.Mt()};
function id(a){var c=a.wk.wb;a=a.hh;var d=(1-Math.SQRT1_2)*(c+a)-a,e=h.g.A.moveBy(d,d)+h.g.A.arc("a","0 0,0",c,h.g.A.Va(-d-a,c-d)),f=h.g.A.arc("a","0 0,0",c+a,h.g.A.Va(c+a,c+a)),g=h.g.A.moveBy(d,-d)+h.g.A.arc("a","0 0,0",c+a,h.g.A.Va(c-d,d+a));return{width:c+a,height:c,nu:function(k){return k?e:""},Sp:function(k){return k?f:g}}}
function jd(a){var c=a.wk.wb;a=a.hh;var d=(1-Math.SQRT1_2)*(c-a)+a,e=h.g.A.moveBy(d,d)+h.g.A.arc("a","0 0,1",c-a,h.g.A.Va(c-d,-d+a)),f=h.g.A.moveBy(a,c)+h.g.A.arc("a","0 0,1",c-a,h.g.A.Va(c,-c+a)),g=-d,k=h.g.A.moveBy(d,g)+h.g.A.arc("a","0 0,1",c-a,h.g.A.Va(-d+a,-g-c));return{height:c,Yu:function(l){return l?e:f},Tr:function(){return k}}}
h.na.Dl.prototype.Lt=function(){var a=this.wk.mh,c=this.wk.yr,d=h.g.A.moveBy(-2,-c+3.4)+h.g.A.lineTo(-.45*a,-2.1),e=h.g.A.ea("v",2.5)+h.g.A.moveBy(.97*-a,2.5)+h.g.A.curve("q",[h.g.A.Va(.05*-a,10),h.g.A.Va(.3*a,9.5)])+h.g.A.moveBy(.67*a,-1.9)+h.g.A.ea("v",2.5),f=h.g.A.ea("v",-1.5)+h.g.A.moveBy(-.92*a,-.5)+h.g.A.curve("q",[h.g.A.Va(-.19*a,-5.5),h.g.A.Va(0,-11)])+h.g.A.moveBy(.92*a,1),g=h.g.A.moveBy(-5,c-.7)+h.g.A.lineTo(.46*a,-2.1);return{width:a,height:c,kn:function(k){return k?d:f},Oe:function(k){return k?
e:g}}};h.na.Dl.prototype.Kt=function(){return{$h:h.g.A.ea("h",this.hh)+this.wk.ek.$h}};h.na.Dl.prototype.Jt=function(){return{$h:h.g.A.lineTo(5.1,2.6)+h.g.A.moveBy(-10.2,6.8)+h.g.A.lineTo(5.1,2.6)}};h.na.Dl.prototype.Mt=function(){var a=this.wk.ug.height,c=h.g.A.moveBy(25,-8.7)+h.g.A.curve("c",[h.g.A.Va(29.7,-6.2),h.g.A.Va(57.2,-.5),h.g.A.Va(75,8.7)]),d=h.g.A.curve("c",[h.g.A.Va(17.8,-9.2),h.g.A.Va(45.3,-14.9),h.g.A.Va(75,-8.7)])+h.g.A.moveTo(100.5,a+.5);return{path:function(e){return e?c:d}}};h.na.kh=function(){h.na.kh.w.constructor.call(this);this.jf=null};h.g.object.W(h.na.kh,h.m.kh);b=h.na.kh.prototype;b.S=function(){h.na.kh.w.S.call(this);this.jf=new h.na.Dl(this.C)};b.az=function(){return new h.na.ui};b.dz=function(a){return new h.na.jh(this,a)};b.bz=function(a,c){return new h.na.dd(a,c)};b.cz=function(a){return new h.na.Ei(a)};h.m.register("geras",h.na.kh);h.h.ADD_COMMENT="Adicionar coment\u00e1rio";h.h.CANNOT_DELETE_VARIABLE_PROCEDURE="N\u00e3o se pode deletar a vari\u00e1vel '%1' porque \u00e9 parte da defini\u00e7\u00e3o da fun\u00e7\u00e3o '%2'";h.h.CHANGE_VALUE_TITLE="Mudar valor:";h.h.CLEAN_UP="Limpar blocos";h.h.COLLAPSED_WARNINGS_WARNING="Bloqueios recolhidos cont\u00eam avisos.";h.h.COLLAPSE_ALL="Colapsar Blocos";h.h.COLLAPSE_BLOCK="Colapsar Bloco";h.h.COLOUR_BLEND_COLOUR1="cor 1";h.h.COLOUR_BLEND_COLOUR2="cor 2";h.h.COLOUR_BLEND_HELPURL="https://meyerweb.com/eric/tools/color-blend/#:::rgbp";
h.h.COLOUR_BLEND_RATIO="propor\u00e7\u00e3o";h.h.COLOUR_BLEND_TITLE="misturar";h.h.COLOUR_BLEND_TOOLTIP="Mistura duas cores em uma dada propor\u00e7\u00e3o (0,0 - 1,0).";h.h.COLOUR_PICKER_HELPURL="https://pt.wikipedia.org/wiki/Cor";h.h.COLOUR_PICKER_TOOLTIP="Escolher uma cor da palheta de cores.";h.h.COLOUR_RANDOM_HELPURL="http://randomcolour.com";h.h.COLOUR_RANDOM_TITLE="cor aleat\u00f3ria";h.h.COLOUR_RANDOM_TOOLTIP="Escolher cor de forma aleat\u00f3ria.";h.h.COLOUR_RGB_BLUE="azul";
h.h.COLOUR_RGB_GREEN="verde";h.h.COLOUR_RGB_HELPURL="https://www.december.com/html/spec/colorpercompact.html";h.h.COLOUR_RGB_RED="vermelho";h.h.COLOUR_RGB_TITLE="colorir com";h.h.COLOUR_RGB_TOOLTIP="Criar uma cor com a quantidade especificada de vermelho, verde e azul. Todos os valores devem estar entre 0 e 100.";h.h.CONTROLS_FLOW_STATEMENTS_HELPURL="https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";h.h.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="encerra o la\u00e7o";
h.h.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="continua com a pr\u00f3xima itera\u00e7\u00e3o do la\u00e7o";h.h.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK="Encerra o la\u00e7o.";h.h.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE="Ignora o resto deste la\u00e7o, e continua com a pr\u00f3xima itera\u00e7\u00e3o.";h.h.CONTROLS_FLOW_STATEMENTS_WARNING="Aten\u00e7\u00e3o: Este bloco s\u00f3 pode ser usado dentro de um la\u00e7o.";h.h.CONTROLS_FOREACH_HELPURL="https://github.com/google/blockly/wiki/Loops#for-each";
h.h.CONTROLS_FOREACH_TITLE="para cada item %1 na lista %2";h.h.CONTROLS_FOREACH_TOOLTIP="Para cada item em uma lista, atribua o item \u00e0 vari\u00e1vel '%1' e ent\u00e3o realize algumas instru\u00e7\u00f5es.";h.h.CONTROLS_FOR_HELPURL="https://github.com/google/blockly/wiki/Loops#count-with";h.h.CONTROLS_FOR_TITLE="contar com %1 de %2 at\u00e9 %3 por %4";h.h.CONTROLS_FOR_TOOLTIP="Fa\u00e7a com que a vari\u00e1vel '%1' assuma os valores do n\u00famero inicial ao n\u00famero final, contando de acordo com o intervalo especificado e execute os blocos especificados.";
h.h.CONTROLS_IF_ELSEIF_TOOLTIP="Acrescente uma condi\u00e7\u00e3o para o bloco se.";h.h.CONTROLS_IF_ELSE_TOOLTIP="Acrescente uma condi\u00e7\u00e3o final para o bloco se.";h.h.CONTROLS_IF_HELPURL="https://github.com/google/blockly/wiki/IfElse";h.h.CONTROLS_IF_IF_TOOLTIP="Acrescente, remova ou reordene se\u00e7\u00f5es para reconfigurar este bloco.";h.h.CONTROLS_IF_MSG_ELSE="sen\u00e3o";h.h.CONTROLS_IF_MSG_ELSEIF="sen\u00e3o se";h.h.CONTROLS_IF_MSG_IF="se";h.h.CONTROLS_IF_TOOLTIP_1="Se um valor for verdadeiro, ent\u00e3o realize algumas instru\u00e7\u00f5es.";
h.h.CONTROLS_IF_TOOLTIP_2="Se um valor for verdadeiro, ent\u00e3o realize o primeiro bloco de instru\u00e7\u00f5es. Sen\u00e3o, realize o segundo bloco de instru\u00e7\u00f5es.";h.h.CONTROLS_IF_TOOLTIP_3="Se o primeiro valor \u00e9 verdadeiro, ent\u00e3o realize o primeiro bloco de instru\u00e7\u00f5es. Sen\u00e3o, se o segundo valor \u00e9 verdadeiro, realize o segundo bloco de instru\u00e7\u00f5es.";h.h.CONTROLS_IF_TOOLTIP_4="Se o primeiro valor for verdadeiro, ent\u00e3o realize o primeiro bloco de instru\u00e7\u00f5es. Sen\u00e3o, se o segundo valor \u00e9 verdadeiro, realize o segundo bloco de instru\u00e7\u00f5es. Se nenhum dos blocos for verdadeiro, realize o \u00faltimo bloco de instru\u00e7\u00f5es.";
h.h.CONTROLS_REPEAT_HELPURL="https://pt.wikipedia.org/wiki/Estrutura_de_repeti%C3%A7%C3%A3o#Repeti.C3.A7.C3.A3o_com_vari.C3.A1vel_de_controle";h.h.CONTROLS_REPEAT_INPUT_DO="fa\u00e7a";h.h.CONTROLS_REPEAT_TITLE="repita %1 vezes";h.h.CONTROLS_REPEAT_TOOLTIP="Fa\u00e7a algumas instru\u00e7\u00f5es v\u00e1rias vezes.";h.h.CONTROLS_WHILEUNTIL_HELPURL="https://github.com/google/blockly/wiki/Loops#repeat";h.h.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL="repita at\u00e9";h.h.CONTROLS_WHILEUNTIL_OPERATOR_WHILE="repita enquanto";
h.h.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL="Enquanto um valor for falso, ent\u00e3o fa\u00e7a algumas instru\u00e7\u00f5es.";h.h.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE="Enquanto um valor for verdadeiro, ent\u00e3o fa\u00e7a algumas instru\u00e7\u00f5es.";h.h.DELETE_ALL_BLOCKS="Deletar todos os blocos %1?";h.h.DELETE_BLOCK="Deletar bloco";h.h.DELETE_VARIABLE="Deletar a vari\u00e1vel '%1'";h.h.DELETE_VARIABLE_CONFIRMATION="Deletar %1 usos da vari\u00e1vel '%2'?";h.h.DELETE_X_BLOCKS="Deletar %1 blocos";
h.h.DISABLE_BLOCK="Desabilitar bloco";h.h.DUPLICATE_BLOCK="Duplicar";h.h.DUPLICATE_COMMENT="Duplicar coment\u00e1rio";h.h.ENABLE_BLOCK="Habilitar bloco";h.h.EXPAND_ALL="Expandir blocos";h.h.EXPAND_BLOCK="Expandir bloco";h.h.EXTERNAL_INPUTS="Entradas externas";h.h.HELP="Ajuda";h.h.INLINE_INPUTS="Entradas incorporadas";h.h.IOS_CANCEL="blockly:IOS Cancelar/pt-br";h.h.IOS_ERROR="Erro";h.h.IOS_OK="Ok";h.h.IOS_PROCEDURES_ADD_INPUT="+ Adicionar Entrada";h.h.IOS_PROCEDURES_ALLOW_STATEMENTS="Permitir declara\u00e7\u00f5es";
h.h.IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR="Essa fun\u00e7\u00e3o tem entradas duplicadas.";h.h.IOS_PROCEDURES_INPUTS="ENTRADAS";h.h.IOS_VARIABLES_ADD_BUTTON="Adicionar";h.h.IOS_VARIABLES_ADD_VARIABLE="+ Adicionar Vari\u00e1vel";h.h.IOS_VARIABLES_DELETE_BUTTON="Deletar";h.h.IOS_VARIABLES_EMPTY_NAME_ERROR="Voc\u00ea n\u00e3o pode usar um nome de vari\u00e1vel vazio.";h.h.IOS_VARIABLES_RENAME_BUTTON="Blockly:Renomear varioas botoens/pt-br";h.h.IOS_VARIABLES_VARIABLE_NAME="Nome variavel";
h.h.LISTS_CREATE_EMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#create-empty-list";h.h.LISTS_CREATE_EMPTY_TITLE="criar lista vazia";h.h.LISTS_CREATE_EMPTY_TOOLTIP="Retorna uma lista, de tamanho 0, contendo nenhum registro";h.h.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD="lista";h.h.LISTS_CREATE_WITH_CONTAINER_TOOLTIP="Acrescenta, remove ou reordena se\u00e7\u00f5es para reconfigurar este bloco de lista.";h.h.LISTS_CREATE_WITH_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";
h.h.LISTS_CREATE_WITH_INPUT_WITH="criar lista com";h.h.LISTS_CREATE_WITH_ITEM_TOOLTIP="Acrescenta um item \u00e0 lista.";h.h.LISTS_CREATE_WITH_TOOLTIP="Cria uma lista com a quantidade de itens informada.";h.h.LISTS_GET_INDEX_FIRST="primeiro";h.h.LISTS_GET_INDEX_FROM_END="n\u00ba a partir do final";h.h.LISTS_GET_INDEX_FROM_START="n\u00ba";h.h.LISTS_GET_INDEX_GET="obter";h.h.LISTS_GET_INDEX_GET_REMOVE="obter e remover";h.h.LISTS_GET_INDEX_LAST="\u00faltimo";h.h.LISTS_GET_INDEX_RANDOM="aleat\u00f3rio";
h.h.LISTS_GET_INDEX_REMOVE="remover";h.h.LISTS_GET_INDEX_TAIL="";h.h.LISTS_GET_INDEX_TOOLTIP_GET_FIRST="Retorna o primeiro item em uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_FROM="Retorna o item da lista na posi\u00e7\u00e3o especificada.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_LAST="Retorna o \u00faltimo item em uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM="Retorna um item aleat\u00f3rio de uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST="Remove e retorna o primeiro item de uma lista.";
h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM="Remove e retorna o item na posi\u00e7\u00e3o especificada em uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST="Remove e retorna o \u00faltimo item de uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM="Remove e retorna um item aleat\u00f3rio de uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST="Remove o primeiro item de uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM="Remove o item na posi\u00e7\u00e3o especificada em uma lista.";
h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST="Remove o \u00faltimo item de uma lista.";h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM="Remove um item aleat\u00f3rio de uma lista.";h.h.LISTS_GET_SUBLIST_END_FROM_END="at\u00e9 n\u00ba a partir do final";h.h.LISTS_GET_SUBLIST_END_FROM_START="at\u00e9 n\u00ba";h.h.LISTS_GET_SUBLIST_END_LAST="at\u00e9 \u00faltimo";h.h.LISTS_GET_SUBLIST_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-a-sublist";h.h.LISTS_GET_SUBLIST_START_FIRST="obt\u00e9m sublista a partir do primeiro";
h.h.LISTS_GET_SUBLIST_START_FROM_END="obt\u00e9m sublista de n\u00ba a partir do final";h.h.LISTS_GET_SUBLIST_START_FROM_START="obt\u00e9m sublista de n\u00ba";h.h.LISTS_GET_SUBLIST_TAIL="";h.h.LISTS_GET_SUBLIST_TOOLTIP="Cria uma c\u00f3pia da por\u00e7\u00e3o especificada de uma lista.";h.h.LISTS_INDEX_FROM_END_TOOLTIP="%1 \u00e9 o \u00faltimo item.";h.h.LISTS_INDEX_FROM_START_TOOLTIP="%1 \u00e9 o primeiro item.";h.h.LISTS_INDEX_OF_FIRST="encontre a primeira ocorr\u00eancia do item";
h.h.LISTS_INDEX_OF_HELPURL="https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list";h.h.LISTS_INDEX_OF_LAST="encontre a \u00faltima ocorr\u00eancia do item";h.h.LISTS_INDEX_OF_TOOLTIP="Retorna o \u00edndice da primeira/\u00faltima ocorr\u00eancia do item na lista. Retorna %1 se o item n\u00e3o for encontrado.";h.h.LISTS_INLIST="na lista";h.h.LISTS_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Lists#is-empty";h.h.LISTS_ISEMPTY_TITLE="%1 \u00e9 vazia";
h.h.LISTS_ISEMPTY_TOOLTIP="Retorna ao verdadeiro se a lista estiver vazia.";h.h.LISTS_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Lists#length-of";h.h.LISTS_LENGTH_TITLE="tamanho de %1";h.h.LISTS_LENGTH_TOOLTIP="Retorna o tamanho de uma lista.";h.h.LISTS_REPEAT_HELPURL="https://github.com/google/blockly/wiki/Lists#create-list-with";h.h.LISTS_REPEAT_TITLE="criar lista com item %1 repetido %2 vezes";h.h.LISTS_REPEAT_TOOLTIP="Cria uma lista consistindo no valor informado repetido o n\u00famero de vezes especificado.";
h.h.LISTS_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Listas#invertendo-uma-lista";h.h.LISTS_REVERSE_MESSAGE0="inverter %1";h.h.LISTS_REVERSE_TOOLTIP="Inverter uma c\u00f3pia da lista.";h.h.LISTS_SET_INDEX_HELPURL="https://github.com/google/blockly/wiki/Lists#in-list--set";h.h.LISTS_SET_INDEX_INPUT_TO="como";h.h.LISTS_SET_INDEX_INSERT="inserir em";h.h.LISTS_SET_INDEX_SET="definir";h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST="Insere o item no in\u00edcio de uma lista.";
h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM="Insere o item na posi\u00e7\u00e3o especificada em uma lista.";h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST="Insere o item no final de uma lista.";h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM="Insere o item em uma posi\u00e7\u00e3o qualquer de uma lista.";h.h.LISTS_SET_INDEX_TOOLTIP_SET_FIRST="Define o primeiro item de uma lista.";h.h.LISTS_SET_INDEX_TOOLTIP_SET_FROM="Define o item da posi\u00e7\u00e3o especificada de uma lista.";
h.h.LISTS_SET_INDEX_TOOLTIP_SET_LAST="Define o \u00faltimo item de uma lista.";h.h.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM="Define um item aleat\u00f3rio de uma lista.";h.h.LISTS_SORT_HELPURL="https://github.com/google/blockly/wiki/Lists#sorting-a-list";h.h.LISTS_SORT_ORDER_ASCENDING="ascendente";h.h.LISTS_SORT_ORDER_DESCENDING="descendente";h.h.LISTS_SORT_TITLE="ordenar %1 %2 %3";h.h.LISTS_SORT_TOOLTIP="Ordenar uma c\u00f3pia de uma lista.";h.h.LISTS_SORT_TYPE_IGNORECASE="alfab\u00e9tico, ignorar mai\u00fascula/min\u00fascula";
h.h.LISTS_SORT_TYPE_NUMERIC="num\u00e9rico";h.h.LISTS_SORT_TYPE_TEXT="alfab\u00e9tico";h.h.LISTS_SPLIT_HELPURL="https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";h.h.LISTS_SPLIT_LIST_FROM_TEXT="Fazer uma lista a partir do texto";h.h.LISTS_SPLIT_TEXT_FROM_LIST="fazer um texto a partir da lista";h.h.LISTS_SPLIT_TOOLTIP_JOIN="Juntar uma lista de textos em um \u00fanico texto, separado por um delimitador.";h.h.LISTS_SPLIT_TOOLTIP_SPLIT="Dividir o texto em uma lista de textos, separando-o em cada delimitador.";
h.h.LISTS_SPLIT_WITH_DELIMITER="com delimitador";h.h.LOGIC_BOOLEAN_FALSE="falso";h.h.LOGIC_BOOLEAN_HELPURL="https://github.com/google/blockly/wiki/Logic#values";h.h.LOGIC_BOOLEAN_TOOLTIP="Retorna verdadeiro ou falso.";h.h.LOGIC_BOOLEAN_TRUE="verdadeiro";h.h.LOGIC_COMPARE_HELPURL="https://pt.wikipedia.org/wiki/Inequa%C3%A7%C3%A3o";h.h.LOGIC_COMPARE_TOOLTIP_EQ="Retorna verdadeiro se ambas as entradas forem iguais.";h.h.LOGIC_COMPARE_TOOLTIP_GT="Retorna verdadeiro se a primeira entrada for maior que a segunda entrada.";
h.h.LOGIC_COMPARE_TOOLTIP_GTE="Retorna verdadeiro se a primeira entrada for maior ou igual \u00e0 segunda entrada.";h.h.LOGIC_COMPARE_TOOLTIP_LT="Retorna verdadeiro se a primeira entrada for menor que a segunda entrada.";h.h.LOGIC_COMPARE_TOOLTIP_LTE="Retorna verdadeiro se a primeira entrada for menor ou igual \u00e0 segunda entrada.";h.h.LOGIC_COMPARE_TOOLTIP_NEQ="Retorna verdadeiro se ambas as entradas forem diferentes.";h.h.LOGIC_NEGATE_HELPURL="https://github.com/google/blockly/wiki/Logic#not";
h.h.LOGIC_NEGATE_TITLE="n\u00e3o %1";h.h.LOGIC_NEGATE_TOOLTIP="Retorna verdadeiro se a entrada for falsa. Retorna falsa se a entrada for verdadeira.";h.h.LOGIC_NULL="nulo";h.h.LOGIC_NULL_HELPURL="https://en.wikipedia.org/wiki/Nullable_type";h.h.LOGIC_NULL_TOOLTIP="Retorna nulo.";h.h.LOGIC_OPERATION_AND="e";h.h.LOGIC_OPERATION_HELPURL="https://github.com/google/blockly/wiki/Logic#logical-operations";h.h.LOGIC_OPERATION_OR="ou";h.h.LOGIC_OPERATION_TOOLTIP_AND="Retorna verdadeiro se ambas as entradas forem verdadeiras.";
h.h.LOGIC_OPERATION_TOOLTIP_OR="Retorna verdadeiro se uma das estradas for verdadeira.";h.h.LOGIC_TERNARY_CONDITION="teste";h.h.LOGIC_TERNARY_HELPURL="https://en.wikipedia.org/wiki/%3F:";h.h.LOGIC_TERNARY_IF_FALSE="se falso";h.h.LOGIC_TERNARY_IF_TRUE="se verdadeiro";h.h.LOGIC_TERNARY_TOOLTIP='Avalia a condi\u00e7\u00e3o em "teste". Se a condi\u00e7\u00e3o for verdadeira retorna o valor "se verdadeiro", sen\u00e3o retorna o valor "se falso".';h.h.MATH_ADDITION_SYMBOL="+";
h.h.MATH_ARITHMETIC_HELPURL="https://pt.wikipedia.org/wiki/Aritm%C3%A9tica";h.h.MATH_ARITHMETIC_TOOLTIP_ADD="Retorna a soma dos dois n\u00fameros.";h.h.MATH_ARITHMETIC_TOOLTIP_DIVIDE="Retorna o quociente da divis\u00e3o dos dois n\u00fameros.";h.h.MATH_ARITHMETIC_TOOLTIP_MINUS="Retorna a diferen\u00e7a entre os dois n\u00fameros.";h.h.MATH_ARITHMETIC_TOOLTIP_MULTIPLY="Retorna o produto dos dois n\u00fameros.";h.h.MATH_ARITHMETIC_TOOLTIP_POWER="Retorna o primeiro n\u00famero elevado \u00e0 pot\u00eancia do segundo n\u00famero.";
h.h.MATH_ATAN2_HELPURL="https://en.wikipedia.org/wiki/Atan2";h.h.MATH_ATAN2_TITLE="atan2 de X:%1 Y:%2";h.h.MATH_ATAN2_TOOLTIP="Retorne o arco tangente do ponto (X, Y) em graus de -180 a 180.";h.h.MATH_CHANGE_HELPURL="https://pt.wikipedia.org/wiki/Adi%C3%A7%C3%A3o";h.h.MATH_CHANGE_TITLE="alterar %1 por %2";h.h.MATH_CHANGE_TOOLTIP='Soma um n\u00famero \u00e0 vari\u00e1vel "%1".';h.h.MATH_CONSTANT_HELPURL="https://pt.wikipedia.org/wiki/Anexo:Lista_de_constantes_matem%C3%A1ticas";
h.h.MATH_CONSTANT_TOOLTIP="Retorna uma das constantes comuns: \u03c0 (3.141\u2026), e (2.718\u2026), \u03c6 (1.618\u2026), sqrt(2) (1.414\u2026), sqrt(\u00bd) (0.707\u2026), ou \u221e (infinito).";h.h.MATH_CONSTRAIN_HELPURL="https://en.wikipedia.org/wiki/Clamping_(graphics)";h.h.MATH_CONSTRAIN_TITLE="restringe %1 inferior %2 superior %3";h.h.MATH_CONSTRAIN_TOOLTIP="Restringe um n\u00famero entre os limites especificados (inclusivo).";h.h.MATH_DIVISION_SYMBOL="\u00f7";h.h.MATH_IS_DIVISIBLE_BY="\u00e9 divis\u00edvel por";
h.h.MATH_IS_EVEN="\u00e9 par";h.h.MATH_IS_NEGATIVE="\u00e9 negativo";h.h.MATH_IS_ODD="\u00e9 \u00edmpar";h.h.MATH_IS_POSITIVE="\u00e9 positivo";h.h.MATH_IS_PRIME="\u00e9 primo";h.h.MATH_IS_TOOLTIP="Verifica se um n\u00famero \u00e9 par, \u00edmpar, inteiro, positivo, negativo, ou se \u00e9 divis\u00edvel por outro n\u00famero. Retorna verdadeiro ou falso.";h.h.MATH_IS_WHOLE="\u00e9 inteiro";h.h.MATH_MODULO_HELPURL="https://pt.wikipedia.org/wiki/Opera%C3%A7%C3%A3o_m%C3%B3dulo";
h.h.MATH_MODULO_TITLE="resto da divis\u00e3o de %1 \u00f7 %2";h.h.MATH_MODULO_TOOLTIP="Retorna o resto da divis\u00e3o de dois n\u00fameros.";h.h.MATH_MULTIPLICATION_SYMBOL="\u00d7";h.h.MATH_NUMBER_HELPURL="https://pt.wikipedia.org/wiki/N%C3%BAmero";h.h.MATH_NUMBER_TOOLTIP="Um n\u00famero.";h.h.MATH_ONLIST_HELPURL="";h.h.MATH_ONLIST_OPERATOR_AVERAGE="m\u00e9dia da lista";h.h.MATH_ONLIST_OPERATOR_MAX="maior da lista";h.h.MATH_ONLIST_OPERATOR_MEDIAN="mediana da lista";h.h.MATH_ONLIST_OPERATOR_MIN="menor da lista";
h.h.MATH_ONLIST_OPERATOR_MODE="moda da lista";h.h.MATH_ONLIST_OPERATOR_RANDOM="item aleat\u00f3rio da lista";h.h.MATH_ONLIST_OPERATOR_STD_DEV="desvio padr\u00e3o da lista";h.h.MATH_ONLIST_OPERATOR_SUM="soma de uma lista";h.h.MATH_ONLIST_TOOLTIP_AVERAGE="Retorna a m\u00e9dia aritm\u00e9tica dos n\u00fameros da lista.";h.h.MATH_ONLIST_TOOLTIP_MAX="Retorna o maior n\u00famero da lista.";h.h.MATH_ONLIST_TOOLTIP_MEDIAN="Retorna a mediana dos n\u00fameros da lista.";h.h.MATH_ONLIST_TOOLTIP_MIN="Retorna o menor n\u00famero da lista.";
h.h.MATH_ONLIST_TOOLTIP_MODE="Retorna uma lista do(s) item(ns) mais comum(ns) da lista.";h.h.MATH_ONLIST_TOOLTIP_RANDOM="Retorna um elemento aleat\u00f3rio da lista.";h.h.MATH_ONLIST_TOOLTIP_STD_DEV="Retorna o desvio padr\u00e3o dos n\u00fameros da lista.";h.h.MATH_ONLIST_TOOLTIP_SUM="Retorna a soma de todos os n\u00fameros na lista.";h.h.MATH_POWER_SYMBOL="^";h.h.MATH_RANDOM_FLOAT_HELPURL="https://pt.wikipedia.org/wiki/Gerador_de_n%C3%BAmeros_pseudoaleat%C3%B3rios";
h.h.MATH_RANDOM_FLOAT_TITLE_RANDOM="fra\u00e7\u00e3o aleat\u00f3ria";h.h.MATH_RANDOM_FLOAT_TOOLTIP="Retorna uma fra\u00e7\u00e3o aleat\u00f3ria entre 0.0 (inclusivo) e 1.0 (exclusivo).";h.h.MATH_RANDOM_INT_HELPURL="https://pt.wikipedia.org/wiki/Gerador_de_n%C3%BAmeros_pseudoaleat%C3%B3rios";h.h.MATH_RANDOM_INT_TITLE="inteiro aleat\u00f3rio entre %1 e %2";h.h.MATH_RANDOM_INT_TOOLTIP="Retorna um n\u00famero inteiro entre os dois limites informados, inclusivo.";h.h.MATH_ROUND_HELPURL="https://pt.wikipedia.org/wiki/Arredondamento";
h.h.MATH_ROUND_OPERATOR_ROUND="arredonda";h.h.MATH_ROUND_OPERATOR_ROUNDDOWN="arredonda para baixo";h.h.MATH_ROUND_OPERATOR_ROUNDUP="arredonda para cima";h.h.MATH_ROUND_TOOLTIP="Arredonda um n\u00famero para cima ou para baixo.";h.h.MATH_SINGLE_HELPURL="https://pt.wikipedia.org/wiki/Raiz_quadrada";h.h.MATH_SINGLE_OP_ABSOLUTE="absoluto";h.h.MATH_SINGLE_OP_ROOT="raiz quadrada";h.h.MATH_SINGLE_TOOLTIP_ABS="Retorna o valor absoluto de um n\u00famero.";h.h.MATH_SINGLE_TOOLTIP_EXP="Retorna o n\u00famero e elevado \u00e0 pot\u00eancia de um n\u00famero.";
h.h.MATH_SINGLE_TOOLTIP_LN="Retorna o logaritmo natural de um n\u00famero.";h.h.MATH_SINGLE_TOOLTIP_LOG10="Retorna o logaritmo em base 10 de um n\u00famero.";h.h.MATH_SINGLE_TOOLTIP_NEG="Retorna o oposto de um n\u00famero.";h.h.MATH_SINGLE_TOOLTIP_POW10="Retorna 10 elevado \u00e0 pot\u00eancia de um n\u00famero.";h.h.MATH_SINGLE_TOOLTIP_ROOT="Retorna a raiz quadrada de um n\u00famero.";h.h.MATH_SUBTRACTION_SYMBOL="-";h.h.MATH_TRIG_ACOS="acos";h.h.MATH_TRIG_ASIN="asin";h.h.MATH_TRIG_ATAN="atan";
h.h.MATH_TRIG_COS="cos";h.h.MATH_TRIG_HELPURL="https://pt.wikipedia.org/wiki/Fun%C3%A7%C3%A3o_trigonom%C3%A9trica";h.h.MATH_TRIG_SIN="sin";h.h.MATH_TRIG_TAN="tan";h.h.MATH_TRIG_TOOLTIP_ACOS="Retorna o arco cosseno de um n\u00famero.";h.h.MATH_TRIG_TOOLTIP_ASIN="Retorna o arco seno de um n\u00famero.";h.h.MATH_TRIG_TOOLTIP_ATAN="Retorna o arco tangente de um n\u00famero.";h.h.MATH_TRIG_TOOLTIP_COS="Retorna o cosseno de um grau (n\u00e3o radiano).";h.h.MATH_TRIG_TOOLTIP_SIN="Retorna o seno de um grau (n\u00e3o radiano).";
h.h.MATH_TRIG_TOOLTIP_TAN="Retorna a tangente de um grau (n\u00e3o radiano).";h.h.NEW_COLOUR_VARIABLE="Criar vari\u00e1vel colorida...";h.h.NEW_NUMBER_VARIABLE="Criar vari\u00e1vel num\u00e9rica...";h.h.NEW_STRING_VARIABLE="Criar vari\u00e1vel de segmentos de texto...";h.h.NEW_VARIABLE="Criar vari\u00e1vel...";h.h.NEW_VARIABLE_TITLE="Nome da nova vari\u00e1vel:";h.h.NEW_VARIABLE_TYPE_TITLE="Tipo da nova vari\u00e1vel:";h.h.ORDINAL_NUMBER_SUFFIX="";h.h.PROCEDURES_ALLOW_STATEMENTS="permitir declara\u00e7\u00f5es";
h.h.PROCEDURES_BEFORE_PARAMS="com:";h.h.PROCEDURES_CALLNORETURN_HELPURL="https://pt.wikipedia.org/wiki/Sub-rotina";h.h.PROCEDURES_CALLNORETURN_TOOLTIP='Executa a fun\u00e7\u00e3o definida pelo usu\u00e1rio "%1".';h.h.PROCEDURES_CALLRETURN_HELPURL="https://pt.wikipedia.org/wiki/Sub-rotina";h.h.PROCEDURES_CALLRETURN_TOOLTIP='Executa a fun\u00e7\u00e3o definida pelo usu\u00e1rio "%1" e usa seu retorno.';h.h.PROCEDURES_CALL_BEFORE_PARAMS="com:";h.h.PROCEDURES_CREATE_DO='Criar "%1"';
h.h.PROCEDURES_DEFNORETURN_COMMENT="Descreva esta fun\u00e7\u00e3o...";h.h.PROCEDURES_DEFNORETURN_DO="";h.h.PROCEDURES_DEFNORETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine";h.h.PROCEDURES_DEFNORETURN_PROCEDURE="fa\u00e7a algo";h.h.PROCEDURES_DEFNORETURN_TITLE="para";h.h.PROCEDURES_DEFNORETURN_TOOLTIP="Cria uma fun\u00e7\u00e3o que n\u00e3o tem retorno.";h.h.PROCEDURES_DEFRETURN_HELPURL="https://en.wikipedia.org/wiki/Subroutine";h.h.PROCEDURES_DEFRETURN_RETURN="retorna";
h.h.PROCEDURES_DEFRETURN_TOOLTIP="Cria uma fun\u00e7\u00e3o que possui um valor de retorno.";h.h.PROCEDURES_DEF_DUPLICATE_WARNING="Aten\u00e7\u00e3o: Esta fun\u00e7\u00e3o tem par\u00e2metros duplicados.";h.h.PROCEDURES_HIGHLIGHT_DEF="Destacar defini\u00e7\u00e3o da fun\u00e7\u00e3o";h.h.PROCEDURES_IFRETURN_HELPURL="http://c2.com/cgi/wiki?GuardClause";h.h.PROCEDURES_IFRETURN_TOOLTIP="Se um valor \u00e9 verdadeiro, ent\u00e3o retorna um valor.";h.h.PROCEDURES_IFRETURN_WARNING="Aten\u00e7\u00e3o: Este bloco s\u00f3 pode ser utilizado dentro da defini\u00e7\u00e3o de uma fun\u00e7\u00e3o.";
h.h.PROCEDURES_MUTATORARG_TITLE="nome da entrada:";h.h.PROCEDURES_MUTATORARG_TOOLTIP="Adiciona uma entrada para esta fun\u00e7\u00e3o";h.h.PROCEDURES_MUTATORCONTAINER_TITLE="entradas";h.h.PROCEDURES_MUTATORCONTAINER_TOOLTIP="Adiciona, remove, ou reordena as entradas para esta fun\u00e7\u00e3o.";h.h.REDO="Refazer";h.h.REMOVE_COMMENT="Remover coment\u00e1rio";h.h.RENAME_VARIABLE="Renomear vari\u00e1vel...";h.h.RENAME_VARIABLE_TITLE="Renomear todas as vari\u00e1veis '%1' para:";
h.h.TEXT_APPEND_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";h.h.TEXT_APPEND_TITLE="para %1 anexar texto %2";h.h.TEXT_APPEND_TOOLTIP='Acrescentar um peda\u00e7o de texto \u00e0 vari\u00e1vel "%1".';h.h.TEXT_CHANGECASE_HELPURL="https://github.com/google/blockly/wiki/Text#adjusting-text-case";h.h.TEXT_CHANGECASE_OPERATOR_LOWERCASE="para min\u00fasculas";h.h.TEXT_CHANGECASE_OPERATOR_TITLECASE="para Nomes Pr\u00f3prios";h.h.TEXT_CHANGECASE_OPERATOR_UPPERCASE="para MAI\u00daSCULAS";
h.h.TEXT_CHANGECASE_TOOLTIP="Retorna uma c\u00f3pia do texto em um formato diferente.";h.h.TEXT_CHARAT_FIRST="obter primeira letra";h.h.TEXT_CHARAT_FROM_END="obter letra # a partir do final";h.h.TEXT_CHARAT_FROM_START="obter letra n\u00ba";h.h.TEXT_CHARAT_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-text";h.h.TEXT_CHARAT_LAST="obter \u00faltima letra";h.h.TEXT_CHARAT_RANDOM="obter letra aleat\u00f3ria";h.h.TEXT_CHARAT_TAIL="";h.h.TEXT_CHARAT_TITLE="no texto %1 %2";
h.h.TEXT_CHARAT_TOOLTIP="Retorna a letra na posi\u00e7\u00e3o especificada.";h.h.TEXT_COUNT_HELPURL="https://github.com/google/blockly/wiki/Text#counting-substrings";h.h.TEXT_COUNT_MESSAGE0="Contar %1 em %2";h.h.TEXT_COUNT_TOOLTIP="Calcule quantas vezes algum texto aparece centro de algum outro texto.";h.h.TEXT_CREATE_JOIN_ITEM_TOOLTIP="Acrescentar um item ao texto.";h.h.TEXT_CREATE_JOIN_TITLE_JOIN="unir";h.h.TEXT_CREATE_JOIN_TOOLTIP="Acrescenta, remove ou reordena se\u00e7\u00f5es para reconfigurar este bloco de texto.";
h.h.TEXT_GET_SUBSTRING_END_FROM_END="at\u00e9 letra n\u00ba a partir do final";h.h.TEXT_GET_SUBSTRING_END_FROM_START="at\u00e9 letra n\u00ba";h.h.TEXT_GET_SUBSTRING_END_LAST="at\u00e9 \u00faltima letra";h.h.TEXT_GET_SUBSTRING_HELPURL="https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";h.h.TEXT_GET_SUBSTRING_INPUT_IN_TEXT="no texto";h.h.TEXT_GET_SUBSTRING_START_FIRST="obter trecho de primeira letra";h.h.TEXT_GET_SUBSTRING_START_FROM_END="obter trecho de letra n\u00ba a partir do final";
h.h.TEXT_GET_SUBSTRING_START_FROM_START="obter trecho de letra n\u00ba";h.h.TEXT_GET_SUBSTRING_TAIL="";h.h.TEXT_GET_SUBSTRING_TOOLTIP="Retorna o trecho de texto especificado.";h.h.TEXT_INDEXOF_HELPURL="https://github.com/google/blockly/wiki/Text#finding-text";h.h.TEXT_INDEXOF_OPERATOR_FIRST="encontre a primeira ocorr\u00eancia do item";h.h.TEXT_INDEXOF_OPERATOR_LAST="encontre a \u00faltima ocorr\u00eancia do texto";h.h.TEXT_INDEXOF_TITLE="no texto %1 %2 %3";h.h.TEXT_INDEXOF_TOOLTIP="Retorna a posi\u00e7\u00e3o da primeira/\u00faltima ocorr\u00eancia do primeiro texto no segundo texto. Retorna %1 se o texto n\u00e3o for encontrado.";
h.h.TEXT_ISEMPTY_HELPURL="https://github.com/google/blockly/wiki/Text#checking-for-empty-text";h.h.TEXT_ISEMPTY_TITLE="%1 \u00e9 vazio";h.h.TEXT_ISEMPTY_TOOLTIP="Retorna verdadeiro se o texto fornecido for vazio.";h.h.TEXT_JOIN_HELPURL="https://github.com/google/blockly/wiki/Text#text-creation";h.h.TEXT_JOIN_TITLE_CREATEWITH="criar texto com";h.h.TEXT_JOIN_TOOLTIP="Criar um peda\u00e7o de texto juntando qualquer n\u00famero de itens.";h.h.TEXT_LENGTH_HELPURL="https://github.com/google/blockly/wiki/Text#text-modification";
h.h.TEXT_LENGTH_TITLE="tamanho de %1";h.h.TEXT_LENGTH_TOOLTIP="Retorna o n\u00famero de letras (incluindo espa\u00e7os) no texto fornecido.";h.h.TEXT_PRINT_HELPURL="https://github.com/google/blockly/wiki/Text#printing-text";h.h.TEXT_PRINT_TITLE="imprime %1";h.h.TEXT_PRINT_TOOLTIP="Imprime o texto, n\u00famero ou valor especificado.";h.h.TEXT_PROMPT_HELPURL="https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";h.h.TEXT_PROMPT_TOOLTIP_NUMBER="Pede ao usu\u00e1rio um n\u00famero.";
h.h.TEXT_PROMPT_TOOLTIP_TEXT="Pede ao usu\u00e1rio um texto.";h.h.TEXT_PROMPT_TYPE_NUMBER="Pede um n\u00famero com uma mensagem";h.h.TEXT_PROMPT_TYPE_TEXT="Pede um texto com uma mensagem";h.h.TEXT_REPLACE_HELPURL="https://github.com/google/blockly/wiki/Texto#substituindo-substrings";h.h.TEXT_REPLACE_MESSAGE0="substituir %1 por %2 em %3";h.h.TEXT_REPLACE_TOOLTIP="Substitua todas as ocorr\u00eancias de algum texto dentro de algum outro texto.";h.h.TEXT_REVERSE_HELPURL="https://github.com/google/blockly/wiki/Texto#invertendo-texto";
h.h.TEXT_REVERSE_MESSAGE0="inverter %1";h.h.TEXT_REVERSE_TOOLTIP="Inverter a ordem dos caracteres no texto.";h.h.TEXT_TEXT_HELPURL="https://pt.wikipedia.org/wiki/Cadeia_de_caracteres";h.h.TEXT_TEXT_TOOLTIP="Uma letra, palavra ou linha de texto.";h.h.TEXT_TRIM_HELPURL="https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";h.h.TEXT_TRIM_OPERATOR_BOTH="remover espa\u00e7os de ambos os lados de";h.h.TEXT_TRIM_OPERATOR_LEFT="remover espa\u00e7os \u00e0 esquerda de";
h.h.TEXT_TRIM_OPERATOR_RIGHT="remover espa\u00e7os \u00e0 direita de";h.h.TEXT_TRIM_TOOLTIP="Retorna uma c\u00f3pia do texto com os espa\u00e7os removidos de uma ou ambas extremidades.";h.h.TODAY="Hoje";h.h.UNDO="Desfazer";h.h.UNNAMED_KEY="Sem t\u00edtulo";h.h.VARIABLES_DEFAULT_NAME="item";h.h.VARIABLES_GET_CREATE_SET='Criar "definir %1"';h.h.VARIABLES_GET_HELPURL="https://github.com/google/blockly/wiki/Variables#get";h.h.VARIABLES_GET_TOOLTIP="Retorna o valor desta vari\u00e1vel.";
h.h.VARIABLES_SET="definir %1 para %2";h.h.VARIABLES_SET_CREATE_GET='Criar "obter %1"';h.h.VARIABLES_SET_HELPURL="https://github.com/google/blockly/wiki/Variables#set";h.h.VARIABLES_SET_TOOLTIP="Define esta vari\u00e1vel para o valor da entrada.";h.h.VARIABLE_ALREADY_EXISTS="A vari\u00e1vel chamada '%1' j\u00e1 existe.";h.h.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE="J\u00e1 existe uma vari\u00e1vel chamada '%1' para outra do tipo: '%2'.";h.h.WORKSPACE_COMMENT_DEFAULT_TEXT="Diz algo...";
h.h.CONTROLS_FOREACH_INPUT_DO=h.h.CONTROLS_REPEAT_INPUT_DO;h.h.CONTROLS_FOR_INPUT_DO=h.h.CONTROLS_REPEAT_INPUT_DO;h.h.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=h.h.CONTROLS_IF_MSG_ELSEIF;h.h.CONTROLS_IF_ELSE_TITLE_ELSE=h.h.CONTROLS_IF_MSG_ELSE;h.h.CONTROLS_IF_IF_TITLE_IF=h.h.CONTROLS_IF_MSG_IF;h.h.CONTROLS_IF_MSG_THEN=h.h.CONTROLS_REPEAT_INPUT_DO;h.h.CONTROLS_WHILEUNTIL_INPUT_DO=h.h.CONTROLS_REPEAT_INPUT_DO;h.h.LISTS_CREATE_WITH_ITEM_TITLE=h.h.VARIABLES_DEFAULT_NAME;h.h.LISTS_GET_INDEX_HELPURL=h.h.LISTS_INDEX_OF_HELPURL;
h.h.LISTS_GET_INDEX_INPUT_IN_LIST=h.h.LISTS_INLIST;h.h.LISTS_GET_SUBLIST_INPUT_IN_LIST=h.h.LISTS_INLIST;h.h.LISTS_INDEX_OF_INPUT_IN_LIST=h.h.LISTS_INLIST;h.h.LISTS_SET_INDEX_INPUT_IN_LIST=h.h.LISTS_INLIST;h.h.MATH_CHANGE_TITLE_ITEM=h.h.VARIABLES_DEFAULT_NAME;h.h.PROCEDURES_DEFRETURN_COMMENT=h.h.PROCEDURES_DEFNORETURN_COMMENT;h.h.PROCEDURES_DEFRETURN_DO=h.h.PROCEDURES_DEFNORETURN_DO;h.h.PROCEDURES_DEFRETURN_PROCEDURE=h.h.PROCEDURES_DEFNORETURN_PROCEDURE;h.h.PROCEDURES_DEFRETURN_TITLE=h.h.PROCEDURES_DEFNORETURN_TITLE;
h.h.TEXT_APPEND_VARIABLE=h.h.VARIABLES_DEFAULT_NAME;h.h.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=h.h.VARIABLES_DEFAULT_NAME;h.h.MATH_HUE="230";h.h.LOOPS_HUE="120";h.h.LISTS_HUE="260";h.h.LOGIC_HUE="210";h.h.VARIABLES_HUE="330";h.h.TEXTS_HUE="160";h.h.PROCEDURES_HUE="290";h.h.COLOUR_HUE="20";h.h.VARIABLES_DYNAMIC_HUE="310";var V={ef:null,S:function(){Pc();var a=document.getElementById("linkButton");"BlocklyStorage"in window?(BlocklyStorage.HTTPREQUEST_ERROR=S("Games_httpRequestError"),BlocklyStorage.LINK_ALERT=S("Games_linkAlert"),BlocklyStorage.HASH_ERROR=S("Games_hashError"),BlocklyStorage.XML_ERROR=S("Games_xmlError"),BlocklyStorage.alert=T.hA.bind(T,a),a&&Tc(a,BlocklyStorage.link)):a&&(a.style.display="none");(a=document.getElementById("languageMenu"))&&a.addEventListener("change",V.DD,!0);h.J&&(h.J.oC=!1);h.j&&
(h.j.oC=!1)},Zy:function(a,c){if("BlocklyStorage"in window&&1<window.location.hash.length)BlocklyStorage.retrieveXml(window.location.hash.substring(1));else{var d=null;try{d=window.sessionStorage.$y}catch(g){}d&&delete window.sessionStorage.$y;var e=Qc(R),f=c&&Qc(R-1);f&&"function"==typeof c&&(f=c(f));(a=d||e||f||a)&&V.Wz(a)}},Wz:function(a){V.ef?V.ef.setValue(a,-1):(a=h.R.li(a),C.clear(),h.R.xh(a,C),a=C,a.Nj.length=0,a.on.length=0,h.i.LD())},Xs:function(){if(V.ef)var a=V.ef.getValue();else{a=h.R.vA(!0);
if(1==D(C,!1).length&&a.querySelector){var c=a.querySelector("block");c&&(c.removeAttribute("x"),c.removeAttribute("y"))}a=h.R.Md(a)}return a},Ek:function(){return C},OG:function(){window.localStorage&&(window.localStorage[Sc+R]=V.Xs())},wp:function(){window.location=(Kc?"index.html":"./")+"?lang="+Ic},DD:function(){if(window.sessionStorage){if(V.ef)var a=V.ef.getValue();else a=h.R.vA(),a=h.R.Md(a);window.sessionStorage.$y=a}a=document.getElementById("languageMenu");a=encodeURIComponent(a.options[a.selectedIndex].value);
var c=window.location.search;c=1>=c.length?"?lang="+a:c.match(/[?&]lang=[^&]*/)?c.replace(/([?&]lang=)[^&]*/,"$1"+a):c.replace(/\?/,"?lang="+a+"&");window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+c},Wt:function(){10>R?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+Ic+"&level="+(R+1):V.wp()},Iy:function(a,c){if(a){var d=a.match(/^block_id_([^']+)$/);d&&(a=d[1])}var e=a;a=C;if(void 0===c){for(var f=0;d=
a.Lm[f];f++)d.Xg(!1);a.Lm.length=0}if(d=e?r(a,e):null)(c=void 0===c||c)?-1==a.Lm.indexOf(d)&&a.Lm.push(d):h.g.Ko(a.Lm,d),d.Xg(c)},XL:function(a,c){a=document.getElementById(a);a.firstChild||(a=h.Kh(a,{rtl:-1!=Hc.indexOf(Ic),readOnly:!0}),"string"!=typeof c&&(c=c.join("")),h.R.xh(h.R.li(c),a))},gH:function(a){a=a.replace(/(,\s*)?'block_id_[^']+'\)/g,")");return a.replace(/\s+$/,"")},Nf:function(a){if("click"==a.type&&"touchend"==V.Nf.uu&&V.Nf.su+2E3>Date.now()||V.Nf.uu==a.type&&V.Nf.su+400>Date.now())return a.preventDefault(),
a.stopPropagation(),!0;V.Nf.uu=a.type;V.Nf.su=Date.now();return!1}};V.Nf.uu=null;V.Nf.su=0;V.xF=function(){var a=document.createElement("script");a.type="text/javascript";a.src="third-party/JS-Interpreter/compressed.js";document.head.appendChild(a)};V.yF=function(){var a=document.createElement("link");a.rel="stylesheet";a.type="text/css";a.href="common/prettify.css";document.head.appendChild(a);a=document.createElement("script");a.type="text/javascript";a.src="common/prettify.js";document.head.appendChild(a)};
window.BlocklyInterface=V;V.setCode=V.Wz;V.getCode=V.Xs;V.getWorkspace=V.Ek;var T={ij:!1,wx:null,Yo:null,fl:function(a,c,d,e,f,g){function k(){T.ij&&(l.style.visibility="visible",l.style.zIndex=10,m.style.visibility="hidden")}if(!a)throw TypeError("Content not found: "+a);T.ij&&T.ge(!1);h.Ab()&&h.oc(!0);T.ij=!0;T.wx=c;T.Yo=g;var l=document.getElementById("dialog");g=document.getElementById("dialogShadow");var m=document.getElementById("dialogBorder"),n;for(n in f)l.style[n]=f[n];e&&(g.style.visibility="visible",g.style.opacity=.3,g.style.zIndex=9,e=document.createElement("div"),
e.id="dialogHeader",l.appendChild(e),T.ss=h.gd(e,"mousedown",null,T.lE));l.appendChild(a);a.className=a.className.replace("dialogHiddenContent","");d&&c?(T.Th(c,!1,.2),T.Th(l,!0,.8),setTimeout(k,175)):k()},xx:0,yx:0,lE:function(a){T.vs();if(!h.g.mj(a)){var c=document.getElementById("dialog");T.xx=c.offsetLeft-a.clientX;T.yx=c.offsetTop-a.clientY;T.us=h.gd(document,"mouseup",null,T.vs);T.ts=h.gd(document,"mousemove",null,T.mE);a.stopPropagation()}},mE:function(a){var c=document.getElementById("dialog"),
d=T.xx+a.clientX;a=T.yx+a.clientY;a=Math.max(a,0);a=Math.min(a,window.innerHeight-c.offsetHeight);d=Math.max(d,0);d=Math.min(d,window.innerWidth-c.offsetWidth);c.style.left=d+"px";c.style.top=a+"px"},vs:function(){T.us&&(h.$a(T.us),T.us=null);T.ts&&(h.$a(T.ts),T.ts=null)},ge:function(a){function c(){e.style.zIndex=-1;e.style.visibility="hidden";document.getElementById("dialogBorder").style.visibility="hidden"}if(T.ij){T.vs();T.ss&&(h.$a(T.ss),T.ss=null);T.ij=!1;T.Yo&&T.Yo();T.Yo=null;var d=!1===a?
null:T.wx;a=document.getElementById("dialog");var e=document.getElementById("dialogShadow");e.style.opacity=0;d&&a?(T.Th(a,!1,.8),T.Th(d,!0,.2),setTimeout(c,175)):c();a.style.visibility="hidden";a.style.zIndex=-1;for((d=document.getElementById("dialogHeader"))&&d.parentNode.removeChild(d);a.firstChild;)d=a.firstChild,d.className+=" dialogHiddenContent",document.body.appendChild(d)}},Th:function(a,c,d){function e(){f.style.width=g.width+"px";f.style.height=g.height+"px";f.style.left=g.x+"px";f.style.top=
g.y+"px";f.style.opacity=d}if(a){var f=document.getElementById("dialogBorder"),g=T.LE(a);c?(f.className="dialogAnimate",setTimeout(e,1)):(f.className="",e());f.style.visibility="visible"}},LE:function(a){var c=h.g.style.pp(a);c={x:c.x,y:c.y};a.getBBox?(a=a.getBBox(),c.height=a.height,c.width=a.width):(c.height=a.offsetHeight,c.width=a.offsetWidth);return c},hA:function(a,c){var d=document.getElementById("containerStorage");d.textContent="";c=c.split("\n");for(var e=0;e<c.length;e++){var f=document.createElement("p");
f.appendChild(document.createTextNode(c[e]));d.appendChild(f)}d=document.getElementById("dialogStorage");T.fl(d,a,!0,!0,{width:"50%",left:"25%",top:"5em"},T.Su);T.Pu()},hD:function(){if(!Qc(R))if(T.ij||C.gc())setTimeout(T.hD,15E3);else{var a=document.getElementById("dialogAbort"),c=document.getElementById("abortCancel");c.addEventListener("click",T.ge,!0);c.addEventListener("touchend",T.ge,!0);c=document.getElementById("abortOk");c.addEventListener("click",V.wp,!0);c.addEventListener("touchend",V.wp,
!0);T.fl(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",T.Dw,!0)});document.body.addEventListener("keydown",T.Dw,!0)}},aA:function(){document.getElementById("galleryXml").value=V.Xs();var a=document.getElementById("galleryDialog");if(!T.aA.NG){var c=document.getElementById("galleryCancel");c.addEventListener("click",T.ge,!0);c.addEventListener("touchend",T.ge,!0);c=document.getElementById("galleryOk");c.addEventListener("click",T.Ss,!0);c.addEventListener("touchend",
T.Ss,!0);T.aA.NG=!0}c=document.getElementById("submitButton");T.fl(a,c,!0,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",T.Vx,!0)});document.body.addEventListener("keydown",T.Vx,!0);setTimeout(function(){document.getElementById("galleryTitle").focus()},250)},SD:function(){var a=document.getElementById("dialogDone");if(C){var c=document.getElementById("dialogLinesText");c.textContent="";var d=kd();d=V.gH(d);var e=d.replace(/\/\/[^\n]*/g,"");e=e.replace(/\/\*.*\*\//g,
"");e=e.replace(/[ \t]+\n/g,"\n");e=e.replace(/\n+/g,"\n");e=e.trim();e=e.split("\n").length;var f=document.getElementById("containerCode");f.textContent=d;"function"==typeof prettyPrintOne&&(d=f.innerHTML,d=prettyPrintOne(d,"js"),f.innerHTML=d);d=1==e?S("Games_linesOfCode1"):S("Games_linesOfCode2").replace("%1",String(e));c.appendChild(document.createTextNode(d))}d=10>R?S("Games_nextLevel").replace("%1",String(R+1)):S("Games_finalLevel");c=document.getElementById("doneCancel");c.addEventListener("click",
T.ge,!0);c.addEventListener("touchend",T.ge,!0);c=document.getElementById("doneOk");c.addEventListener("click",V.Wt,!0);c.addEventListener("touchend",V.Wt,!0);T.fl(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",T.ax,!0)});document.body.addEventListener("keydown",T.ax,!0);document.getElementById("dialogDoneText").textContent=d},vx:function(a){!T.ij||13!=a.keyCode&&27!=a.keyCode&&32!=a.keyCode||(T.ge(!0),a.stopPropagation(),a.preventDefault())},
Pu:function(){document.body.addEventListener("keydown",T.vx,!0)},Su:function(){document.body.removeEventListener("keydown",T.vx,!0)},ax:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)T.ge(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&V.Wt()},Dw:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)T.ge(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&V.wp()},Vx:function(a){27==a.keyCode?T.ge(!0):13==a.keyCode&&T.Ss()},Ss:function(){var a=document.getElementById("galleryTitle");
if(a.value.trim()){a=document.getElementById("galleryForm");for(var c=[],d=0,e;e=a.elements[d];d++)e.name&&(c[d]=encodeURIComponent(e.name)+"="+encodeURIComponent(e.value));var f=new XMLHttpRequest;f.open("POST",a.action);f.setRequestHeader("Content-type","application/x-www-form-urlencoded");f.onload=function(){if(4==f.readyState){var g=200==f.status?S("Games_submitted"):S("Games_httpRequestError")+"\nStatus: "+f.status;T.hA(null,g)}};f.send(c.join("&"));T.ge(!0)}else a.value="",a.focus()}};
window.BlocklyDialogs=T;T.hideDialog=T.ge;h.Comment=function(a){h.Comment.w.constructor.call(this,a);this.hc=a.Be;this.hc.text=this.hc.text||"";this.Yr="";hc(this)};h.g.object.W(h.Comment,h.Id);b=h.Comment.prototype;
b.Es=function(a){h.g.o.L("circle",{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},a);h.g.o.L("path",{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},a);h.g.o.L("rect",{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},a)};
b.ks=function(){this.Bm=h.g.o.L("foreignObject",{x:h.oa.cd,y:h.oa.cd},null);var a=document.createElementNS(h.g.o.zi,"body");a.setAttribute("xmlns",h.g.o.zi);a.className="blocklyMinimalBody";var c=this.Lj=document.createElementNS(h.g.o.zi,"textarea");c.className="blocklyCommentTextarea";c.setAttribute("dir",this.U.G?"RTL":"LTR");c.value=this.hc.text;ld(this);a.appendChild(c);this.Bm.appendChild(a);h.ma(c,"mouseup",this,this.cH,!0,!0);h.ma(c,"wheel",this,function(d){d.stopPropagation()});h.ma(c,"change",
this,function(){this.Yr!=this.hc.text&&h.i.Ka(new h.i.hg(this.U,"comment",null,this.Yr,this.hc.text))});h.ma(c,"input",this,function(){this.hc.text=c.value});setTimeout(c.focus.bind(c),0);return this.Bm};b.ah=function(){h.Comment.w.ah.call(this);this.isVisible()&&(md(this),nd(this))};b.kG=function(){this.isVisible()&&(this.hc.size=this.Yb.Vs(),ld(this))};
function ld(a){var c=a.hc.size,d=2*h.oa.cd,e=c.width-d;c=c.height-d;a.Bm.setAttribute("width",e);a.Bm.setAttribute("height",c);a.Lj.style.width=e-4+"px";a.Lj.style.height=c-4+"px"}b.Vb=function(a){a!=this.isVisible()&&(h.i.Ka(new h.i.ud(this.U,"commentOpen",!a,a)),(this.hc.pu=a)?nd(this):md(this))};
function nd(a){if(!a.U.jd()||h.g.userAgent.og)h.Cf.prototype.kx.call(a);else{a.Yb=new h.oa(a.U.v,a.ks(),a.U.Td,a.Kk,a.hc.size.width,a.hc.size.height);gb(a.Yb,a.U.id);var c=a.kG.bind(a);a.Yb.zu=c;a.Qe()}}function md(a){a.yj?h.Cf.prototype.Ax.call(a):(a.Yb.I(),a.Yb=null,a.Lj=null,a.Bm=null)}b.cH=function(){hb(this.Yb)&&this.Lj.focus();this.Yr=this.hc.text};b.Vs=function(){return this.hc.size};b.un=function(a,c){this.Yb?this.Yb.un(a,c):(this.hc.size.width=a,this.hc.size.height=c)};
b.Tb=function(){return this.hc.text||""};b.dl=function(a){this.hc.text!=a&&(this.hc.text=a,oc(this))};function oc(a){a.Lj?a.Lj.value=a.hc.text:a.yj&&(a.yj.firstChild.textContent=a.hc.text)}b.I=function(){this.U.vk=null;h.Id.prototype.I.call(this)};h.Da={};h.Da.pd=function(a,c){h.uc.call(this);this.Qc=c;this.af=a;this.zm=this.fq=!1;this.zt=!0;this.qs=-1};h.g.object.W(h.Da.pd,h.uc);h.Da.pd.Ir={};b=h.Da.pd.prototype;b.vm=function(){h.Da.pd.w.vm.call(this);this.Da&&(this.Da=null);this.hb=null};
b.xp=function(){var a=this.ta();if(a){var c=od(this);c&&!c.id&&(c.id=this.ua()+".label");h.g.V.ag(a,h.g.V.Fi.RC);h.g.V.Gb(a,h.g.V.State.Nl,!1);h.g.V.Gb(a,h.g.V.State.TB,this.Ck());c&&h.g.V.Gb(a,h.g.V.State.Rv,c.id);(c=this.Ys())&&h.g.V.ag(c,h.g.V.Fi.uC);if(c=pd(this))if(h.g.V.ag(c,h.g.V.Fi.DB),c.hasChildNodes())for(h.g.V.Gb(a,h.g.V.State.Nq,!1),a=this.kb.length,c=1;c<=a;c++){var d=(this.kb[c-1]||null).ta();h.g.V.Gb(d,h.g.V.State.CC,a);h.g.V.Gb(d,h.g.V.State.tC,c)}}};
b.Oa=function(){var a=document.createElement("div");a.appendChild(qd(this));this.hb=a};b.ff=function(){h.Da.pd.w.ff.call(this);h.Da.pd.Ir[this.ua()]=this;this.xp()};b.zh=function(){h.Da.pd.w.zh.call(this);delete h.Da.pd.Ir[this.ua()]};
b.Zl=function(a,c){var d=this.kb[c-1]||null,e=this.kb[c]||null;h.Da.pd.w.Zl.call(this,a,c);a.Zk=d;a.Xt=e;d?d.Xt=a:this.Ox=a;e&&(e.Zk=a);(c=this.Ie())&&rd(a,c);sd(a,this.Ck()+1);if(c=this.ta())if(this.oq(),h.g.V.Gb(c,h.g.V.State.Nq,this.Ge()),this.Ge()){c=pd(this);a.ta()||a.Oa();var f=a.ta(),g=e&&e.ta();c.insertBefore(f,g);this.Yc&&a.ff();e||(d?d.oq():(h.g.style.Hu(c,!0),this.Dj(this.Ge())))}};b.add=function(a){if(a.getParent())throw Error(h.uc.Error.hr);this.Zl(a,this.kb.length)};b.Ie=function(){return null};
b.Ck=function(){var a=this.qs;0>a&&(a=(a=this.getParent())?a.Ck()+1:0,sd(this,a));return a};function sd(a,c){if(c!=a.qs){a.qs=c;var d=td(a);if(d){var e=ud(a)+"px";a.Rk()?d.style.paddingRight=e:d.style.paddingLeft=e}da(a,function(f){sd(f,c+1)})}}b.contains=function(a){for(;a;){if(a==this)return!0;a=a.getParent()}return!1};b.Ah=function(){var a=[];da(this,function(c){a.push(c)});return a};b.select=function(){var a=this.Ie();a&&Ec(a,this)};
function vd(a,c){if(a.fq!=c){a.fq=c;wd(a);var d=a.ta();d&&(h.g.V.Gb(d,h.g.V.State.Nl,c),c&&(c=a.Ie().ta(),h.g.V.Gb(c,h.g.V.State.iv,a.ua())))}}b.Ge=function(){return this.zm};
b.Dj=function(a){var c=a!=this.zm,d;this.zm=a;var e=this.Ie(),f=this.ta();if(fa(this)){if(!a&&e&&this.contains(e.Rd)&&this.select(),f){if(d=pd(this))h.g.style.Hu(d,a),h.g.V.Gb(f,h.g.V.State.Nq,a),a&&this.Yc&&!d.hasChildNodes()&&(da(this,function(g){d.appendChild(qd(g))}),da(this,function(g){g.ff()}));this.oq()}}else(d=pd(this))&&h.g.style.Hu(d,!1);f&&(this.Ys().className=this.lp());c&&(a?this.Dx():this.Cx())};b.Dx=function(){};b.Cx=function(){};b.toggle=function(){this.Dj(!this.Ge())};
function qd(a){var c=a.Ge()&&fa(a),d=document.createElement("div");d.style.backgroundPosition=xd(a);c||(d.style.display="none");c&&da(a,function(e){d.appendChild(qd(e))});c=document.createElement("div");c.id=a.ua();c.appendChild(yd(a));c.appendChild(d);return c}function ud(a){return Math.max(0,(a.Ck()-1)*a.Qc.Ly)}function yd(a){var c=document.createElement("div");c.className=a.qp();c.style["padding-"+(a.Rk()?"right":"left")]=ud(a)+"px";c.appendChild(zd(a));c.appendChild(Ad(a));return c}
b.qp=function(){var a="";this.fq&&(a=" "+(this.Qc.fE||""));return this.Qc.ox+a};function Ad(a){var c=document.createElement("span");c.className=a.Qc.dE||"";c.textContent=a.Tb();return c}function zd(a){var c=document.createElement("span");c.style.display="inline-block";c.className=a.lp();return c}b.lp=function(){throw Error("unimplemented abstract method");};function xd(a){return(a.Xt?(a.Ck()-1)*a.Qc.Ly:"-100")+"px 0"}
b.ta=function(){var a=h.Da.pd.w.ta.call(this);a||(this.hb=a=document.getElementById(this.ua()));return a};function td(a){return(a=a.ta())?a.firstChild:null}b.Ys=function(){var a=td(this);return a?a.firstChild:null};function od(a){return(a=td(a))&&a.lastChild?a.lastChild.previousSibling:null}function pd(a){return(a=a.ta())?a.lastChild:null}b.dl=function(a){this.af=a};b.Tb=function(){return this.af};function wd(a){var c=td(a);c&&(c.className=a.qp())}
b.oq=function(){var a=pd(this);a&&(a.style.backgroundPosition=xd(this))};b.xz=function(a){"expand"==a.target.getAttribute("type")&&fa(this)?this.zt&&this.toggle():(this.select(),wd(this))};b.uz=function(a){a.preventDefault()};b.fu=function(a){var c=!0;switch(a.keyCode){case h.g.Ba.Co:if(a.altKey)break;c=Bd(this);break;case h.g.Ba.uo:if(a.altKey)break;c=Cd(this);break;case h.g.Ba.zl:c=Dd(this);break;case h.g.Ba.Tl:c=Ed(this);break;default:c=!1}c&&a.preventDefault();return c};
function Dd(a){a:if(fa(a)&&a.Ge())a=a.kb[0]||null;else{for(var c=a,d;c!=a.Ie();){d=c.Xt;if(null!=d){a=d;break a}c=c.getParent()}a=null}a&&a.select();return!0}function Ed(a){var c=a.Zk;if(null!=c)a=Fd(c);else{c=a.getParent();var d=a.Ie();a=c==d||a==d?null:c}a&&a.select();return!0}function Cd(a){if(fa(a)&&a.Ge()&&a.zt)a.Dj(!1);else{var c=a.getParent();a=a.Ie();c&&c!=a&&c.select()}return!0}function Bd(a){return fa(a)?(a.Ge()?(a.kb[0]||null).select():a.Dj(!0),!0):!1}
function Fd(a){return a.Ge()&&fa(a)?Fd(a.kb[a.kb.length-1]||null):a}function rd(a,c){a.Da!=c&&(a.Da=c,da(a,function(d){rd(d,c)}))};h.Da.nh=function(a,c,d){this.ra=a;h.Da.pd.call(this,c,d)};h.g.object.W(h.Da.nh,h.Da.pd);b=h.Da.nh.prototype;b.Ie=function(){if(this.Da)return this.Da;var a=this.getParent();return a&&(a=a.Ie())?(rd(this,a),a):null};b.lp=function(){var a=this.Ge(),c=this.BE;if(a&&c)return c;c=this.wF;if(!a&&c)return c;c=this.Qc;if(fa(this)){if(a&&c.mx)return c.Vo+" "+c.mx;if(!a&&c.aE)return c.Vo+" "+c.aE}else if(c.nx)return c.Vo+" "+c.nx;return""};
b.uz=function(){fa(this)&&this.zt?(this.toggle(),this.select()):this.fq?Ec(this.Ie(),null):this.select();wd(this)};b.xz=function(){};b.fu=function(a){if(this.Da.ra.kf){var c={},d=h.g.Ba.zl,e=h.g.Ba.Tl;c[h.g.Ba.Co]=this.Rk()?e:d;c[h.g.Ba.uo]=this.Rk()?d:e;c[h.g.Ba.Tl]=h.g.Ba.uo;c[h.g.Ba.zl]=h.g.Ba.Co;Object.defineProperties(a,{keyCode:{value:c[a.keyCode]||a.keyCode}})}return h.Da.nh.w.fu.call(this,a)};b.Rz=function(){this.Bz&&this.Bz.call(this.ra)};b.Dx=h.Da.nh.prototype.Rz;b.Cx=h.Da.nh.prototype.Rz;h.Da.Ki=function(a,c){this.ra=a;h.Da.pd.call(this,"",c);this.zm=!0;vd(this,!0);this.Rd=this};h.g.object.W(h.Da.Ki,h.Da.pd);b=h.Da.Ki.prototype;b.Ie=function(){return this};b.Ck=function(){return 0};b.hF=function(){this.Tx=!0;var a=this.ta();h.g.o.Cb(a,"focused");this.Rd&&this.Rd.select()};b.eF=function(){this.Tx=!1;var a=this.ta();h.g.o.Ec(a,"focused")};b.hasFocus=function(){return this.Tx};b.Ge=function(){return!0};b.Dj=function(a){this.zm=a};
b.Ys=function(){var a=td(this);return a?a.firstChild:null};b.oq=function(){};b.qp=function(){return h.Da.Ki.w.qp.call(this)+" "+this.Qc.cE};b.lp=function(){var a=this.Ge(),c=this.BE;if(a&&c)return c;c=this.wF;if(!a&&c)return c;c=this.Qc;return a&&c.bE?c.Vo+" "+c.bE:""};function Ec(a,c){if(c!=a.Rd&&(!a.rz||a.rz.call(a.ra,c))){var d=a.Rd;a.Rd&&vd(a.Rd,!1);(a.Rd=c)&&vd(c,!0);a.qz&&a.qz.call(a.ra,d,c)}}
b.xp=function(){h.Da.Ki.w.xp.call(this);var a=this.ta();h.g.V.ag(a,h.g.V.Fi.QC);h.g.V.Gb(a,h.g.V.State.Rv,od(this).id)};b.ff=function(){h.Da.Ki.w.ff.call(this);var a=this.ta();a.className=this.Qc.eE;a.setAttribute("hideFocus","true");this.Nr();this.xp()};b.zh=function(){h.Da.Ki.w.zh.call(this);this.rs()};b.Nr=function(){var a=this.ta();a.tabIndex=0;this.nG=h.gd(a,"focus",this,this.hF);this.jG=h.gd(a,"blur",this,this.eF);this.lG=h.ma(a,"click",this,this.lF);this.rG=h.gd(a,"keydown",this,this.iF)};
b.rs=function(){h.$a(this.nG);h.$a(this.jG);h.$a(this.lG);h.$a(this.rG)};b.lF=function(a){var c;a:{for(var d=a.target;null!=d;){if(c=h.Da.pd.Ir[d.id])break a;if(d==this.ta())break;d=d.parentNode}c=null}if(c)switch(a.type){case "mousedown":c.xz(a);break;case "click":c.uz(a)}};b.iF=function(a){var c=!1;if(c=this.Rd&&this.Rd.fu(a)||c)h.g.style.Eu(this.Rd.ta(),this.ta().parentNode),a.preventDefault();return c};b.createNode=function(a){return new h.Da.nh(this.ra,a||"",this.Qc)};h.Ji=function(a){this.s=a;this.G=a.options.G;this.kf=a.options.ie;this.Ia=a.options.Ia;this.Qc={Ly:19,eE:"blocklyTreeRoot",cE:"blocklyHidden",ox:"blocklyTreeRow",dE:"blocklyTreeLabel",Vo:"blocklyTreeIcon",mx:"blocklyTreeIconOpen",nx:"blocklyTreeIconNone",fE:"blocklyTreeSelected"};this.oA={ox:"blocklyTreeSeparator"};this.kf&&(this.Qc.cssTreeRow+=a.G?" blocklyHorizontalTreeRtl":" blocklyHorizontalTree",this.oA.cssTreeRow="blocklyTreeSeparatorHorizontal "+(a.G?"blocklyHorizontalTreeRtl":"blocklyHorizontalTree"),
this.Qc.cssTreeIcon="")};b=h.Ji.prototype;b.width=0;b.height=0;b.Tk=null;
b.S=function(){var a=this.s,c=x(this.s);this.vc=document.createElement("div");this.vc.className="blocklyToolboxDiv blocklyNonSelectable";this.vc.setAttribute("dir",a.G?"RTL":"LTR");c.parentNode.insertBefore(this.vc,c);c=a.jc;c.subscribe(this.vc,"toolbox","background-color");c.subscribe(this.vc,"toolboxText","color");h.ma(this.vc,"mousedown",this,function(d){h.g.mj(d)||d.target==this.vc?h.oc(!1):h.oc(!0);h.Touch.em()},!1,!0);c={Ig:a.options.Ig,Nb:a,G:a.G,Ne:a.options.Ne,ie:a.ie,Ia:a.options.Ia,Tg:a.options.Tg};
this.P=null;if(a.ie){if(!h.El)throw Error("Missing require for Blockly.HorizontalFlyout");this.P=new h.El(c)}else{if(!h.yg)throw Error("Missing require for Blockly.VerticalFlyout");this.P=new h.yg(c)}h.g.o.gj(this.P.Oa("svg"),x(this.s));this.P.S(a);this.Qc.cleardotPath=a.options.ai+"1x1.gif";this.Qc.cssCollapsedFolderIcon="blocklyTreeIconClosed"+(a.G?"Rtl":"Ltr");Gd(this,a.options.Sk)};
function Gd(a,c){a.Bd&&(a.Bd.I(),a.Tk=null);var d=new h.Da.Ki(a,a.Qc);a.Bd=d;Ec(d,null);d.rz=a.dF;d.qz=a.cF;var e=null;if(c){a.Bd.Df=[];a.kt=!1;e=Hd(a,c,a.Bd,a.s.options.ai);if(a.Bd.Df.length)throw Error("Toolbox cannot have both blocks and categories in the root level.");na(a.s)}d.za(a.vc);e&&Ec(d,e);Id(a);a.position();a.kf&&h.g.V.Gb(a.Bd.ta(),h.g.V.State.qC,"horizontal")}
b.dF=function(a){if(a==this.Bd)return!1;this.Tk&&(td(this.Tk).style.backgroundColor="");if(a){var c=a.Gk||"#57e";td(a).style.backgroundColor=c;Id(this,a)}return!0};b.cF=function(a,c){c&&c.Df&&c.Df.length?(this.P.show(c.Df),this.Tk!=c&&this.P.pc.set(0),h.Le&&h.navigation.Gb(h.navigation.xr)):(this.P.Ca(),!h.Le||c instanceof h.Ji.Dr||h.navigation.Gb(h.navigation.Pl));a!=c&&a!=this&&(a=new h.i.ud(null,"category",a&&a.Tb(),c&&c.Tb()),a.tc=this.s.id,h.i.Ka(a));c&&(this.Tk=c)};b.oF=function(){h.il(this.s)};
b.Wh=function(a){var c=this.Bd.Rd;if(!c)return!1;switch(a.name){case h.navigation.bb.ye:return Ed(c);case h.navigation.bb.Bo:return Cd(c);case h.navigation.bb.we:return Dd(c);case h.navigation.bb.po:return Bd(c);default:return!1}};b.I=function(){this.P.I();this.Bd.I();this.s.jc.unsubscribe(this.vc);h.g.o.removeNode(this.vc);this.Tk=this.s=null};b.Qf=function(){return this.width};b.ey=function(){return this.height};
b.position=function(){var a=this.vc;if(a){var c=x(this.s);c=h.iA(c);this.kf?(a.style.left="0",a.style.height="auto",a.style.width=c.width+"px",this.height=a.offsetHeight,this.Ia==h.wg?a.style.top="0":a.style.bottom="0"):(this.Ia==h.vg?a.style.right="0":a.style.left="0",a.style.height=c.height+"px",this.width=a.offsetWidth);this.P.position()}};
function Hd(a,c,d,e){for(var f=null,g=null,k=0,l;l=c.childNodes[k];k++)if(l.tagName)switch(l.tagName.toUpperCase()){case "CATEGORY":var m=h.g.le(l.getAttribute("name"));g=a.Bd.createNode(m);g.Bz=a.oF;g.Df=[];d.add(g);var n=l.getAttribute("custom");n?g.Df=n:(n=Hd(a,l,g,e))&&(f=n);var t=l.getAttribute("categorystyle");if((n=l.getAttribute("colour"))&&t)g.Gk="",console.warn('Toolbox category "'+m+'" can not have both a style and a colour');else if(t){n=a;var u=g;u.vM=t;var w=n.s.rp();t&&w&&((w=w.CD[t])&&
w.Lb?Jd(n,w.Lb,u,m):console.warn('Style "'+t+'" must exist and contain a colour value'))}else Jd(a,n,g,m);"true"==l.getAttribute("expanded")?(g.Df.length&&(f=g),g.Dj(!0)):g.Dj(!1);g=l;break;case "SEP":if(g&&"CATEGORY"==g.tagName.toUpperCase()){d.add(new h.Ji.Dr(a.oA));break}case "BLOCK":case "SHADOW":case "LABEL":case "BUTTON":d.Df.push(l),g=l}return f}
function Jd(a,c,d,e){c=h.g.le(c);if(null===c||""===c)d.Gk="";else{var f=Number(c);isNaN(f)?(f=h.g.Lb.parse(c))?(d.Gk=f,a.kt=!0):(d.Gk="",console.warn('Toolbox category "'+e+'" has unrecognized colour attribute: '+c)):(d.Gk=h.Ky(f),a.kt=!0)}}function Id(a,c){c=(c||a.Bd).Ah(!1);for(var d=0,e;e=c[d];d++){var f=td(e);if(f){var g=a.kt?"8px solid "+(e.Gk||"#ddd"):"none";a.s.G?f.style.borderRight=g:f.style.borderLeft=g}Id(a,e)}}
b.Em=function(){if(!this.vc)return null;var a=this.vc.getBoundingClientRect(),c=a.top,d=c+a.height,e=a.left;a=e+a.width;return this.Ia==h.wg?new h.g.Rect(-1E7,d,-1E7,1E7):this.Ia==h.kk?new h.g.Rect(c,1E7,-1E7,1E7):this.Ia==h.Yd?new h.g.Rect(-1E7,1E7,-1E7,a):new h.g.Rect(-1E7,1E7,e,1E7)};h.Ji.Dr=function(a){h.Da.nh.call(this,null,"",a)};h.g.object.W(h.Ji.Dr,h.Da.nh);
h.Ed.register([".blocklyToolboxDelete {",'cursor: url("<<<PATH>>>/handdelete.cur"), auto;',"}",".blocklyToolboxGrab {",'cursor: url("<<<PATH>>>/handclosed.cur"), auto;',"cursor: grabbing;","cursor: -webkit-grabbing;","}",".blocklyToolboxDiv {","background-color: #ddd;","overflow-x: visible;","overflow-y: auto;","position: absolute;","z-index: 70;","-webkit-tap-highlight-color: transparent;","}",".blocklyTreeRoot {","padding: 4px 0;","}",".blocklyTreeRoot:focus {","outline: none;","}",".blocklyTreeRow {",
"height: 22px;","line-height: 22px;","margin-bottom: 3px;","padding-right: 8px;","white-space: nowrap;","}",".blocklyHorizontalTree {","float: left;","margin: 1px 5px 8px 0;","}",".blocklyHorizontalTreeRtl {","float: right;","margin: 1px 0 8px 5px;","}",'.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {',"margin-left: 8px;","}",".blocklyTreeRow:not(.blocklyTreeSelected):hover {","background-color: #e4e4e4;","}",".blocklyTreeSeparator {","border-bottom: solid #e5e5e5 1px;","height: 0;","margin: 5px 0;",
"}",".blocklyTreeSeparatorHorizontal {","border-right: solid #e5e5e5 1px;","width: 0;","padding: 5px 0;","margin: 0 5px;","}",".blocklyTreeIcon {","background-image: url(<<<PATH>>>/sprites.png);","height: 16px;","vertical-align: middle;","width: 16px;","}",".blocklyTreeIconClosedLtr {","background-position: -32px -1px;","}",".blocklyTreeIconClosedRtl {","background-position: 0 -1px;","}",".blocklyTreeIconOpen {","background-position: -16px -1px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedLtr {",
"background-position: -32px -17px;","}",".blocklyTreeSelected>.blocklyTreeIconClosedRtl {","background-position: 0 -17px;","}",".blocklyTreeSelected>.blocklyTreeIconOpen {","background-position: -16px -17px;","}",".blocklyTreeIconNone,",".blocklyTreeSelected>.blocklyTreeIconNone {","background-position: -48px -1px;","}",".blocklyTreeLabel {","cursor: default;","font-family: sans-serif;","font-size: 16px;","padding: 0 3px;","vertical-align: middle;","}",".blocklyToolboxDelete .blocklyTreeLabel {",
'cursor: url("<<<PATH>>>/handdelete.cur"), auto;',"}",".blocklyTreeSelected .blocklyTreeLabel {","color: #fff;","}"]);h.Cr=function(a){this.s=a;this.Si=[];if(!(0>=this.s.options.Mp)){a={scrollbars:!0,Ig:this.s.options.Ig,Nb:this.s,G:this.s.G,Ne:this.s.options.Ne,Tg:this.s.options.Tg};if(this.s.ie){a.Ia=this.s.Ia==h.wg?h.kk:h.wg;if(!h.El)throw Error("Missing require for Blockly.HorizontalFlyout");this.P=new h.El(a)}else{a.Ia=this.s.Ia==h.vg?h.Yd:h.vg;if(!h.yg)throw Error("Missing require for Blockly.VerticalFlyout");this.P=new h.yg(a)}cb(this.s,this.mG.bind(this))}};b=h.Cr.prototype;b.Vl=47;b.Xn=44;b.ck=16;b.dC=20;
b.Tv=20;b.vo=10;b.vr=0;b.wr=32;b.EB=.1;b.xt=!1;b.Np=0;b.N=null;b.kq=null;b.Ft=0;b.Rh=0;b.Wy=0;b.nA=0;
b.Oa=function(){this.N=h.g.o.L("g",{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var c=h.g.o.L("clipPath",{id:"blocklyTrashBodyClipPath"+a},this.N);h.g.o.L("rect",{width:this.Vl,height:this.Xn,y:this.ck},c);var d=h.g.o.L("image",{width:h.ik.width,x:-this.vr,height:h.ik.height,y:-this.wr,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.N);d.setAttributeNS(h.g.o.Mi,"xlink:href",this.s.options.ai+h.ik.url);c=h.g.o.L("clipPath",{id:"blocklyTrashLidClipPath"+a},this.N);
h.g.o.L("rect",{width:this.Vl,height:this.ck},c);this.kq=h.g.o.L("image",{width:h.ik.width,x:-this.vr,height:h.ik.height,y:-this.wr,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.N);this.kq.setAttributeNS(h.g.o.Mi,"xlink:href",this.s.options.ai+h.ik.url);h.ma(this.N,"mouseup",this,this.click);h.gd(d,"mouseover",this,this.XF);h.gd(d,"mouseout",this,this.VF);this.Jr();return this.N};
b.S=function(a){0<this.s.options.Mp&&(h.g.o.gj(this.P.Oa("svg"),x(this.s)),this.P.S(this.s),this.P.Py=function(){return!0});this.rq=this.dC+a;Sa(this,!1);return this.rq+this.Xn+this.ck};b.I=function(){this.N&&(h.g.o.removeNode(this.N),this.N=null);this.s=this.kq=null;clearTimeout(this.Ft)};
b.position=function(){if(this.rq){var a=this.s.Uc();a&&(this.Wy=a.Ia==h.Yd||this.s.ie&&!this.s.G?a.Bb+a.Pc-this.Vl-this.Tv-h.Ua.Zc:this.Tv+h.Ua.Zc,this.nA=a.Ia==h.kk?this.rq:a.Pb+a.fd-(this.Xn+this.ck)-this.rq,this.N.setAttribute("transform","translate("+this.Wy+","+this.nA+")"))}};b.Em=function(){if(!this.N)return null;var a=this.N.getBoundingClientRect(),c=a.top+this.wr-this.vo;a=a.left+this.vr-this.vo;return new h.g.Rect(c,c+this.ck+this.Xn+2*this.vo,a,a+this.Vl+2*this.vo)};
function Sa(a,c){a.xt!=c&&(clearTimeout(a.Ft),a.xt=c,a.Jr())}b.Jr=function(){this.Rh+=this.xt?.2:-.2;this.Rh=Math.min(Math.max(this.Rh,this.Np),1);Kd(this,45*this.Rh);this.N.style.opacity=.4+.4*this.Rh;this.Rh>this.Np&&1>this.Rh&&(this.Ft=setTimeout(this.Jr.bind(this),20))};function Kd(a,c){var d=a.s.Ia==h.vg||a.s.ie&&a.s.G;a.kq.setAttribute("transform","rotate("+(d?-c:c)+","+(d?4:a.Vl-4)+","+(a.ck-2)+")")}b.close=function(){Sa(this,!1)};
b.click=function(){if(this.Si.length){for(var a=[],c=0,d;d=this.Si[c];c++)a[c]=h.R.li(d);this.P.show(a)}};b.XF=function(){this.Si.length&&Sa(this,!0)};b.VF=function(){Sa(this,!1)};
b.mG=function(a){if(!(0>=this.s.options.Mp)&&a.type==h.i.Wn&&"shadow"!=a.bu.tagName.toLowerCase()){for(var c=a=a.bu.cloneNode(!0);c;){c.removeAttribute&&(c.removeAttribute("x"),c.removeAttribute("y"),c.removeAttribute("id"));var d=c.firstChild||c.nextSibling;if(!d)for(d=c.parentNode;d;){if(d.nextSibling){d=d.nextSibling;break}d=d.parentNode}c=d}a=h.R.Md(a);if(-1==this.Si.indexOf(a)){for(this.Si.unshift(a);this.Si.length>this.s.options.Mp;)this.Si.pop();this.Np=this.EB;Kd(this,45*this.Np)}}};h.xi=function(){h.xi.w.constructor.call(this)};h.g.object.W(h.xi,h.jo);h.xi.prototype.next=function(){var a=this.Sb;if(!a)return null;(a=a.next())&&J(this,a);return a};h.xi.prototype.Mm=function(){return null};h.xi.prototype.Wf=function(){var a=this.Sb;if(!a)return null;(a=a.Wf())&&J(this,a);return a};h.xi.prototype.jn=function(){return null};h.Cl=function(a){a.Uc=this.Hm.bind(this);a.ii=this.Zz.bind(this);this.s=new h.lb(a);this.s.ke=!0;this.s.Fu(new h.xi);this.s.Yz(new h.fh);this.G=!!a.G;this.ml=a.Ia;this.Os=[];this.Lp=[];this.cm=[];this.zd=[];this.ou=[];this.jl=this.s.Ug.C.mh};b=h.Cl.prototype;b.pk=!0;b.Qh=!1;b.Ri=!0;b.wb=8;b.eh=h.Cl.prototype.wb;b.BB=3*h.Cl.prototype.eh;b.CB=3*h.Cl.prototype.eh;b.qr=2;b.rb=0;b.Wc=0;b.xE=70;
b.Oa=function(a){this.N=h.g.o.L(a,{"class":"blocklyFlyout",style:"display: none"},null);this.Hc=h.g.o.L("path",{"class":"blocklyFlyoutBackground"},this.N);this.N.appendChild(this.s.Oa());this.s.jc.subscribe(this.Hc,"flyout","fill");this.s.jc.subscribe(this.Hc,"flyoutOpacity","fill-opacity");return this.N};
b.S=function(a){this.Ob=a;this.s.Jj=a;this.pc=new h.Ua(this.s,this.kf,!1,"blocklyFlyoutScrollbar");this.Ca();Array.prototype.push.apply(this.Os,h.ma(this.N,"wheel",this,this.yH));this.pk||(this.gp=this.Ps.bind(this),cb(this.Ob,this.gp));Array.prototype.push.apply(this.Os,h.ma(this.Hc,"mousedown",this,this.Xh));this.s.Ch=this.Ob.Ch.bind(this.Ob);this.s.Sa=this.Ob.Sa;a=this.s;a.bi=new h.Er(a)};
b.I=function(){this.Ca();h.$a(this.Os);this.gp&&(db(this.Ob,this.gp),this.gp=null);this.pc&&(this.pc.I(),this.pc=null);this.s&&(this.s.jc.unsubscribe(this.Hc),this.s.Jj=null,this.s.I(),this.s=null);this.N&&(h.g.o.removeNode(this.N),this.N=null);this.Ob=this.Hc=null};b.Qf=function(){return this.rb};b.ey=function(){return this.Wc};b.Ek=function(){return this.s};b.isVisible=function(){return this.Qh};b.Vb=function(a){var c=a!=this.isVisible();this.Qh=a;c&&this.On()};
b.Bj=function(a){var c=a!=this.Ri;this.Ri=a;c&&this.On()};b.On=function(){var a=this.Ri?this.isVisible():!1;this.N.style.display=a?"block":"none";this.pc.Bj(a)};b.Ca=function(){if(this.isVisible()){this.Vb(!1);for(var a=0,c;c=this.zd[a];a++)h.$a(c);this.zd.length=0;this.ci&&(db(this.s,this.ci),this.ci=null)}};
b.show=function(a){this.s.Gc(!1);this.Ca();Ld(this);if("string"==typeof a){a=this.s.Jj.Xu[a]||null;if("function"!=typeof a)throw TypeError("Couldn't find a callback function when opening a toolbox category.");a=a(this.s.Jj);if(!Array.isArray(a))throw TypeError("Result of toolbox category callback must be an array.");}this.Vb(!0);var c=[],d=[];this.ou.length=0;for(var e=this.kf?this.BB:this.CB,f=0,g;g=a[f];f++)if(g.tagName)switch(g.tagName.toUpperCase()){case "BLOCK":var k=h.R.Zi(g,this.s);k.isEnabled()||
this.ou.push(k);c.push({type:"block",block:k});g=parseInt(g.getAttribute("gap"),10);d.push(isNaN(g)?e:g);break;case "SEP":g=parseInt(g.getAttribute("gap"),10);!isNaN(g)&&0<d.length?d[d.length-1]=g:d.push(e);break;case "LABEL":case "BUTTON":k="LABEL"==g.tagName.toUpperCase();if(!h.zB)throw Error("Missing require for Blockly.FlyoutButton");g=new h.zB(this.s,this.Ob,g,k);c.push({type:"button",button:g});d.push(e)}Md(this,c,d);this.zd.push(h.ma(this.Hc,"mouseover",this,function(){for(var l=D(this.s,!1),
m=0,n;n=l[m];m++)n.qn()}));this.kf?this.Wc=0:this.rb=0;this.s.Gc(!0);this.vu();this.Ps();this.position();this.ci=this.vu.bind(this);cb(this.s,this.ci)};function Ld(a){for(var c=D(a.s,!1),d=0,e;e=c[d];d++)e.v==a.s&&e.I(!1,!1);for(d=0;d<a.Lp.length;d++)(c=a.Lp[d])&&h.g.o.removeNode(c);for(d=a.Lp.length=0;c=a.cm[d];d++)c.I();a.cm.length=0;a.s.bi.clear()}function Nd(a,c){return function(d){var e=a.Ob.Ch(d);e&&(ub(e,c),tb(e,d,a))}}b.Xh=function(a){var c=this.Ob.Ch(a);c&&tb(c,a,this)};b.Py=function(a){return a.isEnabled()};
function pb(a,c){var d=null;h.i.disable();var e=a.Ob.Kg();a.Ob.Gc(!1);try{var f=a.Ob;if(!c.ya())throw Error("oldBlock is not rendered.");var g=h.R.qh(c,!0);f.Gc(!1);var k=h.R.Zi(g,f);if(!k.ya())throw Error("block is not rendered.");var l=h.g.Gm(f.pb),m=h.g.Gm(a.s.pb),n=c.Qa();n.scale(a.s.scale);var t=h.g.K.sum(m,n),u=h.g.K.um(t,l);u.scale(1/f.scale);k.moveBy(u.x,u.y);d=k;h.oc()}finally{h.i.enable()}c=h.O.Xx(a.Ob,e);if(h.i.isEnabled())for(h.i.$(!0),h.i.Ka(new h.i.Re(d)),e=0;e<c.length;e++)h.i.Ka(new h.i.ze(c[e]));
a.pk?a.Ca():a.Ps();return d}b.Ps=function(){for(var a=D(this.s,!1),c=0,d;d=a[c];c++)if(-1==this.ou.indexOf(d))for(var e=ab(this.Ob,h.g.Us(d));d;)d.md(e),d=q(d)};
b.vu=function(){this.ci&&db(this.s,this.ci);this.s.scale=this.Ob.scale;for(var a=0,c=D(this.s,!1),d=0,e;e=c[d];d++){var f=H(e).width;e.M&&(f-=this.jl);a=Math.max(a,f)}for(d=0;e=this.cm[d];d++)a=Math.max(a,e.width);a+=1.5*this.eh+this.jl;a*=this.s.scale;a+=h.Ua.Zc;if(this.rb!=a){for(d=0;e=c[d];d++){if(this.G){f=e.Qa().x;var g=a/this.s.scale-this.eh;e.M||(g-=this.jl);e.moveBy(g-f,0)}e.Qx&&(f=e.Qx,g=e,e=H(g),f.setAttribute("width",e.width),f.setAttribute("height",e.height),g=g.Qa(),f.setAttribute("y",
g.y),f.setAttribute("x",this.G?g.x-e.width:g.x))}if(this.G)for(d=0;e=this.cm[d];d++)c=e.UL().y,e.moveTo(a/this.s.scale-e.width-this.eh-this.jl,c);this.rb=a;this.position()}this.ci&&cb(this.s,this.ci)};function nb(a){return a.pc?a.pc.isVisible():!1};h.yg=function(a){a.Uc=this.Hm.bind(this);a.ii=this.Zz.bind(this);h.yg.w.constructor.call(this,a);this.kf=!1};h.g.object.W(h.yg,h.Cl);b=h.yg.prototype;b.Hm=function(){if(!this.isVisible())return null;try{var a=this.s.pb.getBBox()}catch(f){a={height:0,y:0,width:0,x:0}}var c=this.qr,d=this.Wc-2*this.qr,e=this.rb;this.G||(e-=this.qr);return{Pb:d,Bb:e,ce:a.height*this.s.scale+2*this.eh,Hf:a.width*this.s.scale+2*this.eh,lc:-this.s.scrollY+a.y,dc:-this.s.scrollX,xc:a.y,Rc:a.x,fd:c,Pc:0}};
b.Zz=function(a){var c=this.Hm();c&&("number"==typeof a.y&&(this.s.scrollY=-c.ce*a.y),this.s.translate(this.s.scrollX+c.Pc,this.s.scrollY+c.fd))};
b.position=function(){if(this.isVisible()){var a=this.Ob.Uc();if(a){this.Wc=a.Pb;var c=this.rb-this.wb,d=a.Pb-2*this.wb,e=this.ml==h.vg,f=c+this.wb;f=["M "+(e?f:0)+",0"];f.push("h",e?-c:c);f.push("a",this.wb,this.wb,0,0,e?0:1,e?-this.wb:this.wb,this.wb);f.push("v",Math.max(0,d));f.push("a",this.wb,this.wb,0,0,e?0:1,e?this.wb:-this.wb,this.wb);f.push("h",e?c:-c);f.push("z");this.Hc.setAttribute("d",f.join(" "));c=this.Wc;a=this.Ob.Ia==this.ml?a.lA?this.ml==h.Yd?a.lA:a.Bb-this.rb:this.ml==h.Yd?0:a.Bb:
this.ml==h.Yd?0:a.Bb+a.Pc-this.rb;this.N.setAttribute("width",this.rb);this.N.setAttribute("height",c);"svg"==this.N.tagName?h.g.o.vn(this.N,"translate("+a+"px,0px)"):this.N.setAttribute("transform","translate("+a+",0)");this.pc&&(this.pc.ju=new h.g.K(a,0),this.pc.resize(),sa(this.pc,this.pc.Vf.x,this.pc.Vf.y))}}};b.yH=function(a){var c=h.g.ky(a);if(c.y){var d=this.Hm();c=d.lc-d.xc+c.y;c=Math.min(c,d.ce-d.Pb);c=Math.max(c,0);this.pc.set(c);h.aa.Ca()}a.preventDefault();a.stopPropagation()};
function Md(a,c,d){a.s.scale=a.Ob.scale;for(var e=a.eh,f=a.G?e:e+a.jl,g=0,k;k=c[g];g++)if("block"==k.type){k=k.block;for(var l=p(k,!1),m=0,n;n=l[m];m++)n.$b=!0;k.za();n=k.ya();l=H(k);m=k.M?f-a.jl:f;k.moveBy(m,e);var t=a,u=k,w=g;m=h.g.o.L("rect",{"fill-opacity":0,x:a.G?m-l.width:m,y:e,height:l.height,width:l.width},null);m.sf=u;h.H.qk(m);t.s.pb.insertBefore(m,u.ya());u.Qx=m;t.Lp[w]=m;t=a;t.zd.push(h.ma(n,"mousedown",null,Nd(t,k)));t.zd.push(h.ma(m,"mousedown",null,Nd(t,k)));t.zd.push(h.gd(n,"mouseover",
k,k.Jo));t.zd.push(h.gd(n,"mouseout",k,k.qn));t.zd.push(h.gd(m,"mouseover",k,k.Jo));t.zd.push(h.gd(m,"mouseout",k,k.qn));e+=l.height+d[g]}else"button"==k.type&&(l=a,m=k.button,n=f,t=e,u=m.Oa(),m.moveTo(n,t),m.show(),l.zd.push(h.ma(u,"mousedown",l,l.Xh)),l.cm.push(m),e+=k.button.height+d[g])}
b.Em=function(){if(!this.N)return null;var a=this.N.getBoundingClientRect(),c=a.left;if(this.ml==h.Yd)return new h.g.Rect(-1E9,1E9,-1E9,c+a.width);h.g.userAgent.Oq&&this.Ob&&this.Ob.lj&&(a=this.Ob.N.getBoundingClientRect().x,10>Math.abs(a-c)&&(c+=this.gM*this.Ob.options.Nb.scale));return new h.g.Rect(-1E9,1E9,c,1E9)};function Od(a,c,d,e){var f=W;this.name=a;this.Uw=c;this.fA=d;this.aH=e||0;this.ph=f;this.La=new h.g.K;this.reset();console.log(this+" loaded.")}b=Od.prototype;b.fH=!1;b.cf=!1;b.Ya=0;b.Hg=0;b.facing=0;b.speed=0;b.Lf=0;b.La=null;b.At=0;b.toString=function(){return"["+this.name+"]"};
b.reset=function(){delete this.fH;delete this.cf;delete this.speed;delete this.Lf;delete this.At;this.Ya=this.aH;this.La.x=this.fA.x;this.La.y=this.fA.y;this.facing=this.Hg=Uc(h.g.Ha.ll(Math.atan2(50-this.La.y,50-this.La.x)));var a=this.Uw;if("function"==typeof a)a=a();else if("string"!=typeof a)throw Error("Avatar "+this.name+" has invalid code: "+a);this.EF="Interpreter"in window?new Interpreter(a,this.ph.AF):null};function Pd(a,c){a.Ya+=c;100<=a.Ya&&Qd(a)}
function Qd(a){a.speed=0;a.cf=!0;a.Ya=100;a.ph.Ml.unshift(a);a.ph.Se.push({type:"DIE",avatar:a});console.log(a+" sinks.")}b.stop=function(){this.Lf=0};var W={Dd:[],Ml:[],Se:[],dk:[],AB:50,KC:100,xC:.5,bf:null,MA:1,Wv:3,ev:5,$A:5,Dq:3,Ez:0,fp:0,Uu:0,PC:3E5,Cs:null};W.JC=[new h.g.K(10,90),new h.g.K(90,10),new h.g.K(10,10),new h.g.K(90,90),new h.g.K(50,99),new h.g.K(50,1),new h.g.K(1,50),new h.g.K(99,50),new h.g.K(50,49)];W.reset=function(){clearTimeout(W.Ez);W.Se.length=0;W.dk.length=0;W.Ml.length=0;for(var a=W.Uu=0,c;c=W.Dd[a];a++)c.reset()};W.jD=function(a,c,d,e){d||(d=W.JC[W.Dd.length]);a=new Od(a,c,d,e);W.Dd.push(a)};
W.start=function(a){W.Cs=a;W.fp=Date.now()+W.PC;console.log("Starting battle with "+W.Dd.length+" avatars.");W.update()};W.update=function(){W.sH();W.tH();W.rH();W.Dd.length<=W.Ml.length+1&&(W.fp=Math.min(W.fp,Date.now()+1E3));Date.now()>W.fp?W.stop():W.Ez=setTimeout(W.update,1E3/W.AB)};W.stop=function(){for(var a=[],c=0,d;d=W.Dd[c];c++)d.cf||a.push(d);c=a.length;for(a.sort(function(e,f){return e.Ya-f.Ya});a.length;)W.Ml.unshift(a.pop());W.Cs&&W.Cs(c)};
W.tH=function(){for(var a=W.dk.length-1;0<=a;a--){var c=W.dk[a];c.progress+=W.Wv;var d=0;if(c.Wp-c.progress<W.Wv/2){W.dk.splice(a,1);for(var e=0,f;f=W.Dd[e];e++)if(!f.cf){var g=10*(1-h.g.K.bp(f.La,c.ym)/4);0<g&&(Pd(f,g),d=Math.max(d,g))}W.Se.push({type:"BOOM",damage:d,x:c.ym.x,y:c.ym.y})}}};
W.rH=function(){for(var a=0,c;c=W.Dd[a];a++)if(!c.cf&&(c.speed<c.Lf?c.speed=Math.min(c.speed+W.ev,c.Lf):c.speed>c.Lf&&(c.speed=Math.max(c.speed-W.ev,c.Lf)),0<c.speed)){var d=W.Tw(c),e=d[1],f=h.g.Ha.nd(c.Hg),g=c.speed/100*W.MA,k=Math.cos(f)*g;g*=Math.sin(f);c.La.x+=k;c.La.y+=g;0>c.La.x||100<c.La.x||0>c.La.y||100<c.La.y?(c.La.x=h.g.Ha.Ef(c.La.x,0,100),c.La.y=h.g.Ha.Ef(c.La.y,0,100),e=c.speed/100*W.Dq,Pd(c,e),c.speed=0,c.Lf=0,W.Se.push({type:"CRASH",avatar:c,damage:e})):(d=W.Tw(c),f=d[0],d=d[1],d<W.$A&&
e>d&&(c.La.x-=k,c.La.y-=g,e=Math.max(c.speed,f.speed)/100*W.Dq,Pd(c,e),c.speed=0,c.Lf=0,Pd(f,e),f.speed=0,f.Lf=0,W.Se.push({type:"CRASH",avatar:c,damage:e}),W.Se.push({type:"CRASH",avatar:f,damage:e})))}};W.sH=function(){for(var a=0;a<W.KC;a++){W.Uu++;for(var c=0,d;d=W.Dd[c];c++)if(!d.cf){W.bf=d;try{d.EF.step()}catch(e){console.log(d+" throws an error: "+e),Qd(d)}W.bf=null}}};
W.AF=function(a,c){var d=function(e,f){var g=e;e=W.bf;var k=void 0===f||null===f?5:f;if("number"!=typeof g||isNaN(g)||"number"!=typeof k||isNaN(k))throw TypeError();g=Uc(g);k=h.g.Ha.Ef(k,0,20);e.ph.Se.push({type:"SCAN",avatar:e,degree:g,resolution:k});f=Uc(g-k/2);g=Uc(g+k/2);f>g&&(g+=360);k=e.La.x;for(var l=e.La.y,m=Infinity,n=0,t;t=e.ph.Dd[n];n++)if(t!=e&&!t.cf){var u=t.La.x,w=t.La.y;t=Math.sqrt((w-l)*(w-l)+(u-k)*(u-k));t>=m||(u=Math.atan2(w-l,u-k),u=Uc(h.g.Ha.ll(u)),u<f&&(u+=360),f<=u&&u<=g&&(m=
t))}return m};a.setProperty(c,"scan",a.createNativeFunction(d));d=function(e,f){var g=f;f=W.bf;if("number"!=typeof e||isNaN(e)||"number"!=typeof g||isNaN(g))throw TypeError;var k=Date.now();f.At+1E3*f.ph.xC>k?e=!1:(f.At=k,k=new h.g.K(f.La.x,f.La.y),e=Uc(e),f.facing=e,g=h.g.Ha.Ef(g,0,70),e={qD:f,Cn:k,Hg:e,Wp:g,ym:new h.g.K(k.x+g*Math.cos(h.g.Ha.nd(e)),k.y+g*Math.sin(h.g.Ha.nd(e))),progress:0},f.ph.dk.push(e),f.ph.Se.push({type:"BANG",avatar:f,degree:e.Hg}),e=!0);return e};a.setProperty(c,"cannon",
a.createNativeFunction(d));d=function(e,f){var g=W.bf;f=void 0===f||null===f?50:f;if("number"!=typeof e||isNaN(e)||"number"!=typeof f||isNaN(f))throw TypeError;g.Hg!=Uc(e)&&(50>=g.speed?(g.Hg=Uc(e),g.facing=g.Hg):f=0);0==g.speed&&0<f&&(g.speed=.1);g.Lf=h.g.Ha.Ef(f,0,100)};a.setProperty(c,"drive",a.createNativeFunction(d));a.setProperty(c,"swim",a.createNativeFunction(d));a.setProperty(c,"stop",a.createNativeFunction(function(){W.bf.stop()}));a.setProperty(c,"damage",a.createNativeFunction(function(){return W.bf.Ya}));
a.setProperty(c,"health",a.createNativeFunction(function(){return 100-W.bf.Ya}));a.setProperty(c,"speed",a.createNativeFunction(function(){return W.bf.speed}));d=function(){return W.bf.La.x};a.setProperty(c,"loc_x",a.createNativeFunction(d));a.setProperty(c,"getX",a.createNativeFunction(d));d=function(){return W.bf.La.y};a.setProperty(c,"loc_y",a.createNativeFunction(d));a.setProperty(c,"getY",a.createNativeFunction(d));if(c=a.getProperty(c,"Math"))d=function(e){return Math.sin(h.g.Ha.nd(e))},a.setProperty(c,
"sin_deg",a.createNativeFunction(d)),d=function(e){return Math.cos(h.g.Ha.nd(e))},a.setProperty(c,"cos_deg",a.createNativeFunction(d)),d=function(e){return Math.tan(h.g.Ha.nd(e))},a.setProperty(c,"tan_deg",a.createNativeFunction(d)),d=function(e){return h.g.Ha.ll(Math.asin(e))},a.setProperty(c,"asin_deg",a.createNativeFunction(d)),d=function(e){return h.g.Ha.ll(Math.acos(e))},a.setProperty(c,"acos_deg",a.createNativeFunction(d)),d=function(e){return h.g.Ha.ll(Math.atan(e))},a.setProperty(c,"atan_deg",
a.createNativeFunction(d))};W.Tw=function(a){for(var c=null,d=Infinity,e=0,f;f=W.Dd[e];e++)if(!f.cf&&a!=f){var g=Math.min(d,h.g.K.bp(a.La,f.La));g<d&&(d=g,c=f)}return[c,d]};var Rd,Sd,Td,Ud={},Vd=[],Wd=new Image;Wd.src="pond/sprites.png";var Xd=["#ff8b00","#c90015","#166c0b","#223068"],Yd=0,Zd=Object.create(null);
function $d(){Rd=document.getElementById("scratch").getContext("2d");var a=document.getElementById("display").getContext("2d");Sd=a;Td=a.canvas.width;a.globalCompositeOperation="copy";ae(["pond/whack.mp3","pond/whack.ogg"],"whack");ae(["pond/boom.mp3","pond/boom.ogg"],"boom");ae(["pond/splash.mp3","pond/splash.ogg"],"splash");if(!h.g.userAgent.qg&&!h.g.userAgent.Rq)for(var c in Zd)a=Zd[c],a.volume=.01,a.play(),a.pause()}
function be(){clearTimeout(Yd);Vd.length=0;var a=document.getElementById("avatarStatRow1");a.innerHTML="";var c=document.getElementById("avatarStatRow2");c.innerHTML="";for(var d=[],e=[],f=0,g;g=W.Dd[f];f++){var k=Math.floor(f/2)%2?c:a,l=Xd[f%Xd.length];g.uA=f;var m=document.createElement("td");m.style.borderColor=l;var n=document.createElement("div");n.className="avatarStatHealth";n.style.background=l;g.xH=n;e[f]=n;m.appendChild(n);n=document.createElement("div");n.className="avatarStatName";g=document.createTextNode(g.name);
n.appendChild(g);d[f]=n;m.appendChild(n);n=document.createElement("div");g=document.createTextNode("\u00a0");n.appendChild(g);m.appendChild(n);k.appendChild(m)}for(f=0;n=d[f];f++)n.style.width=n.parentNode.offsetWidth-2+"px";for(f=0;n=e[f];f++)n.style.height=n.parentNode.offsetHeight-2+"px";ce()}var de=0,ee=0;function fe(){ce();var a=Date.now(),c=Math.max(1,1E3/36-(a-de-ee));Yd=setTimeout(fe,c);de=a;ee=c}function ge(a){return a/100*(Td-35)+17.5}
function ce(){var a=Rd;a.beginPath();a.rect(0,0,a.canvas.width,a.canvas.height);a.fillStyle="#527dbf";a.fill();for(var c=[],d=0,e;e=W.Dd[d];d++)e.cf&&c.push(e);for(d=0;e=W.Dd[d];d++)e.cf||c.push(e);for(d=0;e=c[d];d++){a.save();var f=ge(e.La.x),g=ge(100-e.La.y);a.translate(f,g);var k=e.uA%Xd.length*35;e.cf&&(a.globalAlpha=.25);0<e.speed&&(a.save(),f=50<e.speed?0:25<e.speed?35:70,a.rotate(h.g.Ha.nd(-e.Hg)),a.drawImage(Wd,455,f,35,35,-45.5,-17.5,35,35),a.restore());a.drawImage(Wd,0,k,35,35,-17.5,-17.5,
35,35);f=h.g.Ha.nd(e.facing);a.translate(12*Math.cos(f),12*-Math.sin(f)-2);f=(14-Math.round(e.facing/360*12))%12+1;e=e.facing%30;15<=e&&(e-=30);e/=1.5;a.rotate(h.g.Ha.nd(-e));a.drawImage(Wd,35*f,k,35,35,-15.5,-15.5,35,35);a.restore()}for(d=0;e=W.dk[d];d++){a.save();g=e.progress/e.Wp;k=(e.ym.y-e.Cn.y)*-g;f=e.Wp/2;var l=.15*e.Wp;f=l-Math.pow((e.progress-f)/Math.sqrt(l)*l/f,2);g=ge(e.Cn.x+(e.ym.x-e.Cn.x)*g);l=ge(100-e.Cn.y+k-f);k=ge(100-e.Cn.y+k);a.beginPath();a.arc(g,k,5*Math.max(0,1-f/10),0,2*Math.PI,
!0);a.closePath();a.fillStyle="rgba(128, 128, 128, "+Math.max(0,1-f/10)+")";a.fill();a.beginPath();a.arc(g,l,5,0,2*Math.PI,!0);a.closePath();a.fillStyle=Xd[e.qD.uA%Xd.length];a.fill()}for(d=0;d<W.Se.length;d++)if(f=W.Se[d],e=f.avatar,"CRASH"==f.type){if(k=Ud[e.id],!k||k+1E3<Date.now())he("whack",f.damage/W.Dq),Ud[e.id]=Date.now()}else"SCAN"==f.type?(g=Math.max(f.resolution/2,.5),k=-h.g.Ha.nd(f.degree+g),l=-h.g.Ha.nd(f.degree-g),a.beginPath(),f=ge(e.La.x),g=ge(100-e.La.y),a.moveTo(f,g),a.lineTo(f+
200*Math.cos(k),g+200*Math.sin(k)),a.arc(f,g,200,k,l),a.lineTo(f,g),e=a.createRadialGradient(f,g,17.5,f,g,200),e.addColorStop(0,"rgba(255, 255, 255, 0.3)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),a.fillStyle=e,a.fill()):"BANG"!=f.type&&("BOOM"==f.type?(f.damage&&he("boom",f.damage/10),Vd.push({x:f.x,y:f.y,t:0})):"DIE"==f.type&&he("splash"));W.Se.length=0;for(d=Vd.length-1;0<=d;d--)e=Vd[d],f=ge(e.x),g=ge(100-e.y),a.beginPath(),a.arc(f,g,e.t+1,0,2*Math.PI,!0),a.closePath(),a.lineWidth=5,a.strokeStyle=
"rgba(255, 255, 255, "+(1-e.t/10)+")",a.stroke(),e.t+=2,10<e.t&&Vd.splice(d,1);Sd.drawImage(a.canvas,0,0);for(d=0;e=c[d];d++)a=e.xH,a.parentNode.title=e.name+": "+Math.round(100-e.Ya)+"%",a.style.width=Math.max(0,a.parentNode.offsetWidth*(1-e.Ya/100)-2)+"px"}function ae(a,c){if(window.Audio&&a.length){for(var d,e=new window.Audio,f=0;f<a.length;f++){var g=a[f],k=g.match(/\.(\w+)$/);if(k&&e.canPlayType("audio/"+k[1])){d=new window.Audio(g);break}}d&&d.play&&(Zd[c]=d)}}
function he(a,c){a=Zd[a];a=h.g.userAgent.qg||h.g.userAgent.pi?a:a.cloneNode();a.volume=void 0===c?1:c;a.play()};var ie=null,je=!1;function ke(){if(!je){var a=document.getElementById("docsButton"),c=document.getElementById("dialogDocs"),d=document.getElementById("frameDocs"),e="pond/docs.html?lang="+Ic+"&mode="+R;d.src!=e&&(d.src=e);je=!0;T.Th(a,!1,.2);T.Th(c,!0,.8);setTimeout(function(){c.style.visibility="visible";document.getElementById("dialogBorder").style.visibility="hidden"},175)}}
function le(){if(je){var a=document.getElementById("docsButton"),c=document.getElementById("dialogDocs");je=!1;T.Th(c,!1,.8);T.Th(a,!0,.2);setTimeout(function(){document.getElementById("dialogBorder").style.visibility="hidden"},175);c.style.visibility="hidden"}}function me(a){if(!V.Nf(a)){a=document.getElementById("runButton");var c=document.getElementById("resetButton");c.style.minWidth||(c.style.minWidth=a.offsetWidth+"px");a.style.display="none";c.style.display="inline";ne()}}
function oe(a){V.Nf(a)||(document.getElementById("runButton").style.display="inline",document.getElementById("resetButton").style.display="none",W.reset(),be())}function ne(){"Interpreter"in window?(W.reset(),be(),W.start(ie),fe()):setTimeout(ne,250)}function re(){var a=document.getElementById("help"),c=document.getElementById("helpButton");T.fl(a,c,!0,!0,{width:"50%",left:"25%",top:"5em"},T.Su);T.Pu()};h.Ja=function(a,c,d){"function"!=typeof a&&h.Ja.qA(a);this.qj=a;this.kp=null;this.tn=0;this.Tu=this.qu=null;a=this.qj;if(Array.isArray(a)){for(var e=!1,f=0;f<a.length;f++){var g=a[f][0];"string"==typeof g?a[f][0]=h.g.le(g):(null!=g.alt&&(a[f][0].alt=h.g.le(g.alt)),e=!0)}if(!(e||2>a.length)){e=[];for(f=0;f<a.length;f++)e.push(a[f][0]);f=h.g.fb.Mu(e);g=h.g.fb.PD(e,f);var k=h.g.fb.QD(e,f);!g&&!k||f<=g+k||(g&&(this.qu=e[0].substring(0,g-1)),k&&(this.Tu=e[0].substr(1-k)),this.qj=h.Ja.oD(a,g,k))}}a=this.getOptions(!1)[0];
h.Ja.w.constructor.call(this,a[1],c,d);this.bl=this.Hh=null};h.g.object.W(h.Ja,h.Na);h.Ja.va=function(a){return new h.Ja(a.options,void 0,a)};h.Ja.prototype.Hi=!0;h.Ja.WH=25;h.Ja.BJ=.45;h.Ja.Kv=5;h.Ja.KB=2*h.Ja.Kv;h.Ja.nv=h.g.userAgent.pi?"\u25bc":"\u25be";b=h.Ja.prototype;b.Hq="default";
b.Jh=function(){h.Ja.w.Jh.call(this);this.Hh=h.g.o.L("image",{y:h.Ja.Kv},this.gf);this.Xe=h.g.o.L("tspan",{},this.ic);this.Xe.appendChild(document.createTextNode(this.B.G?h.Ja.nv+" ":" "+h.Ja.nv));this.B.G?this.ic.insertBefore(this.Xe,this.Kj):this.ic.appendChild(this.Xe)};b.qf=function(){this.Qg=this.Ls();this.Qg.za(h.D.Zx());h.g.o.Cb(this.Qg.ta(),"blocklyDropdownMenu");h.D.bA(this,this.Ms.bind(this));this.Qg.focus();this.bl&&h.g.style.Eu(this.bl.ta(),this.Qg.ta())};
b.Ls=function(){var a=new h.Ai;ea(a,this.B.G);a.ag("listbox");var c=this.getOptions(!1);this.bl=null;for(var d=0;d<c.length;d++){var e=c[d][0],f=c[d][1];if("object"==typeof e){var g=new Image(e.width,e.height);g.src=e.src;g.alt=e.alt||"";e=g}e=new h.wo(e);e.ag("option");ea(e,this.B.G);e.setValue(f);e.dm=!0;a.Zl(e,a.kb.length,!0);Xb(e,f==this.cc);f==this.cc&&(this.bl=e);Yb(e,this.jF,this)}h.g.V.Gb(a.ta(),h.g.V.State.iv,this.bl?this.bl.ua():"");return a};b.Ms=function(){this.Qg.I();this.Qg=null};
b.jF=function(a){h.D.Hk(this,!0);this.vz(a)};b.vz=function(a){this.setValue(a.getValue())};h.Ja.oD=function(a,c,d){for(var e=[],f=0;f<a.length;f++){var g=a[f][0],k=a[f][1];g=g.substring(c,g.length-d);e[f]=[g,k]}return e};b=h.Ja.prototype;b.getOptions=function(a){return"function"==typeof this.qj?(this.kp&&a||(this.kp=this.qj.call(this),h.Ja.qA(this.kp)),this.kp):this.qj};
b.wh=function(a){for(var c=!1,d=this.getOptions(!0),e=0,f;f=d[e];e++)if(f[1]==a){c=!0;break}return c?a:(this.B&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.B.type+", Field name: "+this.name+", Value: "+a),null)};b.Yi=function(a){h.Ja.w.Yi.call(this,a);a=this.getOptions(!0);for(var c=0,d;d=a[c];c++)d[1]==this.cc&&(this.tn=c)};b.Qe=function(){this.B&&this.Xe&&(this.Xe.style.fill=this.B.cb?Hb(this.B):this.B.sh)};
b.Yf=function(){this.Kj.nodeValue="";this.Hh.style.display="none";var a=this.getOptions(!0),c=0<=this.tn&&a[this.tn][0];if(c&&"object"==typeof c){this.Hh.style.display="";this.Hh.setAttributeNS(h.g.o.Mi,"xlink:href",c.src);this.Hh.setAttribute("height",c.height);this.Hh.setAttribute("width",c.width);a=h.g.o.ct(this.Xe);var d=Number(c.width);this.bc.height=Number(c.height)+h.Ja.KB;this.bc.width=d+a+h.Na.Yl;this.B.G?(c=h.Na.wi-1,this.Hh.setAttribute("x",h.Na.wi+a),this.ic.setAttribute("x",c)):(c=d+
a+h.Na.wi+1,this.ic.setAttribute("text-anchor","end"),this.ic.setAttribute("x",c),this.Hh.setAttribute("x",h.Na.wi))}else this.Kj.nodeValue=yb(this),this.ic.setAttribute("text-anchor","start"),this.ic.setAttribute("x",h.Na.wi),this.bc.height=h.Na.tv,this.bc.width=h.g.o.ct(this.ic)+h.Na.Yl;this.Oi.setAttribute("height",this.bc.height);this.Oi.setAttribute("width",this.bc.width)};b.dt=function(){if(0>this.tn)return null;var a=this.getOptions(!0)[this.tn][0];return"object"==typeof a?a.alt:a};
h.Ja.qA=function(a){if(!Array.isArray(a))throw TypeError("FieldDropdown options must be an array.");if(!a.length)throw TypeError("FieldDropdown options must not be an empty array.");for(var c=!1,d=0;d<a.length;++d){var e=a[d];Array.isArray(e)?"string"!=typeof e[1]?(c=!0,console.error("Invalid option["+d+"]: Each FieldDropdown option id must be a string. Found "+e[1]+" in: ",e)):e[0]&&"string"!=typeof e[0]&&"string"!=typeof e[0].src&&(c=!0,console.error("Invalid option["+d+"]: Each FieldDropdown option must have a string label or image description. Found"+
e[0]+" in: ",e)):(c=!0,console.error("Invalid option["+d+"]: Each FieldDropdown option must be an array. Found: ",e))}if(c)throw TypeError("Found invalid FieldDropdown options.");};h.Ja.prototype.Wh=function(a){if(this.Qg){if(a===h.navigation.wq)return Tb(this.Qg),!0;if(a===h.navigation.vq)return Rb(this.Qg),!0}return h.Ja.w.Wh.call(this,a)};h.Tc.register("field_dropdown",h.Ja);h.xb=function(a,c,d){this.Bn=!0;null==a&&(a="");h.xb.w.constructor.call(this,a,c,d)};h.g.object.W(h.xb,h.Na);h.xb.va=function(a){var c=h.g.le(a.text);return new h.xb(c,void 0,a)};h.xb.prototype.Hi=!0;h.xb.wB=11;h.xb.PA=4;b=h.xb.prototype;b.Hq="text";b.Kd=function(a){h.xb.w.Kd.call(this,a);"boolean"==typeof a.spellcheck&&(this.Bn=a.spellcheck)};b.wh=function(a){return null===a||void 0===a?null:String(a)};
b.Ex=function(){if(this.Nk){this.yt=!1;var a=this.cc;this.cc=this.Xc.qH;this.B&&h.i.isEnabled()&&h.i.Ka(new h.i.hg(this.B,"field",this.name||null,a,this.cc))}};b.Yi=function(a){this.yt=!0;this.cc=a;this.Nk||(this.Sf=!0)};b.Yf=function(){h.xb.w.Yf.call(this);this.Nk&&(this.B.G?setTimeout(this.aq.bind(this),0):this.aq(),this.yt?(h.g.o.Ec(this.Xc,"blocklyInvalidInput"),h.g.V.Gb(this.Xc,"invalid",!1)):(h.g.o.Cb(this.Xc,"blocklyInvalidInput"),h.g.V.Gb(this.Xc,"invalid",!0)))};
function se(a){0!=a.Bn&&(a.Bn=!1,a.Xc&&a.Xc.setAttribute("spellcheck",a.Bn))}b.qf=function(a){this.s=this.B.v;a=a||!1;!a&&(h.g.userAgent.Xv||h.g.userAgent.pi||h.g.userAgent.qg)?te(this):(h.aa.show(this,this.B.G,this.zH.bind(this)),this.Xc=this.cv(),this.Nk=!0,a||(this.Xc.focus(),this.Xc.select()))};function te(a){h.prompt(h.h.CHANGE_VALUE_TITLE,a.Tb(),function(c){a.setValue(c)})}
b.cv=function(){var a=h.aa.Fa,c=document.createElement("input");c.className="blocklyHtmlInput";c.setAttribute("spellcheck",this.Bn);var d=h.xb.wB*this.s.scale+"pt";a.style.fontSize=d;c.style.fontSize=d;c.style.borderRadius=h.xb.PA*this.s.scale+"px";a.appendChild(c);c.value=c.defaultValue=String(this.cc);c.qH=this.cc;c.pz=null;h.g.userAgent.Oq?setTimeout(this.aq.bind(this),0):this.aq();this.gu=h.ma(c,"keydown",this,this.du);this.qG=h.ma(c,"input",this,this.oG);return c};
b.zH=function(){this.Nk=!1;this.yt=!0;zb(this);this.cu&&this.cu(this.cc);h.$a(this.gu);h.$a(this.qG);var a=h.aa.Fa.style;a.width="auto";a.height="auto";a.fontSize=""};b.du=function(a){a.keyCode==h.g.Ba.Kq?(h.aa.Ca(),h.D.Ik()):a.keyCode==h.g.Ba.Lq?(this.Xc.value=this.Xc.defaultValue,h.aa.Ca(),h.D.Ik()):a.keyCode==h.g.Ba.qw&&(h.aa.Ca(),h.D.Ik(),mc(this.B,this,!a.shiftKey),a.preventDefault())};b.oG=function(){var a=this.Xc.value;a!==this.Xc.pz&&(this.Xc.pz=a,h.i.$(!0),this.setValue(a),zb(this),h.i.$(!1))};
b.aq=function(){var a=h.aa.Fa;var c=this.Oi.getBBox();var d=c.height*this.B.v.scale;var e=c.width*this.B.v.scale;var f=h.g.style.pp(this.Oi);c=f.y;d=f.y+d;var g=f.x;e=f.x+e;a.style.width=e-g+"px";a.style.height=d-c+"px";c=new h.g.K(this.B.G?e-a.offsetWidth:g,c);c.y+=1;h.g.userAgent.Oq&&h.aa.Fa.style.top&&(--c.x,--c.y);h.g.userAgent.Fr&&(c.y-=3);a.style.left=c.x+"px";a.style.top=c.y+"px"};
h.xb.hG=function(a){console.warn("Blockly.FieldTextInput.numberValidator is deprecated. Use Blockly.FieldNumber instead.");if(null===a)return null;a=String(a);a=a.replace(/O/ig,"0");a=a.replace(/,/g,"");a=Number(a||0);return isNaN(a)?null:String(a)};h.xb.iM=function(a){(a=h.xb.hG(a))&&(a=String(Math.max(0,Math.floor(a))));return a};h.xb.prototype.Sy=function(){return!0};h.xb.prototype.dt=function(){return this.Nk&&this.Xc?this.Xc.value:null};h.Tc.register("field_input",h.xb);h.Gd=function(a,c,d,e,f,g){this.dn=-Infinity;this.an=Infinity;this.Xk=0;this.ns=null;h.Gd.w.constructor.call(this,a||0,f,g);g||(ue(this,c),ve(this,d),we(this,e),this.setValue(this.getValue()))};h.g.object.W(h.Gd,h.xb);h.Gd.va=function(a){return new h.Gd(a.value,void 0,void 0,void 0,void 0,a)};h.Gd.prototype.Hi=!0;h.Gd.prototype.Kd=function(a){h.Gd.w.Kd.call(this,a);ue(this,a.min);ve(this,a.max);we(this,a.precision)};function ue(a,c){null==c?a.dn=-Infinity:(c=Number(c),isNaN(c)||(a.dn=c))}
function ve(a,c){null==c?a.an=Infinity:(c=Number(c),isNaN(c)||(a.an=c))}function we(a,c){null==c?a.Xk=0:(c=Number(c),isNaN(c)||(a.Xk=c));var d=a.Xk.toString(),e=d.indexOf(".");a.ns=-1==e?c?0:null:d.length-e-1}h.Gd.prototype.wh=function(a){if(null===a)return null;a=String(a);a=a.replace(/O/ig,"0");a=a.replace(/,/g,"");a=Number(a||0);if(isNaN(a))return null;a=Math.min(Math.max(a,this.dn),this.an);this.Xk&&isFinite(a)&&(a=Math.round(a/this.Xk)*this.Xk);null!=this.ns&&(a=Number(a.toFixed(this.ns)));return a};
h.Gd.prototype.cv=function(){var a=h.Gd.w.cv.call(this);-Infinity<this.dn&&h.g.V.Gb(a,h.g.V.State.VC,this.dn);Infinity>this.an&&h.g.V.Gb(a,h.g.V.State.UC,this.an);return a};h.Tc.register("field_number",h.Gd);h.Hd=function(a,c,d,e,f){this.qj=h.Hd.zE;this.iE=a||"";this.bc=new h.g.Ve(0,h.wa.Yq);f&&this.Kd(f);c&&(this.Oj=c);f||xe(this,d,e)};h.g.object.W(h.Hd,h.Ja);h.Hd.va=function(a){var c=h.g.le(a.variable);return new h.Hd(c,void 0,void 0,void 0,a)};b=h.Hd.prototype;b.s=null;b.Hi=!0;b.Kd=function(a){h.Hd.w.Kd.call(this,a);xe(this,a.variableTypes,a.defaultType)};b.fj=function(){if(!this.Ud){var a=h.O.op(this.B.v,null,this.iE,this.hE);h.i.disable();this.setValue(a.ua());h.i.enable()}};
b.Cm=function(a){var c=a.getAttribute("id"),d=a.textContent,e=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";c=h.O.op(this.B.v,c,d,e);if(null!=e&&e!==c.type)throw Error("Serialized variable type with id '"+c.ua()+"' had type "+c.type+", and does not match variable field that references it: "+h.R.Md(a)+".");this.setValue(c.ua())};b.kA=function(a){this.fj();a.id=this.Ud.ua();a.textContent=this.Ud.name;this.Ud.type&&a.setAttribute("variabletype",this.Ud.type);return a};
b.Lu=function(a){if(a.cb)throw Error("Variable fields are not allowed to exist on shadow blocks.");h.Hd.w.Lu.call(this,a)};b.getValue=function(){return this.Ud?this.Ud.ua():null};b.Tb=function(){return this.Ud?this.Ud.name:""};b.Vc=function(){return this.Ud};b.sy=function(){return this.Ud?this.Oj:null};
b.wh=function(a){if(null===a)return null;var c=h.O.Vc(this.B.v,a);if(!c)return console.warn("Variable id doesn't point to a real variable! ID was "+a),null;c=c.type;var d;a:if(d=ye(this)){for(var e=0;e<d.length;e++)if(c==d[e]){d=!0;break a}d=!1}else d=!0;return d?a:(console.warn("Variable type doesn't match this field! Type was "+c),null)};b.Yi=function(a){this.Ud=h.O.Vc(this.B.v,a);h.Hd.w.Yi.call(this,a)};
function ye(a){var c=a.uH;if(null===c&&a.B&&a.B.v)return a.B.v.ft();c=c||[""];if(0==c.length)throw a=a.Tb(),Error("'variableTypes' of field variable "+a+" was an empty list");return c}
function xe(a,c,d){d=d||"";if(null==c||void 0==c)c=null;else if(Array.isArray(c)){for(var e=!1,f=0;f<c.length;f++)c[f]==d&&(e=!0);if(!e)throw Error("Invalid default type '"+d+"' in the definition of a FieldVariable");}else throw Error("'variableTypes' was not an array in the definition of a FieldVariable");a.hE=d;a.uH=c}
h.Hd.zE=function(){if(!this.Ud)throw Error("Tried to call dropdownCreate on a variable field with no variable selected.");var a=this.Tb(),c=[];if(this.B&&this.B.v)for(var d=ye(this),e=0;e<d.length;e++)c=c.concat(this.B.v.Im(d[e]));c.sort(h.Ul.Zw);d=[];for(e=0;e<c.length;e++)d[e]=[c[e].name,c[e].ua()];d.push([h.h.RENAME_VARIABLE,h.lw]);h.h.DELETE_VARIABLE&&d.push([h.h.DELETE_VARIABLE.replace("%1",a),h.Ev]);return d};
h.Hd.prototype.vz=function(a){a=a.getValue();if(this.B&&this.B.v){if(a==h.lw){h.O.$p(this.B.v,this.Ud);return}if(a==h.Ev){this.B.v.Kf(this.Ud.ua());return}}this.setValue(a)};h.Hd.prototype.pn=function(){return!0};h.Tc.register("field_variable",h.Hd);h.J.Ha={};h.la={};h.la.Math={};h.la.Math.oo=230;
h.zk([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",style:"math_blocks",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ADDITION_SYMBOL}","ADD"],["%{BKY_MATH_SUBTRACTION_SYMBOL}","MINUS"],["%{BKY_MATH_MULTIPLICATION_SYMBOL}","MULTIPLY"],
["%{BKY_MATH_DIVISION_SYMBOL}","DIVIDE"],["%{BKY_MATH_POWER_SYMBOL}","POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ARITHMETIC_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_single",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_SINGLE_OP_ROOT}","ROOT"],["%{BKY_MATH_SINGLE_OP_ABSOLUTE}","ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",
name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_SINGLE_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_trig",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_TRIG_SIN}","SIN"],["%{BKY_MATH_TRIG_COS}","COS"],["%{BKY_MATH_TRIG_TAN}","TAN"],["%{BKY_MATH_TRIG_ASIN}","ASIN"],["%{BKY_MATH_TRIG_ACOS}","ACOS"],["%{BKY_MATH_TRIG_ATAN}","ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_TRIG_HELPURL}",
extensions:["math_op_tooltip"]},{type:"math_constant",message0:"%1",args0:[{type:"field_dropdown",name:"CONSTANT",options:[["\u03c0","PI"],["e","E"],["\u03c6","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(\u00bd)","SQRT1_2"],["\u221e","INFINITY"]]}],output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTANT_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTANT_HELPURL}"},{type:"math_number_property",message0:"%1 %2",args0:[{type:"input_value",name:"NUMBER_TO_CHECK",check:"Number"},{type:"field_dropdown",name:"PROPERTY",
options:[["%{BKY_MATH_IS_EVEN}","EVEN"],["%{BKY_MATH_IS_ODD}","ODD"],["%{BKY_MATH_IS_PRIME}","PRIME"],["%{BKY_MATH_IS_WHOLE}","WHOLE"],["%{BKY_MATH_IS_POSITIVE}","POSITIVE"],["%{BKY_MATH_IS_NEGATIVE}","NEGATIVE"],["%{BKY_MATH_IS_DIVISIBLE_BY}","DIVISIBLE_BY"]]}],inputsInline:!0,output:"Boolean",style:"math_blocks",tooltip:"%{BKY_MATH_IS_TOOLTIP}",mutator:"math_is_divisibleby_mutator"},{type:"math_change",message0:"%{BKY_MATH_CHANGE_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_MATH_CHANGE_TITLE_ITEM}"},
{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,style:"variable_blocks",helpUrl:"%{BKY_MATH_CHANGE_HELPURL}",extensions:["math_change_tooltip"]},{type:"math_round",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ROUND_OPERATOR_ROUND}","ROUND"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDUP}","ROUNDUP"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDDOWN}","ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",
helpUrl:"%{BKY_MATH_ROUND_HELPURL}",tooltip:"%{BKY_MATH_ROUND_TOOLTIP}"},{type:"math_on_list",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ONLIST_OPERATOR_SUM}","SUM"],["%{BKY_MATH_ONLIST_OPERATOR_MIN}","MIN"],["%{BKY_MATH_ONLIST_OPERATOR_MAX}","MAX"],["%{BKY_MATH_ONLIST_OPERATOR_AVERAGE}","AVERAGE"],["%{BKY_MATH_ONLIST_OPERATOR_MEDIAN}","MEDIAN"],["%{BKY_MATH_ONLIST_OPERATOR_MODE}","MODE"],["%{BKY_MATH_ONLIST_OPERATOR_STD_DEV}","STD_DEV"],["%{BKY_MATH_ONLIST_OPERATOR_RANDOM}",
"RANDOM"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ONLIST_HELPURL}",mutator:"math_modes_of_list_mutator",extensions:["math_op_tooltip"]},{type:"math_modulo",message0:"%{BKY_MATH_MODULO_TITLE}",args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_MODULO_TOOLTIP}",helpUrl:"%{BKY_MATH_MODULO_HELPURL}"},{type:"math_constrain",
message0:"%{BKY_MATH_CONSTRAIN_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LOW",check:"Number"},{type:"input_value",name:"HIGH",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTRAIN_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTRAIN_HELPURL}"},{type:"math_random_int",message0:"%{BKY_MATH_RANDOM_INT_TITLE}",args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,
output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_INT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_INT_HELPURL}"},{type:"math_random_float",message0:"%{BKY_MATH_RANDOM_FLOAT_TITLE_RANDOM}",output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_FLOAT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_FLOAT_HELPURL}"},{type:"math_atan2",message0:"%{BKY_MATH_ATAN2_TITLE}",args0:[{type:"input_value",name:"X",check:"Number"},{type:"input_value",name:"Y",check:"Number"}],inputsInline:!0,output:"Number",
style:"math_blocks",tooltip:"%{BKY_MATH_ATAN2_TOOLTIP}",helpUrl:"%{BKY_MATH_ATAN2_HELPURL}"}]);
h.la.Math.Ar={ADD:"%{BKY_MATH_ARITHMETIC_TOOLTIP_ADD}",MINUS:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MINUS}",MULTIPLY:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MULTIPLY}",DIVIDE:"%{BKY_MATH_ARITHMETIC_TOOLTIP_DIVIDE}",POWER:"%{BKY_MATH_ARITHMETIC_TOOLTIP_POWER}",ROOT:"%{BKY_MATH_SINGLE_TOOLTIP_ROOT}",ABS:"%{BKY_MATH_SINGLE_TOOLTIP_ABS}",NEG:"%{BKY_MATH_SINGLE_TOOLTIP_NEG}",LN:"%{BKY_MATH_SINGLE_TOOLTIP_LN}",LOG10:"%{BKY_MATH_SINGLE_TOOLTIP_LOG10}",EXP:"%{BKY_MATH_SINGLE_TOOLTIP_EXP}",POW10:"%{BKY_MATH_SINGLE_TOOLTIP_POW10}",
SIN:"%{BKY_MATH_TRIG_TOOLTIP_SIN}",COS:"%{BKY_MATH_TRIG_TOOLTIP_COS}",TAN:"%{BKY_MATH_TRIG_TOOLTIP_TAN}",ASIN:"%{BKY_MATH_TRIG_TOOLTIP_ASIN}",ACOS:"%{BKY_MATH_TRIG_TOOLTIP_ACOS}",ATAN:"%{BKY_MATH_TRIG_TOOLTIP_ATAN}",SUM:"%{BKY_MATH_ONLIST_TOOLTIP_SUM}",MIN:"%{BKY_MATH_ONLIST_TOOLTIP_MIN}",MAX:"%{BKY_MATH_ONLIST_TOOLTIP_MAX}",AVERAGE:"%{BKY_MATH_ONLIST_TOOLTIP_AVERAGE}",MEDIAN:"%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}",MODE:"%{BKY_MATH_ONLIST_TOOLTIP_MODE}",STD_DEV:"%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}",RANDOM:"%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}"};
h.Y.register("math_op_tooltip",h.Y.Lo("OP",h.la.Math.Ar));h.la.Math.NB={eb:function(){var a=h.g.xml.createElement("mutation"),c="DIVISIBLE_BY"==G(this,"PROPERTY");a.setAttribute("divisor_input",c);return a},zb:function(a){a="true"==a.getAttribute("divisor_input");this.Ic(a)},Ic:function(a){var c=B(this,"DIVISOR");a?c||N(this,"DIVISOR").vb("Number"):c&&this.ib("DIVISOR")}};h.la.Math.OB=function(){xb(y(this,"PROPERTY"),function(a){this.B.Ic("DIVISIBLE_BY"==a)})};
h.Y.wu("math_is_divisibleby_mutator",h.la.Math.NB,h.la.Math.OB);h.Y.register("math_change_tooltip",h.Y.Wr("%{BKY_MATH_CHANGE_TOOLTIP}"));h.la.Math.WB={Rn:function(a){"MODE"==a?this.M.vb("Array"):this.M.vb("Number")},eb:function(){var a=h.g.xml.createElement("mutation");a.setAttribute("op",G(this,"OP"));return a},zb:function(a){this.Rn(a.getAttribute("op"))}};h.la.Math.VB=function(){xb(y(this,"OP"),function(a){this.Rn(a)}.bind(this))};h.Y.wu("math_modes_of_list_mutator",h.la.Math.WB,h.la.Math.VB);h.ka=function(a,c,d){this.gm=h.ka.YA;this.wj=h.ka.hh;this.yA=h.ka.$C;this.sn=h.ka.zC;h.ka.w.constructor.call(this,a||0,c,d)};h.g.object.W(h.ka,h.xb);h.ka.va=function(a){return new h.ka(a.angle,void 0,a)};h.ka.prototype.Hi=!0;h.ka.zC=15;h.ka.mc=50;h.ka.YA=!1;h.ka.hh=0;h.ka.$C=360;h.ka.sg=h.ka.mc-1;b=h.ka.prototype;
b.Kd=function(a){h.ka.w.Kd.call(this,a);switch(a.mode){case "compass":this.gm=!0;this.wj=90;break;case "protractor":this.gm=!1,this.wj=0}var c=a.clockwise;"boolean"==typeof c&&(this.gm=c);c=a.offset;null!=c&&(c=Number(c),isNaN(c)||(this.wj=c));c=a.wrap;null!=c&&(c=Number(c),isNaN(c)||(this.yA=c));a=a.round;null!=a&&(a=Number(a),isNaN(a)||(this.sn=a))};b.Jh=function(){h.ka.w.Jh.call(this);this.jA=h.g.o.L("tspan",{},null);this.jA.appendChild(document.createTextNode("\u00b0"));this.ic.appendChild(this.jA)};
b.Yf=function(){h.ka.w.Yf.call(this);ze(this)};b.qf=function(){h.ka.w.qf.call(this,h.g.userAgent.Xv||h.g.userAgent.pi||h.g.userAgent.qg);var a=this.Ls();h.D.Zx().appendChild(a);a=Ib(this.B);a=a.Ro||a.fs;h.D.Fc(this.B.sh,a);h.D.bA(this,this.Ms.bind(this));ze(this)};
b.Ls=function(){var a=h.g.o.L("svg",{xmlns:h.g.o.Ql,"xmlns:html":h.g.o.zi,"xmlns:xlink":h.g.o.Mi,version:"1.1",height:2*h.ka.mc+"px",width:2*h.ka.mc+"px",style:"touch-action: none"},null),c=h.g.o.L("circle",{cx:h.ka.mc,cy:h.ka.mc,r:h.ka.sg,"class":"blocklyAngleCircle"},a);this.Ts=h.g.o.L("path",{"class":"blocklyAngleGauge"},a);this.Yy=h.g.o.L("line",{x1:h.ka.mc,y1:h.ka.mc,"class":"blocklyAngleLine"},a);for(var d=0;360>d;d+=15)h.g.o.L("line",{x1:h.ka.mc+h.ka.sg,y1:h.ka.mc,x2:h.ka.mc+h.ka.sg-(0==d%
45?10:5),y2:h.ka.mc,"class":"blocklyAngleMarks",transform:"rotate("+d+","+h.ka.mc+","+h.ka.mc+")"},a);this.OD=h.ma(a,"click",this,this.tF);this.ND=h.ma(c,"click",this,this.Az,!0,!0);this.$F=h.ma(c,"mousemove",this,this.Az,!0,!0);return a};b.Ms=function(){h.$a(this.OD);h.$a(this.ND);h.$a(this.$F)};b.tF=function(){h.D.Hk(this);h.aa.Ca()};
b.Az=function(a){var c=this.Ts.ownerSVGElement.getBoundingClientRect(),d=a.clientX-c.left-h.ka.mc;a=a.clientY-c.top-h.ka.mc;c=Math.atan(-a/d);isNaN(c)||(c=h.g.Ha.ll(c),0>d?c+=180:0<a&&(c+=360),c=this.gm?this.wj+360-c:360-(this.wj-c),Ae(this,c))};function Ae(a,c){a.sn&&(c=Math.round(c/a.sn)*a.sn);c=Be(a,c);c!=a.cc&&(a.Sf=!0,a.Nk&&(a.Xc.value=String(c)),a.setValue(c))}
function ze(a){if(a.Ts){var c=Number(a.Tb())+a.wj,d=h.g.Ha.nd(c%360);c=["M ",h.ka.mc,",",h.ka.mc];var e=h.ka.mc,f=h.ka.mc;if(!isNaN(d)){var g=Number(a.gm),k=h.g.Ha.nd(a.wj),l=Math.cos(k)*h.ka.sg,m=Math.sin(k)*-h.ka.sg;g&&(d=2*k-d);e+=Math.cos(d)*h.ka.sg;f-=Math.sin(d)*h.ka.sg;d=Math.abs(Math.floor((d-k)/Math.PI)%2);g&&(d=1-d);c.push(" l ",l,",",m," A ",h.ka.sg,",",h.ka.sg," 0 ",d," ",g," ",e,",",f," z")}a.Ts.setAttribute("d",c.join(""));a.Yy.setAttribute("x2",e);a.Yy.setAttribute("y2",f)}}
b.du=function(a){h.ka.w.du.call(this,a);var c;a.keyCode===h.g.Ba.uo?c=this.B.G?1:-1:a.keyCode===h.g.Ba.Co?c=this.B.G?-1:1:a.keyCode===h.g.Ba.zl?c=-1:a.keyCode===h.g.Ba.Tl&&(c=1);if(c){var d=this.getValue();Ae(this,d+c*this.sn);a.preventDefault();a.stopPropagation()}};b.wh=function(a){a=Number(a);return isNaN(a)||!isFinite(a)?null:Be(this,a)};function Be(a,c){c%=360;0>c&&(c+=360);c>a.yA&&(c-=360);return c}h.Ed.register(".blocklyAngleCircle {,stroke: #444;,stroke-width: 1;,fill: #ddd;,fill-opacity: .8;,},.blocklyAngleMarks {,stroke: #444;,stroke-width: 1;,},.blocklyAngleGauge {,fill: #f88;,fill-opacity: .8;,pointer-events: none;,},.blocklyAngleLine {,stroke: #f00;,stroke-width: 2;,stroke-linecap: round;,pointer-events: none;,}".split(","));
h.Tc.register("field_angle",h.ka);h.Generator=function(a){this.dG=a;this.xB=new RegExp(this.ue,"g")};h.Generator.sb="generated_function";b=h.Generator.prototype;b.qo=null;b.Jd=null;b.Oc=null;b.rd=" ";b.aB=60;b.Ao=[];
function kd(){var a=h.j,c=C;c||(console.warn("No workspace specified in workspaceToCode call. Guessing."),c=h.Ab());var d=[];a.S(c);c=D(c,!0);for(var e=0,f;f=c[e];e++){var g=Ce(a,f);Array.isArray(g)&&(g=g[0]);g&&(f.M&&(g=a.Uz(g),a.Jd&&!f.ki&&(g=X(a.Jd,f)+g),a.Oc&&!f.ki&&(g+=X(a.Oc,f))),d.push(g))}d=d.join("\n");d=a.finish(d);d=d.replace(/^\s+\n/,"");d=d.replace(/\n\s+$/,"\n");return d=d.replace(/[ \t]+\n/g,"\n")}function De(a,c){return c+a.replace(/(?!\n$)\n/g,"\n"+c)}
function Ce(a,c){if(!c)return"";if(!c.isEnabled())return Ce(a,q(c));var d=a[c.type];if("function"!=typeof d)throw Error('Language "'+a.dG+'" does not know how to generate code for block type "'+c.type+'".');d=d.call(c,c);if(Array.isArray(d)){if(!c.M)throw TypeError("Expecting string from statement block: "+c.type);return[a.eq(c,d[0],void 0),d[1]]}if("string"==typeof d)return a.Jd&&!c.ki&&(d=X(a.Jd,c)+d),a.Oc&&!c.ki&&(d+=X(a.Oc,c)),a.eq(c,d,void 0);if(null===d)return"";throw SyntaxError("Invalid code generated: "+
d);}
function Y(a,c,d){var e=h.j;if(isNaN(d))throw TypeError("Expecting valid order from block: "+a.type);var f=Nb(a,c);if(!f)return"";c=Ce(e,f);if(""===c)return"";if(!Array.isArray(c))throw TypeError("Expecting tuple from value block: "+f.type);a=c[0];c=c[1];if(isNaN(c))throw TypeError("Expecting valid order from value block: "+f.type);if(!a)return"";f=!1;var g=Math.floor(d),k=Math.floor(c);if(g<=k&&(g!=k||0!=g&&99!=g))for(f=!0,g=0;g<e.Ao.length;g++)if(e.Ao[g][0]==d&&e.Ao[g][1]==c){f=!1;break}f&&(a="("+
a+")");return a}function Ee(a,c){var d=h.j;a=Nb(a,c);c=Ce(d,a);if("string"!=typeof c)throw TypeError("Expecting code from statement block: "+(a&&a.type));c&&(c=De(c,d.rd));return c}function Fe(a,c){var d=h.j;d.qo&&(a=De(X(d.qo,c),d.rd)+a);d.Oc&&!c.ki&&(a=De(X(d.Oc,c),d.rd)+a);d.Jd&&!c.ki&&(a+=De(X(d.Jd,c),d.rd));return a}function X(a,c){c=c.id.replace(/\$/g,"$$$$");return a.replace(/%1/g,"'"+c+"'")}b.kr="";function Ge(a){var c=h.j;c.kr+=a+","}b.ue="{leCUI8hutHZI4480Dc}";
function He(a,c){var d=h.j;if(!d.Wi[a]){var e=Fc(d.Cd,a,h.Ga.sb);d.Rs[a]=e;c=c.join("\n").replace(d.xB,e);for(var f;f!=c;)f=c,c=c.replace(/^(( {2})*) {2}/gm,"$1\x00");c=c.replace(/\0/g,d.rd);d.Wi[a]=c}return d.Rs[a]}b.S=function(){};b.eq=function(a,c){return c};b.finish=function(a){return a};b.Uz=function(a){return a};h.j=new h.Generator("JavaScript");Ge("Blockly,break,case,catch,continue,debugger,default,delete,do,else,finally,for,function,if,in,instanceof,new,return,switch,this,throw,try,typeof,var,void,while,with,class,enum,export,extends,import,super,implements,interface,let,package,private,protected,public,static,yield,const,null,true,false,Array,ArrayBuffer,Boolean,Date,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Error,eval,EvalError,Float32Array,Float64Array,Function,Infinity,Int16Array,Int32Array,Int8Array,isFinite,isNaN,Iterator,JSON,Math,NaN,Number,Object,parseFloat,parseInt,RangeError,ReferenceError,RegExp,StopIteration,String,SyntaxError,TypeError,Uint16Array,Uint32Array,Uint8Array,Uint8ClampedArray,undefined,uneval,URIError,applicationCache,closed,Components,content,_content,controllers,crypto,defaultStatus,dialogArguments,directories,document,frameElement,frames,fullScreen,globalStorage,history,innerHeight,innerWidth,length,location,locationbar,localStorage,menubar,messageManager,mozAnimationStartTime,mozInnerScreenX,mozInnerScreenY,mozPaintCount,name,navigator,opener,outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance,personalbar,pkcs11,returnValue,screen,screenX,screenY,scrollbars,scrollMaxX,scrollMaxY,scrollX,scrollY,self,sessionStorage,sidebar,status,statusbar,toolbar,top,URL,window,addEventListener,alert,atob,back,blur,btoa,captureEvents,clearImmediate,clearInterval,clearTimeout,close,confirm,disableExternalCapture,dispatchEvent,dump,enableExternalCapture,escape,find,focus,forward,GeckoActiveXObject,getAttention,getAttentionWithCycleCount,getComputedStyle,getSelection,home,matchMedia,maximize,minimize,moveBy,moveTo,mozRequestAnimationFrame,open,openDialog,postMessage,print,prompt,QueryInterface,releaseEvents,removeEventListener,resizeBy,resizeTo,restore,routeEvent,scroll,scrollBy,scrollByLines,scrollByPages,scrollTo,setCursor,setImmediate,setInterval,setResizable,setTimeout,showModalDialog,sizeToContent,stop,unescape,updateCommands,XPCNativeWrapper,XPCSafeJSObjectWrapper,onabort,onbeforeunload,onblur,onchange,onclick,onclose,oncontextmenu,ondevicemotion,ondeviceorientation,ondragdrop,onerror,onfocus,onhashchange,onkeydown,onkeypress,onkeyup,onload,onmousedown,onmousemove,onmouseout,onmouseover,onmouseup,onmozbeforepaint,onpaint,onpopstate,onreset,onresize,onscroll,onselect,onsubmit,onunload,onpageshow,onpagehide,Image,Option,Worker,Event,Range,File,FileReader,Blob,BlobBuilder,Attr,CDATASection,CharacterData,Comment,console,DocumentFragment,DocumentType,DomConfiguration,DOMError,DOMErrorHandler,DOMException,DOMImplementation,DOMImplementationList,DOMImplementationRegistry,DOMImplementationSource,DOMLocator,DOMObject,DOMString,DOMStringList,DOMTimeStamp,DOMUserData,Entity,EntityReference,MediaQueryList,MediaQueryListListener,NameList,NamedNodeMap,Node,NodeFilter,NodeIterator,NodeList,Notation,Plugin,PluginArray,ProcessingInstruction,SharedWorker,Text,TimeRanges,Treewalker,TypeInfo,UserDataHandler,Worker,WorkerGlobalScope,HTMLDocument,HTMLElement,HTMLAnchorElement,HTMLAppletElement,HTMLAudioElement,HTMLAreaElement,HTMLBaseElement,HTMLBaseFontElement,HTMLBodyElement,HTMLBRElement,HTMLButtonElement,HTMLCanvasElement,HTMLDirectoryElement,HTMLDivElement,HTMLDListElement,HTMLEmbedElement,HTMLFieldSetElement,HTMLFontElement,HTMLFormElement,HTMLFrameElement,HTMLFrameSetElement,HTMLHeadElement,HTMLHeadingElement,HTMLHtmlElement,HTMLHRElement,HTMLIFrameElement,HTMLImageElement,HTMLInputElement,HTMLKeygenElement,HTMLLabelElement,HTMLLIElement,HTMLLinkElement,HTMLMapElement,HTMLMenuElement,HTMLMetaElement,HTMLModElement,HTMLObjectElement,HTMLOListElement,HTMLOptGroupElement,HTMLOptionElement,HTMLOutputElement,HTMLParagraphElement,HTMLParamElement,HTMLPreElement,HTMLQuoteElement,HTMLScriptElement,HTMLSelectElement,HTMLSourceElement,HTMLSpanElement,HTMLStyleElement,HTMLTableElement,HTMLTableCaptionElement,HTMLTableCellElement,HTMLTableDataCellElement,HTMLTableHeaderCellElement,HTMLTableColElement,HTMLTableRowElement,HTMLTableSectionElement,HTMLTextAreaElement,HTMLTimeElement,HTMLTitleElement,HTMLTrackElement,HTMLUListElement,HTMLUnknownElement,HTMLVideoElement,HTMLCanvasElement,CanvasRenderingContext2D,CanvasGradient,CanvasPattern,TextMetrics,ImageData,CanvasPixelArray,HTMLAudioElement,HTMLVideoElement,NotifyAudioAvailableEvent,HTMLCollection,HTMLAllCollection,HTMLFormControlsCollection,HTMLOptionsCollection,HTMLPropertiesCollection,DOMTokenList,DOMSettableTokenList,DOMStringMap,RadioNodeList,SVGDocument,SVGElement,SVGAElement,SVGAltGlyphElement,SVGAltGlyphDefElement,SVGAltGlyphItemElement,SVGAnimationElement,SVGAnimateElement,SVGAnimateColorElement,SVGAnimateMotionElement,SVGAnimateTransformElement,SVGSetElement,SVGCircleElement,SVGClipPathElement,SVGColorProfileElement,SVGCursorElement,SVGDefsElement,SVGDescElement,SVGEllipseElement,SVGFilterElement,SVGFilterPrimitiveStandardAttributes,SVGFEBlendElement,SVGFEColorMatrixElement,SVGFEComponentTransferElement,SVGFECompositeElement,SVGFEConvolveMatrixElement,SVGFEDiffuseLightingElement,SVGFEDisplacementMapElement,SVGFEDistantLightElement,SVGFEFloodElement,SVGFEGaussianBlurElement,SVGFEImageElement,SVGFEMergeElement,SVGFEMergeNodeElement,SVGFEMorphologyElement,SVGFEOffsetElement,SVGFEPointLightElement,SVGFESpecularLightingElement,SVGFESpotLightElement,SVGFETileElement,SVGFETurbulenceElement,SVGComponentTransferFunctionElement,SVGFEFuncRElement,SVGFEFuncGElement,SVGFEFuncBElement,SVGFEFuncAElement,SVGFontElement,SVGFontFaceElement,SVGFontFaceFormatElement,SVGFontFaceNameElement,SVGFontFaceSrcElement,SVGFontFaceUriElement,SVGForeignObjectElement,SVGGElement,SVGGlyphElement,SVGGlyphRefElement,SVGGradientElement,SVGLinearGradientElement,SVGRadialGradientElement,SVGHKernElement,SVGImageElement,SVGLineElement,SVGMarkerElement,SVGMaskElement,SVGMetadataElement,SVGMissingGlyphElement,SVGMPathElement,SVGPathElement,SVGPatternElement,SVGPolylineElement,SVGPolygonElement,SVGRectElement,SVGScriptElement,SVGStopElement,SVGStyleElement,SVGSVGElement,SVGSwitchElement,SVGSymbolElement,SVGTextElement,SVGTextPathElement,SVGTitleElement,SVGTRefElement,SVGTSpanElement,SVGUseElement,SVGViewElement,SVGVKernElement,SVGAngle,SVGColor,SVGICCColor,SVGElementInstance,SVGElementInstanceList,SVGLength,SVGLengthList,SVGMatrix,SVGNumber,SVGNumberList,SVGPaint,SVGPoint,SVGPointList,SVGPreserveAspectRatio,SVGRect,SVGStringList,SVGTransform,SVGTransformList,SVGAnimatedAngle,SVGAnimatedBoolean,SVGAnimatedEnumeration,SVGAnimatedInteger,SVGAnimatedLength,SVGAnimatedLengthList,SVGAnimatedNumber,SVGAnimatedNumberList,SVGAnimatedPreserveAspectRatio,SVGAnimatedRect,SVGAnimatedString,SVGAnimatedTransformList,SVGPathSegList,SVGPathSeg,SVGPathSegArcAbs,SVGPathSegArcRel,SVGPathSegClosePath,SVGPathSegCurvetoCubicAbs,SVGPathSegCurvetoCubicRel,SVGPathSegCurvetoCubicSmoothAbs,SVGPathSegCurvetoCubicSmoothRel,SVGPathSegCurvetoQuadraticAbs,SVGPathSegCurvetoQuadraticRel,SVGPathSegCurvetoQuadraticSmoothAbs,SVGPathSegCurvetoQuadraticSmoothRel,SVGPathSegLinetoAbs,SVGPathSegLinetoHorizontalAbs,SVGPathSegLinetoHorizontalRel,SVGPathSegLinetoRel,SVGPathSegLinetoVerticalAbs,SVGPathSegLinetoVerticalRel,SVGPathSegMovetoAbs,SVGPathSegMovetoRel,ElementTimeControl,TimeEvent,SVGAnimatedPathData,SVGAnimatedPoints,SVGColorProfileRule,SVGCSSRule,SVGExternalResourcesRequired,SVGFitToViewBox,SVGLangSpace,SVGLocatable,SVGRenderingIntent,SVGStylable,SVGTests,SVGTextContentElement,SVGTextPositioningElement,SVGTransformable,SVGUnitTypes,SVGURIReference,SVGViewSpec,SVGZoomAndPan");
h.j.Ci=0;h.j.rK=1.1;h.j.Rb=1.2;h.j.gb=2;h.j.pK=3;h.j.lK=3;h.j.hK=4.1;h.j.tK=4.2;h.j.Ll=4.3;h.j.Jl=4.4;h.j.sK=4.5;h.j.uK=4.6;h.j.mK=4.7;h.j.fK=4.8;h.j.nK=5;h.j.er=5.1;h.j.Il=5.2;h.j.Kl=5.3;h.j.gk=6.1;h.j.ih=6.2;h.j.jK=7;h.j.pC=8;h.j.oK=8;h.j.qK=8;h.j.aw=9;h.j.gK=10;h.j.kK=11;h.j.iK=12;h.j.cr=13;h.j.dr=14;h.j.zo=15;h.j.rg=16;h.j.vK=17;h.j.Lc=18;h.j.Mc=99;h.j.Ao=[[h.j.gb,h.j.Rb],[h.j.gb,h.j.gb],[h.j.Rb,h.j.Rb],[h.j.Rb,h.j.gb],[h.j.Jl,h.j.Jl],[h.j.er,h.j.er],[h.j.ih,h.j.ih],[h.j.cr,h.j.cr],[h.j.dr,h.j.dr]];
h.j.S=function(a){h.j.Wi=Object.create(null);h.j.Rs=Object.create(null);h.j.Cd?h.j.Cd.reset():h.j.Cd=new h.Xd(h.j.kr);h.j.Cd.Sa=a.Sa;for(var c=[],d=h.O.lD(a),e=0;e<d.length;e++)c.push(Q(d[e],h.Xd.Jq));a=h.O.Gw(a);for(e=0;e<a.length;e++)c.push(Q(a[e].ua(),h.O.sb));c.length&&(h.j.Wi.variables="var "+c.join(", ")+";")};h.j.finish=function(a){var c=[],d;for(d in h.j.Wi)c.push(h.j.Wi[d]);delete h.j.Wi;delete h.j.Rs;h.j.Cd.reset();return c.join("\n\n")+"\n\n\n"+a};h.j.Uz=function(a){return a+";\n"};
h.j.HG=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/'/g,"\\'");return"'"+a+"'"};h.j.hM=function(a){return a.split(/\n/g).map(h.j.HG).join(" + '\\n' +\n")};
h.j.eq=function(a,c,d){var e="";if(!a.M||!a.M.ca){var f=a.Be.text;f&&(f=h.g.fb.wA(f,h.j.aB-3),e+=De(f+"\n","// "));for(var g=0;g<a.T.length;g++)if(a.T[g].type==h.Wa){var k=z(a.T[g].connection);if(k){f=[];k=p(k,!0);for(var l=0;l<k.length;l++){var m=k[l].Be.text;m&&f.push(m)}f.length&&f.push("");(f=f.join("\n"))&&(e+=De(f,"// "))}}}a=a.X&&z(a.X);d=d?"":Ce(h.j,a);return e+c+d};
h.j.Of=function(a,c,d,e,f){d=d||0;f=f||h.j.Mc;a.v.options.Ne&&d--;var g=a.v.options.Ne?"1":"0";a=0<d?Y(a,c,h.j.ih)||g:0>d?Y(a,c,h.j.gk)||g:e?Y(a,c,h.j.Ll)||g:Y(a,c,f)||g;if(h.Ph(a))a=Number(a)+d,e&&(a=-a);else{if(0<d){a=a+" + "+d;var k=h.j.ih}else 0>d&&(a=a+" - "+-d,k=h.j.gk);e&&(a=d?"-("+a+")":"-"+a,k=h.j.Ll);k=Math.floor(k);f=Math.floor(f);k&&f>=k&&(a="("+a+")")}return a};h.j.Ha={};h.j.math_number=function(a){a=Number(G(a,"NUM"));return[a,0<=a?h.j.Ci:h.j.Ll]};h.j.math_arithmetic=function(a){var c={ADD:[" + ",h.j.ih],MINUS:[" - ",h.j.gk],MULTIPLY:[" * ",h.j.er],DIVIDE:[" / ",h.j.Il],POWER:[null,h.j.Lc]}[G(a,"OP")],d=c[0];c=c[1];var e=Y(a,"A",c)||"0";a=Y(a,"B",c)||"0";return d?[e+d+a,c]:["Math.pow("+e+", "+a+")",h.j.gb]};
h.j.math_single=function(a){var c=G(a,"OP");if("NEG"==c)return a=Y(a,"NUM",h.j.Ll)||"0","-"==a[0]&&(a=" "+a),["-"+a,h.j.Ll];a="SIN"==c||"COS"==c||"TAN"==c?Y(a,"NUM",h.j.Il)||"0":Y(a,"NUM",h.j.Mc)||"0";switch(c){case "ABS":var d="Math.abs("+a+")";break;case "ROOT":d="Math.sqrt("+a+")";break;case "LN":d="Math.log("+a+")";break;case "EXP":d="Math.exp("+a+")";break;case "POW10":d="Math.pow(10,"+a+")";break;case "ROUND":d="Math.round("+a+")";break;case "ROUNDUP":d="Math.ceil("+a+")";break;case "ROUNDDOWN":d=
"Math.floor("+a+")";break;case "SIN":d="Math.sin("+a+" / 180 * Math.PI)";break;case "COS":d="Math.cos("+a+" / 180 * Math.PI)";break;case "TAN":d="Math.tan("+a+" / 180 * Math.PI)"}if(d)return[d,h.j.gb];switch(c){case "LOG10":d="Math.log("+a+") / Math.log(10)";break;case "ASIN":d="Math.asin("+a+") / Math.PI * 180";break;case "ACOS":d="Math.acos("+a+") / Math.PI * 180";break;case "ATAN":d="Math.atan("+a+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+c);}return[d,h.j.Il]};
h.j.math_constant=function(a){return{PI:["Math.PI",h.j.Rb],E:["Math.E",h.j.Rb],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",h.j.Il],SQRT2:["Math.SQRT2",h.j.Rb],SQRT1_2:["Math.SQRT1_2",h.j.Rb],INFINITY:["Infinity",h.j.Ci]}[G(a,"CONSTANT")]};
h.j.math_number_property=function(a){var c=Y(a,"NUMBER_TO_CHECK",h.j.Kl)||"0",d=G(a,"PROPERTY");if("PRIME"==d){var e=He("mathIsPrime",["function "+h.j.ue+"(n) {"," // https://en.wikipedia.org/wiki/Primality_test#Naive_methods"," if (n == 2 || n == 3) {"," return true;"," }"," // False if n is NaN, negative, is 1, or not whole."," // And false if n is divisible by 2 or 3."," if (isNaN(n) || n <= 1 || n % 1 != 0 || n % 2 == 0 || n % 3 == 0) {"," return false;"," }"," // Check all the numbers of form 6k +/- 1, up to sqrt(n).",
" for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) {"," if (n % (x - 1) == 0 || n % (x + 1) == 0) {"," return false;"," }"," }"," return true;","}"])+"("+c+")";return[e,h.j.gb]}switch(d){case "EVEN":e=c+" % 2 == 0";break;case "ODD":e=c+" % 2 == 1";break;case "WHOLE":e=c+" % 1 == 0";break;case "POSITIVE":e=c+" > 0";break;case "NEGATIVE":e=c+" < 0";break;case "DIVISIBLE_BY":a=Y(a,"DIVISOR",h.j.Kl)||"0",e=c+" % "+a+" == 0"}return[e,h.j.aw]};
h.j.math_change=function(a){var c=Y(a,"DELTA",h.j.ih)||"0";a=Q(G(a,"VAR"),h.O.sb);return a+" = (typeof "+a+" == 'number' ? "+a+" : 0) + "+c+";\n"};h.j.math_round=h.j.math_single;h.j.math_trig=h.j.math_single;
h.j.math_on_list=function(a){var c=G(a,"OP");switch(c){case "SUM":a=Y(a,"LIST",h.j.Rb)||"[]";a+=".reduce(function(x, y) {return x + y;})";break;case "MIN":a=Y(a,"LIST",h.j.Lc)||"[]";a="Math.min.apply(null, "+a+")";break;case "MAX":a=Y(a,"LIST",h.j.Lc)||"[]";a="Math.max.apply(null, "+a+")";break;case "AVERAGE":c=He("mathMean",["function "+h.j.ue+"(myList) {"," return myList.reduce(function(x, y) {return x + y;}) / myList.length;","}"]);a=Y(a,"LIST",h.j.Mc)||"[]";a=c+"("+a+")";break;case "MEDIAN":c=
He("mathMedian",["function "+h.j.ue+"(myList) {"," var localList = myList.filter(function (x) {return typeof x == 'number';});"," if (!localList.length) return null;"," localList.sort(function(a, b) {return b - a;});"," if (localList.length % 2 == 0) {"," return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2;"," } else {"," return localList[(localList.length - 1) / 2];"," }","}"]);a=Y(a,"LIST",h.j.Mc)||"[]";a=c+"("+a+")";break;case "MODE":c=He("mathModes",
["function "+h.j.ue+"(values) {"," var modes = [];"," var counts = [];"," var maxCount = 0;"," for (var i = 0; i < values.length; i++) {"," var value = values[i];"," var found = false;"," var thisCount;"," for (var j = 0; j < counts.length; j++) {"," if (counts[j][0] === value) {"," thisCount = ++counts[j][1];"," found = true;"," break;"," }"," }"," if (!found) {"," counts.push([value, 1]);"," thisCount = 1;"," }"," maxCount = Math.max(thisCount, maxCount);",
" }"," for (var j = 0; j < counts.length; j++) {"," if (counts[j][1] == maxCount) {"," modes.push(counts[j][0]);"," }"," }"," return modes;","}"]);a=Y(a,"LIST",h.j.Mc)||"[]";a=c+"("+a+")";break;case "STD_DEV":c=He("mathStandardDeviation",["function "+h.j.ue+"(numbers) {"," var n = numbers.length;"," if (!n) return null;"," var mean = numbers.reduce(function(x, y) {return x + y;}) / n;"," var variance = 0;"," for (var j = 0; j < n; j++) {"," variance += Math.pow(numbers[j] - mean, 2);",
" }"," variance = variance / n;"," return Math.sqrt(variance);","}"]);a=Y(a,"LIST",h.j.Mc)||"[]";a=c+"("+a+")";break;case "RANDOM":c=He("mathRandomList",["function "+h.j.ue+"(list) {"," var x = Math.floor(Math.random() * list.length);"," return list[x];","}"]);a=Y(a,"LIST",h.j.Mc)||"[]";a=c+"("+a+")";break;default:throw Error("Unknown operator: "+c);}return[a,h.j.gb]};h.j.math_modulo=function(a){var c=Y(a,"DIVIDEND",h.j.Kl)||"0";a=Y(a,"DIVISOR",h.j.Kl)||"0";return[c+" % "+a,h.j.Kl]};
h.j.math_constrain=function(a){var c=Y(a,"VALUE",h.j.Lc)||"0",d=Y(a,"LOW",h.j.Lc)||"0";a=Y(a,"HIGH",h.j.Lc)||"Infinity";return["Math.min(Math.max("+c+", "+d+"), "+a+")",h.j.gb]};
h.j.math_random_int=function(a){var c=Y(a,"FROM",h.j.Lc)||"0";a=Y(a,"TO",h.j.Lc)||"0";return[He("mathRandomInt",["function "+h.j.ue+"(a, b) {"," if (a > b) {"," // Swap a and b to ensure a is smaller."," var c = a;"," a = b;"," b = c;"," }"," return Math.floor(Math.random() * (b - a + 1) + a);","}"])+"("+c+", "+a+")",h.j.gb]};h.j.math_random_float=function(){return["Math.random()",h.j.gb]};
h.j.math_atan2=function(a){var c=Y(a,"X",h.j.Lc)||"0";return["Math.atan2("+(Y(a,"Y",h.j.Lc)||"0")+", "+c+") / Math.PI * 180",h.j.Il]};h.Qb=function(a){h.Qb.w.constructor.call(this,null);this.Nz=a};h.g.object.W(h.Qb,h.Id);b=h.Qb.prototype;b.rl=0;b.Un=0;
b.Es=function(a){h.g.o.L("rect",{"class":"blocklyIconShape",rx:"4",ry:"4",height:"16",width:"16"},a);h.g.o.L("path",{"class":"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},a);
h.g.o.L("circle",{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},a)};b.qt=function(a){this.U.jd()&&h.Id.prototype.qt.call(this,a)};
b.ks=function(){this.Gn=h.g.o.L("svg",{x:h.oa.cd,y:h.oa.cd},null);if(this.Nz.length)for(var a=h.g.xml.createElement("xml"),c=0,d;d=this.Nz[c];c++){var e=h.g.xml.createElement("block");e.setAttribute("type",d);a.appendChild(e)}else a=null;a={disable:!1,Ig:this.U.v.options.Ig,Sk:a,Nb:this.U.v,ai:this.U.v.options.ai,G:this.U.G,Ia:this.U.G?h.vg:h.Yd,ie:!1,Uc:this.WE.bind(this),ii:null,Tg:this.U.v.options.Tg};this.s=new h.lb(a);this.s.lj=!0;cb(this.s,h.i.oE);a=wc(this.s,"g");c=this.s.Oa("blocklyMutatorBackground");
c.insertBefore(a,this.s.pb);this.Gn.appendChild(c);return this.Gn};b.ah=function(){h.Qb.w.ah.call(this);this.U.$b||(this.U.jd()?this.Od&&h.g.o.Ec(this.Od,"blocklyIconGroupReadonly"):(this.Vb(!1),this.Od&&h.g.o.Cb(this.Od,"blocklyIconGroupReadonly")))};
function Ie(a){var c=2*h.oa.cd,d=a.s.pb.getBBox();var e=a.U.G?-d.x:d.width+d.x;d=d.height+3*c;if(a.s.P){var f=a.s.P.Hm();d=Math.max(d,f.ce+20)}e+=3*c;if(Math.abs(a.rl-e)>c||Math.abs(a.Un-d)>c)a.rl=e,a.Un=d,a.Yb.un(e+c,d+c),a.Gn.setAttribute("width",a.rl),a.Gn.setAttribute("height",a.Un);a.U.G&&a.s.pb.setAttribute("transform","translate("+a.rl+",0)");a.s.resize()}
b.Vb=function(a){if(a!=this.isVisible())if(h.i.Ka(new h.i.ud(this.U,"mutatorOpen",!a,a)),a){this.Yb=new h.oa(this.U.v,this.ks(),this.U.Td,this.Kk,null,null);gb(this.Yb,this.U.id);if(a=this.s.options.Sk)this.s.P.S(this.s),this.s.P.show(a.childNodes);this.Vg=this.U.Gg(this.s);a=p(this.Vg,!1);for(var c=0,d;d=a[c];c++)d.za();this.Vg.gq(!1);this.Vg.ps=!1;this.s.P?(a=2*this.s.P.wb,c=xc(this.s).Qf()+a):c=a=16;this.U.G&&(c=-c);this.Vg.moveBy(c,a);if(this.U.cq){var e=this;this.U.cq(this.Vg);this.hq=function(){e.U.cq(e.Vg)};
cb(this.U.v,this.hq)}Ie(this);cb(this.s,this.AH.bind(this));this.Qe()}else this.Gn=null,this.s.I(),this.Vg=this.s=null,this.Yb.I(),this.Yb=null,this.Un=this.rl=0,this.hq&&(db(this.U.v,this.hq),this.hq=null)};
b.AH=function(a){if(a.type!=h.i.Io&&(a.type!=h.i.si||"disabled"!=a.element)){if(!this.s.gc()){a=D(this.s,!1);for(var c=0,d;d=a[c];c++){var e=d.Qa(),f=H(d);20>e.y+f.height&&d.moveBy(0,20-f.height-e.y)}}if(this.Vg.v==this.s){h.i.$(!0);d=this.U;a=(a=d.eb())&&h.R.Md(a);c=d.ba;d.ba=!1;d.Dg(this.Vg);d.ba=c;d.Ke();c=(c=d.eb())&&h.R.Md(c);if(a!=c){h.i.Ka(new h.i.hg(d,"mutation",null,a,c));var g=h.i.Zb();setTimeout(function(){h.i.$(g);d.Kb();h.i.$(!1)},h.Yn)}d.ba&&d.za();a!=c&&h.Le&&h.navigation.ZF(d);this.s.gc()||
Ie(this);h.i.$(!1)}}};b.WE=function(){return{Pb:this.Un,Bb:this.rl-xc(this.s).Qf(),fd:0,Pc:this.s.G?0:xc(this.s).Qf()}};b.I=function(){this.U.Pd=null;h.Id.prototype.I.call(this)};h.Qb.$k=function(a,c,d){if(!a||!a.B.v)return!1;d=B(c,d).connection;var e=z(a);return e&&e!=c||d.ca==a?!1:(d.isConnected()&&d.disconnect(),d.connect(a),!0)};h.Qb.Nx=function(a){var c=null;if(a&&a.options){var d=a.options.Nb;a.ke?d&&d.options&&(c=d.options.Nb):d&&(c=d)}return c};h.J.Ht={};h.la.bC={};h.la.bC.oo=260;
h.zk([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",
args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"},{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",
name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]);
h.J.lists_create_with={S:function(){this.ub=h.h.LISTS_CREATE_WITH_HELPURL;M(this,"list_blocks");this.yd=3;this.Ic();this.Ad(!0,"Array");this.ji(new h.Qb(["lists_create_with_item"]));this.Ra(h.h.LISTS_CREATE_WITH_TOOLTIP)},eb:function(){var a=h.g.xml.createElement("mutation");a.setAttribute("items",this.yd);return a},zb:function(a){this.yd=parseInt(a.getAttribute("items"),10);this.Ic()},Gg:function(a){var c=a.Uh("lists_create_with_container");c.Ke();for(var d=B(c,"STACK").connection,e=0;e<this.yd;e++){var f=
a.Uh("lists_create_with_item");f.Ke();d.connect(f.Z);d=f.X}return c},Dg:function(a){var c=Nb(a,"STACK");for(a=[];c;)a.push(c.bv),c=c.X&&z(c.X);for(c=0;c<this.yd;c++){var d=B(this,"ADD"+c).connection.ca;d&&-1==a.indexOf(d)&&d.disconnect()}this.yd=a.length;this.Ic();for(c=0;c<this.yd;c++)h.Qb.$k(a[c],this,"ADD"+c)},cq:function(a){a=Nb(a,"STACK");for(var c=0;a;){var d=B(this,"ADD"+c);a.bv=d&&d.connection.ca;c++;a=a.X&&z(a.X)}},Ic:function(){this.yd&&B(this,"EMPTY")?this.ib("EMPTY"):this.yd||B(this,"EMPTY")||
L(O(this,"EMPTY"),h.h.LISTS_CREATE_EMPTY_TITLE);for(var a=0;a<this.yd;a++)if(!B(this,"ADD"+a)){var c=N(this,"ADD"+a);0==a&&L(c,h.h.LISTS_CREATE_WITH_INPUT_WITH)}for(;B(this,"ADD"+a);)this.ib("ADD"+a),a++}};h.J.lists_create_with_container={S:function(){M(this,"list_blocks");L(O(this),h.h.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD);Lb(this,"STACK");this.Ra(h.h.LISTS_CREATE_WITH_CONTAINER_TOOLTIP);this.contextMenu=!1}};
h.J.lists_create_with_item={S:function(){M(this,"list_blocks");L(O(this),h.h.LISTS_CREATE_WITH_ITEM_TITLE);this.ne(!0);this.me(!0);this.Ra(h.h.LISTS_CREATE_WITH_ITEM_TOOLTIP);this.contextMenu=!1}};
h.J.lists_indexOf={S:function(){var a=[[h.h.LISTS_INDEX_OF_FIRST,"FIRST"],[h.h.LISTS_INDEX_OF_LAST,"LAST"]];this.ub=h.h.LISTS_INDEX_OF_HELPURL;M(this,"list_blocks");this.Ad(!0,"Number");L(N(this,"VALUE").vb("Array"),h.h.LISTS_INDEX_OF_INPUT_IN_LIST);L(N(this,"FIND"),new h.Ja(a),"END");this.$c(!0);var c=this;this.Ra(function(){return h.h.LISTS_INDEX_OF_TOOLTIP.replace("%1",c.v.options.Ne?"0":"-1")})}};
h.J.lists_getIndex={S:function(){var a=[[h.h.LISTS_GET_INDEX_GET,"GET"],[h.h.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[h.h.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.Gr=[[h.h.LISTS_GET_INDEX_FROM_START,"FROM_START"],[h.h.LISTS_GET_INDEX_FROM_END,"FROM_END"],[h.h.LISTS_GET_INDEX_FIRST,"FIRST"],[h.h.LISTS_GET_INDEX_LAST,"LAST"],[h.h.LISTS_GET_INDEX_RANDOM,"RANDOM"]];this.ub=h.h.LISTS_GET_INDEX_HELPURL;M(this,"list_blocks");a=new h.Ja(a,function(d){this.B.pA("REMOVE"==d)});L(N(this,"VALUE").vb("Array"),
h.h.LISTS_GET_INDEX_INPUT_IN_LIST);L(L(O(this),a,"MODE"),"","SPACE");O(this,"AT");h.h.LISTS_GET_INDEX_TAIL&&L(O(this,"TAIL"),h.h.LISTS_GET_INDEX_TAIL);this.$c(!0);this.Ad(!0);this.qe(!0);var c=this;this.Ra(function(){var d=G(c,"MODE"),e=G(c,"WHERE"),f="";switch(d+" "+e){case "GET FROM_START":case "GET FROM_END":f=h.h.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case "GET FIRST":f=h.h.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case "GET LAST":f=h.h.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case "GET RANDOM":f=
h.h.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case "GET_REMOVE FROM_START":case "GET_REMOVE FROM_END":f=h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case "GET_REMOVE FIRST":f=h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case "GET_REMOVE LAST":f=h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case "GET_REMOVE RANDOM":f=h.h.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case "REMOVE FROM_START":case "REMOVE FROM_END":f=h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case "REMOVE FIRST":f=
h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case "REMOVE LAST":f=h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case "REMOVE RANDOM":f=h.h.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}if("FROM_START"==e||"FROM_END"==e)f+=" "+("FROM_START"==e?h.h.LISTS_INDEX_FROM_START_TOOLTIP:h.h.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",c.v.options.Ne?"#1":"#0");return f})},eb:function(){var a=h.g.xml.createElement("mutation");a.setAttribute("statement",!this.M);a.setAttribute("at",B(this,"AT").type==h.Wa);return a},
zb:function(a){var c="true"==a.getAttribute("statement");this.pA(c);a="false"!=a.getAttribute("at");this.qe(a)},pA:function(a){a!=!this.M&&(A(this,!0),a?(this.Ad(!1),this.ne(!0),this.me(!0)):(this.ne(!1),this.me(!1),this.Ad(!0)))},qe:function(a){this.ib("AT");this.ib("ORDINAL",!0);a?(N(this,"AT").vb("Number"),h.h.ORDINAL_NUMBER_SUFFIX&&L(O(this,"ORDINAL"),h.h.ORDINAL_NUMBER_SUFFIX)):O(this,"AT");var c=new h.Ja(this.Gr,function(d){var e="FROM_START"==d||"FROM_END"==d;if(e!=a){var f=this.B;f.qe(e);
Jb(f,d,"WHERE");return null}});L(B(this,"AT"),c,"WHERE");h.h.LISTS_GET_INDEX_TAIL&&Mb(this,"TAIL",null)}};
h.J.lists_setIndex={S:function(){var a=[[h.h.LISTS_SET_INDEX_SET,"SET"],[h.h.LISTS_SET_INDEX_INSERT,"INSERT"]];this.Gr=[[h.h.LISTS_GET_INDEX_FROM_START,"FROM_START"],[h.h.LISTS_GET_INDEX_FROM_END,"FROM_END"],[h.h.LISTS_GET_INDEX_FIRST,"FIRST"],[h.h.LISTS_GET_INDEX_LAST,"LAST"],[h.h.LISTS_GET_INDEX_RANDOM,"RANDOM"]];this.ub=h.h.LISTS_SET_INDEX_HELPURL;M(this,"list_blocks");L(N(this,"LIST").vb("Array"),h.h.LISTS_SET_INDEX_INPUT_IN_LIST);L(L(O(this),new h.Ja(a),"MODE"),"","SPACE");O(this,"AT");L(N(this,
"TO"),h.h.LISTS_SET_INDEX_INPUT_TO);this.$c(!0);this.ne(!0);this.me(!0);this.Ra(h.h.LISTS_SET_INDEX_TOOLTIP);this.qe(!0);var c=this;this.Ra(function(){var d=G(c,"MODE"),e=G(c,"WHERE"),f="";switch(d+" "+e){case "SET FROM_START":case "SET FROM_END":f=h.h.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case "SET FIRST":f=h.h.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case "SET LAST":f=h.h.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case "SET RANDOM":f=h.h.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case "INSERT FROM_START":case "INSERT FROM_END":f=
h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case "INSERT FIRST":f=h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case "INSERT LAST":f=h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case "INSERT RANDOM":f=h.h.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}if("FROM_START"==e||"FROM_END"==e)f+=" "+h.h.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",c.v.options.Ne?"#1":"#0");return f})},eb:function(){var a=h.g.xml.createElement("mutation");a.setAttribute("at",B(this,"AT").type==h.Wa);return a},zb:function(a){a=
"false"!=a.getAttribute("at");this.qe(a)},qe:function(a){this.ib("AT");this.ib("ORDINAL",!0);a?(N(this,"AT").vb("Number"),h.h.ORDINAL_NUMBER_SUFFIX&&L(O(this,"ORDINAL"),h.h.ORDINAL_NUMBER_SUFFIX)):O(this,"AT");var c=new h.Ja(this.Gr,function(d){var e="FROM_START"==d||"FROM_END"==d;if(e!=a){var f=this.B;f.qe(e);Jb(f,d,"WHERE");return null}});Mb(this,"AT","TO");B(this,"ORDINAL")&&Mb(this,"ORDINAL","TO");L(B(this,"AT"),c,"WHERE")}};
h.J.lists_getSublist={S:function(){this.WHERE_OPTIONS_1=[[h.h.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[h.h.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[h.h.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[h.h.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[h.h.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[h.h.LISTS_GET_SUBLIST_END_LAST,"LAST"]];this.ub=h.h.LISTS_GET_SUBLIST_HELPURL;M(this,"list_blocks");L(N(this,"LIST").vb("Array"),h.h.LISTS_GET_SUBLIST_INPUT_IN_LIST);O(this,
"AT1");O(this,"AT2");h.h.LISTS_GET_SUBLIST_TAIL&&L(O(this,"TAIL"),h.h.LISTS_GET_SUBLIST_TAIL);this.$c(!0);this.Ad(!0,"Array");this.qe(1,!0);this.qe(2,!0);this.Ra(h.h.LISTS_GET_SUBLIST_TOOLTIP)},eb:function(){var a=h.g.xml.createElement("mutation");a.setAttribute("at1",B(this,"AT1").type==h.Wa);a.setAttribute("at2",B(this,"AT2").type==h.Wa);return a},zb:function(a){var c="true"==a.getAttribute("at1");a="true"==a.getAttribute("at2");this.qe(1,c);this.qe(2,a)},qe:function(a,c){this.ib("AT"+a);this.ib("ORDINAL"+
a,!0);c?(N(this,"AT"+a).vb("Number"),h.h.ORDINAL_NUMBER_SUFFIX&&L(O(this,"ORDINAL"+a),h.h.ORDINAL_NUMBER_SUFFIX)):O(this,"AT"+a);var d=new h.Ja(this["WHERE_OPTIONS_"+a],function(e){var f="FROM_START"==e||"FROM_END"==e;if(f!=c){var g=this.B;g.qe(a,f);Jb(g,e,"WHERE"+a);return null}});L(B(this,"AT"+a),d,"WHERE"+a);1==a&&(Mb(this,"AT1","AT2"),B(this,"ORDINAL1")&&Mb(this,"ORDINAL1","AT2"));h.h.LISTS_GET_SUBLIST_TAIL&&Mb(this,"TAIL",null)}};
h.J.lists_sort={S:function(){P(this,{message0:h.h.LISTS_SORT_TITLE,args0:[{type:"field_dropdown",name:"TYPE",options:[[h.h.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[h.h.LISTS_SORT_TYPE_TEXT,"TEXT"],[h.h.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[h.h.LISTS_SORT_ORDER_ASCENDING,"1"],[h.h.LISTS_SORT_ORDER_DESCENDING,"-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",style:"list_blocks",tooltip:h.h.LISTS_SORT_TOOLTIP,helpUrl:h.h.LISTS_SORT_HELPURL})}};
h.J.lists_split={S:function(){var a=this,c=new h.Ja([[h.h.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[h.h.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]],function(d){a.Rn(d)});this.ub=h.h.LISTS_SPLIT_HELPURL;M(this,"list_blocks");L(N(this,"INPUT").vb("String"),c,"MODE");L(N(this,"DELIM").vb("String"),h.h.LISTS_SPLIT_WITH_DELIMITER);this.$c(!0);this.Ad(!0,"Array");this.Ra(function(){var d=G(a,"MODE");if("SPLIT"==d)return h.h.LISTS_SPLIT_TOOLTIP_SPLIT;if("JOIN"==d)return h.h.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+
d);})},Rn:function(a){if(G(this,"MODE")!=a){var c=B(this,"INPUT").connection;c.pf=null;var d=z(c);d&&(c.disconnect(),d.cb?d.I():this.Kb())}"SPLIT"==a?(this.M.vb("Array"),B(this,"INPUT").vb("String")):(this.M.vb("String"),B(this,"INPUT").vb("Array"))},eb:function(){var a=h.g.xml.createElement("mutation");a.setAttribute("mode",G(this,"MODE"));return a},zb:function(a){this.Rn(a.getAttribute("mode"))}};h.J.NF={};h.la.ed={};h.la.ed.oo=210;
h.zk([{type:"logic_boolean",message0:"%1",args0:[{type:"field_dropdown",name:"BOOL",options:[["%{BKY_LOGIC_BOOLEAN_TRUE}","TRUE"],["%{BKY_LOGIC_BOOLEAN_FALSE}","FALSE"]]}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_BOOLEAN_TOOLTIP}",helpUrl:"%{BKY_LOGIC_BOOLEAN_HELPURL}"},{type:"controls_if",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],previousStatement:null,
nextStatement:null,style:"logic_blocks",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",mutator:"controls_if_mutator",extensions:["controls_if_tooltip"]},{type:"controls_ifelse",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],message2:"%{BKY_CONTROLS_IF_MSG_ELSE} %1",args2:[{type:"input_statement",name:"ELSE"}],previousStatement:null,nextStatement:null,style:"logic_blocks",tooltip:"%{BKYCONTROLS_IF_TOOLTIP_2}",
helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",extensions:["controls_if_tooltip"]},{type:"logic_compare",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A"},{type:"field_dropdown",name:"OP",options:[["=","EQ"],["\u2260","NEQ"],["\u200f<","LT"],["\u200f\u2264","LTE"],["\u200f>","GT"],["\u200f\u2265","GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",
message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",
tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",
name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]}]);
h.zk([{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",
tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]);h.la.ed.Ar={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};h.Y.register("logic_op_tooltip",h.Y.Lo("OP",h.la.ed.Ar));
h.la.ed.Fq={Nd:0,De:0,ki:!0,eb:function(){if(!this.Nd&&!this.De)return null;var a=h.g.xml.createElement("mutation");this.Nd&&a.setAttribute("elseif",this.Nd);this.De&&a.setAttribute("else",1);return a},zb:function(a){this.Nd=parseInt(a.getAttribute("elseif"),10)||0;this.De=parseInt(a.getAttribute("else"),10)||0;this.IG()},Gg:function(a){var c=a.Uh("controls_if_if");c.Ke();for(var d=c.X,e=1;e<=this.Nd;e++){var f=a.Uh("controls_if_elseif");f.Ke();d.connect(f.Z);d=f.X}this.De&&(a=a.Uh("controls_if_else"),
a.Ke(),d.connect(a.Z));return c},Dg:function(a){a=z(a.X);this.De=this.Nd=0;for(var c=[null],d=[null],e=null;a;){switch(a.type){case "controls_if_elseif":this.Nd++;c.push(a.bv);d.push(a.rf);break;case "controls_if_else":this.De++;e=a.rf;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.X&&z(a.X)}this.Ic();this.Oz(c,d,e)},cq:function(a){a=z(a.X);for(var c=1;a;){switch(a.type){case "controls_if_elseif":var d=B(this,"IF"+c),e=B(this,"DO"+c);a.bv=d&&d.connection.ca;a.rf=e&&e.connection.ca;
c++;break;case "controls_if_else":e=B(this,"ELSE");a.rf=e&&e.connection.ca;break;default:throw TypeError("Unknown block type: "+a.type);}a=a.X&&z(a.X)}},IG:function(){var a=[null],c=[null],d=null;B(this,"ELSE")&&(d=B(this,"ELSE").connection.ca);for(var e=1;B(this,"IF"+e);){var f=B(this,"DO"+e);a.push(B(this,"IF"+e).connection.ca);c.push(f.connection.ca);e++}this.Ic();this.Oz(a,c,d)},Ic:function(){B(this,"ELSE")&&this.ib("ELSE");for(var a=1;B(this,"IF"+a);)this.ib("IF"+a),this.ib("DO"+a),a++;for(a=
1;a<=this.Nd;a++)L(N(this,"IF"+a).vb("Boolean"),h.h.CONTROLS_IF_MSG_ELSEIF),L(Lb(this,"DO"+a),h.h.CONTROLS_IF_MSG_THEN);this.De&&L(Lb(this,"ELSE"),h.h.CONTROLS_IF_MSG_ELSE)},Oz:function(a,c,d){for(var e=1;e<=this.Nd;e++)h.Qb.$k(a[e],this,"IF"+e),h.Qb.$k(c[e],this,"DO"+e);h.Qb.$k(d,this,"ELSE")}};h.Y.wu("controls_if_mutator",h.la.ed.Fq,null,["controls_if_elseif","controls_if_else"]);
h.la.ed.yv=function(){this.Ra(function(){if(this.Nd||this.De){if(!this.Nd&&this.De)return h.h.CONTROLS_IF_TOOLTIP_2;if(this.Nd&&!this.De)return h.h.CONTROLS_IF_TOOLTIP_3;if(this.Nd&&this.De)return h.h.CONTROLS_IF_TOOLTIP_4}else return h.h.CONTROLS_IF_TOOLTIP_1;return""}.bind(this))};h.Y.register("controls_if_tooltip",h.la.ed.yv);
h.la.ed.YB={onchange:function(a){this.Yk||(this.Yk=[null,null]);var c=Nb(this,"A"),d=Nb(this,"B");c&&d&&!Ea(c.M,d.M)&&(h.i.$(a.group),a=this.Yk[0],a!==c&&(A(c),a&&!a.cb&&B(this,"A").connection.connect(a.M)),c=this.Yk[1],c!==d&&(A(d),c&&!c.cb&&B(this,"B").connection.connect(c.M)),this.Kb(),h.i.$(!1));this.Yk[0]=Nb(this,"A");this.Yk[1]=Nb(this,"B")}};h.la.ed.XB=function(){this.rj(h.la.ed.YB)};h.Y.register("logic_compare",h.la.ed.XB);
h.la.ed.ZB={Kz:null,onchange:function(a){var c=Nb(this,"THEN"),d=Nb(this,"ELSE"),e=this.M.ca;if((c||d)&&e)for(var f=0;2>f;f++){var g=1==f?c:d;g&&!Ea(g.M,e)&&(h.i.$(a.group),e===this.Kz?(A(this),e.B.Kb()):(A(g),g.Kb()),h.i.$(!1))}this.Kz=e}};h.Y.Xp("logic_ternary",h.la.ed.ZB);h.J.PF={};h.la.ve={};h.la.ve.oo=120;
h.zk([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",
args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}","UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",
name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_WHILEUNTIL_HELPURL}",extensions:["controls_whileUntil_tooltip"]},{type:"controls_for",message0:"%{BKY_CONTROLS_FOR_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",
args1:[{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOR_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_for_tooltip"]},{type:"controls_forEach",message0:"%{BKY_CONTROLS_FOREACH_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,
nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}","CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",extensions:["controls_flow_tooltip",
"controls_flow_in_loop_check"]}]);h.la.ve.YC={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"};h.Y.register("controls_whileUntil_tooltip",h.Y.Lo("MODE",h.la.ve.YC));h.la.ve.QA={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"};h.Y.register("controls_flow_tooltip",h.Y.Lo("FLOW",h.la.ve.QA));
h.la.ve.gB={Fg:function(a){if(!this.$b){var c=y(this,"VAR").Vc(),d=c.name;if(!this.isCollapsed()&&null!=d){var e={enabled:!0};e.text=h.h.VARIABLES_SET_CREATE_GET.replace("%1",d);c=h.O.Dm(c);d=h.g.xml.createElement("block");d.setAttribute("type","variables_get");d.appendChild(c);e.yb=h.Ea.Mo(this,d);a.push(e)}}}};h.Y.Xp("contextMenu_newGetVariableBlock",h.la.ve.gB);h.Y.register("controls_for_tooltip",h.Y.Wr("%{BKY_CONTROLS_FOR_TOOLTIP}"));h.Y.register("controls_forEach_tooltip",h.Y.Wr("%{BKY_CONTROLS_FOREACH_TOOLTIP}"));
h.la.ve.eo={aC:["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"],ki:!0,qy:function(a){do{if(-1!=h.la.ve.eo.aC.indexOf(a.type))return a;a=Gb(a)}while(a);return null},onchange:function(){this.v.gc&&!this.v.gc()&&(h.la.ve.eo.qy(this)?(this.Yg(null),this.$b||this.md(!0)):(this.Yg(h.h.CONTROLS_FLOW_STATEMENTS_WARNING),this.$b||Kb(this)||this.md(!1)))}};h.Y.Xp("controls_flow_in_loop_check",h.la.ve.eo);h.Kc=function(a,c,d){this.Ow=null;null==a&&(a="FALSE");h.Kc.w.constructor.call(this,a,c,d);this.bc.width=h.Kc.ZC};h.g.object.W(h.Kc,h.Na);h.Kc.va=function(a){return new h.Kc(a.checked,void 0,a)};h.Kc.ZC=15;h.Kc.UA="\u2713";h.Kc.VA=h.Na.wi-3;h.Kc.WA=14;b=h.Kc.prototype;b.Hi=!0;b.Hq="default";b.Sf=!1;b.Kd=function(a){h.Kc.w.Kd.call(this,a);a.checkCharacter&&(this.Ow=a.checkCharacter)};
b.Jh=function(){h.Kc.w.Jh.call(this);this.ic.setAttribute("x",h.Kc.VA);this.ic.setAttribute("y",h.Kc.WA);h.g.o.Cb(this.ic,"blocklyCheckbox");this.Kj.nodeValue=this.Ow||h.Kc.UA;this.ic.style.display=this.cc?"block":"none"};b.qf=function(){this.setValue(!this.cc)};b.wh=function(a){return!0===a||"TRUE"===a?"TRUE":!1===a||"FALSE"===a?"FALSE":null};b.Yi=function(a){this.cc=Je(a);this.ic&&(this.ic.style.display=this.cc?"block":"none")};b.getValue=function(){return this.cc?"TRUE":"FALSE"};b.Tb=function(){return String(Je(this.cc))};
function Je(a){return"string"==typeof a?"TRUE"==a:!!a}h.Tc.register("field_checkbox",h.Kc);h.J.GG={};
h.J.procedures_defnoreturn={S:function(){var a=new h.xb("",h.Ga.Yp);se(a);L(L(L(O(this),h.h.PROCEDURES_DEFNORETURN_TITLE),a,"NAME"),"","PARAMS");this.ji(new h.Qb(["procedures_mutatorarg"]));(this.v.options.hm||this.v.options.Nb&&this.v.options.Nb.options.hm)&&h.h.PROCEDURES_DEFNORETURN_COMMENT&&this.$f(h.h.PROCEDURES_DEFNORETURN_COMMENT);M(this,"procedure_blocks");this.Ra(h.h.PROCEDURES_DEFNORETURN_TOOLTIP);this.ub=h.h.PROCEDURES_DEFNORETURN_HELPURL;this.xa=[];this.Xb=[];this.cg(!0);this.rf=null},
cg:function(a){this.vp!==a&&(a?(L(Lb(this,"STACK"),h.h.PROCEDURES_DEFNORETURN_DO),B(this,"RETURN")&&Mb(this,"STACK","RETURN")):this.ib("STACK",!0),this.vp=a)},Qn:function(){var a="";this.xa.length&&(a=h.h.PROCEDURES_BEFORE_PARAMS+" "+this.xa.join(", "));h.i.disable();try{Jb(this,a,"PARAMS")}finally{h.i.enable()}},eb:function(a){var c=h.g.xml.createElement("mutation");a&&c.setAttribute("name",G(this,"NAME"));for(var d=0;d<this.Xb.length;d++){var e=h.g.xml.createElement("arg"),f=this.Xb[d];e.setAttribute("name",
f.name);e.setAttribute("varid",f.ua());a&&this.lu&&e.setAttribute("paramId",this.lu[d]);c.appendChild(e)}this.vp||c.setAttribute("statements","false");return c},zb:function(a){this.xa=[];this.Xb=[];for(var c=0,d;d=a.childNodes[c];c++)if("arg"==d.nodeName.toLowerCase()){var e=d.getAttribute("name");d=d.getAttribute("varid")||d.getAttribute("varId");this.xa.push(e);d=h.O.op(this.v,d,e,"");null!=d?this.Xb.push(d):console.log("Failed to create a variable with name "+e+", ignoring.")}this.Qn();h.Ga.gn(this);
this.cg("false"!==a.getAttribute("statements"))},Gg:function(a){var c=h.g.xml.createElement("block");c.setAttribute("type","procedures_mutatorcontainer");var d=h.g.xml.createElement("statement");d.setAttribute("name","STACK");c.appendChild(d);for(var e=0;e<this.xa.length;e++){var f=h.g.xml.createElement("block");f.setAttribute("type","procedures_mutatorarg");var g=h.g.xml.createElement("field");g.setAttribute("name","NAME");var k=h.g.xml.createTextNode(this.xa[e]);g.appendChild(k);f.appendChild(g);
g=h.g.xml.createElement("next");f.appendChild(g);d.appendChild(f);d=g}a=h.R.Zi(c,a);"procedures_defreturn"==this.type?Jb(a,this.vp,"STATEMENTS"):a.ib("STATEMENT_INPUT");h.Ga.gn(this);return a},Dg:function(a){this.xa=[];this.lu=[];this.Xb=[];for(var c=Nb(a,"STACK");c;){var d=G(c,"NAME");this.xa.push(d);d=this.v.Vc(d,"");this.Xb.push(d);this.lu.push(c.id);c=c.X&&z(c.X)}this.Qn();h.Ga.gn(this);a=G(a,"STATEMENTS");if(null!==a&&(a="TRUE"==a,this.vp!=a))if(a)this.cg(!0),h.Qb.$k(this.rf,this,"STACK"),this.rf=
null;else{a=B(this,"STACK").connection;if(this.rf=a.ca)a=z(a),A(a),a.Kb();this.cg(!1)}},Dh:function(){return[G(this,"NAME"),this.xa,!1]},ht:function(){return this.xa},Mg:function(){return this.Xb},Zp:function(a,c){var d=this.v.hf(a);if(""==d.type){d=d.name;c=this.v.hf(c);for(var e=!1,f=0;f<this.Xb.length;f++)this.Xb[f].ua()==a&&(this.xa[f]=c.name,this.Xb[f]=c,e=!0);e&&(this.$o(d,c.name),h.Ga.gn(this))}},pq:function(a){for(var c=a.name,d=!1,e=0;e<this.Xb.length;e++)if(this.Xb[e].ua()==a.ua()){var f=
this.xa[e];this.xa[e]=c;d=!0}d&&(this.$o(f,c),h.Ga.gn(this))},$o:function(a,c){this.Qn();if(this.Pd&&this.Pd.isVisible())for(var d=K(this.Pd.s,!1),e=0,f;f=d[e];e++)"procedures_mutatorarg"==f.type&&h.Xd.Ee(a,G(f,"NAME"))&&Jb(f,c,"NAME")},Fg:function(a){if(!this.$b){var c={enabled:!0},d=G(this,"NAME");c.text=h.h.PROCEDURES_CREATE_DO.replace("%1",d);var e=h.g.xml.createElement("mutation");e.setAttribute("name",d);for(d=0;d<this.xa.length;d++){var f=h.g.xml.createElement("arg");f.setAttribute("name",
this.xa[d]);e.appendChild(f)}d=h.g.xml.createElement("block");d.setAttribute("type",this.Mw);d.appendChild(e);c.yb=h.Ea.Mo(this,d);a.push(c);if(!this.isCollapsed())for(d=0;d<this.Xb.length;d++)c={enabled:!0},e=this.Xb[d],c.text=h.h.VARIABLES_SET_CREATE_GET.replace("%1",e.name),e=h.O.Dm(e),f=h.g.xml.createElement("block"),f.setAttribute("type","variables_get"),f.appendChild(e),c.yb=h.Ea.Mo(this,f),a.push(c)}},Mw:"procedures_callnoreturn"};
h.J.procedures_defreturn={S:function(){var a=new h.xb("",h.Ga.Yp);se(a);L(L(L(O(this),h.h.PROCEDURES_DEFRETURN_TITLE),a,"NAME"),"","PARAMS");L(Fb(N(this,"RETURN"),h.tl),h.h.PROCEDURES_DEFRETURN_RETURN);this.ji(new h.Qb(["procedures_mutatorarg"]));(this.v.options.hm||this.v.options.Nb&&this.v.options.Nb.options.hm)&&h.h.PROCEDURES_DEFRETURN_COMMENT&&this.$f(h.h.PROCEDURES_DEFRETURN_COMMENT);M(this,"procedure_blocks");this.Ra(h.h.PROCEDURES_DEFRETURN_TOOLTIP);this.ub=h.h.PROCEDURES_DEFRETURN_HELPURL;
this.xa=[];this.Xb=[];this.cg(!0);this.rf=null},cg:h.J.procedures_defnoreturn.cg,Qn:h.J.procedures_defnoreturn.Qn,eb:h.J.procedures_defnoreturn.eb,zb:h.J.procedures_defnoreturn.zb,Gg:h.J.procedures_defnoreturn.Gg,Dg:h.J.procedures_defnoreturn.Dg,Dh:function(){return[G(this,"NAME"),this.xa,!0]},ht:h.J.procedures_defnoreturn.ht,Mg:h.J.procedures_defnoreturn.Mg,Zp:h.J.procedures_defnoreturn.Zp,pq:h.J.procedures_defnoreturn.pq,$o:h.J.procedures_defnoreturn.$o,Fg:h.J.procedures_defnoreturn.Fg,Mw:"procedures_callreturn"};
h.J.procedures_mutatorcontainer={S:function(){L(O(this),h.h.PROCEDURES_MUTATORCONTAINER_TITLE);Lb(this,"STACK");L(L(O(this,"STATEMENT_INPUT"),h.h.PROCEDURES_ALLOW_STATEMENTS),new h.Kc("TRUE"),"STATEMENTS");M(this,"procedure_blocks");this.Ra(h.h.PROCEDURES_MUTATORCONTAINER_TOOLTIP);this.contextMenu=!1},onchange:function(a){if(this.v&&!this.v.ke&&(a.type==h.i.Wn||a.type==h.i.vl)){var c=K(this.v),d=this.v.Kg();if(a.type==h.i.Wn){a=[];for(var e=0;e<c.length;e+=1)G(c[e],"NAME")&&a.push(G(c[e],"NAME"));
for(c=0;c<d.length;c+=1)-1==a.indexOf(d[c].name)&&this.v.Kf(d[c].ua())}else if(a.type==h.i.vl&&(d=r(this.v,a.wc),y(d,"NAME")&&(e=G(d,"NAME"),(a=this.v.Vc(e))||(a=this.v.Ld(e)),!d.Z.isConnected()&&!d.X.isConnected())))for(e=0;e<c.length;e+=1)if(d.id!=c[e].id&&G(c[e],"NAME")==a.name){e=h.O.Wx(this.v);a=this.v.Ld(e);Jb(d,a.name,"NAME");break}}}};
h.J.procedures_mutatorarg={S:function(){var a=new h.xb("x",this.Oj);a.iG=a.qf;a.qf=function(){this.qm=[];this.iG()};L(L(O(this),h.h.PROCEDURES_MUTATORARG_TITLE),a,"NAME");this.ne(!0);this.me(!0);M(this,"procedure_blocks");this.Ra(h.h.PROCEDURES_MUTATORARG_TOOLTIP);this.contextMenu=!1;a.cu=this.jE;a.qm=[];a.cu("x")},Oj:function(a){var c=this.B,d=h.Qb.Nx(c.v);a=a.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,"");if(!a)return null;c=K(c.v);for(var e=0;e<c.length;e++)if(c[e].id!=this.B.id&&G(c[e],"NAME")==
a)return null;(c=d.Vc(a,""))&&c.name!=a&&d.ei(c.ua(),a);c||(c=d.Ld(a,""))&&this.qm&&this.qm.push(c);return a},jE:function(a){var c=h.Qb.Nx(this.B.v);if(c)for(var d=0;d<this.qm.length;d++){var e=this.qm[d];e.name!=a&&c.Kf(e.ua())}}};
h.J.procedures_callnoreturn={S:function(){L(O(this,"TOPROW"),this.id,"NAME");this.ne(!0);this.me(!0);M(this,"procedure_blocks");this.ub=h.h.PROCEDURES_CALLNORETURN_HELPURL;this.xa=[];this.Xb=[];this.Rg={};this.Xf=null;this.tu=!0},ee:function(){return G(this,"NAME")},rn:function(a,c){h.Xd.Ee(a,this.ee())&&(Jb(this,c,"NAME"),this.Ra((this.M?h.h.PROCEDURES_CALLRETURN_TOOLTIP:h.h.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",c)))},Ju:function(a,c){var d=h.Ga.Fm(this.ee(),this.v),e=d&&d.Pd&&d.Pd.isVisible();
e||(this.Rg={},this.Xf=null);if(c)if(a.join("\n")==this.xa.join("\n"))this.Xf=c;else{if(c.length!=a.length)throw RangeError("paramNames and paramIds must be the same length.");this.Wg(!1);this.Xf||(this.Rg={},this.Xf=[]);d=this.ba;this.ba=!1;for(var f=0;f<this.xa.length;f++){var g=B(this,"ARG"+f);g&&(g=g.connection.ca,this.Rg[this.Xf[f]]=g,e&&g&&-1==c.indexOf(this.Xf[f])&&(g.disconnect(),g.B.Kb()))}this.xa=[].concat(a);this.Xb=[];for(f=0;f<this.xa.length;f++)a=h.O.op(this.v,null,this.xa[f],""),this.Xb.push(a);
this.Ic();if(this.Xf=c)for(f=0;f<this.xa.length;f++)c=this.Xf[f],c in this.Rg&&(g=this.Rg[c],h.Qb.$k(g,this,"ARG"+f)||delete this.Rg[c]);(this.ba=d)&&this.za()}},Ic:function(){for(var a=0;a<this.xa.length;a++){var c=y(this,"ARGNAME"+a);if(c){h.i.disable();try{c.setValue(this.xa[a])}finally{h.i.enable()}}else c=new h.Fd(this.xa[a]),L(Fb(N(this,"ARG"+a),h.tl),c,"ARGNAME"+a).S()}for(;B(this,"ARG"+a);)this.ib("ARG"+a),a++;if(a=B(this,"TOPROW"))this.xa.length?y(this,"WITH")||(L(a,h.h.PROCEDURES_CALL_BEFORE_PARAMS,
"WITH"),a.S()):y(this,"WITH")&&Cb(a,"WITH")},eb:function(){var a=h.g.xml.createElement("mutation");a.setAttribute("name",this.ee());for(var c=0;c<this.xa.length;c++){var d=h.g.xml.createElement("arg");d.setAttribute("name",this.xa[c]);a.appendChild(d)}return a},zb:function(a){var c=a.getAttribute("name");this.rn(this.ee(),c);c=[];for(var d=[],e=0,f;f=a.childNodes[e];e++)"arg"==f.nodeName.toLowerCase()&&(c.push(f.getAttribute("name")),d.push(f.getAttribute("paramId")));this.Ju(c,d)},Mg:function(){return this.Xb},
onchange:function(a){if(this.v&&!this.v.ke&&a.Dc)if(a.type==h.i.vl&&-1!=a.Gh.indexOf(this.id)){var c=this.ee();c=h.Ga.Fm(c,this.v);!c||c.type==this.os&&JSON.stringify(c.xa)==JSON.stringify(this.xa)||(c=null);if(!c){h.i.$(a.group);a=h.g.xml.createElement("xml");c=h.g.xml.createElement("block");c.setAttribute("type",this.os);var d=this.Qa(),e=d.y+2*h.td;c.setAttribute("x",d.x+h.td*(this.G?-1:1));c.setAttribute("y",e);d=this.eb();c.appendChild(d);d=h.g.xml.createElement("field");d.setAttribute("name",
"NAME");d.appendChild(h.g.xml.createTextNode(this.ee()));c.appendChild(d);a.appendChild(c);h.R.xh(a,this.v);h.i.$(!1)}}else a.type==h.i.Wn?(c=this.ee(),c=h.Ga.Fm(c,this.v),c||(h.i.$(a.group),this.I(!0,!1),h.i.$(!1))):a.type==h.i.si&&"disabled"==a.element&&(c=this.ee(),(c=h.Ga.Fm(c,this.v))&&c.id==a.wc&&((c=h.i.Zb())&&console.log("Saw an existing group while responding to a definition change"),h.i.$(a.group),a.newValue?(this.tu=this.isEnabled(),this.md(!1)):this.md(this.tu),h.i.$(c)))},Fg:function(a){if(this.v.kd()){var c=
{enabled:!0};c.text=h.h.PROCEDURES_HIGHLIGHT_DEF;var d=this.ee(),e=this.v;c.yb=function(){var f=h.Ga.Fm(d,e);if(f){if(e.kd()){var g=r(e,f.id);if(g){var k=g.Qa(),l=H(g),m=e.scale;g=(k.x+(e.G?-1:1)*l.width/2)*m;k=(k.y+l.height/2)*m;l=e.Uc();g=-(g-l.Rc-l.Bb/2)-l.Rc;k=-(k-l.xc-l.Pb/2)-l.xc;h.oc();e.scroll(g,k)}}else console.warn("Tried to move a non-movable workspace. This could result in blocks becoming inaccessible.");f.select()}};a.push(c)}},os:"procedures_defnoreturn"};
h.J.procedures_callreturn={S:function(){L(O(this,"TOPROW"),"","NAME");this.Ad(!0);M(this,"procedure_blocks");this.ub=h.h.PROCEDURES_CALLRETURN_HELPURL;this.xa=[];this.Rg={};this.Xf=null;this.tu=!0},ee:h.J.procedures_callnoreturn.ee,rn:h.J.procedures_callnoreturn.rn,Ju:h.J.procedures_callnoreturn.Ju,Ic:h.J.procedures_callnoreturn.Ic,eb:h.J.procedures_callnoreturn.eb,zb:h.J.procedures_callnoreturn.zb,Mg:h.J.procedures_callnoreturn.Mg,onchange:h.J.procedures_callnoreturn.onchange,Fg:h.J.procedures_callnoreturn.Fg,
os:"procedures_defreturn"};
h.J.procedures_ifreturn={S:function(){L(N(this,"CONDITION").vb("Boolean"),h.h.CONTROLS_IF_MSG_IF);L(N(this,"VALUE"),h.h.PROCEDURES_DEFRETURN_RETURN);this.$c(!0);this.ne(!0);this.me(!0);M(this,"procedure_blocks");this.Ra(h.h.PROCEDURES_IFRETURN_TOOLTIP);this.ub=h.h.PROCEDURES_IFRETURN_HELPURL;this.Fh=!0},eb:function(){var a=h.g.xml.createElement("mutation");a.setAttribute("value",Number(this.Fh));return a},zb:function(a){this.Fh=1==a.getAttribute("value");this.Fh||(this.ib("VALUE"),L(O(this,"VALUE"),
h.h.PROCEDURES_DEFRETURN_RETURN))},onchange:function(){if(this.v.gc&&!this.v.gc()){var a=!1,c=this;do{if(-1!=this.yB.indexOf(c.type)){a=!0;break}c=Gb(c)}while(c);a?("procedures_defnoreturn"==c.type&&this.Fh?(this.ib("VALUE"),L(O(this,"VALUE"),h.h.PROCEDURES_DEFRETURN_RETURN),this.Fh=!1):"procedures_defreturn"!=c.type||this.Fh||(this.ib("VALUE"),L(N(this,"VALUE"),h.h.PROCEDURES_DEFRETURN_RETURN),this.Fh=!0),this.Yg(null),this.$b||this.md(!0)):(this.Yg(h.h.PROCEDURES_IFRETURN_WARNING),this.$b||Kb(this)||
this.md(!1))}},yB:["procedures_defnoreturn","procedures_defreturn"]};h.J.vH={};h.la.O={};h.la.O.oo=330;
h.zk([{type:"variables_get",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableSetterGetter"]},{type:"variables_set",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,
style:"variable_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableSetterGetter"]}]);
h.la.O.hB={Fg:function(a){if(!this.$b){if("variables_get"==this.type)var c="variables_set",d=h.h.VARIABLES_GET_CREATE_SET;else c="variables_get",d=h.h.VARIABLES_SET_CREATE_GET;var e={enabled:0<$a(this.v)},f=y(this,"VAR").Tb();e.text=d.replace("%1",f);d=h.g.xml.createElement("field");d.setAttribute("name","VAR");d.appendChild(h.g.xml.createTextNode(f));f=h.g.xml.createElement("block");f.setAttribute("type",c);f.appendChild(d);e.yb=h.Ea.Mo(this,f);a.push(e)}else if("variables_get"==this.type||"variables_get_reporter"==
this.type)c={text:h.h.PK,enabled:!0,yb:h.la.O.yC(this)},f=y(this,"VAR").Tb(),e={text:h.h.jI.replace("%1",f),enabled:!0,yb:h.la.O.lB(this)},a.unshift(c),a.unshift(e)}};h.la.O.yC=function(a){return function(){var c=a.v,d=y(a,"VAR").Vc();h.O.$p(c,d)}};h.la.O.lB=function(a){return function(){var c=a.v,d=y(a,"VAR").Vc();c.Kf(d.ua());zc(c)}};h.Y.Xp("contextMenu_variableSetterGetter",h.la.O.hB);h.j.Ht={};h.j.lists_create_empty=function(){return["[]",h.j.Ci]};h.j.lists_create_with=function(a){for(var c=Array(a.yd),d=0;d<a.yd;d++)c[d]=Y(a,"ADD"+d,h.j.Lc)||"null";return["["+c.join(", ")+"]",h.j.Ci]};h.j.lists_repeat=function(a){var c=He("listsRepeat",["function "+h.j.ue+"(value, n) {"," var array = [];"," for (var i = 0; i < n; i++) {"," array[i] = value;"," }"," return array;","}"]),d=Y(a,"ITEM",h.j.Lc)||"null";a=Y(a,"NUM",h.j.Lc)||"0";return[c+"("+d+", "+a+")",h.j.gb]};
h.j.lists_length=function(a){return[(Y(a,"VALUE",h.j.Rb)||"[]")+".length",h.j.Rb]};h.j.lists_isEmpty=function(a){return["!"+(Y(a,"VALUE",h.j.Rb)||"[]")+".length",h.j.Jl]};h.j.lists_indexOf=function(a){var c="FIRST"==G(a,"END")?"indexOf":"lastIndexOf",d=Y(a,"FIND",h.j.Mc)||"''";c=(Y(a,"VALUE",h.j.Rb)||"[]")+"."+c+"("+d+")";return a.v.options.Ne?[c+" + 1",h.j.ih]:[c,h.j.gb]};
h.j.lists_getIndex=function(a){var c=G(a,"MODE")||"GET",d=G(a,"WHERE")||"FROM_START",e=Y(a,"VALUE","RANDOM"==d?h.j.Lc:h.j.Rb)||"[]";switch(d){case "FIRST":if("GET"==c)return[e+"[0]",h.j.Rb];if("GET_REMOVE"==c)return[e+".shift()",h.j.Rb];if("REMOVE"==c)return e+".shift();\n";break;case "LAST":if("GET"==c)return[e+".slice(-1)[0]",h.j.Rb];if("GET_REMOVE"==c)return[e+".pop()",h.j.Rb];if("REMOVE"==c)return e+".pop();\n";break;case "FROM_START":a=h.j.Of(a,"AT");if("GET"==c)return[e+"["+a+"]",h.j.Rb];if("GET_REMOVE"==
c)return[e+".splice("+a+", 1)[0]",h.j.gb];if("REMOVE"==c)return e+".splice("+a+", 1);\n";break;case "FROM_END":a=h.j.Of(a,"AT",1,!0);if("GET"==c)return[e+".slice("+a+")[0]",h.j.gb];if("GET_REMOVE"==c)return[e+".splice("+a+", 1)[0]",h.j.gb];if("REMOVE"==c)return e+".splice("+a+", 1);";break;case "RANDOM":e=He("listsGetRandomItem",["function "+h.j.ue+"(list, remove) {"," var x = Math.floor(Math.random() * list.length);"," if (remove) {"," return list.splice(x, 1)[0];"," } else {"," return list[x];",
" }","}"])+"("+e+", "+("GET"!=c)+")";if("GET"==c||"GET_REMOVE"==c)return[e,h.j.gb];if("REMOVE"==c)return e+";\n"}throw Error("Unhandled combination (lists_getIndex).");};
h.j.lists_setIndex=function(a){function c(){if(d.match(/^\w+$/))return"";var k=Fc(h.j.Cd,"tmpList",h.O.sb),l="var "+k+" = "+d+";\n";d=k;return l}var d=Y(a,"LIST",h.j.Rb)||"[]",e=G(a,"MODE")||"GET",f=G(a,"WHERE")||"FROM_START",g=Y(a,"TO",h.j.rg)||"null";switch(f){case "FIRST":if("SET"==e)return d+"[0] = "+g+";\n";if("INSERT"==e)return d+".unshift("+g+");\n";break;case "LAST":if("SET"==e)return a=c(),a+(d+"["+d+".length - 1] = "+g+";\n");if("INSERT"==e)return d+".push("+g+");\n";break;case "FROM_START":f=
h.j.Of(a,"AT");if("SET"==e)return d+"["+f+"] = "+g+";\n";if("INSERT"==e)return d+".splice("+f+", 0, "+g+");\n";break;case "FROM_END":f=h.j.Of(a,"AT",1,!1,h.j.gk);a=c();if("SET"==e)return a+(d+"["+d+".length - "+f+"] = "+g+";\n");if("INSERT"==e)return a+(d+".splice("+d+".length - "+f+", 0, "+g+");\n");break;case "RANDOM":a=c();f=Fc(h.j.Cd,"tmpX",h.O.sb);a+="var "+f+" = Math.floor(Math.random() * "+d+".length);\n";if("SET"==e)return a+(d+"["+f+"] = "+g+";\n");if("INSERT"==e)return a+(d+".splice("+f+
", 0, "+g+");\n")}throw Error("Unhandled combination (lists_setIndex).");};h.j.Ht.XE=function(a,c,d){return"FIRST"==c?"0":"FROM_END"==c?a+".length - 1 - "+d:"LAST"==c?a+".length - 1":d};
h.j.lists_getSublist=function(a){var c=Y(a,"LIST",h.j.Rb)||"[]",d=G(a,"WHERE1"),e=G(a,"WHERE2");if("FIRST"==d&&"LAST"==e)c+=".slice(0)";else if(c.match(/^\w+$/)||"FROM_END"!=d&&"FROM_START"==e){switch(d){case "FROM_START":var f=h.j.Of(a,"AT1");break;case "FROM_END":f=h.j.Of(a,"AT1",1,!1,h.j.gk);f=c+".length - "+f;break;case "FIRST":f="0";break;default:throw Error("Unhandled option (lists_getSublist).");}switch(e){case "FROM_START":a=h.j.Of(a,"AT2",1);break;case "FROM_END":a=h.j.Of(a,"AT2",0,!1,h.j.gk);
a=c+".length - "+a;break;case "LAST":a=c+".length";break;default:throw Error("Unhandled option (lists_getSublist).");}c=c+".slice("+f+", "+a+")"}else{f=h.j.Of(a,"AT1");a=h.j.Of(a,"AT2");var g=h.j.Ht.XE,k={FIRST:"First",LAST:"Last",FROM_START:"FromStart",FROM_END:"FromEnd"};c=He("subsequence"+k[d]+k[e],["function "+h.j.ue+"(sequence"+("FROM_END"==d||"FROM_START"==d?", at1":"")+("FROM_END"==e||"FROM_START"==e?", at2":"")+") {"," var start = "+g("sequence",d,"at1")+";"," var end = "+g("sequence",e,
"at2")+" + 1;"," return sequence.slice(start, end);","}"])+"("+c+("FROM_END"==d||"FROM_START"==d?", "+f:"")+("FROM_END"==e||"FROM_START"==e?", "+a:"")+")"}return[c,h.j.gb]};
h.j.lists_sort=function(a){var c=Y(a,"LIST",h.j.gb)||"[]",d="1"===G(a,"DIRECTION")?1:-1;a=G(a,"TYPE");var e=He("listsGetSortCompare",["function "+h.j.ue+"(type, direction) {"," var compareFuncs = {",' "NUMERIC": function(a, b) {'," return Number(a) - Number(b); },",' "TEXT": function(a, b) {'," return a.toString() > b.toString() ? 1 : -1; },",' "IGNORE_CASE": function(a, b) {'," return a.toString().toLowerCase() > b.toString().toLowerCase() ? 1 : -1; },"," };"," var compare = compareFuncs[type];",
" return function(a, b) { return compare(a, b) * direction; }","}"]);return[c+".slice().sort("+e+'("'+a+'", '+d+"))",h.j.gb]};h.j.lists_split=function(a){var c=Y(a,"INPUT",h.j.Rb),d=Y(a,"DELIM",h.j.Mc)||"''";a=G(a,"MODE");if("SPLIT"==a)c||(c="''"),a="split";else if("JOIN"==a)c||(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+"."+a+"("+d+")",h.j.gb]};h.j.lists_reverse=function(a){return[(Y(a,"LIST",h.j.gb)||"[]")+".slice().reverse()",h.j.gb]};h.j.NF={};h.j.controls_if=function(a){var c=0,d="";h.j.Jd&&(d+=X(h.j.Jd,a));do{var e=Y(a,"IF"+c,h.j.Mc)||"false";var f=Ee(a,"DO"+c);h.j.Oc&&(f=De(X(h.j.Oc,a),h.j.rd)+f);d+=(0<c?" else ":"")+"if ("+e+") {\n"+f+"}";++c}while(B(a,"IF"+c));if(B(a,"ELSE")||h.j.Oc)f=Ee(a,"ELSE"),h.j.Oc&&(f=De(X(h.j.Oc,a),h.j.rd)+f),d+=" else {\n"+f+"}";return d+"\n"};h.j.controls_ifelse=h.j.controls_if;
h.j.logic_compare=function(a){var c={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[G(a,"OP")],d="=="==c||"!="==c?h.j.aw:h.j.pC,e=Y(a,"A",d)||"0";a=Y(a,"B",d)||"0";return[e+" "+c+" "+a,d]};h.j.logic_operation=function(a){var c="AND"==G(a,"OP")?"&&":"||",d="&&"==c?h.j.cr:h.j.dr,e=Y(a,"A",d);a=Y(a,"B",d);if(e||a){var f="&&"==c?"true":"false";e||(e=f);a||(a=f)}else a=e="false";return[e+" "+c+" "+a,d]};h.j.logic_negate=function(a){var c=h.j.Jl;return["!"+(Y(a,"BOOL",c)||"true"),c]};
h.j.logic_boolean=function(a){return["TRUE"==G(a,"BOOL")?"true":"false",h.j.Ci]};h.j.logic_null=function(){return["null",h.j.Ci]};h.j.logic_ternary=function(a){var c=Y(a,"IF",h.j.zo)||"false",d=Y(a,"THEN",h.j.zo)||"null";a=Y(a,"ELSE",h.j.zo)||"null";return[c+" ? "+d+" : "+a,h.j.zo]};h.j.PF={};h.j.controls_repeat_ext=function(a){var c=y(a,"TIMES")?String(Number(G(a,"TIMES"))):Y(a,"TIMES",h.j.rg)||"0",d=Ee(a,"DO");d=Fe(d,a);a="";var e=Fc(h.j.Cd,"count",h.O.sb),f=c;c.match(/^\w+$/)||h.Ph(c)||(f=Fc(h.j.Cd,"repeat_end",h.O.sb),a+="var "+f+" = "+c+";\n");return a+("for (var "+e+" = 0; "+e+" < "+f+"; "+e+"++) {\n"+d+"}\n")};h.j.controls_repeat=h.j.controls_repeat_ext;
h.j.controls_whileUntil=function(a){var c="UNTIL"==G(a,"MODE"),d=Y(a,"BOOL",c?h.j.Jl:h.j.Mc)||"false",e=Ee(a,"DO");e=Fe(e,a);c&&(d="!"+d);return"while ("+d+") {\n"+e+"}\n"};
h.j.controls_for=function(a){var c=Q(G(a,"VAR"),h.O.sb),d=Y(a,"FROM",h.j.rg)||"0",e=Y(a,"TO",h.j.rg)||"0",f=Y(a,"BY",h.j.rg)||"1",g=Ee(a,"DO");g=Fe(g,a);if(h.Ph(d)&&h.Ph(e)&&h.Ph(f)){var k=Number(d)<=Number(e);a="for ("+c+" = "+d+"; "+c+(k?" <= ":" >= ")+e+"; "+c;c=Math.abs(Number(f));a=(1==c?a+(k?"++":"--"):a+((k?" += ":" -= ")+c))+(") {\n"+g+"}\n")}else a="",k=d,d.match(/^\w+$/)||h.Ph(d)||(k=Fc(h.j.Cd,c+"_start",h.O.sb),a+="var "+k+" = "+d+";\n"),d=e,e.match(/^\w+$/)||h.Ph(e)||(d=Fc(h.j.Cd,c+"_end",
h.O.sb),a+="var "+d+" = "+e+";\n"),e=Fc(h.j.Cd,c+"_inc",h.O.sb),a+="var "+e+" = ",a=h.Ph(f)?a+(Math.abs(f)+";\n"):a+("Math.abs("+f+");\n"),a=a+("if ("+k+" > "+d+") {\n")+(h.j.rd+e+" = -"+e+";\n"),a+="}\n",a+="for ("+c+" = "+k+"; "+e+" >= 0 ? "+c+" <= "+d+" : "+c+" >= "+d+"; "+c+" += "+e+") {\n"+g+"}\n";return a};
h.j.controls_forEach=function(a){var c=Q(G(a,"VAR"),h.O.sb),d=Y(a,"LIST",h.j.rg)||"[]",e=Ee(a,"DO");e=Fe(e,a);a="";var f=d;d.match(/^\w+$/)||(f=Fc(h.j.Cd,c+"_list",h.O.sb),a+="var "+f+" = "+d+";\n");d=Fc(h.j.Cd,c+"_index",h.O.sb);e=h.j.rd+c+" = "+f+"["+d+"];\n"+e;return a+("for (var "+d+" in "+f+") {\n"+e+"}\n")};
h.j.controls_flow_statements=function(a){var c="";h.j.Jd&&(c+=X(h.j.Jd,a));h.j.Oc&&(c+=X(h.j.Oc,a));if(h.j.Jd){var d=h.la.ve.eo.qy(a);d&&!d.ki&&(c+=X(h.j.Jd,d))}switch(G(a,"FLOW")){case "BREAK":return c+"break;\n";case "CONTINUE":return c+"continue;\n"}throw Error("Unknown flow statement.");};h.j.GG={};h.j.procedures_defreturn=function(a){var c=Q(G(a,"NAME"),h.Ga.sb),d="";h.j.Jd&&(d+=X(h.j.Jd,a));h.j.Oc&&(d+=X(h.j.Oc,a));d&&(d=De(d,h.j.rd));var e="";h.j.qo&&(e=De(X(h.j.qo,a),h.j.rd));var f=Ee(a,"STACK"),g=Y(a,"RETURN",h.j.Mc)||"",k="";f&&g&&(k=d);g&&(g=h.j.rd+"return "+g+";\n");for(var l=[],m=0;m<a.xa.length;m++)l[m]=Q(a.xa[m],h.O.sb);d="function "+c+"("+l.join(", ")+") {\n"+d+e+f+k+g+"}";d=h.j.eq(a,d);h.j.Wi["%"+c]=d;return null};h.j.procedures_defnoreturn=h.j.procedures_defreturn;
h.j.procedures_callreturn=function(a){for(var c=Q(G(a,"NAME"),h.Ga.sb),d=[],e=0;e<a.xa.length;e++)d[e]=Y(a,"ARG"+e,h.j.Lc)||"null";return[c+"("+d.join(", ")+")",h.j.gb]};h.j.procedures_callnoreturn=function(a){return h.j.procedures_callreturn(a)[0]+";\n"};h.j.procedures_ifreturn=function(a){var c="if ("+(Y(a,"CONDITION",h.j.Mc)||"false")+") {\n";h.j.Oc&&(c+=De(X(h.j.Oc,a),h.j.rd));a.Fh?(a=Y(a,"VALUE",h.j.Mc)||"null",c+=h.j.rd+"return "+a+";\n"):c+=h.j.rd+"return;\n";return c+"}\n"};h.j.vH={};h.j.variables_get=function(a){return[Q(G(a,"VAR"),h.O.sb),h.j.Ci]};h.j.variables_set=function(a){var c=Y(a,"VALUE",h.j.rg)||"0";return Q(G(a,"VAR"),h.O.sb)+" = "+c+";\n"};for(var Ke in h.la.ed.Fq)h.J.controls_if[Ke]=h.la.ed.Fq[Ke];h.J.controls_if.S=function(){this.ub=h.h.CONTROLS_IF_HELPURL;this.Fc(h.h.LOGIC_HUE);L(N(this,"IF0").vb("Boolean"),"if (");L(O(this),") {");Lb(this,"DO0");L(O(this,"TAIL"),"}");this.$c(!0);this.ne(!0);this.me(!0);this.ji(new h.Qb(["controls_if_elseif","controls_if_else"]));h.la.ed.yv.apply(this)};
h.J.controls_if.Ic=function(){B(this,"ELSE")&&(this.ib("ELSEMSG"),this.ib("ELSE"));for(var a=1;B(this,"IF"+a);)this.ib("IF"+a),this.ib("TAIL"+a),this.ib("DO"+a),a++;for(a=1;a<=this.Nd;a++)L(N(this,"IF"+a).vb("Boolean"),"} else if ("),L(O(this,"TAIL"+a),") {"),Lb(this,"DO"+a);this.De&&(L(O(this,"ELSEMSG"),"} else {"),Lb(this,"ELSE"));Mb(this,"TAIL",null)};
h.J.logic_compare.S=function(){this.ub=h.h.LOGIC_COMPARE_HELPURL;this.Fc(h.h.LOGIC_HUE);this.Ad(!0,"Boolean");N(this,"A");L(N(this,"B"),new h.Ja([["==","EQ"],["!=","NEQ"],["<","LT"],["<=","LTE"],[">","GT"],[">=","GTE"]]),"OP");this.$c(!0);var a=this;this.Ra(function(){var c=G(a,"OP");return{EQ:h.h.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:h.h.LOGIC_COMPARE_TOOLTIP_NEQ,LT:h.h.LOGIC_COMPARE_TOOLTIP_LT,LTE:h.h.LOGIC_COMPARE_TOOLTIP_LTE,GT:h.h.LOGIC_COMPARE_TOOLTIP_GT,GTE:h.h.LOGIC_COMPARE_TOOLTIP_GTE}[c]});this.Yk=
[null,null]};h.h.LOGIC_OPERATION_AND="&&";h.h.LOGIC_OPERATION_OR="||";h.h.LOGIC_NEGATE_TITLE="! %1";h.h.LOGIC_BOOLEAN_TRUE="true";h.h.LOGIC_BOOLEAN_FALSE="false";h.J.controls_whileUntil.S=function(){P(this,{message0:"while ( %1 ) { %2 %3 }",args0:[{type:"input_value",name:"BOOL",check:"Boolean"},{type:"input_dummy"},{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:h.h.LOOPS_HUE,tooltip:h.h.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,helpUrl:h.h.CONTROLS_WHILEUNTIL_HELPURL})};
h.J.controls_for.S=function(){P(this,{message0:"for (var %1 = %2; %3 < %4; %5 += 1) { %6 %7 }",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"field_label",name:"VAR1",text:"?"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"field_label",name:"VAR2",text:"?"},{type:"input_dummy"},{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:h.h.LOOPS_HUE,helpUrl:h.h.CONTROLS_FOR_HELPURL});
var a=this;this.Ra(function(){return h.h.CONTROLS_FOR_TOOLTIP.replace("%1",G(a,"VAR"))})};h.J.controls_for.onchange=function(){var a=y(this,"VAR").Tb();Jb(this,a,"VAR1");Jb(this,a,"VAR2")};h.j.controls_for=function(a){var c=Q(G(a,"VAR"),h.O.sb),d=Y(a,"FROM",h.j.rg)||"0",e=Y(a,"TO",h.j.rg)||"0",f=Ee(a,"DO");f=Fe(f,a.id);return"for (var "+c+" = "+d+"; "+c+" < "+e+"; "+c+" += 1) {\n"+f+"}\n"};h.h.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK="break ;";h.h.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE="continue ;";
h.J.math_arithmetic.S=function(){P(this,{message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["+","ADD"],["-","MINUS"],["*","MULTIPLY"],["/","DIVIDE"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",colour:h.h.MATH_HUE,helpUrl:h.h.MATH_ARITHMETIC_HELPURL});var a=this;this.Ra(function(){var c=G(a,"OP");return{ADD:h.h.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:h.h.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:h.h.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,
DIVIDE:h.h.MATH_ARITHMETIC_TOOLTIP_DIVIDE}[c]})};h.J.math_change.S=function(){P(this,{message0:"%1 += %2;",args0:[{type:"field_variable",name:"VAR",variable:"name"},{type:"input_value",name:"DELTA",check:"Number"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:h.h.VARIABLES_HUE,helpUrl:h.h.MATH_CHANGE_HELPURL});var a=this;this.Ra(function(){return h.h.MATH_CHANGE_TOOLTIP.replace("%1",G(a,"VAR"))})};
h.j.math_change=function(a){var c=Y(a,"DELTA",h.j.ih)||"0";return Q(G(a,"VAR"),h.O.sb)+" += "+c+";\n"};h.J.math_random_int.S=function(){P(this,{message0:"%1(%2,%3)",args0:["Math.randomInt",{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",colour:h.h.MATH_HUE,tooltip:h.h.MATH_RANDOM_INT_TOOLTIP,helpUrl:h.h.MATH_RANDOM_INT_HELPURL})};h.h.MATH_RANDOM_FLOAT_TITLE_RANDOM="Math.random ( )";h.h.LISTS_CREATE_EMPTY_TITLE="[ ]";
h.h.LISTS_CREATE_WITH_INPUT_WITH="[";h.J.lists_create_with.Ic=function(){B(this,"TAIL")&&this.ib("TAIL");this.yd&&B(this,"EMPTY")?this.ib("EMPTY"):this.yd||B(this,"EMPTY")||L(O(this,"EMPTY"),h.h.LISTS_CREATE_EMPTY_TITLE);for(var a=0;a<this.yd;a++)if(!B(this,"ADD"+a)){var c=N(this,"ADD"+a);0==a?L(c,h.h.LISTS_CREATE_WITH_INPUT_WITH):L(c,",")}for(;B(this,"ADD"+a);)this.ib("ADD"+a),a++;this.yd&&L(O(this,"TAIL"),"]")};
h.J.lists_getIndex={S:function(){P(this,{message0:"%1[%2]",args0:[{type:"input_value",name:"VALUE",check:"Array"},{type:"input_value",name:"AT",check:"Number"}],inputsInline:!0,output:null,colour:h.h.LISTS_HUE,tooltip:h.h.LISTS_GET_INDEX_TOOLTIP_GET_FROM+h.h.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1","#0"),helpUrl:h.h.LISTS_GET_INDEX_HELPURL})}};
h.J.lists_setIndex={S:function(){P(this,{message0:"%1[%2] = %3;",args0:[{type:"input_value",name:"LIST",check:"Array"},{type:"input_value",name:"AT",check:"Number"},{type:"input_value",name:"TO"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:h.h.LISTS_HUE,tooltip:h.h.LISTS_SET_INDEX_TOOLTIP_SET_FROM+h.h.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1","#0"),helpUrl:h.h.LISTS_SET_INDEX_HELPURL})}};h.h.LISTS_LENGTH_TITLE="%1 . length";
h.J.variables_get.S=function(){this.ub=h.h.VARIABLES_GET_HELPURL;this.Fc(h.h.VARIABLES_HUE);L(O(this),new h.Hd("name"),"VAR");this.Ad(!0);this.Ra(h.h.VARIABLES_GET_TOOLTIP)};h.J.variables_set.S=function(){this.ub=h.h.VARIABLES_SET_HELPURL;this.Fc(h.h.VARIABLES_HUE);L(L(L(N(this,"VALUE"),"var"),new h.Hd("name"),"VAR"),"=");L(O(this),";");this.$c(!0);this.ne(!0);this.me(!0);this.Ra(h.h.VARIABLES_SET_TOOLTIP)};
h.J.procedures_defnoreturn.S=function(){var a=new h.xb("",h.Ga.Yp);L(L(L(L(L(O(this),"function"),a,"NAME"),"("),"","PARAMS"),") {");this.cg(!0);L(O(this),"}");this.ji(new h.Qb(["procedures_mutatorarg"]));h.h.PROCEDURES_DEFNORETURN_COMMENT&&this.$f(h.h.PROCEDURES_DEFNORETURN_COMMENT);this.Fc(h.h.PROCEDURES_HUE);this.Ra(h.h.PROCEDURES_DEFNORETURN_TOOLTIP);this.ub=h.h.PROCEDURES_DEFNORETURN_HELPURL;this.xa=[];this.Xb=[];this.cg(!0);this.rf=null};
h.J.procedures_defreturn.S=function(){var a=new h.xb("",h.Ga.Yp);L(L(L(L(L(O(this),"function"),a,"NAME"),"("),"","PARAMS"),") {");L(Fb(N(this,"RETURN"),h.tl),"return");L(O(this),"}");this.ji(new h.Qb(["procedures_mutatorarg"]));h.h.PROCEDURES_DEFRETURN_COMMENT&&this.$f(h.h.PROCEDURES_DEFRETURN_COMMENT);this.Fc(h.h.PROCEDURES_HUE);this.Ra(h.h.PROCEDURES_DEFRETURN_TOOLTIP);this.ub=h.h.PROCEDURES_DEFRETURN_HELPURL;this.xa=[];this.Xb=[];this.cg(!0);this.rf=null};h.h.PROCEDURES_BEFORE_PARAMS="";
h.J.procedures_callnoreturn.S=function(){this.ub=h.h.PROCEDURES_CALLNORETURN_HELPURL;this.Fc(h.h.PROCEDURES_HUE);L(L(O(this),"","NAME"),"(");L(O(this,"TAIL"),");");this.$c(!0);this.ne(!0);this.me(!0);this.Ra(h.h.PROCEDURES_CALLNORETURN_TOOLTIP);this.xa=[];this.Rg={}};h.J.procedures_callnoreturn.Ic=function(){for(var a=0;a<this.xa.length;a++)if(!B(this,"ARG"+a)){new h.Fd(this.xa[a]);var c=N(this,"ARG"+a);0<a&&L(c,",");c.S()}for(;B(this,"ARG"+a);)this.ib("ARG"+a),a++;Mb(this,"TAIL",null)};
h.J.procedures_callreturn.S=function(){this.ub=h.h.PROCEDURES_CALLRETURN_HELPURL;this.Fc(h.h.PROCEDURES_HUE);L(L(O(this),"","NAME"),"(");L(O(this,"TAIL"),")");this.$c(!0);this.Ad(!0);this.Ra(h.h.PROCEDURES_CALLRETURN_TOOLTIP);this.xa=[];this.Rg={}};h.J.procedures_callreturn.Ic=h.J.procedures_callnoreturn.Ic;delete h.J.procedures_ifreturn;h.J.pond_scan={S:function(){P(this,{message0:"%1(%2)",args0:["scan",{type:"input_value",name:"DEGREE",check:["Number","Angle"]}],inputsInline:!0,output:"Number",colour:290,tooltip:S("Pond_scanTooltip")})}};h.j.pond_scan=function(a){return["scan("+(Y(a,"DEGREE",h.j.Mc)||0)+")",h.j.gb]};
h.J.pond_cannon={S:function(){P(this,{message0:"%1(%2, %3);",args0:["cannon",{type:"input_value",name:"DEGREE",check:["Number","Angle"]},{type:"input_value",name:"RANGE",check:"Number"}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:290,tooltip:S("Pond_cannonTooltip")})}};h.j.pond_cannon=function(a){var c=Y(a,"DEGREE",h.j.Lc)||0;a=Y(a,"RANGE",h.j.Lc)||0;return"cannon("+c+", "+a+");\n"};
h.J.pond_swim={S:function(){P(this,{message0:"%1(%2);",args0:["swim",{type:"input_value",name:"DEGREE",check:["Number","Angle"]}],inputsInline:!0,previousStatement:null,nextStatement:null,colour:290,tooltip:S("Pond_swimTooltip")})}};h.j.pond_swim=function(a){return"swim("+(Y(a,"DEGREE",h.j.Mc)||0)+");\n"};h.J.pond_stop={S:function(){P(this,{message0:"%1(%2);",args0:["stop",""],previousStatement:null,nextStatement:null,colour:290,tooltip:S("Pond_stopTooltip")})}};h.j.pond_stop=function(){return"stop();\n"};
h.J.pond_health={S:function(){P(this,{message0:"%1(%2)",args0:["health",""],output:"Number",colour:290,tooltip:S("Pond_healthTooltip")})}};h.j.pond_health=function(){return["health()",h.j.gb]};h.J.pond_speed={S:function(){P(this,{message0:"%1(%2)",args0:["speed",""],output:"Number",colour:290,tooltip:S("Pond_speedTooltip")})}};h.j.pond_speed=function(){return["speed()",h.j.gb]};h.J.pond_getX={S:function(){P(this,{message0:"%1(%2)",args0:["getX",""],output:"Number",colour:290,tooltip:S("Pond_locXTooltip")})}};
h.j.pond_getX=function(){return["getX()",h.j.gb]};h.J.pond_getY={S:function(){P(this,{message0:"%1(%2)",args0:["getY",""],output:"Number",colour:290,tooltip:S("Pond_locYTooltip")})}};h.j.pond_getY=function(){return["getY()",h.j.gb]};
h.J.pond_math_number={S:function(){this.ub=h.h.MATH_NUMBER_HELPURL;this.Fc(h.h.MATH_HUE);L(O(this,"DUMMY"),new h.Gd(0),"NUM");this.Ad(!0,"Number");this.Ra(h.h.MATH_NUMBER_TOOLTIP)},eb:function(){var a=document.createElement("mutation");a.setAttribute("angle_field",y(this,"NUM").constructor==h.ka);return a},zb:function(a){a="true"==a.getAttribute("angle_field");this.av(a)},onchange:function(){if(this.v&&this.M.ca&&this.M.ca.Ze){var a=y(this,"NUM");-1!=this.M.ca.Ze.indexOf("Angle")?a.constructor!=h.ka&&
this.av(!0):a.constructor!=h.Gd&&this.av(!1)}},av:function(a){h.i.disable();var c=B(this,"DUMMY"),d=y(this,"NUM"),e=d.getValue();a?(Cb(c,"NUM"),d=new h.ka(""),L(c,d,"NUM"),d.setValue(e)):(Cb(c,"NUM"),L(c,new h.Gd(e),"NUM"));this.ba&&this.za();h.i.enable()}};
h.J.pond_math_single={S:function(){P(this,{message0:"%1 (%2)",args0:[{type:"field_dropdown",name:"OP",options:[["Math.sqrt","ROOT"],["Math.abs","ABS"],["Math.sin_deg","SIN"],["Math.cos_deg","COS"],["Math.tan_deg","TAN"],["Math.asin_deg","ASIN"],["Math.acos_deg","ACOS"],["Math.atan_deg","ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],inputsInline:!0,output:"Number",colour:h.h.MATH_HUE,helpUrl:h.h.MATH_SINGLE_HELPURL});var a=this;this.Ra(function(){var c=G(a,"OP");return{ROOT:h.h.MATH_SINGLE_TOOLTIP_ROOT,
ABS:h.h.MATH_SINGLE_TOOLTIP_ABS,SIN:h.h.MATH_TRIG_TOOLTIP_SIN,COS:h.h.MATH_TRIG_TOOLTIP_COS,TAN:h.h.MATH_TRIG_TOOLTIP_TAN,ASIN:h.h.MATH_TRIG_TOOLTIP_ASIN,ACOS:h.h.MATH_TRIG_TOOLTIP_ACOS,ATAN:h.h.MATH_TRIG_TOOLTIP_ATAN}[c]})}};
h.j.pond_math_single=function(a){var c=G(a,"OP");a=Y(a,"NUM",h.j.Mc)||"0";switch(c){case "ABS":c="Math.abs("+a+")";break;case "ROOT":c="Math.sqrt("+a+")";break;case "SIN":c="Math.sin_deg("+a+")";break;case "COS":c="Math.cos_deg("+a+")";break;case "TAN":c="Math.tan_deg("+a+")";break;case "ASIN":c="Math.asin_deg("+a+")";break;case "ACOS":c="Math.acos_deg("+a+")";break;case "ATAN":c="Math.atan_deg("+a+")";break;default:throw Error("Unknown math operator: "+c);}return[c,h.j.gb]};
h.j.pond_math_number=h.j.math_number;h.J.pond_loc_x=h.J.pond_getX;h.j.pond_loc_x=h.j.pond_getX;h.J.pond_loc_y=h.J.pond_getY;h.j.pond_loc_y=h.j.pond_getY;h.J.pond_controls_if=h.J.controls_if;h.j.pond_controls_if=h.j.controls_if;h.J.pond_loops_while=h.J.controls_whileUntil;h.j.pond_loops_while=h.j.controls_whileUntil;h.J.pond_math_arithmetic=h.J.math_arithmetic;h.j.pond_math_arithmetic=h.j.math_arithmetic;h.J.pond_math_change=h.J.math_change;h.j.pond_math_change=h.j.math_change;var Le=Le||{};function Me(a,c){function d(){}d.prototype=c.prototype;a.w=c.prototype;a.prototype=new d;a.prototype.constructor=a;a.IL=function(e,f,g){return c.prototype[f].apply(e,Array.prototype.slice.call(arguments,2))}}if(!Ne){var Ne,Oe="";"undefined"!==typeof navigator&&navigator&&"string"==typeof navigator.userAgent&&(Oe=navigator.userAgent);var Pe=0==Oe.indexOf("Opera");Ne={fM:{aJ:"ScriptEngine"in window},dK:Pe,og:!Pe&&-1!=Oe.indexOf("MSIE"),Fr:!Pe&&-1!=Oe.indexOf("WebKit")}}if(!Qe)var Qe={};
if(!Re)var Re={};if(!Se)var Se={};if(!Te)var Te={};if(!Ue)var Ue={};if(!Ve)var Ve={};var We=Le.hI?{nM:!0}:{};function Xe(){throw Error("Do not instantiate directly");}Xe.prototype.hx=null;Xe.prototype.toString=function(){return this.content};function Ye(a){if(null!=a)switch(a.hx){case 1:return 1;case -1:return-1;case 0:return 0}return null}function Ze(){Xe.call(this)}Me(Ze,Xe);Ze.prototype.VD=We;function Z(a){return null!=a&&a.VD===We?a:$e(String(String(a)).replace(af,bf),Ye(a))}
var $e=function(a){function c(){}c.prototype=a.prototype;return function(d,e){var f=new c;f.content=String(d);void 0!==e&&(f.hx=e);return f}}(Ze),cf={"\x00":"&#0;",'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;","\t":"&#9;","\n":"&#10;","\x0B":"&#11;","\f":"&#12;","\r":"&#13;"," ":"&#32;","-":"&#45;","/":"&#47;","=":"&#61;","`":"&#96;","\u0085":"&#133;","\u00a0":"&#160;","\u2028":"&#8232;","\u2029":"&#8233;"};function bf(a){return cf[a]}var af=/[\x00\x22\x26\x27\x3c\x3e]/g;function df(){return'<div class="farSide" style="padding: 1ex 3ex 0"><button class="secondary" onclick="BlocklyDialogs.hideDialog(true)">OK</button></div>'};function ef(){for(var a=Ic,c='<div style="display: none"><span id="Games_name">Jogos do Blockly</span><span id="Games_puzzle">Quebra-Cabe\u00e7a</span><span id="Games_maze">Labirinto</span><span id="Games_bird">P\u00e1ssaro</span><span id="Games_turtle">Tartaruga</span><span id="Games_movie">Filme</span><span id="Games_music">M\u00fasica</span><span id="Games_pondTutor">Tutor de Lagoa</span><span id="Games_pond">Lagoa</span><span id="Games_genetics">Gen\u00e9ticas</span><span id="Games_linesOfCode1">Voc\u00ea solucionou esse n\u00edvel com uma linha de JavaScript:</span><span id="Games_linesOfCode2">Voc\u00ea solucionou esse n\u00edvel com %1 linhas de JavaScript:</span><span id="Games_nextLevel">Voc\u00ea esta preparado para o n\u00edvel %1?</span><span id="Games_finalLevel">Voc\u00ea esta preparado para o pr\u00f3ximo desafio?</span><span id="Games_submitTitle">T\u00edtulo:</span><span id="Games_linkTooltip">Salvar e ligar aos blocos.</span><span id="Games_runTooltip">Rodar o programa que voc\u00ea escreveu.</span><span id="Games_runProgram">Executar o programa</span><span id="Games_resetTooltip">Parar a execu\u00e7\u00e3o do programa e resetar o nivel.</span><span id="Games_resetProgram">Reiniciar</span><span id="Games_help">Ajuda</span><span id="Games_dialogOk">OK</span><span id="Games_dialogCancel">Cancelar</span><span id="Games_catLogic">L\u00f3gica</span><span id="Games_catLoops">La\u00e7os</span><span id="Games_catMath">Matem\u00e1tica</span><span id="Games_catText">Texto</span><span id="Games_catLists">Listas</span><span id="Games_catColour">Cor</span><span id="Games_catVariables">Vari\u00e1veis</span><span id="Games_catProcedures">Fun\u00e7\u00f5es</span><span id="Games_httpRequestError">Houve um problema com a requisi\u00e7\u00e3o.</span><span id="Games_linkAlert">Compartilhe seus blocos com este link:\n\n%1</span><span id="Games_hashError">Desculpe, \'%1\' n\u00e3o corresponde a um programa salvo.</span><span id="Games_xmlError">N\u00e3o foi poss\u00edvel carregar seu arquivo salvo. Talvez ele tenha sido criado com uma vers\u00e3o diferente do Blockly?</span><span id="Games_submitted">Agradecemos pelo programa! Se a nossa equipa gostar dele, este ser\u00e1 publicado na galeria por n\u00f3s dentro de alguns dias.</span><span id="Games_listVariable">lista</span><span id="Games_textVariable">texto</span><span id="Games_breakLink">Quando voc\u00ea come\u00e7ar a editar o JavaScript, voc\u00ea n\u00e3o poder\u00e1 mais voltar a editar os blocos. Voc\u00ea tem certeza?</span><span id="Games_blocks">Blocos</div></div><div style="display: none"><span id="Pond_scanTooltip">Busque inimigos. Especifique uma dire\u00e7\u00e3o(0-360). \\nRetorna a distancia do inimigo mais proximo \\nnaquela dire\u00e7\u00e3o. Retorna infinito se nenhum \\ninimigo for encontrado. </span><span id="Pond_cannonTooltip">Dispare o canh\u00e3o. Especifique uma dire\u00e7\u00e3o \\n(0-360) e o alcance (0-70). </span><span id="Pond_swimTooltip">Nadar para a frente. Especifique uma dire\u00e7\u00e3o \\n(0-360). </span><span id="Pond_stopTooltip">Parar de nadar. O jogador fara uma parada lenta. </span><span id="Pond_healthTooltip">Retorna a saude atual do jogador (0 esta morto, \\n100 esta saud\u00e1vel). </span><span id="Pond_speedTooltip">Retorna a velocidade atual do jogador (0 esta \\npar\u00e1do, 100 esta na velocidade maxima) </span><span id="Pond_locXTooltip">Retorna a coordenada X do jogador (0 \u00e9 a margem \\nesquerda, 100 \u00e9 a margem direita). </span><span id="Pond_locYTooltip">Retorna a coordenada Y do jogador (0 \u00e9 a borda \\ninferior, 100 \u00e9 a borda superior). </span></div><div style="display: none"><span id="Pond_playerName">Jogador</span><span id="Pond_targetName">Alvo</span><span id="Pond_pendulumName">Pendulo</span><span id="Pond_scaredName">Assustado</span></div><table width="100%"><tr><td><h1><span id="title">'+
((Kc?'<a href="index.html?lang='+Z(a)+'">':'<a href="./?lang='+Z(a)+'">')+"Jogos do Blockly</a> : "+Z({appName:"Tutor de Lagoa"}.appName)+"</span>"),d=" &nbsp; ",e=1;11>e;e++)d+=" "+(e==R?'<span class="level_number level_done" id="level'+Z(e)+'">'+Z(e)+"</span>":10==e?'<a class="level_number" id="level'+Z(e)+'" href="?lang='+Z(a)+"&level="+Z(e)+Z("")+'">'+Z(e)+"</a>":'<a class="level_dot" id="level'+Z(e)+'" href="?lang='+Z(a)+"&level="+Z(e)+Z("")+'"></a>');a=c+d+'</h1></td><td class="farSide"><select id="languageMenu"></select>&nbsp;<button id="linkButton" title="Salvar e ligar aos blocos."><img src="common/1x1.gif" class="link icon21"></button>&nbsp;<button id="helpButton">Ajuda</button></td></tr></table><div id="visualization"><canvas id="scratch" width="400" height="400" style="display: none"></canvas><canvas id="display" width="400" height="400"></canvas></div><table id="avatarStatTable"><tbody><tr id="avatarStatRow1"></tr><tr id="avatarStatRow2"></tr></tbody></table><table width="400"><tr><td style="width: 190px; text-align: center; vertical-align: top;"><button id="docsButton" title="Mostrar a documenta\u00e7\u00e3o de idioma.">Documenta\u00e7\u00e3o</button></td><td><button id="runButton" class="primary" title="Rodar o programa que voc\u00ea escreveu."><img src="common/1x1.gif" class="run icon21"> Executar o programa</button><button id="resetButton" class="primary" style="display: none" title="Parar a execu\u00e7\u00e3o do programa e resetar o nivel."><img src="common/1x1.gif" class="stop icon21"> Reiniciar</button></td></tr></table><div id="dialogDocs"><img src="common/1x1.gif" class="close icon21" id="closeDocs"><iframe id="frameDocs"></iframe></div>';
switch(R){case 1:case 3:case 5:case 7:case 9:a+='<xml id="toolbox" style="display: none;" xmlns="https://developers.google.com/blockly/xml"><category name="Lagoa"><block type="pond_cannon"><value name="DEGREE"><shadow type="pond_math_number"><mutation angle_field="true"></mutation><field name="NUM">0</field></shadow></value><value name="RANGE"><shadow type="pond_math_number"><mutation angle_field="false"></mutation><field name="NUM">70</field></shadow></value></block>'+(5<=R?'<block type="pond_scan"><value name="DEGREE"><shadow type="pond_math_number"><mutation angle_field="true"></mutation><field name="NUM">0</field></shadow></value></block>':
"")+(7<=R?'<block type="pond_swim"><value name="DEGREE"><shadow type="pond_math_number"><mutation angle_field="true"></mutation><field name="NUM">0</field></shadow></value></block>':"")+(9<=R?'<block type="pond_stop"></block>':"")+(9<=R?'<block type="pond_getX"></block><block type="pond_getY"></block>':"")+"</category>"+(3<=R?'<category name="L\u00f3gica">'+(9<=R?'<block type="controls_if"></block><block type="logic_compare"></block>':"")+'<block type="logic_boolean"></block></category><category name="La\u00e7os"><block type="controls_whileUntil"></block></category>':
"")+'<category name="Matem\u00e1tica"><block type="pond_math_number"><mutation angle_field="false"></mutation></block></category></xml><div id="blockly"></div>';break;case 2:case 4:case 6:case 8:case 10:a+='<div id="editor"></div>'}return a+='\n<div id="playerTarget" style="display: none">\n</div>\n\n<div id="playerPendulum" style="display: none">\n/* Slowly moves east and west. Does not fire. */\nvar west = false;\nwhile (true) {\n if (west) {\n if (getX() > 25) {\n swim(180, 25);\n } else {\n west = false;\n swim(0, 0);\n }\n } else {\n if (getX() < 75) {\n swim(0, 25);\n } else {\n west = true;\n swim(0, 0);\n }\n }\n}\n</div>\n\n<div id="playerScared" style="display: none">\n/* Moves south-west when hit. Does not fire. */\nvar d = damage();\nwhile (true) {\n if (d != damage()) {\n swim(45, 100);\n var t = 0;\n for (var t = 0; t < 100; t++) {}\n d = damage();\n stop();\n }\n}\n</div>\n<div id="dialogShadow" class="dialogAnimate"></div><div id="dialogBorder"></div><div id="dialog"></div><div id="dialogDone" class="dialogHiddenContent"><div style="font-size: large; margin: 1em;">Parab\u00e9ns!</div><div id="dialogLinesText" style="font-size: large; margin: 1em;"></div><pre id="containerCode"></pre><div id="dialogDoneText" style="font-size: large; margin: 1em;"></div><div id="dialogDoneButtons" class="farSide" style="padding: 1ex 3ex 0"><button id="doneCancel">Cancelar</button><button id="doneOk" class="secondary">OK</button></div></div><div id="dialogStorage" class="dialogHiddenContent"><div id="containerStorage"></div>'+
(df()+"</div>")+(5==R||6==R?'<div id="helpUseScan" class="dialogHiddenContent"><div style="padding-bottom: 0.7ex">Sua solu\u00e7\u00e3o funciona, mas voc\u00ea pode fazer melhor. Use \'scan\' para mostrar ao canh\u00e3o o qu\u00e3o longe atirar.</div>'+df()+"</div>":"")+'<div id="help" class="dialogHiddenContent"><div style="padding-bottom: 0.7ex">'+(1==R||2==R?"Use o comando 'cannon' para atingir o alvo. O primeiro par\u00e2metro \u00e9 o \u00e2ngulo, o segundo \u00e9 o alcance. Ache a combina\u00e7\u00e3o correta."+
(1==R?'<br><br><svg height="41" width="250"><g class="blocklyDraggable"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 222.36071014404297 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 125.01641845703125,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z M 193.4027557373047,5 h -38.31193542480469 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 38.31193542480469 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 222.36071014404297 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 125.01641845703125,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z M 193.4027557373047,5 h -38.31193542480469 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 38.31193542480469 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 39.5 M 39.5,0.5 H 221.86071014404297 M 2.6966991411008934,33.30330085889911 A 7.5,7.5 0 0,1 0.5,28 V 8 M 125.51641845703125,5.5 v 27 h -36.020530700683594 M 83.89588775634766,24.3 l 3.68,-2.1 M 193.9027557373047,5.5 v 27 h -38.31193542480469 M 149.9908203125,24.3 l 3.68,-2.1"></path><g transform="translate(89.99588775634766,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#bdc2db" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#bdc2db" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" style="display: none;" d="m 0.5,0.5 H 33.520530700683594 M 33.520530700683594,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="24.020530700683594"></rect><text class="blocklyText" y="12.5">0<tspan>\u00b0</tspan></text></g></g><g transform="translate(156.0908203125,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#bdc2db" d="m 0,0 H 36.31193542480469 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#bdc2db" d="m 0,0 H 36.31193542480469 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" style="display: none;" d="m 0.5,0.5 H 35.81193542480469 M 35.81193542480469,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="26.311935424804688"></rect><text class="blocklyText" y="12.5">70</text></g></g><text class="blocklyText" y="12.5" transform="translate(10,10)">cannon</text><text class="blocklyText" y="12.5" transform="translate(68.11233520507812,10)">(</text><text class="blocklyText" y="12.5" transform="translate(135.01641845703125,10)">,</text><text class="blocklyText" y="12.5" transform="translate(203.4027557373047,10)">);</text></g></svg>':
2==R?"<pre>cannon(0, 70);</pre>":""):3==R||4==R?"Este alvo deve ser acertado v\u00e1rias vezes. Use o ciclo 'while (true)' para fazer algo indefinidamente."+(3==R?'<br><br><svg height="92" width="250"><g class="blocklyDraggable"><path class="blocklyPathDark" transform="translate(1,1)" fill="#498449" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 50 H 162.94287872314453 v 36 H 50 l -6,4 -3,0 -6,-4 h -7 a 8,8 0 0,0 -8,8 v 9 a 8,8 0 0,0 8,8 H 50 H 50 v 25 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 129.08705139160156,5 h -60.71040344238281 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 60.71040344238281 z"></path><path class="blocklyPath" fill="#5ba55b" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 50 H 162.94287872314453 v 36 H 50 l -6,4 -3,0 -6,-4 h -7 a 8,8 0 0,0 -8,8 v 9 a 8,8 0 0,0 8,8 H 50 H 50 v 25 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 129.08705139160156,5 h -60.71040344238281 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 60.71040344238281 z"></path><path class="blocklyPathLight" stroke="#8cc08c" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 49.5 M 49.5,0.5 H 162.44287872314453 M 49.5,36.5 M 21.989592359914347,59.01040764008565 a 8.5,8.5 0 0,0 6.0104076400856545,2.4895923599143455 H 49.5 M 49.5,61.5 H 49.5 M 2.6966991411008934,83.3033008588991 A 7.5,7.5 0 0,1 0.5,78 V 8 M 129.58705139160156,5.5 v 27 h -60.71040344238281 M 63.27664794921875,24.3 l 3.68,-2.1"></path><text class="blocklyText" y="12.5" transform="translate(10,10)">while&#160;(</text><text class="blocklyText" y="12.5" transform="translate(139.08705139160156,10)">)&#160;{</text><text class="blocklyText" y="12.5" transform="translate(10,66)">}</text><g class="blocklyDraggable" transform="translate(69.37664794921875,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#496684" d="m 0,0 H 58.71040344238281 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b80a5" d="m 0,0 H 58.71040344238281 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8ca6c0" d="m 0.5,0.5 H 58.21040344238281 M 58.21040344238281,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: default;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="48.71040344238281"></rect><text class="blocklyText" y="12.5" text-anchor="start" x="0">true<tspan style="fill: rgb(91, 128, 165);"> \u25be</tspan></text></g></g></g></svg>':
4==R?"<pre>while (true) {\n ...\n}</pre>":""):5==R||6==R?"Esse oponente move-se para frente e para tr\u00e1s, fazendo ficar dif\u00edcil acert\u00e1-lo. A Express\u00e3o 'scan' retorna o alcance exato do oponente naquela dire\u00e7\u00e3o."+(5==R?'<br><br><svg height="37" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,0 H 20 H 132.76456451416016 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 107.88101196289062,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,0 H 20 H 132.76456451416016 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 107.88101196289062,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,0.5 H 19.5 M 19.5,0.5 H 132.26456451416016 M 0.5,35.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1 M 108.38101196289062,5.5 v 27 h -36.020530700683594 M 66.76048126220704,24.3 l 3.68,-2.1"></path><g transform="translate(72.86048126220703,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#bdc2db" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#bdc2db" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" style="display: none;" d="m 0.5,0.5 H 33.520530700683594 M 33.520530700683594,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="24.020530700683594"></rect><text class="blocklyText" y="12.5">0<tspan>\u00b0</tspan></text></g></g><text class="blocklyText" y="12.5" transform="translate(10,10)">scan</text><text class="blocklyText" y="12.5" transform="translate(50.9769287109375,10)">(</text><text class="blocklyText" y="12.5" transform="translate(117.88101196289062,10)">)</text></g></svg><br><br>':
6==R?"<pre>scan(0)</pre>":"")+"Este alcance \u00e9 exatamente o que o comando 'cannon' precisa para atirar precisamente.":7==R||8==R?"Esse oponente est\u00e1 muito longe para usar o canh\u00e3o (que tem um alcance de 70 metros). Inv\u00e9s disso, use o comando 'swim' para come\u00e7ar a nadar at\u00e9 o oponente e trombar nele."+(7==R?'<br><br><svg height="41" width="250"><g class="blocklyDraggable"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 139.2592544555664 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 110.30130004882812,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 40 H 139.2592544555664 v 36 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z M 110.30130004882812,5 h -36.020530700683594 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 36.020530700683594 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 39.5 M 39.5,0.5 H 138.7592544555664 M 2.6966991411008934,33.30330085889911 A 7.5,7.5 0 0,1 0.5,28 V 8 M 110.80130004882812,5.5 v 27 h -36.020530700683594 M 69.18076934814454,24.3 l 3.68,-2.1"></path><g transform="translate(75.28076934814453,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#bdc2db" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#bdc2db" d="m 0,0 H 34.020530700683594 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" style="display: none;" d="m 0.5,0.5 H 33.520530700683594 M 33.520530700683594,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="24.020530700683594"></rect><text class="blocklyText" y="12.5">0<tspan>\u00b0</tspan></text></g></g><text class="blocklyText" y="12.5" transform="translate(10,10)">swim</text><text class="blocklyText" y="12.5" transform="translate(53.397216796875,10)">(</text><text class="blocklyText" y="12.5" transform="translate(120.30130004882812,10)">);</text></g></svg>':
8==R?"<pre>swim(0);</pre>":""):9==R?"Este oponente tamb\u00e9m est\u00e1 muito longe para usar o canh\u00e3o. Mas voc\u00ea est\u00e1 muito fraco para sobreviver \u00e0 uma colis\u00e3o. Nade at\u00e9 o oponente enquanto sua posi\u00e7\u00e3o horizontal for menor que 50. Ent\u00e3o 'pare' e use o canh\u00e3o."+(9==R?'<br><br><svg height="37" width="250"><g class="blocklyDraggable" transform="translate(8,0)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#496684" d="m 0,0 H 20 H 194.25144958496094 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 97.93487548828125,5 h -81.93487548828125 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 81.93487548828125 z M 184.25144958496094,5 h -38.31193542480469 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 38.31193542480469 z"></path><path class="blocklyPath" fill="#5b80a5" d="m 0,0 H 20 H 194.25144958496094 v 36 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z M 97.93487548828125,5 h -81.93487548828125 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 6 h 81.93487548828125 z M 184.25144958496094,5 h -38.31193542480469 v 5 c 0,10 -8,-8 -8,7.5 s 8,-2.5 8,7.5 v 7 h 38.31193542480469 z"></path><path class="blocklyPathLight" stroke="#8ca6c0" d="m 0.5,0.5 H 19.5 M 19.5,0.5 H 193.75144958496094 M 0.5,35.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1 M 98.43487548828125,5.5 v 26 h -81.93487548828125 M 10.9,24.3 l 3.68,-2.1 M 184.75144958496094,5.5 v 27 h -38.31193542480469 M 140.83951416015626,24.3 l 3.68,-2.1"></path><g class="blocklyEditableText" transform="translate(107.93487548828125,10)" style="cursor: default;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="32.004638671875"></rect><text class="blocklyText" y="12.5" text-anchor="start" x="0">&lt;<tspan style="fill: rgb(91, 128, 165);"> \u25be</tspan></text></g><g class="blocklyDraggable" transform="translate(146.93951416015625,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#495284" d="m 0,0 H 36.31193542480469 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#5b67a5" d="m 0,0 H 36.31193542480469 v 25 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#8c95c0" d="m 0.5,0.5 H 35.81193542480469 M 35.81193542480469,0.5 M 0.5,24.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><g class="blocklyEditableText" transform="translate(10,5)" style="cursor: text;"><rect rx="4" ry="4" x="-5" y="0" height="16" width="26.311935424804688"></rect><text class="blocklyText" y="12.5">50</text></g></g><g class="blocklyDraggable" transform="translate(17,6)"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,0 H 79.93487548828125 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,0 H 79.93487548828125 v 24 H 0 V 20 c 0,-10 -8,8 -8,-7.5 s 8,2.5 8,-7.5 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,0.5 H 79.43487548828125 M 79.43487548828125,0.5 M 0.5,23.5 V 18.5 m -7.36,-0.5 q -1.52,-5.5 0,-11 m 7.36,1 V 0.5 H 1"></path><text class="blocklyText" y="12.5" transform="translate(10,5)">getX</text><text class="blocklyText" y="12.5" transform="translate(50.16777038574219,5)">(</text><text class="blocklyText" y="12.5" transform="translate(65.05132293701172,5)">)</text></g></g></svg><br><br><svg height="31" width="250"><g class="blocklyDraggable"><path class="blocklyPathDark" transform="translate(1,1)" fill="#7a4984" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 81.56034088134766 v 24 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z"></path><path class="blocklyPath" fill="#995ba5" d="m 0,8 A 8,8 0 0,1 8,0 H 15 l 6,4 3,0 6,-4 H 81.56034088134766 v 24 H 29.5 l -6,4 -3,0 -6,-4 H 8 a 8,8 0 0,1 -8,-8 z"></path><path class="blocklyPathLight" stroke="#b88cc0" d="m 0.5,7.5 A 7.5,7.5 0 0,1 8,0.5 H 15 l 6,4 3,0 6,-4 H 81.06034088134766 M 81.06034088134766,0.5 M 2.6966991411008934,21.303300858899107 A 7.5,7.5 0 0,1 0.5,16 V 8"></path><text class="blocklyText" y="12.5" transform="translate(10,5)">stop</text><text class="blocklyText" y="12.5" transform="translate(47.718833923339844,5)">(</text><text class="blocklyText" y="12.5" transform="translate(62.602386474609375,5)">);</text></g></svg>':
10==R?"<pre>getX() &lt; 50</pre><pre>stop();</pre>":""):10==R?"Este oponente ir\u00e1 se mover para longe quando golpeado. Nade at\u00e9 ele se est\u00e1 fora do alcance (70 metros).":"")+"</div>"+df()+"</div>"};var Sc="pond-tutor";
window.addEventListener("load",function(){document.body.innerHTML=ef();V.S();$d();Tc("runButton",me);Tc("resetButton",oe);Tc("docsButton",ke);Tc("closeDocs",le);setTimeout(V.xF,1);setTimeout(V.yF,1);Tc("helpButton",re);2>location.hash.length&&!Qc(R)&&setTimeout(re,1E3);var a=-1!=Hc.indexOf(Ic),c=document.getElementById("blockly"),d=document.getElementById("editor"),e=document.getElementById("visualization");if(c){var f=function(){c.style.top=Math.max(10,e.offsetTop-window.pageYOffset)+"px";c.style.left=
a?"10px":"420px";c.style.width=window.innerWidth-440+"px"};window.addEventListener("scroll",function(){f(null);h.il(C)});f(null);var g=document.getElementById("toolbox");C=h.Kh("blockly",{media:"third-party/blockly/media/",rtl:!1,toolbox:g,trashcan:!0});Ge("scan,cannon,drive,swim,stop,speed,damage,health,loc_x,getX,loc_y,getY,");V.Zy(7==R?'<xml><block type="pond_swim" x="70" y="70"><value name="DEGREE"><shadow type="pond_math_number"><mutation angle_field="true"></mutation><field name="NUM">0</field></shadow></value></block></xml>':
'<xml><block type="pond_cannon" x="70" y="70"><value name="DEGREE"><shadow type="pond_math_number"><mutation angle_field="true"></mutation><field name="NUM">0</field></shadow></value><value name="RANGE"><shadow type="pond_math_number"><mutation angle_field="false"></mutation><field name="NUM">70</field></shadow></value></block></xml>')}if(d){g=document.getElementById("containerCode");g.parentNode.removeChild(g);g=8==R?"swim(0);":"cannon(0, 70);";V.ef=window.ace.edit("editor");V.ef.setTheme("ace/theme/chrome");
V.ef.setShowPrintMargin(!1);var k=V.ef.getSession();k.setMode("ace/mode/javascript");k.setTabSize(2);k.setUseSoftTabs(!0);V.Zy(g+"\n");f=function(){d.style.top=Math.max(10,e.offsetTop-window.pageYOffset)+"px";d.style.left=a?"10px":"420px";d.style.width=window.innerWidth-440+"px"};window.addEventListener("scroll",f)}window.addEventListener("resize",f);f(null);for(k=0;g=ff[k];k++){var l=g.code?document.getElementById(g.code).textContent:c?function(){return kd()}:function(){return V.ef.getValue()},m=
S(g.name);W.jD(m,l,g.start,g.Ya)}W.reset();be()});
var ff=[void 0,[{start:new h.g.K(50,30),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(50,70),Ya:99,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(70,50),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(20,50),Ya:99,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(20,20),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(62.4264,62.4264),Ya:0,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(50,80),Ya:0,name:"Pond_playerName",code:null},
{start:new h.g.K(50,20),Ya:0,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(90,50),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(50,50),Ya:0,name:"Pond_pendulumName",code:"playerPendulum"}],[{start:new h.g.K(10,50),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(50,50),Ya:0,name:"Pond_pendulumName",code:"playerPendulum"}],[{start:new h.g.K(20,80),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(80,20),Ya:99,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(50,
90),Ya:0,name:"Pond_playerName",code:null},{start:new h.g.K(50,10),Ya:99,name:"Pond_pendulumName",code:"playerPendulum"}],[{start:new h.g.K(5,50),Ya:99,name:"Pond_playerName",code:null},{start:new h.g.K(95,50),Ya:0,name:"Pond_targetName",code:"playerTarget"}],[{start:new h.g.K(10,10),Ya:50,name:"Pond_playerName",code:null},{start:new h.g.K(40,40),Ya:0,name:"Pond_scaredName",code:"playerScared"}]][R];
ie=function(a){clearTimeout(Yd);0!=a&&1==a&&"function"==typeof W.Ml[0].Uw&&((5==R||6==R)&&2E5<W.Uu?(a=document.getElementById("helpUseScan"),T.fl(a,null,!1,!0,{width:"30%",left:"35%",top:"12em"},T.Su),T.Pu()):(V.OG(),T.SD()))};