text: // Automatically generated file.  Do not edit!
  
  'use strict';var b,h={X:{Rb:1,cd:2,Sb:3,ed:4}};
  h.lb={};h.Ju=40;h.bv=125;h.zz=5;h.Wz=10;h.kc=28;h.gu=h.kc;h.nz=8;h.rp=250;h.sp=10;h.jz=30;h.rA=750;h.WA=100;h.Az=!0;h.eA=.45;h.fA=.65;h.cj={width:96,height:124,url:"sprites.png"};h.lb.Td={Yb:-1,Nm:0,fd:1};h.LF=0;h.MF=1;h.JF=1;h.KF=2;h.$i=[];h.$i[h.X.Rb]=h.X.cd;h.$i[h.X.cd]=h.X.Rb;h.$i[h.X.Sb]=h.X.ed;h.$i[h.X.ed]=h.X.Sb;h.mu=null;h.yp=1;h.nu=2;h.ij="VARIABLE";h.hB="VARIABLE_DYNAMIC";h.dv="PROCEDURE";h.WH="RENAME_VARIABLE_ID";h.IF="DELETE_VARIABLE_ID";h.lb.Pm="_TEMP_COLLAPSED_INPUT";h.lb.Om="_TEMP_COLLAPSED_FIELD";
  h.g={};h.g.global=function(){return"object"===typeof self?self:"object"===typeof window?window:"object"===typeof global?global:this}();
  h.P={};h.g.global.Blockly||(h.g.global.Blockly={});h.g.global.Blockly.Msg||(h.g.global.Blockly.Msg=h.P);h.g.sb={};h.g.sb.parse=function(a){a=String(a).toLowerCase().trim();var c=h.g.sb.names[a];if(c)return c;c="0x"==a.substring(0,2)?"#"+a.substring(2):a;c="#"==c[0]?c:"#"+c;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.sb.rt(a,c,d):null};
  h.g.sb.rt=function(a,c,d){c=a<<16|c<<8|d;return 16>a?"#"+(16777216|c).toString(16).substr(1):"#"+c.toString(16)};h.g.sb.gx=function(a){a=h.g.sb.parse(a);if(!a)return[0,0,0];a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]};
  h.g.sb.lx=function(a){var c=h.eA,d=255*h.fA,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.sb.rt(Math.floor(e),Math.floor(f),Math.floor(g))};
  h.g.sb.Cq=function(a,c,d){a=h.g.sb.parse(a);if(!a)return null;c=h.g.sb.parse(c);if(!c)return null;a=h.g.sb.gx(a);c=h.g.sb.gx(c);return h.g.sb.rt(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.sb.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.g.U=function(a,c){this.x=a;this.y=c};h.g.U.Gf=function(a,c){return a==c?!0:a&&c?a.x==c.x&&a.y==c.y:!1};h.g.U.ir=function(a,c){var d=a.x-c.x;a=a.y-c.y;return Math.sqrt(d*d+a*a)};h.g.U.yD=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};h.g.U.fl=function(a,c){return new h.g.U(a.x-c.x,a.y-c.y)};h.g.U.sum=function(a,c){return new h.g.U(a.x+c.x,a.y+c.y)};h.g.U.prototype.scale=function(a){this.x*=a;this.y*=a;return this};h.g.U.prototype.translate=function(a,c){this.x+=a;this.y+=c;return this};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.g.Ra={};h.g.Ra.startsWith=function(a,c){return 0==a.lastIndexOf(c,0)};h.g.Ra.At=function(a){return a.length?a.reduce(function(c,d){return c.length<d.length?c:d}).length:0};h.g.Ra.Vv=function(a,c){if(!a.length)return 0;if(1==a.length)return a[0].length;var d=0;c=c||h.g.Ra.At(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.Ra.Wv=function(a,c){if(!a.length)return 0;if(1==a.length)return a[0].length;var d=0;c=c||h.g.Ra.At(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.Ra.Uy=function(a,c){a=a.split("\n");for(var d=0;d<a.length;d++)a[d]=h.g.Ra.jF(a[d],c);return a.join("\n")};
  h.g.Ra.jF=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.Ra.Vy(d,a,c);e=h.g.Ra.St(d,a,c);a=h.g.Ra.kF(d,a);f++}while(e>g);return k};
  h.g.Ra.St=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.Ra.Vy=function(a,c,d){for(var e=h.g.Ra.St(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.Ra.St(a,k,d);l>e&&(e=l,f=k)}return f?h.g.Ra.Vy(a,f,d):c};h.g.Ra.kF=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.gd=function(a,c){this.width=a;this.height=c};h.g.gd.Gf=function(a,c){return a==c?!0:a&&c?a.width==c.width&&a.height==c.height:!1};h.g.style={};h.g.style.If=function(a){if("none"!=h.g.style.Vw(a,"display"))return h.g.style.Tw(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.gd(g,a)};h.g.style.Tw=function(a){return new h.g.gd(a.offsetWidth,a.offsetHeight)};h.g.style.Vw=function(a,c){return h.g.style.getComputedStyle(a,c)||h.g.style.JC(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.JC=function(a,c){return a.currentStyle?a.currentStyle[c]:null};h.g.style.$h=function(a){var c=new h.g.U(0,0);a=a.getBoundingClientRect();var d=document.documentElement;d=new h.g.U(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.VC=function(){var a=document.body,c=document.documentElement;return new h.g.U(a.scrollLeft||c.scrollLeft,a.scrollTop||c.scrollTop)};h.g.style.NJ=function(a,c){a.style.display=c?"":"none"};h.g.style.sJ=function(a){return"rtl"==h.g.style.Vw(a,"direction")};
  h.g.style.GC=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.EE=function(a,c){a=h.g.style.LC(a,c);c.scrollLeft=a.x;c.scrollTop=a.y};
  h.g.style.LC=function(a,c){var d=h.g.style.$h(a),e=h.g.style.$h(c),f=h.g.style.GC(c),g=d.x-e.x-f.left;d=d.y-e.y-f.top;a=h.g.style.Tw(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.U(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.Wd=c("Trident")||c("MSIE");h.g.userAgent.zh=c("Edge");h.g.userAgent.nA=c("JavaFX");h.g.userAgent.AF=(c("Chrome")||c("CriOS"))&&!h.g.userAgent.zh;h.g.userAgent.xv=c("WebKit")&&!h.g.userAgent.zh;h.g.userAgent.$z=c("Gecko")&&!h.g.userAgent.xv&&!h.g.userAgent.Wd&&!h.g.userAgent.zh;h.g.userAgent.Hm=c("Android");h.g.userAgent.Bk=c("iPad");h.g.userAgent.Gu=c("iPod");h.g.userAgent.Fu=
  c("iPhone")&&!h.g.userAgent.Bk&&!h.g.userAgent.Gu;h.g.userAgent.sA=c("Macintosh");h.g.userAgent.bB=h.g.userAgent.Bk||h.g.userAgent.Hm&&!c("Mobile")||c("Silk");h.g.userAgent.OG=!h.g.userAgent.bB&&(h.g.userAgent.Gu||h.g.userAgent.Fu||h.g.userAgent.Hm||c("IEMobile"))})(h.g.global.navigator&&h.g.global.navigator.userAgent||"");
  h.g.MD=function(a){a.preventDefault();a.stopPropagation()};h.g.so=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||a.target.dataset&&"true"==a.target.dataset.uJ};
  h.g.le=function(a){var c=new h.g.U(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.le.iB))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.le.jB))&&(c.x+=Number(a[1]),a[3]&&(c.y+=Number(a[3])));return c};
  h.g.xl=function(a){for(var c=0,d=0;a;){var e=h.g.le(a);c+=e.x;d+=e.y;if(-1!=(" "+(a.getAttribute("class")||"")+" ").indexOf(" injectionDiv "))break;a=a.parentNode}return new h.g.U(c,d)};h.g.le.iB=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/;h.g.le.jB=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/;h.g.Kl=function(a){return a.ctrlKey&&h.g.userAgent.sA?!0:2==a.button};
  h.g.Tl=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.Sw=function(a){switch(a.deltaMode){default:return{x:a.deltaX,y:a.deltaY};case 1:return{x:a.deltaX*h.Ju,y:a.deltaY*h.Ju};case 2:return{x:a.deltaX*h.bv,y:a.deltaY*h.bv}}};h.g.ZE=function(a){return h.g.Jt(a,!0)};h.g.ad=function(a){if("string"!=typeof a)return a;a=h.g.Jt(a,!1);return a.length?String(a[0]):""};
  h.g.Rv=function(a){for(var c=h.P,d=a.match(/%{BKY_[A-Z]\w*}/ig),e=0;e<d.length;e++)void 0==c[d[e].toUpperCase().slice(6,-1)]&&console.warn("No message string for "+d[e]+" in "+a)};
  h.g.Jt=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.Ra.startsWith(l,"BKY_")?
  l.substring(4):null)&&l in h.P?(f=h.P[l],"string"==typeof f?Array.prototype.push.apply(d,h.g.Jt(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.Hf=function(){for(var a=h.g.Hf.yy.length,c=[],d=0;20>d;d++)c[d]=h.g.Hf.yy.charAt(Math.random()*a);return c.join("")};
  h.g.Hf.yy="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  h.g.ii=function(){if(void 0!==h.g.ii.Kq)return h.g.ii.Kq;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.ii.Kq="none"!==c;return h.g.ii.Kq};h.g.sy=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.UC=function(){var a=h.g.style.VC();return new h.g.Rect(a.y,document.documentElement.clientHeight+a.y,a.x,document.documentElement.clientWidth+a.x)};
  h.g.Rk=function(a,c){c=a.indexOf(c);if(-1==c)return!1;a.splice(c,1);return!0};h.g.OC=function(){var a=document.documentElement,c=window;return h.g.userAgent.Wd&&c.pageYOffset!=a.scrollTop?new h.g.U(a.scrollLeft,a.scrollTop):new h.g.U(c.pageXOffset||a.scrollLeft,c.pageYOffset||a.scrollTop)};h.g.Dr=function(a,c){var d=Object.create(null),e=r(a,!0);c&&(a=t(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.KJ=function(a,c){var d=c.x;c=c.y;var e=aa(a).getBoundingClientRect();d=new h.g.U(d-e.left,c-e.top);c=h.g.xl(a.xb);return h.g.U.fl(d,c).scale(1/a.scale)};h.g.Ro=function(a){var c="string"==typeof a?h.g.ad(a):a,d=Number(c);if(!isNaN(d)&&0<=d&&360>=d)return{fD:d,Cl:h.g.sb.lx(d)};if(d=h.g.sb.parse(c))return{fD:null,Cl:d};d='Invalid colour: "'+c+'"';a!=c&&(d+=' (from "'+a+'")');throw Error(d);};h.Touch={};h.Touch.qv="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.ym=null;h.Touch.Fe={};
  h.g.global.PointerEvent?h.Touch.Fe={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]}:h.Touch.qv&&(h.Touch.Fe={mousedown:["touchstart"],mousemove:["touchmove"],mouseup:["touchend","touchcancel"]});h.zo=0;
  h.xD=function(a,c){h.Sg();a.changedTouches&&1!=a.changedTouches.length||(h.zo=setTimeout(function(){a.changedTouches&&(a.button=2,a.clientX=a.changedTouches[0].clientX,a.clientY=a.changedTouches[0].clientY);c&&ba(c,a)},h.rA))};h.Sg=function(){h.zo&&(clearTimeout(h.zo),h.zo=0)};h.Touch.Dn=function(){h.Touch.ym=null};h.Touch.Bt=function(a){return!h.Touch.qD(a)||h.Touch.QB(a)};
  h.Touch.ao=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.QB=function(a){var c=h.Touch.ao(a);return void 0!==h.Touch.ym&&null!==h.Touch.ym?h.Touch.ym==c:"mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type?(h.Touch.ym=c,!0):!1};
  h.Touch.GE=function(a){if(h.g.Ra.startsWith(a.type,"touch")){var c=a.changedTouches[0];a.clientX=c.clientX;a.clientY=c.clientY}};h.Touch.qD=function(a){return h.g.Ra.startsWith(a.type,"touch")||h.g.Ra.startsWith(a.type,"mouse")||h.g.Ra.startsWith(a.type,"pointer")};h.Touch.uo=function(a){return h.g.Ra.startsWith(a.type,"touch")||h.g.Ra.startsWith(a.type,"pointer")};
  h.Touch.PE=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.N={};h.N.Ca=function(a,c,d,e,f,g){function k(u){var H=!f;u=h.Touch.PE(u);for(var K=0,I;I=u[K];K++)if(!H||h.Touch.Bt(I))h.Touch.GE(I),d?e.call(d,I):e(I),l=!0}var l=!1,m=[];if(h.g.global.PointerEvent&&c in h.Touch.Fe)for(var n=0,q;q=h.Touch.Fe[c][n];n++)a.addEventListener(q,k,!1),m.push([a,q,k]);else if(a.addEventListener(c,k,!1),m.push([a,c,k]),c in h.Touch.Fe){var p=function(u){k(u);var H=!g;l&&H&&u.preventDefault()};for(n=0;q=h.Touch.Fe[c][n];n++)a.addEventListener(q,p,!1),m.push([a,q,p])}return m};
  h.N.bind=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.Fe)for(var k=0,l;l=h.Touch.Fe[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.Fe){var m=function(n){if(n.changedTouches&&1==n.changedTouches.length){var q=n.changedTouches[0];n.clientX=q.clientX;n.clientY=q.clientY}f(n);n.preventDefault()};for(k=0;l=h.Touch.Fe[c][k];k++)a.addEventListener(l,m,!1),g.push([a,l,m])}return g};
  h.N.yb=function(a){for(;a.length;){var c=a.pop(),d=c[2];c[0].removeEventListener(c[1],d,!1)}return d};
  h.v={};h.v.hk={};h.v.rk="default";h.v.R=function(a){this.Ul=a};h.v.R.prototype.toString=function(){return this.Ul};h.v.R.iu=new h.v.R("connectionChecker");h.v.R.qk=new h.v.R("cursor");h.v.R.Fb=new h.v.R("event");h.v.R.Ac=new h.v.R("field");h.v.R.RENDERER=new h.v.R("renderer");h.v.R.cB=new h.v.R("toolbox");h.v.R.jq=new h.v.R("theme");h.v.R.oI=new h.v.R("toolboxItem");h.v.R.Ep=new h.v.R("flyoutsVerticalToolbox");h.v.R.vu=new h.v.R("flyoutsHorizontalToolbox");h.v.R.Pu=new h.v.R("metricsManager");
  h.v.register=function(a,c,d,e){if(!(a instanceof h.v.R)&&"string"!=typeof a||""==String(a).trim())throw Error('Invalid type "'+a+'". The type must be a non-empty string or a Blockly.registry.Type.');a=String(a).toLowerCase();if("string"!=typeof c||""==c.trim())throw Error('Invalid name "'+c+'". The name must be a non-empty string.');c=c.toLowerCase();if(!d)throw Error("Can not register a null value");var f=h.v.hk[a];f||(f=h.v.hk[a]={});h.v.gF(a,d);if(!e&&f[c])throw Error('Name "'+c+'" with type "'+
  a+'" already registered.');f[c]=d};h.v.gF=function(a,c){switch(a){case String(h.v.R.Ac):if("function"!=typeof c.ba)throw Error('Type "'+a+'" must have a fromJson function');}};h.v.unregister=function(a,c){a=String(a).toLowerCase();c=c.toLowerCase();var d=h.v.hk[a];d&&d[c]?delete h.v.hk[a][c]:console.warn("Unable to unregister ["+c+"]["+a+"] from the registry.")};
  h.v.Mw=function(a,c,d){a=String(a).toLowerCase();c=c.toLowerCase();var e=h.v.hk[a];if(!e||!e[c]){c="Unable to find ["+c+"]["+a+"] in the registry.";if(d)throw Error(c+" You must require or register a "+a+" plugin.");console.warn(c);return null}return e[c]};h.v.kJ=function(a,c){a=String(a).toLowerCase();c=c.toLowerCase();return(a=h.v.hk[a])?!!a[c]:!1};h.v.Fr=function(a,c,d){return h.v.Mw(a,c,d)};h.v.Lr=function(a,c){return h.v.Mw(a,c,void 0)};
  h.v.Dg=function(a,c,d){c=c.plugins[a.toString()]||h.v.rk;return"function"==typeof c?c:h.v.Fr(a,c,d)};h.h={};h.h.Zw="";h.h.Ma=!0;h.h.dr=0;h.h.pk="create";h.h.qh=h.h.pk;h.h.yh="delete";h.h.pp=h.h.yh;h.h.Si="change";h.h.ph=h.h.Si;h.h.Gk="move";h.h.rh=h.h.Gk;h.h.Nk="var_create";h.h.qn="var_delete";h.h.qq="var_rename";h.h.oq="ui";h.h.Km="drag";h.h.bj="selected";h.h.mk="click";h.h.Pp="marker_move";h.h.$t="bubble_open";h.h.mq="trashcan_open";h.h.pI="toolbox_item_select";h.h.kq="theme_change";h.h.rn="viewport_change";h.h.Qm="comment_create";h.h.fu="comment_delete";h.h.du="comment_change";h.h.nk="comment_move";
  h.h.Dp="finished_loading";h.h.iz=[h.h.qh,h.h.rh,h.h.Qm,h.h.nk];h.h.xk=[];h.h.Ga=function(a){h.h.isEnabled()&&(h.h.xk.length||setTimeout(h.h.AC,0),h.h.xk.push(a))};h.h.AC=function(){for(var a=h.h.filter(h.h.xk,!0),c=h.h.xk.length=0,d;d=a[c];c++)if(d.Wb){var e=h.qb.tl(d.Wb);if(e){var f=d;if(f.Ma)for(e.Li.push(f),e.cm.length=0;e.Li.length>e.Nu&&0<=e.Nu;)e.Li.shift();for(var g=0;d=e.Ic[g];g++)d(f)}}};
  h.h.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.Tj()){var k=[g.hs?h.h.oq:g.type,g.fb,g.Wb].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.h.Gk&&l.index==f-1)m.xi=g.xi,m.wi=g.wi,m.Vg=g.Vg,l.index=f;else if(g.type==h.h.Si&&g.element==m.element&&g.name==m.name)m.newValue=g.newValue;else if(g.type!=h.h.mk||m.type!=h.h.$t)e[k]={event:g,index:f},d.push(g)}a=d.filter(function(n){return!n.Tj()});c||a.reverse();
  for(f=1;g=a[f];f++)g.type==h.h.Si&&"mutation"==g.element&&a.unshift(a.splice(f,1)[0]);return a};h.h.SB=function(){for(var a=0,c;c=h.h.xk[a];a++)c.Ma=!1};h.h.disable=function(){h.h.dr++};h.h.enable=function(){h.h.dr--};h.h.isEnabled=function(){return 0==h.h.dr};h.h.Vb=function(){return h.h.Zw};h.h.ta=function(a){h.h.Zw="boolean"==typeof a?a?h.g.Hf():"":a};h.h.Jw=function(a){var c=[];a=r(a,!1);for(var d=0,e;e=a[d];d++)c[d]=e.id;return c};
  h.h.ba=function(a){var c=h.h.get(a.type);if(!c)throw Error("Unknown event type.");c=new c;c.ba(a);c.Wb=(void 0).id;return c};h.h.get=function(a){return h.v.Fr(h.v.R.Fb,a)};h.h.XI=function(a){if((a.type==h.h.Gk||a.type==h.h.pk)&&a.Wb){var c=h.qb.tl(a.Wb),d=c.Gc(a.fb);if(d){a=h.h.Ma;try{h.h.Ma=!1;var e=d.getParent();if(e&&e.isEnabled()){var f=r(d,!1);c=0;for(var g;g=f[c];c++)g.af(!0)}else if((d.S||d.Y)&&!c.Xc()){do d.af(!1),d=t(d);while(d)}}finally{h.h.Ma=a}}}};
  h.h.Abstract=function(){this.nd=null;this.Wb=void 0;this.group=h.h.Vb();this.Ma=h.h.Ma};b=h.h.Abstract.prototype;b.hs=!1;b.qa=function(){var a={type:this.type};this.group&&(a.group=this.group);return a};b.ba=function(a){this.nd=!1;this.group=a.group};b.Tj=function(){return!1};b.run=function(){};function v(a){if(a.Wb)var c=h.qb.tl(a.Wb);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.A=c.prototype;a.prototype=Object.create(c.prototype);a.prototype.constructor=a};h.g.object.Ug=function(a,c){for(var d in c)a[d]=c[d]};h.g.object.yj=function(a,c){for(var d in c)a[d]=null!=c[d]&&"object"===typeof c[d]?h.g.object.yj(a[d]||Object.create(null),c[d]):c[d];return a};h.g.object.values=function(a){return Object.values?Object.values(a):Object.keys(a).map(function(c){return a[c]})};h.g.xml={};h.g.xml.zA="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.zA,a)};h.g.xml.createTextNode=function(a){return h.g.xml.document().createTextNode(a)};h.g.xml.WE=function(a){return(new DOMParser).parseFromString(a,"text/xml")};h.g.xml.Gd=function(a){return(new XMLSerializer).serializeToString(a)};h.Ha={He:h.X.Rb,lc:h.X.Sb,Ae:5};h.g.D=function(a){this.VE=a};h.g.D.prototype.toString=function(){return this.VE};h.g.D.np=new h.g.D("animate");h.g.D.bu=new h.g.D("circle");h.g.D.cu=new h.g.D("clipPath");h.g.D.lu=new h.g.D("defs");h.g.D.Ap=new h.g.D("feComposite");h.g.D.Lz=new h.g.D("feComponentTransfer");h.g.D.Mz=new h.g.D("feFlood");h.g.D.Nz=new h.g.D("feFuncA");h.g.D.Oz=new h.g.D("feGaussianBlur");h.g.D.Pz=new h.g.D("fePointLight");h.g.D.Qz=new h.g.D("feSpecularLighting");h.g.D.uu=new h.g.D("filter");h.g.D.jG=new h.g.D("foreignObject");
  h.g.D.Nc=new h.g.D("g");h.g.D.Ak=new h.g.D("image");h.g.D.Ek=new h.g.D("line");h.g.D.Ee=new h.g.D("path");h.g.D.cv=new h.g.D("pattern");h.g.D.JA=new h.g.D("polygon");h.g.D.Lb=new h.g.D("rect");h.g.D.ej=new h.g.D("svg");h.g.D.pv=new h.g.D("text");h.g.D.rv=new h.g.D("tspan");h.g.j={};h.g.j.nn="http://www.w3.org/2000/svg";h.g.j.Fp="http://www.w3.org/1999/xhtml";h.g.j.hd="http://www.w3.org/1999/xlink";h.g.j.mg={ELEMENT_NODE:1,TEXT_NODE:3,COMMENT_NODE:8,DOCUMENT_POSITION_CONTAINED_BY:16};h.g.j.ae=null;h.g.j.Hq=0;h.g.j.An=null;h.g.j.J=function(a,c,d){a=document.createElementNS(h.g.j.nn,String(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.j.Mb=function(a,c){var d=a.getAttribute("class")||"";-1==(" "+d+" ").indexOf(" "+c+" ")&&(d&&(d+=" "),a.setAttribute("class",d+c))};h.g.j.EJ=function(a,c){c=c.split(" ");for(var d=0;d<c.length;d++)h.g.j.$c(a,c[d])};h.g.j.$c=function(a,c){var d=a.getAttribute("class");if(-1!=(" "+d+" ").indexOf(" "+c+" ")){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")}};
  h.g.j.Rr=function(a,c){return-1!=(" "+a.getAttribute("class")+" ").indexOf(" "+c+" ")};h.g.j.removeNode=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null};h.g.j.Oj=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.j.containsNode=function(a,c){return!!(a.compareDocumentPosition(c)&h.g.j.mg.DOCUMENT_POSITION_CONTAINED_BY)};
  h.g.j.gm=function(a,c){a.style.transform=c;a.style["-webkit-transform"]=c};h.g.j.pm=function(){h.g.j.Hq++;h.g.j.ae||(h.g.j.ae={})};h.g.j.qm=function(){h.g.j.Hq--;h.g.j.Hq||(h.g.j.ae=null)};h.g.j.jJ=function(a){var c=a.textContent+"\n"+a.className.baseVal,d;if(h.g.j.ae&&(d=h.g.j.ae[c]))return d;try{d=h.g.userAgent.Wd||h.g.userAgent.zh?a.getBBox().width:a.getComputedTextLength()}catch(e){return 8*a.textContent.length}h.g.j.ae&&(h.g.j.ae[c]=d);return d};
  h.g.j.Ir=function(a,c,d,e){return h.g.j.PC(a,c+"pt",d,e)};h.g.j.PC=function(a,c,d,e){var f=a.textContent;a=f+"\n"+a.className.baseVal;var g;if(h.g.j.ae&&(g=h.g.j.ae[a]))return g;h.g.j.An||(g=document.createElement("canvas"),g.className="blocklyComputeCanvas",document.body.appendChild(g),h.g.j.An=g.getContext("2d"));h.g.j.An.font=d+" "+c+" "+e;g=h.g.j.An.measureText(f).width;h.g.j.ae&&(h.g.j.ae[a]=g);return g};
  h.g.j.AD=function(a,c,d){var e=document.createElement("span");e.style.font=c+" "+a+" "+d;e.textContent="Hg";a=document.createElement("div");a.style.width="1px";a.style.height="0px";c=document.createElement("div");c.setAttribute("style","position: fixed; top: 0; left: 0; display: flex;");c.appendChild(e);c.appendChild(a);document.body.appendChild(c);try{d={},c.style.alignItems="baseline",d.$d=a.offsetTop-e.offsetTop,c.style.alignItems="flex-end",d.height=a.offsetTop-e.offsetTop}finally{document.body.removeChild(c)}return d};h.K={};h.K.Ty=function(a){var c=w,d=h.g.xml.createElement("xml"),e=h.K.hF(h.oa.Jv(c));e.hasChildNodes()&&d.appendChild(e);var f=[].concat(c.gp);1<f.length&&(c.bf.offset=Math.sin(h.g.qd.It(h.qb.fv)),c.L&&(c.bf.offset*=-1),f.sort(c.bf));e=0;for(var g;g=f[e];e++)d.appendChild(g.Fy(a));c=c.tb(!0);for(e=0;f=c[e];e++)d.appendChild(h.K.Eq(f,a));return d};
  h.K.hF=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.pc();c.appendChild(f)}return c};h.K.Eq=function(a,c){if(a.od()&&(a=ca(a,!1)[0],!a))return new DocumentFragment;var d;a.B.L&&(d=a.B.zl());c=h.K.yf(a,c);var e=a.Xa();c.setAttribute("x",Math.round(a.B.L?d-e.x:e.x));c.setAttribute("y",Math.round(e.y));return c};
  h.K.yC=function(a){var c=!1;a.name&&(a.gv?c=!0:a.tk&&(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||""),c.textContent=a.getValue(),c):null};h.K.rB=function(a,c){for(var d=0,e;e=a.T[d];d++)for(var f=0,g;g=e.eb[f];f++)(g=h.K.yC(g))&&c.appendChild(g)};
  h.K.yf=function(a,c){if(a.od())return(a=ca(a,!1)[0])?h.K.yf(a):new DocumentFragment;var d=h.g.xml.createElement(a.Qa?"shadow":"block");d.setAttribute("type",a.type);c||d.setAttribute("id",a.id);if(a.Md){var e=a.Md();e&&(e.hasChildNodes()||e.hasAttributes())&&d.appendChild(e)}h.K.rB(a,d);if(e=a.ce.text){var f=a.ce.size,g=a.ce.Yx,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(e=0;f=a.T[e];e++){var l;g=!0;if(f.type!=h.Ha.Ae){var m=f.connection.va();f.type==h.Ha.He?l=h.g.xml.createElement("value"):f.type==h.Ha.lc&&(l=h.g.xml.createElement("statement"));k=f.connection.Ij();!k||m&&m.Qa||l.appendChild(h.K.Uv(k,c));m&&(k=h.K.yf(m,c),k.nodeType==h.g.j.mg.ELEMENT_NODE&&(l.appendChild(k),g=!1));l.setAttribute("name",f.name);g||d.appendChild(l)}}void 0!=a.Kf&&a.Kf!=a.mD&&d.setAttribute("inline",
  a.Kf);a.isCollapsed()&&d.setAttribute("collapsed",!0);a.isEnabled()||d.setAttribute("disabled",!0);a.Wc()||a.Qa||d.setAttribute("deletable",!1);a.rc()||a.Qa||d.setAttribute("movable",!1);a.Kd()||d.setAttribute("editable",!1);if(e=t(a))k=h.K.yf(e,c),k.nodeType==h.g.j.mg.ELEMENT_NODE&&(l=h.g.xml.createElement("next"),l.appendChild(k),d.appendChild(l));k=a.Z&&a.Z.Ij();!k||e&&e.Qa||l.appendChild(h.K.Uv(k,c));return d};
  h.K.Uv=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.j.mg.TEXT_NODE&&""==e.data.trim()&&d.firstChild!=e&&h.g.j.removeNode(e);d&&(e=d,d=d.nextSibling,e.nodeType==h.g.j.mg.TEXT_NODE&&""==e.data.trim()&&h.g.j.removeNode(e))}return a};h.K.Gd=function(a){return h.g.xml.Gd(a).replace(/<(\w+)([^<]*)\/>/g,"<$1$2></$1>")};
  h.K.YI=function(a){a=h.K.Gd(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.K.ue=function(a){var c=h.g.xml.WE(a);if(!c||!c.documentElement||c.getElementsByTagName("parsererror").length)throw Error("textToDom was unable to parse: "+a);return c.documentElement};
  h.K.LI=function(a,c){c.Zb(!1);c.clear();a=h.K.Uh(a,c);c.Zb(!0);return a};
  h.K.Uh=function(a,c){if(a instanceof h.qb){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments.")}var e;c.L&&(e=c.zl());d=[];h.g.j.pm();var f=h.h.Vb();f||h.h.ta(!0);c.Zb&&c.Zb(!1);var g=!0;try{for(var k=0,l;l=a.childNodes[k];k++){var m=l.nodeName.toLowerCase(),n=l;if("block"==m||"shadow"==m&&!h.h.Ma){var q=h.K.Bj(n,c);d.push(q.id);var p=n.hasAttribute("x")?parseInt(n.getAttribute("x"),10):10,u=n.hasAttribute("y")?parseInt(n.getAttribute("y"),10):10;isNaN(p)||
  isNaN(u)||q.moveBy(c.L?e-p:p,u);g=!1}else{if("shadow"==m)throw TypeError("Shadow block cannot be a top-level block.");if("comment"==m)c.ua?h.kj?h.kj.ql(n):console.warn("Missing require for Blockly.WorkspaceCommentSvg, ignoring workspace comment."):h.Bv?h.Bv.ql(n):console.warn("Missing require for Blockly.WorkspaceComment, ignoring workspace comment.");else if("variables"==m){if(g)h.K.qC(n,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.");
  g=!1}}}}finally{f||h.h.ta(!1),h.g.j.qm()}c.Zb&&c.Zb(!0);h.h.Ga(new (h.h.get(h.h.Dp))(c));return d};h.K.CI=function(a,c){var d;Object.prototype.hasOwnProperty.call(c,"scale")&&(d=da(c));a=h.K.Uh(a,c);if(d&&d.top!=d.bottom){var e=d.bottom;var f=c.L?d.right:d.left;var g=Infinity,k=-Infinity,l=Infinity;for(d=0;d<a.length;d++){var m=c.Gc(a[d]).Xa();m.y<l&&(l=m.y);m.x<g&&(g=m.x);m.x>k&&(k=m.x)}e=e-l+10;f=c.L?f-k:f-g;for(d=0;d<a.length;d++)c.Gc(a[d]).moveBy(f,e)}return a};
  h.K.Bj=function(a,c){if(a instanceof h.qb){var d=a;a=c;c=d;console.warn("Deprecated call to Blockly.Xml.domToBlock, swap the arguments.")}h.h.disable();d=c.Xh();try{var e=h.K.kr(a,c),f=r(e,!1);if(c.ua){ea(e,!1);for(var g=f.length-1;0<=g;g--)f[g].Nj();for(g=f.length-1;0<=g;g--)f[g].Ja(!1);setTimeout(function(){e.Ef||ea(e,!0)},1);fa(e);ha(c)}else for(g=f.length-1;0<=g;g--);}finally{h.h.enable()}if(h.h.isEnabled()){a=h.oa.Hw(c,d);for(g=0;g<a.length;g++)c=a[g],h.h.Ga(new (h.h.get(h.h.Nk))(c));h.h.Ga(new (h.h.get(h.h.pk))(e))}return e};
  h.K.qC=function(a,c){for(var d=0,e;e=a.childNodes[d];d++)if(e.nodeType==h.g.j.mg.ELEMENT_NODE){var f=e.getAttribute("type"),g=e.getAttribute("id");c.ee(e.textContent,f,g)}};
  h.K.zD=function(a){for(var c={Hx:[],Qh:[],data:[],Ej:[],input:[],next:[]},d=0,e;e=a.childNodes[d];d++)if(e.nodeType!=h.g.j.mg.TEXT_NODE)switch(e.nodeName.toLowerCase()){case "mutation":c.Hx.push(e);break;case "comment":if(!h.Comment){console.warn("Missing require for Blockly.Comment, ignoring block comment.");break}c.Qh.push(e);break;case "data":c.data.push(e);break;case "title":case "field":c.Ej.push(e);break;case "value":case "statement":c.input.push(e);break;case "next":c.next.push(e);break;default:console.warn("Ignoring unknown tag: "+
  e.nodeName)}return c};h.K.xB=function(a,c){for(var d=!1,e=0,f;f=a[e];e++)c.Ff&&(c.Ff(f),c.Nj&&(d=!0));return d};h.K.tB=function(a,c){for(var d=0,e;e=a[d];d++){var f=e.textContent,g="true"==e.getAttribute("pinned"),k=parseInt(e.getAttribute("w"),10);e=parseInt(e.getAttribute("h"),10);c.ak(f);c.ce.Yx=g;isNaN(k)||isNaN(e)||(c.ce.size=new h.g.gd(k,e));g&&c.KC&&!c.Yc&&setTimeout(function(){c.Ed.Hb(!0)},1)}};h.K.uB=function(a,c){for(var d=0,e;e=a[d];d++)c.data=e.textContent};
  h.K.vB=function(a,c){for(var d=0,e;e=a[d];d++){var f=e.getAttribute("name");h.K.pC(c,f,e)}};h.K.Cw=function(a){for(var c={Tk:null,Uk:null},d=0,e;e=a.childNodes[d];d++)e.nodeType==h.g.j.mg.ELEMENT_NODE&&("block"==e.nodeName.toLowerCase()?c.Tk=e:"shadow"==e.nodeName.toLowerCase()&&(c.Uk=e));return c};
  h.K.wB=function(a,c,d,e){for(var f=0,g;g=a[f];f++){var k=g.getAttribute("name"),l=ia(d,k);if(!l){console.warn("Ignoring non-existent input "+k+" in block "+e);break}g=h.K.Cw(g);if(g.Tk){if(!l.connection)throw TypeError("Input connection does not exist.");h.K.kr(g.Tk,c,l.connection,!1)}g.Uk&&l.connection.jm(g.Uk)}};
  h.K.yB=function(a,c,d){for(var e=0,f;f=a[e];e++){f=h.K.Cw(f);if(f.Tk){if(!d.Z)throw TypeError("Next statement does not exist.");if(d.Z.isConnected())throw TypeError("Next statement is already connected.");h.K.kr(f.Tk,c,d.Z,!0)}f.Uk&&d.Z&&d.Z.jm(f.Uk)}};
  h.K.kr=function(a,c,d,e){var f=a.getAttribute("type");if(!f)throw TypeError("Block type unspecified: "+a.outerHTML);var g=a.getAttribute("id");g=c.Ds(f,g);var k=h.K.zD(a),l=h.K.xB(k.Hx,g);h.K.tB(k.Qh,g);h.K.uB(k.data,g);if(d)if(e)if(g.Y)d.connect(g.Y);else throw TypeError("Next block does not have previous statement.");else if(g.S)d.connect(g.S);else if(g.Y)d.connect(g.Y);else throw TypeError("Child block does not have output or previous statement.");h.K.vB(k.Ej,g);h.K.wB(k.input,c,g,f);h.K.yB(k.next,
  c,g);l&&g.Nj();(c=a.getAttribute("inline"))&&g.Fi("true"==c);(c=a.getAttribute("disabled"))&&g.af("true"!=c&&"disabled"!=c);if(c=a.getAttribute("deletable"))g.nw="true"==c;(c=a.getAttribute("movable"))&&g.vt("true"==c);(c=a.getAttribute("editable"))&&g.ut("true"==c);(c=a.getAttribute("collapsed"))&&g.Di("true"==c);if("shadow"==a.nodeName.toLowerCase()){a=ca(g,!1);for(c=0;d=a[c];c++)if(!d.Qa)throw TypeError("Shadow block not allowed non-shadow child.");if(ja(g).length)throw TypeError("Shadow blocks cannot have variable references.");
  g.yt(!0)}return g};h.K.pC=function(a,c,d){var e=ka(a,c);e?e.ql(d):console.warn("Ignoring non-existent field "+c+" in block "+a.type)};h.K.jC=function(a){for(var c=0,d;d=a.childNodes[c];c++)if("next"==d.nodeName.toLowerCase()){a.removeChild(d);break}};h.h.xe=function(a){h.h.xe.A.constructor.call(this);this.fb=(this.nd="undefined"==typeof a)?"":a.id;this.Wb=this.nd?"":a.B.id};h.g.object.W(h.h.xe,h.h.Abstract);h.h.xe.prototype.qa=function(){var a=h.h.xe.A.qa.call(this);a.blockId=this.fb;return a};h.h.xe.prototype.ba=function(a){h.h.xe.A.ba.call(this,a);this.fb=a.blockId};
  h.h.xh=function(a,c,d,e,f){h.h.xh.A.constructor.call(this,a);a&&(this.element="undefined"==typeof c?"":c,this.name="undefined"==typeof d?"":d,this.oldValue="undefined"==typeof e?"":e,this.newValue="undefined"==typeof f?"":f)};h.g.object.W(h.h.xh,h.h.xe);h.h.tF=h.h.xh;b=h.h.xh.prototype;b.type=h.h.Si;b.qa=function(){var a=h.h.xh.A.qa.call(this);a.element=this.element;this.name&&(a.name=this.name);a.oldValue=this.oldValue;a.newValue=this.newValue;return a};
  b.ba=function(a){h.h.xh.A.ba.call(this,a);this.element=a.element;this.name=a.name;this.oldValue=a.oldValue;this.newValue=a.newValue};b.Tj=function(){return this.oldValue==this.newValue};
  b.run=function(a){var c=v(this).Gc(this.fb);if(c)switch(c.pe&&c.pe.Hb(!1),a=a?this.newValue:this.oldValue,this.element){case "field":(c=ka(c,this.name))?c.setValue(a):console.warn("Can't set non-existent field: "+this.name);break;case "comment":c.ak(a||null);break;case "collapsed":c.Di(!!a);break;case "disabled":c.af(!a);break;case "inline":c.Fi(!!a);break;case "mutation":var d="";c.Md&&(d=(d=c.Md())&&h.K.Gd(d));if(c.Ff){var e=h.K.ue(a||"<mutation/>");c.Ff(e)}h.h.Ga(new (h.h.get(h.h.Si))(c,"mutation",
  null,d,a));break;default:console.warn("Unknown change type: "+this.element)}else console.warn("Can't change non-existent block: "+this.fb)};h.h.ye=function(a){h.h.ye.A.constructor.call(this,a);a&&(a.Qa&&(this.Ma=!1),this.xml=a.B.ua?h.K.Eq(a):h.K.yf(a),this.ei=h.h.Jw(a))};h.g.object.W(h.h.ye,h.h.xe);h.h.uF=h.h.ye;h.h.ye.prototype.type=h.h.pk;h.h.ye.prototype.qa=function(){var a=h.h.ye.A.qa.call(this);a.xml=h.K.Gd(this.xml);a.ids=this.ei;this.Ma||(a.recordUndo=this.Ma);return a};
  h.h.ye.prototype.ba=function(a){h.h.ye.A.ba.call(this,a);this.xml=h.K.ue(a.xml);this.ei=a.ids;void 0!==a.recordUndo&&(this.Ma=a.recordUndo)};h.h.ye.prototype.run=function(a){var c=v(this);if(a)a=h.g.xml.createElement("xml"),a.appendChild(this.xml),h.K.Uh(a,c);else{a=0;for(var d;d=this.ei[a];a++){var e=c.Gc(d);e?e.I(!1):d==this.fb&&console.warn("Can't uncreate non-existent block: "+d)}}};
  h.h.Be=function(a){h.h.Be.A.constructor.call(this,a);if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");a.Qa&&(this.Ma=!1);this.Wj=a.B.ua?h.K.Eq(a):h.K.yf(a);this.ei=h.h.Jw(a)}};h.g.object.W(h.h.Be,h.h.xe);h.h.vF=h.h.Be;h.h.Be.prototype.type=h.h.yh;h.h.Be.prototype.qa=function(){var a=h.h.Be.A.qa.call(this);a.oldXml=h.K.Gd(this.Wj);a.ids=this.ei;this.Ma||(a.recordUndo=this.Ma);return a};
  h.h.Be.prototype.ba=function(a){h.h.Be.A.ba.call(this,a);this.Wj=h.K.ue(a.oldXml);this.ei=a.ids;void 0!==a.recordUndo&&(this.Ma=a.recordUndo)};h.h.Be.prototype.run=function(a){var c=v(this);if(a){a=0;for(var d;d=this.ei[a];a++){var e=c.Gc(d);e?e.I(!1):d==this.fb&&console.warn("Can't delete non-existent block: "+d)}}else a=h.g.xml.createElement("xml"),a.appendChild(this.Wj),h.K.Uh(a,c)};
  h.h.Fh=function(a){h.h.Fh.A.constructor.call(this,a);a&&(a.Qa&&(this.Ma=!1),a=la(this),this.Px=a.Vx,this.Mx=a.mx,this.Hs=a.hw)};h.g.object.W(h.h.Fh,h.h.xe);h.h.wF=h.h.Fh;b=h.h.Fh.prototype;b.type=h.h.Gk;b.qa=function(){var a=h.h.Fh.A.qa.call(this);this.xi&&(a.newParentId=this.xi);this.wi&&(a.newInputName=this.wi);this.Vg&&(a.newCoordinate=Math.round(this.Vg.x)+","+Math.round(this.Vg.y));this.Ma||(a.recordUndo=this.Ma);return a};
  b.ba=function(a){h.h.Fh.A.ba.call(this,a);this.xi=a.newParentId;this.wi=a.newInputName;if(a.newCoordinate){var c=a.newCoordinate.split(",");this.Vg=new h.g.U(Number(c[0]),Number(c[1]))}void 0!==a.recordUndo&&(this.Ma=a.recordUndo)};b.Ai=function(){var a=la(this);this.xi=a.Vx;this.wi=a.mx;this.Vg=a.hw};function la(a){var c=v(a).Gc(a.fb);a={};var d=c.getParent();if(d){if(a.Vx=d.id,c=ma(d,c))a.mx=c.name}else a.hw=c.Xa();return a}
  b.Tj=function(){return this.Px==this.xi&&this.Mx==this.wi&&h.g.U.Gf(this.Hs,this.Vg)};
  b.run=function(a){var c=v(this),d=c.Gc(this.fb);if(d){var e=a?this.xi:this.Px,f=a?this.wi:this.Mx,g=a?this.Vg:this.Hs;a=null;if(e&&(a=c.Gc(e),!a)){console.warn("Can't connect to non-existent block: "+e);return}d.getParent()&&x(d);if(g)f=d.Xa(),d.moveBy(g.x-f.x,g.y-f.y);else{d=d.S||d.Y;c=d.type;if(f){if(a=ia(a,f))var k=a.connection}else c==h.X.ed&&(k=a.Z);k?d.connect(k):console.warn("Can't connect to non-existent input: "+f)}}else console.warn("Can't move non-existent block: "+this.fb)};
  h.v.register(h.v.R.Fb,h.h.pk,h.h.ye);h.v.register(h.v.R.Fb,h.h.yh,h.h.Be);h.v.register(h.v.R.Fb,h.h.Si,h.h.xh);h.v.register(h.v.R.Fb,h.h.Gk,h.h.Fh);h.bb={};h.bb.gr=0;h.bb.Sn=null;h.bb.nC=function(a){var c=a.B,d=a.ra();c.Rc.play("delete");a=na(c,d);d=d.cloneNode(!0);d.bF=a.x;d.cF=a.y;d.setAttribute("transform","translate("+a.x+","+a.y+")");y(c).appendChild(d);d.Kv=d.getBBox();h.bb.xw(d,c.L,new Date,c.scale)};h.bb.xw=function(a,c,d,e){var f=(new Date-d)/150;1<f?h.g.j.removeNode(a):(a.setAttribute("transform","translate("+(a.bF+(c?-1:1)*a.Kv.width*e/2*f)+","+(a.cF+a.Kv.height*e*f)+") scale("+(1-f)*e+")"),setTimeout(h.bb.xw,10,a,c,d,e))};
  h.bb.ZB=function(a){var c=a.B,d=c.scale;c.Rc.play("click");if(!(1>d)){var e=na(c,a.ra());a.S?(e.x+=(a.L?3:-3)*d,e.y+=13*d):a.Y&&(e.x+=(a.L?-23:23)*d,e.y+=3*d);a=h.g.j.J(h.g.D.bu,{cx:e.x,cy:e.y,r:0,fill:"none",stroke:"#888","stroke-width":10},y(c));h.bb.bw(a,new Date,d)}};h.bb.bw=function(a,c,d){var e=(new Date-c)/150;1<e?h.g.j.removeNode(a):(a.setAttribute("r",25*e*d),a.style.opacity=1-e,h.bb.gr=setTimeout(h.bb.bw,10,a,c,d))};
  h.bb.mC=function(a){a.B.Rc.play("disconnect");if(!(1>a.B.scale)){var c=z(a).height;c=Math.atan(10/c)/Math.PI*180;a.L||(c*=-1);h.bb.ww(a.ra(),c,new Date)}};h.bb.ww=function(a,c,d){var e=(new Date-d)/200;1<e?a.om="":(a.om="skewX("+Math.round(Math.sin(e*Math.PI*3)*(1-e)*c)+")",h.bb.Sn=a,h.bb.gr=setTimeout(h.bb.ww,10,a,c,d));a.setAttribute("transform",a.zm+a.om)};h.bb.hr=function(){if(h.bb.Sn){clearTimeout(h.bb.gr);var a=h.bb.Sn;a.om="";a.setAttribute("transform",a.zm);h.bb.Sn=null}};h.h.Zd=function(a){h.h.Zd.A.constructor.call(this);this.nd="undefined"==typeof a;this.Wb=a?a:"";this.Ma=!1};h.g.object.W(h.h.Zd,h.h.Abstract);h.h.Zd.prototype.hs=!0;h.h.tg=function(a,c,d,e){h.h.tg.A.constructor.call(this,a?a.B.id:void 0);this.fb=a?a.id:null;this.element="undefined"==typeof c?"":c;this.oldValue="undefined"==typeof d?"":d;this.newValue="undefined"==typeof e?"":e};h.g.object.W(h.h.tg,h.h.Zd);h.h.tg.prototype.type=h.h.oq;
  h.h.tg.prototype.qa=function(){var a=h.h.tg.A.qa.call(this);a.element=this.element;void 0!==this.newValue&&(a.newValue=this.newValue);this.fb&&(a.blockId=this.fb);return a};h.h.tg.prototype.ba=function(a){h.h.tg.A.ba.call(this,a);this.element=a.element;this.newValue=a.newValue;this.fb=a.blockId};h.v.register(h.v.R.Fb,h.h.oq,h.h.tg);h.h.Zf=function(a,c,d){h.h.Zf.A.constructor.call(this,a?a.B.id:void 0);this.fb=a?a.id:null;this.tx=c;this.Lv=d};h.g.object.W(h.h.Zf,h.h.Zd);h.h.Zf.prototype.type=h.h.Km;h.h.Zf.prototype.qa=function(){var a=h.h.Zf.A.qa.call(this);a.isStart=this.tx;a.blockId=this.fb;a.blocks=this.Lv;return a};h.h.Zf.prototype.ba=function(a){h.h.Zf.A.ba.call(this,a);this.tx=a.isStart;this.fb=a.blockId;this.Lv=a.blocks};h.v.register(h.v.R.Fb,h.h.Km,h.h.Zf);
  h.Xd=function(a){this.Vf=h.selected=a;this.m=a.B;this.Qg=this.js=null;this.ml=oa(this,this.Vf);this.tc=this.Bb=null;this.jf=!1;this.kl=this.Vr=this.pi=null;this.yn=pa(this)};h.Xd.aj={Hp:0,jA:1,ev:2};h.Xd.prototype.I=function(){this.yn.length=0;h.h.disable();try{this.ml&&this.ml.I(),this.Qg&&this.Qg.I()}finally{h.h.enable()}};
  h.Xd.prototype.update=function(a,c){var d=this.Bb&&this.tc?h.gu:h.kc;for(var e=null,f=null,g=0;g<this.yn.length;g++){var k=this.yn[g],l=k.closest(d,a);l.connection&&(e=l.connection,f=k,d=l.Vo)}e=(d={closest:e,local:f,Vo:d},!!d.closest)&&c!=h.nu;if((this.jf=!!c&&!this.Vf.getParent()&&this.Vf.Wc()&&!e)||qa(this,d,a)){h.h.disable();d.closest?(a=this.Bb!=d.closest,c=this.tc!=d.local,this.Bb&&this.tc&&(a||c||this.jf)&&ra(this)):ra(this);this.tc=this.Bb=this.pi=null;if(!this.jf&&(a=d.closest,c=d.local,
  a))if(a==this.Bb||a.ga().od())console.log("Trying to connect to an insertion marker");else{this.Bb=a;this.tc=c;a=this.Bb;d=this.tc;c=this.Vf;d.type==h.X.cd||d.type==h.X.ed?((e=!a.isConnected())||(e=a.va(),d.type==h.X.cd?(d=e.S,c=h.xa.wx(c,e)):(d=e.Y,c=c.vo()),e=c?A(d.M.B.Me,c,d,!1):!1),c=e?h.Xd.aj.Hp:h.Xd.aj.ev):c=h.Xd.aj.Hp;switch(c){case h.Xd.aj.jA:this.Vr=this.Bb.ga();break;case h.Xd.aj.Hp:e=this.tc;c=this.Bb;d=this.js&&e==this.js?this.Qg:this.ml;e=d.Jr(e.ga(),e);if(e==this.pi)throw Error("Made it to showInsertionMarker_ even though the marker isn't changing");
  d.Ja();d.ua=!0;d.ra().setAttribute("visibility","visible");e&&c&&(e.type!=h.X.Sb&&e.type!=h.X.Rb||d.moveBy(c.x-e.x,c.y-e.y));c&&e.connect(c);this.pi=e;break;case h.Xd.aj.ev:this.kl=this.Bb.va(),sa(this.kl.wb,"blocklyReplaceable",!0)}a&&(d=a.M.B.ob.ea(),c=ta(d,a),a.type==h.X.Rb||a.type==h.X.cd?(d=d.gj,c=h.g.u.moveBy(0,-d)+h.g.u.$("v",d)+c.Pd+h.g.u.$("v",d)):(d=d.Ik-d.pb,c=h.g.u.moveBy(-d,0)+h.g.u.$("h",d)+c.ah+h.g.u.$("h",d)),d=a.M.Xa(),h.xa.jx=h.g.j.J(h.g.D.Ee,{"class":"blocklyHighlightedConnectionPath",
  d:c,transform:"translate("+(a.x-d.x)+","+(a.y-d.y)+")"+(a.M.L?" scale(-1 1)":"")},a.M.ra()))}h.h.enable()}};function oa(a,c){var d=c.type;h.h.disable();try{var e=a.m.Ds(d);e.vy(!0);if(c.Md){var f=c.Md();f&&e.Ff(f)}for(a=0;a<c.T.length;a++){var g=c.T[a];if(g.name!=h.lb.Pm){var k=e.T[a];for(d=0;d<g.eb.length;d++)k.eb[d].setValue(g.eb[d].getValue())}}e.Di(c.isCollapsed());e.Fi(ua(c));e.Nj();e.ra().setAttribute("visibility","hidden")}finally{h.h.enable()}return e}
  function pa(a){var c=a.Vf.je(!1),d=a.Vf.vo();if(d&&d!=a.Vf.Z){c.push(d);a.js=d;if(a.Qg){h.h.disable();try{a.Qg.I()}finally{h.h.enable()}}a.Qg=oa(a,d.ga())}return c}
  function qa(a,c,d){var e=c.local,f=c.closest;c=c.Vo;if(e&&f){if(a.tc&&a.Bb){if(a.Bb==f&&a.tc==e)return!1;e=a.tc.x+d.x-a.Bb.x;a=a.tc.y+d.y-a.Bb.y;a=Math.sqrt(e*e+a*a);return!(f&&c>a-h.nz)}if(a.tc||a.Bb)console.error("Only one of localConnection_ and closestConnection_ was set.");else return!0}else return!(!a.tc||!a.Bb);console.error("Returning true from shouldUpdatePreviews, but it's not clear why.");return!0}
  function ra(a){a.Bb&&a.Bb.va()&&(h.g.j.removeNode(h.xa.jx),delete h.xa.jx);if(a.kl)sa(a.kl.wb,"blocklyReplaceable",!1),a.kl=null;else if(a.Vr)a.Vr=null;else if(a.pi)if(a.pi){var c=a.pi,d=c.ga(),e=d.Z,f=d.Y,g=d.S;g=c.type==h.X.Rb&&!(g&&g.Aa);!(c!=e||f&&f.Aa)||g?x(c.va(),!1):c.type==h.X.Sb&&c!=e?(e=c.Aa,x(e.ga(),!1),f=f?f.Aa:null,x(d,!0),f&&f.connect(e)):x(d,!0);if(c.Aa)throw Error("markerConnection_ still connected at the end of disconnectInsertionMarker");a.pi=null;d.ra().setAttribute("visibility",
  "hidden")}else console.log("No insertion marker connection to disconnect")}h.Xd.prototype.Fj=function(){var a=[];this.ml&&a.push(this.ml);this.Qg&&a.push(this.Qg);return a};h.uh=function(a,c){this.hb=a;this.m=c;this.Qe=new h.Xd(this.hb);this.Th=null;this.jf=!1;this.cf=this.hb.Xa();this.Vn=h.uh.jD(a)};h.uh.prototype.I=function(){this.Vn.length=0;this.Qe&&this.Qe.I()};h.uh.jD=function(a){var c=[];a=r(a,!1);for(var d=0,e;e=a[d];d++){e=va(e);for(var f=0;f<e.length;f++){var g={location:e[f].fJ(),icon:e[f]};c.push(g)}}return c};
  function wa(a,c,d){d=a.Xj(d);var e=h.g.U.sum(a.cf,d);a.hb.Cs(e);for(e=0;e<a.Vn.length;e++){var f=a.Vn[e];f.icon.OJ(h.g.U.sum(f.location,d))}a.Th=xa(a.m,c);a.Qe.update(d,a.Th);a.jf=a.Qe.jf;c=a.m.xc;a.jf?(a.hb.hm(!0),a.Th==h.yp&&c&&ya(c,!0)):(a.hb.hm(!1),c&&ya(c,!1))}
  function za(a,c,d){wa(a,c,d);a.Vn=[];c=new (h.h.get(h.h.Km))(a.hb,!1,r(a.hb,!1));h.h.Ga(c);h.g.j.qm();h.bb.hr();d=a.Xj(d);c=h.g.U.sum(a.cf,d);var e=a.hb;e.Em&&(e.translate(c.x,c.y),e.B.jd.Cn(e.B.xb));c=a.m.xc;a.jf?(c&&setTimeout(c.Fn.bind(c),100),a.ll(),a.hb.I(!1,!0),h.Dj=[]):c&&c.Fn();a.jf||(Aa(a.hb,d.x,d.y),a.hb.gh(!1),a.ll(),a.Qe.Bb?(d=a.Qe,d.Bb&&(h.h.disable(),ra(d),h.h.enable(),d.tc.connect(d.Bb),d.Vf.ua&&(h.bb.ZB((Ba(d.tc)?d.Bb:d.tc).ga()),Ca(d.Vf.me())))):a.hb.Ja(),Da(a.hb));a.m.Zb(!0);(d=
  a.m.Na)&&"function"==typeof d.ht&&d.ht(a.hb.Wc()?"blocklyToolboxDelete":"blocklyToolboxGrab");h.h.ta(!1)}h.uh.prototype.ll=function(){var a=new (h.h.get(h.h.rh))(this.hb);a.Hs=this.cf;a.Ai();h.h.Ga(a)};h.uh.prototype.Xj=function(a){a=new h.g.U(a.x/this.m.scale,a.y/this.m.scale);this.m.qo&&a.scale(1/this.m.options.Zc.scale);return a};h.uh.prototype.Fj=function(){return this.Qe&&this.Qe.Fj?this.Qe.Fj():[]};h.g.PG=function(){};
  h.iq=function(a,c,d,e){this.m=a;c=void 0===c?!0:c;d=void 0===d?!0:d;var f=c&&d;c&&(this.mb=new h.ya(a,!0,f,e));d&&(this.Va=new h.ya(a,!1,f,e));f&&(this.Zk=h.g.j.J(h.g.D.Lb,{height:h.ya.fc,width:h.ya.fc,"class":"blocklyScrollbarBackground"},null),h.g.j.Oj(this.Zk,a.Tf));this.Za=null};b=h.iq.prototype;b.I=function(){h.g.j.removeNode(this.Zk);this.Za=this.m=this.Zk=null;this.mb&&(this.mb.I(),this.mb=null);this.Va&&(this.Va.I(),this.Va=null)};
  b.resize=function(){var a=this.m.ke();if(a){var c=!1,d=!1;this.Za&&this.Za.yc==a.yc&&this.Za.Lc==a.Lc&&this.Za.Qc==a.Qc&&this.Za.Dc==a.Dc?(this.Za&&this.Za.scrollWidth==a.scrollWidth&&this.Za.gf==a.gf&&this.Za.scrollLeft==a.scrollLeft||(c=!0),this.Za&&this.Za.scrollHeight==a.scrollHeight&&this.Za.hf==a.hf&&this.Za.scrollTop==a.scrollTop||(d=!0)):d=c=!0;if(c||d){try{h.h.disable(),this.mb&&c&&this.mb.resize(a),this.Va&&d&&this.Va.resize(a)}finally{h.h.enable()}Ea(this.m)}this.mb&&this.Va&&(this.Za&&
  this.Za.yc==a.yc&&this.Za.Dc==a.Dc||this.Zk.setAttribute("x",this.Va.position.x),this.Za&&this.Za.Lc==a.Lc&&this.Za.Qc==a.Qc||this.Zk.setAttribute("y",this.mb.position.y));this.Za=a}};b.Yo=function(a,c){this.mb&&this.mb.Yo(a,c);this.Va&&this.Va.Yo(a,c)};b.set=function(a,c,d){this.mb&&this.mb.set(a,!1);this.Va&&this.Va.set(c,!1);if(d||void 0===d)a={},this.mb&&(a.x=Fa(this.mb)),this.Va&&(a.y=Fa(this.Va)),this.m.im(a)};b.Ei=function(a){this.mb&&this.mb.Ei(a);this.Va&&this.Va.Ei(a)};
  b.isVisible=function(){var a=!1;this.mb&&(a=this.mb.isVisible());this.Va&&(a=a||this.Va.isVisible());return a};
  h.ya=function(a,c,d,e){this.m=a;this.$g=d||!1;this.di=c;this.ratio=this.Za=null;this.$k(e);this.position=new h.g.U(0,0);a=h.ya.fc;c?(this.hc.setAttribute("height",a),this.Ye.setAttribute("height",a),this.vd.setAttribute("height",a-5),this.vd.setAttribute("y",2.5),this.xo="width",this.ay="x"):(this.hc.setAttribute("width",a),this.Ye.setAttribute("width",a),this.vd.setAttribute("width",a-5),this.vd.setAttribute("x",2.5),this.xo="height",this.ay="y");this.Sx=h.N.Ca(this.hc,"mousedown",this,this.PD);
  this.Tx=h.N.Ca(this.vd,"mousedown",this,this.QD)};b=h.ya.prototype;b.Qs=new h.g.U(0,0);b.By=0;b.Qd=0;b.Ig=0;b.Al=0;b.Nf=!0;b.Rh=!0;h.ya.fc=15;h.Touch.qv&&(h.ya.fc=25);h.ya.Ih=.5;h.ya.BD=function(a,c){return a&&c&&a.yc==c.yc&&a.Lc==c.Lc&&a.gf==c.gf&&a.hf==c.hf&&a.Qc==c.Qc&&a.Dc==c.Dc&&a.scrollWidth==c.scrollWidth&&a.scrollHeight==c.scrollHeight&&a.scrollLeft==c.scrollLeft&&a.scrollTop==c.scrollTop?!0:!1};b=h.ya.prototype;
  b.I=function(){Ga();h.N.yb(this.Sx);this.Sx=null;h.N.yb(this.Tx);this.Tx=null;h.g.j.removeNode(this.Ye);this.hc=this.O=this.Ye=null;this.vd&&(this.m.jc.unsubscribe(this.vd),this.vd=null);this.m=null};function Ha(a,c){return c=0>=c||isNaN(c)?0:Math.min(c,a.Qd)}function Ia(a,c){a.Ig=c;a.vd.setAttribute(a.xo,a.Ig)}function Ja(a,c){return c=0>=c||isNaN(c)?0:Math.min(c,a.Qd-a.Ig)}function Ka(a,c){a.Al=c;a.vd.setAttribute(a.ay,a.Al)}
  function La(a,c){a.Qd=c;a.Ye.setAttribute(a.xo,a.Qd);a.hc.setAttribute(a.xo,a.Qd)}b.setPosition=function(a,c){this.position.x=a;this.position.y=c;h.g.j.gm(this.Ye,"translate("+(this.position.x+this.Qs.x)+"px,"+(this.position.y+this.Qs.y)+"px)")};b.resize=function(a){if(!a&&(a=this.m.ke(),!a))return;if(!h.ya.BD(a,this.Za)){if(this.di){var c=a;Ma(this,c)?Na(this,c):Oa(this,c)}else c=a,Ma(this,c)?Pa(this,c):Qa(this,c);this.Za=a;Ra(this)}};
  function Ma(a,c){return a.Za?a.Za.yc!==c.yc||a.Za.Lc!==c.Lc||a.Za.Dc!==c.Dc||a.Za.Qc!==c.Qc:!0}function Na(a,c){var d=c.yc-2*h.ya.Ih;a.$g&&(d-=h.ya.fc);La(a,Math.max(0,d));d=c.Dc+h.ya.Ih;a.$g&&a.m.L&&(d+=h.ya.fc);a.setPosition(d,c.Qc+c.Lc-h.ya.fc-h.ya.Ih);Oa(a,c)}function Oa(a,c){if(c.yc>=c.scrollWidth)Ia(a,a.Qd),Ka(a,0),a.$g||a.Hb(!1);else{a.$g||a.Hb(!0);var d=a.Qd*c.yc/c.scrollWidth;d=Ha(a,d);Ia(a,d);d=c.scrollWidth-c.yc;var e=a.Qd-a.Ig;c=(c.gf-c.scrollLeft)/d*e;c=Ja(a,c);Ka(a,c);a.ratio=e/d}}
  function Pa(a,c){var d=c.Lc-2*h.ya.Ih;a.$g&&(d-=h.ya.fc);La(a,Math.max(0,d));a.setPosition(a.m.L?c.Dc+h.ya.Ih:c.Dc+c.yc-h.ya.fc-h.ya.Ih,c.Qc+h.ya.Ih);Qa(a,c)}function Qa(a,c){if(c.Lc>=c.scrollHeight)Ia(a,a.Qd),Ka(a,0),a.$g||a.Hb(!1);else{a.$g||a.Hb(!0);var d=a.Qd*c.Lc/c.scrollHeight;d=Ha(a,d);Ia(a,d);d=c.scrollHeight-c.Lc;var e=a.Qd-a.Ig;c=(c.hf-c.scrollTop)/d*e;c=Ja(a,c);Ka(a,c);a.ratio=e/d}}
  b.$k=function(a){var c="blocklyScrollbar"+(this.di?"Horizontal":"Vertical");a&&(c+=" "+a);this.Ye=h.g.j.J(h.g.D.ej,{"class":c},null);this.O=h.g.j.J(h.g.D.Nc,{},this.Ye);this.hc=h.g.j.J(h.g.D.Lb,{"class":"blocklyScrollbarBackground"},this.O);a=Math.floor((h.ya.fc-5)/2);this.vd=h.g.j.J(h.g.D.Lb,{"class":"blocklyScrollbarHandle",rx:a,ry:a},this.O);this.m.jc.subscribe(this.vd,"scrollbarColour","fill");this.m.jc.subscribe(this.vd,"scrollbarOpacity","fill-opacity");h.g.j.Oj(this.Ye,y(this.m))};
  b.isVisible=function(){return this.Nf};b.Ei=function(a){var c=a!=this.Rh;this.Rh=a;c&&this.Bm()};b.Hb=function(a){var c=a!=this.isVisible();if(this.$g)throw Error("Unable to toggle visibility of paired scrollbars.");this.Nf=a;c&&this.Bm()};b.Bm=function(){this.Rh&&this.isVisible()?this.Ye.setAttribute("display","block"):this.Ye.setAttribute("display","none")};
  b.PD=function(a){Sa(this.m);h.Touch.Dn();Ga();if(h.g.Kl(a))a.stopPropagation();else{var c=h.g.Tl(a,y(this.m),Ta(this.m));c=this.di?c.x:c.y;var d=h.g.xl(this.vd);d=this.di?d.x:d.y;var e=this.Al,f=.95*this.Ig;c<=d?e-=f:c>=d+this.Ig&&(e+=f);Ka(this,Ja(this,e));Ra(this);a.stopPropagation();a.preventDefault()}};
  b.QD=function(a){Sa(this.m);Ga();h.g.Kl(a)?a.stopPropagation():(this.QE=this.Al,Ua(this.m),this.By=this.di?a.clientX:a.clientY,h.ya.Yg=h.N.Ca(document,"mouseup",this,this.UD),h.ya.Xg=h.N.Ca(document,"mousemove",this,this.RD),a.stopPropagation(),a.preventDefault())};b.RD=function(a){Ka(this,Ja(this,this.QE+((this.di?a.clientX:a.clientY)-this.By)));Ra(this)};b.UD=function(){Va(this.m);h.Touch.Dn();Ga()};
  function Ga(){h.ec(!0);h.ya.Yg&&(h.N.yb(h.ya.Yg),h.ya.Yg=null);h.ya.Xg&&(h.N.yb(h.ya.Xg),h.ya.Xg=null)}function Fa(a){a=a.Al/(a.Qd-a.Ig);isNaN(a)&&(a=0);return a}function Ra(a){var c=Fa(a),d={};a.di?d.x=c:d.y=c;a.m.im(d)}b.set=function(a,c){Ka(this,Ja(this,a*this.ratio));(c||void 0===c)&&Ra(this)};b.Yo=function(a,c){this.Qs=new h.g.U(a,c)};h.g.qd={};h.g.qd.It=function(a){return a*Math.PI/180};h.g.qd.YE=function(a){return 180*a/Math.PI};h.g.qd.sj=function(a,c,d){if(d<a){var e=d;d=a;a=e}return Math.max(a,Math.min(c,d))};h.g.Qn={};h.g.Qn.warn=function(a,c,d,e){a=a+" was deprecated on "+c+" and will be deleted on "+d+".";e&&(a+="\nUse "+e+" instead.");console.warn(a)};h.xa=function(a,c){this.M=a;this.type=c};h.xa.Mm=0;h.xa.PA=1;h.xa.SA=2;h.xa.RA=3;h.xa.MA=4;h.xa.NA=5;h.xa.QA=6;h.xa.OA=7;b=h.xa.prototype;b.Aa=null;b.Ef=!1;b.rj=null;b.ap=null;b.x=0;b.y=0;
  b.In=function(a){var c=this,d=c.ga(),e=a.ga();a.isConnected()&&a.disconnect();if(c.isConnected()){var f=c.va(),g=c.Ij();c.ap=null;if(f.Qa)g=h.K.yf(f),f.I(!1),f=null;else if(c.type==h.X.Rb){if(!f.S)throw Error("Orphan block does not have an output connection.");var k=h.xa.wx(e,f);k&&(f.S.connect(k),f=null)}else if(c.type==h.X.Sb){if(!f.Y)throw Error("Orphan block does not have a previous connection.");for(k=e;k.Z;){var l=t(k);if(l&&!l.Qa)k=l;else{A(f.B.Me,f.Y,k.Z,!1)&&(k.Z.connect(f.Y),f=null);break}}}if(f&&
  (c.disconnect(),h.h.Ma)){var m=h.h.Vb();setTimeout(function(){f.B&&!f.getParent()&&(h.h.ta(m),f.S?f.S.Lo(c):f.Y&&f.Y.Lo(c),h.h.ta(!1))},h.rp)}c.ap=g}var n;h.h.isEnabled()&&(n=new (h.h.get(h.h.rh))(e));h.xa.YB(c,a);e.Zo(d);n&&(n.Ai(),h.h.Ga(n))};b.I=function(){if(this.isConnected()){this.jm(null);var a=this.va();a&&x(a)}this.Ef=!0};b.ga=function(){return this.M};function Ba(a){return a.type==h.X.Rb||a.type==h.X.Sb}b.isConnected=function(){return!!this.Aa};
  b.Lq=function(a){h.g.Qn.warn("Connection.prototype.canConnectWithReason","July 2020","July 2021","the workspace's connection checker");return this.M.B.Me.Lq(this,a,!1)};b.Lo=function(){};b.connect=function(a){if(this.Aa!=a&&A(this.M.B.Me,this,a,!1)){var c=h.h.Vb();c||h.h.ta(!0);Ba(this)?this.In(a):a.In(this);c||h.h.ta(!1)}};h.xa.YB=function(a,c){if(!a||!c)throw Error("Cannot connect null connections.");a.Aa=c;c.Aa=a};
  h.xa.NE=function(a,c){var d=null;c=c.S;for(var e=0;e<a.T.length;e++){var f=a.T[e].connection,g=c.M.B.Me;if(f&&f.type==h.X.Rb&&A(g,c,f,!1)){if(d)return null;d=f}}return d};h.xa.wx=function(a,c){for(var d;d=h.xa.NE(a,c);)if(a=d.va(),!a||a.Qa)return d;return null};b=h.xa.prototype;
  b.disconnect=function(){var a=this.Aa;if(!a)throw Error("Source connection not connected.");if(a.Aa!=this)throw Error("Target connection not connected to source connection.");if(Ba(this)){var c=this.M;var d=a.ga();a=this}else c=a.ga(),d=this.M;var e=h.h.Vb();e||h.h.ta(!0);this.er(c,d);d.Qa||a.em();e||h.h.ta(!1)};b.er=function(a,c){var d;h.h.isEnabled()&&(d=new (h.h.get(h.h.rh))(c));this.Aa=this.Aa.Aa=null;c.Zo(null);d&&(d.Ai(),h.h.Ga(d))};
  b.em=function(){var a=this.ga(),c=this.Ij();if(a.B&&c)if(a=h.K.Bj(c,a.B),a.S)this.connect(a.S);else if(a.Y)this.connect(a.Y);else throw Error("Child block does not have output or previous statement.");};b.va=function(){return this.isConnected()?this.Aa.ga():null};b.Rx=function(){!this.isConnected()||this.Aa&&A(this.M.B.Me,this,this.Aa,!1)||x(Ba(this)?this.va():this.M)};b.$j=function(a){a?(Array.isArray(a)||(a=[a]),this.rj=a,this.Rx()):this.rj=null};
  b.jm=function(a){this.ap=a;a=this.va();a?a.Qa&&(a.I(!1),this.em()):this.em()};b.Ij=function(){return this.ap};b.Ix=function(){return[]};b.Se=function(){for(var a=null,c=this.M,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.M;if(a)if(a.S==this)var c="Output Connection of ";else if(a.Y==this)c="Previous Connection of ";else if(a.Z==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.rG=function(){};h.ku=function(){};function A(a,c,d,e,f){return a.Lq(c,d,e,f)==h.xa.Mm}h.ku.prototype.Lq=function(a,c,d,e){if(a&&c){if(Ba(a)){var f=a.ga();var g=c.ga()}else g=a.ga(),f=c.ga();f=f==g?h.xa.PA:c.type!=h.$i[a.type]?h.xa.SA:f.B!==g.B?h.xa.NA:f.Qa&&!g.Qa?h.xa.QA:h.xa.Mm}else f=h.xa.RA;if(f!=h.xa.Mm)a=f;else{a:if(f=a.rj,g=c.rj,f&&g){for(var k=0;k<f.length;k++)if(-1!=g.indexOf(f[k])){f=!0;break a}f=!1}else f=!0;a=f?d&&!Wa(a,c,e||0)?h.xa.OA:h.xa.Mm:h.xa.MA}return a};
  function Wa(a,c,d){if(Xa(a,c)>d||c.ga().od())return!1;switch(c.type){case h.X.ed:return a.Aa||-1!=h.Dj.indexOf(c)?a=!1:c.Aa?(a=c.va(),a=a.od()?!(a.Y&&a.Y.va()):!1):a=!0,a;case h.X.cd:if(c.isConnected()&&!c.va().od()||a.isConnected())return!1;break;case h.X.Rb:if(c.isConnected()&&!c.va().rc()&&!c.va().Qa)return!1;break;case h.X.Sb:if(c.isConnected()&&!a.ga().Z&&!c.va().Qa&&c.va().Z)return!1;break;default:return!1}return-1!=h.Dj.indexOf(c)?!1:!0}h.v.register(h.v.R.iu,h.v.rk,h.ku);h.Lh=function(a,c,d,e){this.name=a;this.vg=c||Object.create(null);this.Mq=d||Object.create(null);this.Xv=e||Object.create(null);this.fontStyle=Object.create(null);this.Et=null;h.v.register(h.v.R.jq,a,this)};h.Lh.prototype.ie=function(){return this.name+"-theme"};function Ya(a,c){return(c=a.Xv[c])&&"string"==typeof c&&Ya(a,c)?Ya(a,c):c?String(c):null}
  h.Lh.iC=function(a,c){var d=new h.Lh(a),e=c.base;e&&("string"==typeof e&&(e=h.v.Lr(h.v.R.jq,e)),e instanceof h.Lh&&(h.g.object.yj(d,e),d.name=a));h.g.object.yj(d.vg,c.blockStyles);h.g.object.yj(d.Mq,c.categoryStyles);h.g.object.yj(d.Xv,c.componentStyles);h.g.object.yj(d.fontStyle,c.fontStyle);null!=c.startHats&&(d.Et=c.startHats);return d};h.sf={};h.sf.$f={};h.sf.$f.hC={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.sf.$f.Mq={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.sf.$f=new h.Lh("classic",h.sf.$f.hC,h.sf.$f.Mq);h.g.Ck={};h.g.Ck.LD=0;h.g.Ck.Nw=function(){return"blockly-"+(h.g.Ck.LD++).toString(36)};h.g.V={};h.g.V.up="categoryToolbox";h.g.V.wu="flyoutToolbox";h.g.V.Pa={Kh:0,Ri:1,Yb:2,fd:3};h.g.V.gw=function(a){if(!a)return null;if(a instanceof Element||"string"==typeof a)a=h.g.V.Us(a),a=h.g.V.aC(a);h.g.V.fF(a);return a};h.g.V.fF=function(a){var c=a.kind;a=a.contents;if(c&&c!=h.g.V.wu&&c!=h.g.V.up)throw Error("Invalid toolbox kind "+c+". Please supply either "+h.g.V.wu+" or "+h.g.V.up);if(!a)throw Error("Toolbox must have a contents attribute.");};
  h.g.V.fw=function(a){return a?a.contents?a.contents:Array.isArray(a)&&0<a.length&&!a[0].nodeType?a:h.g.V.Tt(a):[]};h.g.V.Bl=function(a){if(!a)return!1;var c=a.kind;return c?c==h.g.V.up:!!a.contents.filter(function(d){return"CATEGORY"==d.kind.toUpperCase()}).length};h.g.V.mJ=function(a){return a&&a.contents?!!a.contents.filter(function(c){return"CATEGORY"==c.kind.toUpperCase()}).length:!1};h.g.V.aC=function(a){var c={contents:h.g.V.Tt(a)};a instanceof Node&&h.g.V.Fv(a,c);return c};
  h.g.V.Tt=function(a){var c=[],d=a.childNodes;d||(d=a);a=0;for(var e;e=d[a];a++)if(e.tagName){var f={},g=e.tagName.toUpperCase();f.kind=g;"BLOCK"==g?f.blockxml=e:e.childNodes&&0<e.childNodes.length&&(f.contents=h.g.V.Tt(e));h.g.V.Fv(e,f);c.push(f)}return c};h.g.V.Fv=function(a,c){for(var d=0;d<a.attributes.length;d++){var e=a.attributes[d];-1<e.nodeName.indexOf("css-")?(c.cssconfig=c.cssconfig||{},c.cssconfig[e.nodeName.replace("css-","")]=e.value):c[e.nodeName]=e.value}};
  h.g.V.Us=function(a){if(a){if("string"!=typeof a&&(h.g.userAgent.Wd&&a.outerHTML?a=a.outerHTML:a instanceof Element||(a=null)),"string"==typeof a&&(a=h.K.ue(a),"xml"!=a.nodeName.toLowerCase()))throw TypeError("Toolbox should be an <xml> document.");}else a=null;return a};h.dd=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.g.V.gw(a.toolbox);e=h.g.V.Bl(d);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 q=!!a.rtl,p=a.horizontalLayout;void 0===p&&(p=!1);var u=a.toolboxPosition;u="end"!==u;u=p?u?h.g.V.Pa.Kh:h.g.V.Pa.Ri:u==q?h.g.V.Pa.fd:h.g.V.Pa.Yb;var H=a.css;void 0===H&&
  (H=!0);var K="https://blockly-demo.appspot.com/static/media/";a.media?K=a.media:a.path&&(K=a.path+"media/");var I=void 0===a.oneBasedIndex?!0:!!a.oneBasedIndex,Hb=a.renderer||"geras",oe=a.plugins||{};this.L=q;this.Po=I;this.collapse=g;this.TB=k;this.disable=l;this.readOnly=c;this.zs=a.maxBlocks||Infinity;this.Do=a.maxInstances;this.Uo=K;this.Bl=e;this.uc=h.dd.XD(a,e);this.bx=f;this.Eo=n;this.eD=m;this.cD=H;this.Vc=p;this.oi=d;this.Yw=h.dd.WD(a);this.zb=h.dd.ZD(a);this.Kc=u;this.XE=h.dd.YD(a);this.mt=
  Hb;this.nt=a.rendererOverrides;this.Qr=null;this.Zc=a.parentWorkspace;this.plugins=oe};h.xF=function(){};
  h.dd.XD=function(a,c){var d=a.move||{},e={};void 0===d.scrollbars&&void 0===a.scrollbars?e.scrollbars=c:"object"==typeof d.scrollbars?(e.scrollbars={},e.scrollbars.Wr=!!d.scrollbars.horizontal,e.scrollbars.vertical=!!d.scrollbars.vertical,e.scrollbars.Wr&&e.scrollbars.vertical?e.scrollbars=!0:e.scrollbars.Wr||e.scrollbars.vertical||(e.scrollbars=!1)):e.scrollbars=!!d.scrollbars||!!a.scrollbars;e.ik=e.scrollbars&&void 0!==d.wheel?!!d.wheel:"object"==typeof e.scrollbars;e.Cj=e.scrollbars?void 0===d.drag?
  !0:!!d.drag:!1;return e};h.dd.ZD=function(a){a=a.zoom||{};var c={};c.controls=void 0===a.controls?!1:!!a.controls;c.ik=void 0===a.wheel?!1:!!a.wheel;c.SE=void 0===a.startScale?1:Number(a.startScale);c.Ql=void 0===a.maxScale?3:Number(a.maxScale);c.Sl=void 0===a.minScale?.3:Number(a.minScale);c.DE=void 0===a.scaleSpeed?1.2:Number(a.scaleSpeed);c.Xx=void 0===a.pinch?c.ik||c.controls:!!a.pinch;return c};
  h.dd.WD=function(a){a=a.grid||{};var c={};c.spacing=Number(a.spacing)||0;c.sb=a.colour||"#888";c.length=void 0===a.length?1:Number(a.length);c.RJ=0<c.spacing&&!!a.snap;return c};h.dd.YD=function(a){a=a.theme||h.sf.$f;return"string"==typeof a?h.v.Lr(h.v.R.jq,a):a instanceof h.Lh?a:h.Lh.iC(a.name||"builtin"+h.g.Ck.Nw(),a)};h.dd.Us=function(a){h.g.Qn.warn("Blockly.Options.parseToolboxTree","September 2020","September 2021","Blockly.utils.toolbox.parseToolboxTree");return h.g.V.Us(a)};h.h.tf=function(a){h.h.tf.A.constructor.call(this);this.mh=(this.nd="undefined"==typeof a)?"":a.pc();this.Wb=this.nd?"":a.B.id};h.g.object.W(h.h.tf,h.h.Abstract);h.h.tf.prototype.qa=function(){var a=h.h.tf.A.qa.call(this);a.varId=this.mh;return a};h.h.tf.prototype.ba=function(a){h.h.tf.A.qa.call(this);this.mh=a.varId};h.h.uf=function(a){h.h.uf.A.constructor.call(this,a);a&&(this.Ni=a.type,this.Mi=a.name)};h.g.object.W(h.h.uf,h.h.tf);h.h.uf.prototype.type=h.h.Nk;
  h.h.uf.prototype.qa=function(){var a=h.h.uf.A.qa.call(this);a.varType=this.Ni;a.varName=this.Mi;return a};h.h.uf.prototype.ba=function(a){h.h.uf.A.ba.call(this,a);this.Ni=a.varType;this.Mi=a.varName};h.h.uf.prototype.run=function(a){var c=v(this);a?c.ee(this.Mi,this.Ni,this.mh):c.zj(this.mh)};h.h.vf=function(a){h.h.vf.A.constructor.call(this,a);a&&(this.Ni=a.type,this.Mi=a.name)};h.g.object.W(h.h.vf,h.h.tf);h.h.vf.prototype.type=h.h.qn;
  h.h.vf.prototype.qa=function(){var a=h.h.vf.A.qa.call(this);a.varType=this.Ni;a.varName=this.Mi;return a};h.h.vf.prototype.ba=function(a){h.h.vf.A.ba.call(this,a);this.Ni=a.varType;this.Mi=a.varName};h.h.vf.prototype.run=function(a){var c=v(this);a?c.zj(this.mh):c.ee(this.Mi,this.Ni,this.mh)};h.h.wf=function(a,c){h.h.wf.A.constructor.call(this,a);a&&(this.Is=a.name,this.Es="undefined"==typeof c?"":c)};h.g.object.W(h.h.wf,h.h.tf);h.h.wf.prototype.type=h.h.qq;
  h.h.wf.prototype.qa=function(){var a=h.h.wf.A.qa.call(this);a.oldName=this.Is;a.newName=this.Es;return a};h.h.wf.prototype.ba=function(a){h.h.wf.A.ba.call(this,a);this.Is=a.oldName;this.Es=a.newName};h.h.wf.prototype.run=function(a){var c=v(this);a?c.Bi(this.mh,this.Es):c.Bi(this.mh,this.Is)};h.v.register(h.v.R.Fb,h.h.Nk,h.h.uf);h.v.register(h.v.R.Fb,h.h.qn,h.h.vf);h.v.register(h.v.R.Fb,h.h.qq,h.h.wf);h.rq=function(a){this.Oa=Object.create(null);this.B=a};b=h.rq.prototype;b.clear=function(){this.Oa=Object.create(null)};b.ny=function(a,c){var d=this.Gg(c,a.type),e=B(this.B,!1);h.h.ta(!0);try{if(d&&d.pc()!=a.pc()){var f=a.type;c!=d.name&&Za(d,c,e);for(c=0;c<e.length;c++){d=void 0;for(var g=0;d=e[c].T[g];g++)for(var k=0;d.eb[k];k++);}h.h.Ga(new (h.h.get(h.h.qn))(a));this.Oa[f].splice(this.bo(f).indexOf(a),1)}else Za(a,c,e)}finally{h.h.ta(!1)}};
  b.Bi=function(a,c){var d=this.Hg(a);if(!d)throw Error("Tried to rename a variable that didn't exist. ID: "+a);this.ny(d,c)};function Za(a,c,d){h.h.Ga(new (h.h.get(h.h.qq))(a,c));a.name=c;for(a=0;a<d.length;a++)for(var e=d[a],f=0;c=e.T[f];f++)for(var g=0;c.eb[g];g++);}
  b.ee=function(a,c,d){var e=this.Gg(a,c);if(e){if(d&&e.pc()!=d)throw Error('Variable "'+a+'" is already in use and its id is "'+e.pc()+'" which conflicts with the passed in id, "'+d+'".');return e}if(d&&this.Hg(d))throw Error('Variable id, "'+d+'", is already in use.');e=d||h.g.Hf();c=c||"";e=new h.sn(this.B,a,c,e);a=this.Oa[c]||[];a.push(e);delete this.Oa[c];this.Oa[c]=a;return e};
  b.zj=function(a){var c=this.Hg(a);if(c){var d=c.name,e=this.Pr(a);a=0;for(var f;f=e[a];a++)if("procedures_defnoreturn"==f.type||"procedures_defreturn"==f.type){a=$a(f,"NAME");d=h.P.CANNOT_DELETE_VARIABLE_PROCEDURE.replace("%1",d).replace("%2",a);h.alert(d);return}var g=this;1<e.length?(d=h.P.DELETE_VARIABLE_CONFIRMATION.replace("%1",String(e.length)).replace("%2",d),h.confirm(d,function(k){k&&c&&ab(g,c,e)})):ab(g,c,e)}else console.warn("Can't delete non-existent variable: "+a)};
  function ab(a,c,d){var e=h.h.Vb();e||h.h.ta(!0);try{for(var f=0;f<d.length;f++)d[f].I(!0);var g=a.Oa[c.type];a=0;for(var k;k=g[a];a++)if(k.pc()==c.pc()){g.splice(a,1);h.h.Ga(new (h.h.get(h.h.qn))(c));break}}finally{e||h.h.ta(!1)}}b.Gg=function(a,c){if(c=this.Oa[c||""])for(var d=0,e;e=c[d];d++)if(h.Ad.Gf(e.name,a))return e;return null};b.Hg=function(a){for(var c=Object.keys(this.Oa),d=0;d<c.length;d++)for(var e=c[d],f=0,g;g=this.Oa[e][f];f++)if(g.pc()==a)return g;return null};
  b.bo=function(a){return(a=this.Oa[a||""])?a.slice():[]};b.Xh=function(){var a=[],c;for(c in this.Oa)a=a.concat(this.Oa[c]);return a};b.Cr=function(){var a=[],c;for(c in this.Oa)for(var d=this.Oa[c],e=0,f;f=d[e];e++)a.push(f.name);return a};b.Pr=function(a){for(var c=[],d=B(this.B,!1),e=0;e<d.length;e++){var f=ja(d[e]);if(f)for(var g=0;g<f.length;g++)f[g].pc()==a&&c.push(d[e])}return c};h.qb=function(a){this.id=h.g.Hf();h.qb.Pk[this.id]=this;this.options=a||new h.dd({});this.L=!!this.options.L;this.Vc=!!this.options.Vc;this.Kc=this.options.Kc;this.Me=new (h.v.Dg(h.v.R.iu,this.options,!0))(this);this.wm=[];this.gp=[];this.Hn=Object.create(null);this.Ic=[];this.Li=[];this.cm=[];this.Dq=Object.create(null);this.Xf=Object.create(null);this.Oa=new h.rq(this);this.Yj=null};b=h.qb.prototype;b.ua=!1;b.ds=!1;b.Nu=1024;b.Kn=null;b.I=function(){this.Ic.length=0;this.clear();delete h.qb.Pk[this.id]};
  h.qb.fv=3;b=h.qb.prototype;b.bf=function(a,c){a=a.Xa();c=c.Xa();return a.y+h.qb.prototype.bf.offset*a.x-(c.y+h.qb.prototype.bf.offset*c.x)};b.vn=function(a){this.wm.push(a)};b.Wo=function(a){if(!h.g.Rk(this.wm,a))throw Error("Block not present in workspace's list of top-most blocks.");};b.tb=function(a){var c=[].concat(this.wm);a&&1<c.length&&(this.bf.offset=Math.sin(h.g.qd.It(h.qb.fv)),this.L&&(this.bf.offset*=-1),c.sort(this.bf));return c};function bb(a,c){return a.Xf[c]?a.Xf[c].slice(0):[]}
  function B(a,c){if(c){a=a.tb(!0);c=[];for(var d=0;d<a.length;d++)c.push.apply(c,r(a[d],!0))}else for(c=a.tb(!1),d=0;d<c.length;d++)c.push.apply(c,ca(c[d],!1));return c.filter(function(e){return!e.od()})}b.clear=function(){this.ds=!0;try{var a=h.h.Vb();for(a||h.h.ta(!0);this.wm.length;)this.wm[0].I(!1);for(;this.gp.length;)this.gp[this.gp.length-1].I(!1);a||h.h.ta(!1);this.Oa.clear();this.Yj&&this.Yj.clear()}finally{this.ds=!1}};b.Bi=function(a,c){this.Oa.Bi(a,c)};
  b.ee=function(a,c,d){return this.Oa.ee(a,c,d)};b.Pr=function(a){return this.Oa.Pr(a)};b.zj=function(a){this.Oa.zj(a)};b.Gg=function(a,c){return this.Oa.Gg(a,c)};b.Hg=function(a){return this.Oa.Hg(a)};b.bo=function(a){return this.Oa.bo(a)};b.Xh=function(){return this.Oa.Xh()};b.Cr=function(){return this.Oa.Cr()};b.zl=function(){return 0};b.Ds=function(a,c){return new h.Yf(this,a,c)};function cb(a){return isNaN(a.options.zs)?Infinity:a.options.zs-B(a,!1).length}
  function db(a,c){if(!eb(a))return!0;var d=0,e;for(e in c){if(c[e]>(a.options.Do?(void 0!==a.options.Do[e]?a.options.Do[e]:Infinity)-bb(a,e).length:Infinity))return!1;d+=c[e]}return d>cb(a)?!1:!0}function eb(a){return Infinity!=a.options.zs||!!a.options.Do}
  function fb(a,c){var d=c?a.cm:a.Li;a=c?a.Li:a.cm;var e=d.pop();if(e){for(var f=[e];d.length&&e.group&&e.group==d[d.length-1].group;)f.push(d.pop());for(d=0;e=f[d];d++)a.push(e);f=h.h.filter(f,c);h.h.Ma=!1;try{for(d=0;e=f[d];d++)e.run(c)}finally{h.h.Ma=!0}}}function C(a,c){a.Ic.push(c)}function gb(a,c){h.g.Rk(a.Ic,c)}b.Gc=function(a){return this.Dq[a]||null};b.zt=function(a){this.Oa=a};h.qb.Pk=Object.create(null);h.qb.tl=function(a){return h.qb.Pk[a]||null};
  h.qb.getAll=function(){var a=[],c;for(c in h.qb.Pk)a.push(h.qb.Pk[c]);return a};h.wa=function(a,c,d,e,f,g){this.m=a;this.Cf=c;this.KE=d;this.Ns=this.Ms=this.Gx=this.qy=null;this.Ef=!1;d=h.wa.cz;this.m.L&&(d=-d);this.AB=h.g.qd.It(d);a.Tf.appendChild(this.$k(c,!(!f||!g)));this.Nb=e;this.oy&&hb(this);f&&g||(a=this.Cf.getBBox(),f=a.width+2*h.wa.we,g=a.height+2*h.wa.we);ib(this,f,g);hb(this);jb(this);this.oy=!0};h.wa.we=6;h.wa.dz=5;h.wa.cz=20;h.wa.Wt=4;h.wa.$y=8;h.wa.Yg=null;h.wa.Xg=null;
  h.wa.Mt=function(){h.wa.Yg&&(h.N.yb(h.wa.Yg),h.wa.Yg=null);h.wa.Xg&&(h.N.yb(h.wa.Xg),h.wa.Xg=null)};h.wa.GB=function(){h.Touch.Dn();h.wa.Mt()};b=h.wa.prototype;b.oy=!1;b.Nb=null;b.$e=0;b.eh=0;b.jb=0;b.qc=0;b.Bq=!0;
  b.$k=function(a,c){this.Cd=h.g.j.J(h.g.D.Nc,{},null);var d={filter:"url(#"+this.m.ob.ea().Wn+")"};h.g.userAgent.nA&&(d={});d=h.g.j.J(h.g.D.Nc,d,this.Cd);this.Mv=h.g.j.J(h.g.D.Ee,{},d);this.zn=h.g.j.J(h.g.D.Lb,{"class":"blocklyDraggable",x:0,y:0,rx:h.wa.we,ry:h.wa.we},d);c?(this.Rf=h.g.j.J(h.g.D.Nc,{"class":this.m.L?"blocklyResizeSW":"blocklyResizeSE"},this.Cd),c=2*h.wa.we,h.g.j.J(h.g.D.JA,{points:"0,x x,x x,0".replace(/x/g,c.toString())},this.Rf),h.g.j.J(h.g.D.Ek,{"class":"blocklyResizeLine",x1:c/
  3,y1:c-1,x2:c-1,y2:c/3},this.Rf),h.g.j.J(h.g.D.Ek,{"class":"blocklyResizeLine",x1:2*c/3,y1:c-1,x2:c-1,y2:2*c/3},this.Rf)):this.Rf=null;this.m.options.readOnly||(this.Ms=h.N.Ca(this.zn,"mousedown",this,this.FB),this.Rf&&(this.Ns=h.N.Ca(this.Rf,"mousedown",this,this.yE)));this.Cd.appendChild(a);return this.Cd};b.ra=function(){return this.Cd};
  b.FB=function(a){var c=this.m.Eg(a);if(c){if(c.bi)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");c.ud||(c.ud=this);c.Ld=a}};b.lm=function(){};b.Wc=function(){return!1};b.hm=function(){};
  b.yE=function(a){var c=this.Cd.parentNode;c.lastChild!==this.Cd&&c.appendChild(this.Cd);h.wa.Mt();h.g.Kl(a)||(this.m.Dt(a,new h.g.U(this.m.L?-this.jb:this.jb,this.qc)),h.wa.Yg=h.N.Ca(document,"mouseup",this,h.wa.GB),h.wa.Xg=h.N.Ca(document,"mousemove",this,this.zE),h.ec());a.stopPropagation()};b.zE=function(a){this.Bq=!1;var c=this.m;a=h.g.Tl(a,y(c),Ta(c));a.x/=c.scale;a.y/=c.scale;c=h.g.U.sum(c.yw,a);ib(this,this.m.L?-c.x:c.x,c.y);this.m.L&&hb(this)};
  function kb(a,c,d){var e=a.m.L?a.Nb.x-c.x-a.jb:c.x+a.Nb.x;c=c.y+a.Nb.y;return Math.max(0,Math.min(1,(Math.min(e+a.jb,d.left+d.width)-Math.max(e,d.left))*(Math.min(c+a.qc,d.top+d.height)-Math.max(c,d.top))/(a.jb*a.qc)))}function hb(a){var c=a.Nb.x;c=a.m.L?c-(a.$e+a.jb):c+a.$e;a.moveTo(c,a.eh+a.Nb.y)}b.moveTo=function(a,c){this.Cd.setAttribute("transform","translate("+a+","+c+")")};b.gh=function(a){!a&&this.Gx&&this.Gx()};
  function ib(a,c,d){var e=2*h.wa.we;c=Math.max(c,e+45);d=Math.max(d,e+20);a.jb=c;a.qc=d;a.zn.setAttribute("width",c);a.zn.setAttribute("height",d);a.Rf&&(a.m.L?a.Rf.setAttribute("transform","translate("+2*h.wa.we+","+(d-e)+") scale(-1 1)"):a.Rf.setAttribute("transform","translate("+(c-e)+","+(d-e)+")"));if(a.Bq){c=a.m.rd.Te(!0);d=-a.jb/4;if(!(a.jb>c.width)){if(a.m.L){e=a.Nb.x-d;var f=e-a.jb;var g=c.left+c.width,k=c.left+h.ya.fc/a.m.scale}else f=d+a.Nb.x,e=f+a.jb,k=c.left,g=c.left+c.width-h.ya.fc/a.m.scale;
  a.m.L?f<k?d=-(k-a.Nb.x+a.jb):e>g&&(d=-(g-a.Nb.x)):f<k?d=k-a.Nb.x:e>g&&(d=g-a.Nb.x-a.jb)}f=d;d=-a.qc/4;if(!(a.qc>c.height)){e=a.Nb.y+d;g=e+a.qc;k=c.top;var l=c.top+c.height-h.ya.fc/a.m.scale,m=a.Nb.y;e<k?d=k-m:g>l&&(d=l-m-a.qc)}k=d;g=a.KE.getBBox();d={x:f,y:-a.qc-a.m.ob.ea().Fk};e={x:-a.jb-30,y:k};k={x:g.width,y:k};l={x:f,y:g.height};f=g.width<g.height?k:l;g=g.width<g.height?l:k;k=kb(a,d,c);l=kb(a,e,c);m=kb(a,f,c);c=Math.max(k,l,m,kb(a,g,c));k==c?(a.$e=d.x,a.eh=d.y):l==c?(a.$e=e.x,a.eh=e.y):m==c?(a.$e=
  f.x,a.eh=f.y):(a.$e=g.x,a.eh=g.y)}hb(a);jb(a);a.qy&&a.qy()}
  function jb(a){var c=[],d=a.jb/2,e=a.qc/2,f=-a.$e,g=-a.eh;if(d==f&&e==g)c.push("M "+d+","+e);else{g-=e;f-=d;a.m.L&&(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),q=Math.cos(m),p=new h.g.gd(a.jb,a.qc);m=(p.width+p.height)/h.wa.dz;m=Math.min(m,p.width,p.height)/4;p=1-h.wa.$y/k;f=d+p*f;g=e+p*g;p=d+m*q;var u=e+m*n;d-=m*q;e-=m*n;n=l+a.AB;n>2*Math.PI&&(n-=2*Math.PI);l=Math.sin(n)*k/h.wa.Wt;k=Math.cos(n)*k/h.wa.Wt;c.push("M"+
  p+","+u);c.push("C"+(p+k)+","+(u+l)+" "+f+","+g+" "+f+","+g);c.push("C"+f+","+g+" "+(d+k)+","+(e+l)+" "+d+","+e)}c.push("z");a.Mv.setAttribute("d",c.join(" "))}b.re=function(a){this.zn.setAttribute("fill",a);this.Mv.setAttribute("fill",a)};b.I=function(){this.Ms&&h.N.yb(this.Ms);this.Ns&&h.N.yb(this.Ns);h.wa.Mt();h.g.j.removeNode(this.Cd);this.Ef=!0};b.Cs=function(a,c){a?a.Ki(c.x,c.y):this.moveTo(c.x,c.y);this.$e=this.m.L?this.Nb.x-c.x-this.jb:c.x-this.Nb.x;this.eh=c.y-this.Nb.y;jb(this)};
  b.Xa=function(){return new h.g.U(this.m.L?-this.$e+this.Nb.x-this.jb:this.Nb.x+this.$e,this.Nb.y+this.eh)};h.wa.ue=function(a){var c=h.g.j.J(h.g.D.pv,{"class":"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:h.wa.we},null);a=a.split("\n");for(var d=0;d<a.length;d++){var e=h.g.j.J(h.g.D.rv,{dy:"1em",x:h.wa.we},c),f=document.createTextNode(a[d]);e.appendChild(f)}return c};
  h.wa.UI=function(a,c,d){d=new h.wa(c.B,a,c.wb.Eb,d,null,null);d.Cd.dataset&&(d.Cd.dataset.blockId=c.id);if(c.L){c=a.getBBox().width;for(var e=0,f;f=a.childNodes[e];e++)f.setAttribute("text-anchor","end"),f.setAttribute("x",c+h.wa.we)}return d};h.h.kf=function(a){this.Je=(this.nd="undefined"==typeof a)?"":a.id;this.Wb=this.nd?"":a.B.id;this.group=h.h.Vb();this.Ma=h.h.Ma};h.g.object.W(h.h.kf,h.h.Abstract);h.h.kf.prototype.qa=function(){var a=h.h.kf.A.qa.call(this);this.Je&&(a.commentId=this.Je);return a};h.h.kf.prototype.ba=function(a){h.h.kf.A.ba.call(this,a);this.Je=a.commentId};h.h.Ti=function(a,c,d){h.h.Ti.A.constructor.call(this,a);a&&(this.Ko="undefined"==typeof c?"":c,this.Jo="undefined"==typeof d?"":d)};h.g.object.W(h.h.Ti,h.h.kf);
  b=h.h.Ti.prototype;b.type=h.h.du;b.qa=function(){var a=h.h.Ti.A.qa.call(this);a.oldContents=this.Ko;a.newContents=this.Jo;return a};b.ba=function(a){h.h.Ti.A.ba.call(this,a);this.Ko=a.oldContents;this.Jo=a.newContents};b.Tj=function(){return this.Ko==this.Jo};b.run=function(a){var c;(c=v(this).Hn[this.Je]||null)?c.MJ(a?this.Jo:this.Ko):console.warn("Can't change non-existent comment: "+this.Je)};h.h.lf=function(a){h.h.lf.A.constructor.call(this,a);a&&(this.xml=a.Fy())};h.g.object.W(h.h.lf,h.h.kf);
  h.h.lf.prototype.type=h.h.Qm;h.h.lf.prototype.qa=function(){var a=h.h.lf.A.qa.call(this);a.xml=h.K.Gd(this.xml);return a};h.h.lf.prototype.ba=function(a){h.h.lf.A.ba.call(this,a);this.xml=h.K.ue(a.xml)};h.h.lf.prototype.run=function(a){h.h.ju(this,a)};h.h.ju=function(a,c){var d=v(a);c?(c=h.g.xml.createElement("xml"),c.appendChild(a.xml),h.K.Uh(c,d)):(d=d.Hn[a.Je]||null)?d.I(!1,!1):console.warn("Can't uncreate non-existent comment: "+a.Je)};
  h.h.mf=function(a){h.h.mf.A.constructor.call(this,a);a&&(this.xml=a.Fy())};h.g.object.W(h.h.mf,h.h.kf);h.h.mf.prototype.type=h.h.fu;h.h.mf.prototype.qa=function(){return h.h.mf.A.qa.call(this)};h.h.mf.prototype.ba=function(a){h.h.mf.A.ba.call(this,a)};h.h.mf.prototype.run=function(a){h.h.ju(this,!a)};h.h.Ui=function(a){h.h.Ui.A.constructor.call(this,a);a&&(this.Rq=a,this.yi=a.Xw(),this.ui=null)};h.g.object.W(h.h.Ui,h.h.kf);b=h.h.Ui.prototype;
  b.Ai=function(){if(!this.Rq)throw Error("Tried to record the new position of a comment on the same event twice.");this.ui=this.Rq.Xw();this.Rq=null};b.type=h.h.nk;b.qa=function(){var a=h.h.Ui.A.qa.call(this);this.yi&&(a.oldCoordinate=Math.round(this.yi.x)+","+Math.round(this.yi.y));this.ui&&(a.newCoordinate=Math.round(this.ui.x)+","+Math.round(this.ui.y));return a};
  b.ba=function(a){h.h.Ui.A.ba.call(this,a);if(a.oldCoordinate){var c=a.oldCoordinate.split(",");this.yi=new h.g.U(Number(c[0]),Number(c[1]))}a.newCoordinate&&(c=a.newCoordinate.split(","),this.ui=new h.g.U(Number(c[0]),Number(c[1])))};b.Tj=function(){return h.g.U.Gf(this.yi,this.ui)};b.run=function(a){var c;if(c=v(this).Hn[this.Je]||null){a=a?this.ui:this.yi;var d=c.Xw();c.moveBy(a.x-d.x,a.y-d.y)}else console.warn("Can't move non-existent comment: "+this.Je)};h.v.register(h.v.R.Fb,h.h.Qm,h.h.lf);
  h.v.register(h.v.R.Fb,h.h.du,h.h.Ti);h.v.register(h.v.R.Fb,h.h.nk,h.h.Ui);h.v.register(h.v.R.Fb,h.h.fu,h.h.mf);h.Lm=function(a,c){this.Ub=a;this.m=c;this.Th=null;this.mp=!1;this.cf=this.Ub.Xa();this.Vh=h.g.ii()&&c.jd?c.jd:null};h.Lm.prototype.I=function(){this.Vh=this.m=this.Ub=null};function lb(a,c,d){d=a.Xj(d);d=h.g.U.sum(a.cf,d);a.Ub.Cs(a.Vh,d);a.Ub.Wc()&&(a.Th=xa(a.m,c),a.mp=a.Th!=h.mu,c=a.m.xc,a.mp?(a.Ub.hm(!0),a.Th==h.yp&&c&&ya(c,!0)):(a.Ub.hm(!1),c&&ya(c,!1)))}
  function mb(a,c,d){lb(a,c,d);c=a.Xj(d);c=h.g.U.sum(a.cf,c);a.Ub.moveTo(c.x,c.y);c=a.m.xc;a.mp?(c&&setTimeout(c.Fn.bind(c),100),a.ll(),a.Ub.I(!1,!0)):c&&c.Fn();a.mp||(a.Vh&&a.Vh.Cn(a.m.Tf),a.Ub.gh&&a.Ub.gh(!1),a.ll());a.m.Zb(!0);(c=a.m.Na)&&"function"==typeof c.ht&&c.ht(a.Ub.Wc()?"blocklyToolboxDelete":"blocklyToolboxGrab");h.h.ta(!1)}h.Lm.prototype.ll=function(){if(this.Ub.nJ){var a=new (h.h.get(h.h.nk))(this.Ub);a.yi=this.cf;a.Ai();h.h.Ga(a)}};
  h.Lm.prototype.Xj=function(a){a=new h.g.U(a.x/this.m.scale,a.y/this.m.scale);this.m.qo&&a.scale(1/this.m.options.Zc.scale);return a};h.h.ag=function(a,c,d){h.h.ag.A.constructor.call(this,a?a.B.id:c);this.fb=a?a.id:null;this.Dy=d};h.g.object.W(h.h.ag,h.h.Zd);h.h.ag.prototype.type=h.h.mk;h.h.ag.prototype.qa=function(){var a=h.h.ag.A.qa.call(this);a.targetType=this.Dy;this.fb&&(a.blockId=this.fb);return a};h.h.ag.prototype.ba=function(a){h.h.ag.A.ba.call(this,a);this.Dy=a.targetType;this.fb=a.blockId};h.v.register(h.v.R.Fb,h.h.mk,h.h.ag);h.G={};h.G.visible=!1;h.G.qj=!1;h.G.pA=50;h.G.Ex=0;h.G.nm=0;h.G.ls=0;h.G.ns=0;h.G.cb=null;h.G.Yl=null;h.G.Su=0;h.G.Tu=10;h.G.LA=10;h.G.dA=750;h.G.Np=5;h.G.ab=null;h.G.TC=function(){var a=h.G.Ww(h.G.cb);if(a){for(a=a.Sd;"function"==typeof a;)a=a();if("string"!=typeof a)throw Error("Tooltip function must return a string.");return a}return""};h.G.Ww=function(a){for(;a&&a.Sd;){if("string"==typeof a.Sd||"function"==typeof a.Sd)return a;a=a.Sd}return null};
  h.G.Ua=function(){h.G.ab||(h.G.ab=document.createElement("div"),h.G.ab.className="blocklyTooltipDiv",(h.Qo||document.body).appendChild(h.G.ab))};h.G.pj=function(a){a.ED=h.N.bind(a,"mouseover",null,h.G.TD);a.CD=h.N.bind(a,"mouseout",null,h.G.SD);a.addEventListener("mousemove",h.G.Ux,!1)};h.G.Nt=function(a){a&&(h.N.yb(a.ED),h.N.yb(a.CD),a.removeEventListener("mousemove",h.G.Ux))};h.G.TD=function(a){h.G.qj||(a=h.G.Ww(a.currentTarget),h.G.cb!=a&&(h.G.Ya(),h.G.Yl=null,h.G.cb=a),clearTimeout(h.G.Ex))};
  h.G.SD=function(){h.G.qj||(h.G.Ex=setTimeout(function(){h.G.cb=null;h.G.Yl=null;h.G.Ya()},1),clearTimeout(h.G.nm))};h.G.Ux=function(a){if(h.G.cb&&h.G.cb.Sd&&!h.G.qj)if(h.G.visible){var c=h.G.ls-a.pageX;a=h.G.ns-a.pageY;Math.sqrt(c*c+a*a)>h.G.LA&&h.G.Ya()}else h.G.Yl!=h.G.cb&&(clearTimeout(h.G.nm),h.G.ls=a.pageX,h.G.ns=a.pageY,h.G.nm=setTimeout(h.G.ME,h.G.dA))};h.G.I=function(){h.G.cb=null;h.G.Yl=null;h.G.Ya()};
  h.G.Ya=function(){h.G.visible&&(h.G.visible=!1,h.G.ab&&(h.G.ab.style.display="none"));h.G.nm&&clearTimeout(h.G.nm)};h.G.block=function(){h.G.Ya();h.G.qj=!0};h.G.eF=function(){h.G.qj=!1};
  h.G.ME=function(){if(!h.G.qj&&(h.G.Yl=h.G.cb,h.G.ab)){h.G.ab.textContent="";var a=h.G.TC();a=h.g.Ra.Uy(a,h.G.pA);a=a.split("\n");for(var c=0;c<a.length;c++){var d=document.createElement("div");d.appendChild(document.createTextNode(a[c]));h.G.ab.appendChild(d)}a=h.G.cb.L;c=document.documentElement.clientWidth;d=document.documentElement.clientHeight;h.G.ab.style.direction=a?"rtl":"ltr";h.G.ab.style.display="block";h.G.visible=!0;var e=h.G.ls;e=a?e-(h.G.Su+h.G.ab.offsetWidth):e+h.G.Su;var f=h.G.ns+h.G.Tu;
  f+h.G.ab.offsetHeight>d+window.scrollY&&(f-=h.G.ab.offsetHeight+2*h.G.Tu);a?e=Math.max(h.G.Np-window.scrollX,e):e+h.G.ab.offsetWidth>c+window.scrollX-2*h.G.Np&&(e=c-h.G.ab.offsetWidth-2*h.G.Np);h.G.ab.style.top=f+"px";h.G.ab.style.left=e+"px"}};h.tn=function(a){this.m=a;this.kx=nb(this.m);this.Qy=ob(this.m);this.TE=new h.g.U(a.scrollX,a.scrollY)};h.tn.prototype.I=function(){this.m=null};h.tn.prototype.Dt=function(){h.selected&&pb(h.selected);Ua(this.m)};h.tn.prototype.Cj=function(a){a=h.g.U.sum(this.TE,a);if(this.kx&&this.Qy)this.m.scroll(a.x,a.y);else if(this.kx)this.m.scroll(a.x,this.m.scrollY);else if(this.Qy)this.m.scroll(this.m.scrollX,a.y);else throw new TypeError("Invalid state.");};h.Ce=function(a,c){this.Dx=null;this.Ec=new h.g.U(0,0);this.Ib=this.ic=this.dk=this.ek=this.ud=null;this.jw=c;this.Gl=this.ki=this.Hl=this.ai=!1;this.Ld=a;this.ma=this.Pi=this.Ie=this.wg=this.Oo=this.No=null;this.no=this.bi=this.Pv=!1;this.ex=!h.Az};b=h.Ce.prototype;b.I=function(){h.Touch.Dn();h.G.eF();this.jw.oc=null;this.No&&h.N.yb(this.No);this.Oo&&h.N.yb(this.Oo);this.Ie&&this.Ie.I();this.Pi&&this.Pi.I();this.wg&&this.wg.I()};
  function qb(a,c){a.Ec=h.g.U.fl(new h.g.U(c.clientX,c.clientY),a.Dx);if(a.ai)var d=!1;else a.ai=h.g.U.yD(a.Ec)>(a.ma?h.Wz:h.zz),d=a.ai;if(d){if(a.Pv)throw Error("updateIsDragging_ should only be called once per gesture.");a.Pv=!0;if(a.ud){a.Gl=!0;a.wg=new h.Lm(a.ud,a.Ib);d=a.wg;h.h.Vb()||h.h.ta(!0);d.m.Zb(!1);d.Ub.Bq=!1;d.Vh&&(d.Ub.moveTo(0,0),d.Vh.Ki(d.cf.x,d.cf.y),rb(d.Vh,d.Ub.ra()));d.Ub.gh&&d.Ub.gh(!0);var e=d.m.Na;e&&"function"==typeof e.vq&&e.vq(d.Ub.Wc()?"blocklyToolboxDelete":"blocklyToolboxGrab");
  lb(a.wg,a.Ld,a.Ec);d=!0}else d=!1;if(!d){if(a.ic)if(a.ma?(a.ic&&a.ic.isEnabled()?((d=!sb(a.ma))||(d=a.Ec,d=Math.atan2(d.y,d.x)/Math.PI*180,e=a.ma.rC,d=d<e&&d>-e||d<-180+e||d>180-e?!0:!1),d?(a.Ib=a.ma.Ka,tb(a.Ib),h.h.Vb()||h.h.ta(!0),a.dk=null,a.ic=ub(a.ma,a.ic),a.ic.select(),d=!0):d=!1):d=!1,a.ki=d):a.ic.rc()&&(a.ki=!0),a.ki){a.Ie=new h.uh(a.ic,a.Ib);d=a.Ie;e=a.Ec;var f=a.ex;h.h.Vb()||h.h.ta(!0);var g=new (h.h.get(h.h.Km))(d.hb,!0,r(d.hb,!1));h.h.Ga(g);d.m.qo&&Ca(d.hb);h.g.j.pm();d.m.Zb(!1);h.bb.hr();
  if(d.hb.getParent()||f&&d.hb.Z&&d.hb.Z.va())x(d.hb,f),e=d.Xj(e),e=h.g.U.sum(d.cf,e),d.hb.translate(e.x,e.y),h.bb.mC(d.hb),e=d.Qe,e.yn=pa(e);d.hb.gh(!0);e=d.hb;e.Em&&(f=e.Xa(),e.ra().removeAttribute("transform"),e.B.jd.Ki(f.x,f.y),(f=e.ra())&&rb(e.B.jd,f));(e=d.m.Na)&&"function"==typeof e.vq&&e.vq(d.hb.Wc()?"blocklyToolboxDelete":"blocklyToolboxGrab");wa(a.Ie,a.Ld,a.Ec);d=!0}else d=!1;else d=!1;if(d=!d)if(a.ma)d=sb(a.ma);else if(d=a.Ib)d=a.Ib,d=d.options.uc&&d.options.uc.Cj;d&&(a.Pi=new h.tn(a.Ib),
  a.Hl=!0,a.Pi.Dt())}h.Sg()}a.Ld=c}b.jr=function(a){h.g.so(a)?this.cancel():(this.bi=!0,h.bb.hr(),tb(this.Ib),this.Ib.qo&&this.Ib.resize(),h.ec(!!this.ma),Sa(this.Ib),this.Ld=a,h.G.block(),this.ic&&this.ic.select(),h.g.Kl(a)?ba(this,a):("touchstart"!=a.type.toLowerCase()&&"pointerdown"!=a.type.toLowerCase()||"mouse"==a.pointerType||h.xD(a,this),this.Dx=new h.g.U(a.clientX,a.clientY),this.ex=a.altKey||a.ctrlKey||a.metaKey,this.pj(a)))};
  b.pj=function(a){this.No=h.N.Ca(document,"mousemove",null,this.Kj.bind(this));this.Oo=h.N.Ca(document,"mouseup",null,this.co.bind(this));a.preventDefault();a.stopPropagation()};b.Kj=function(a){qb(this,a);this.Hl?this.Pi.Cj(this.Ec):this.ki?wa(this.Ie,this.Ld,this.Ec):this.Gl&&lb(this.wg,this.Ld,this.Ec);a.preventDefault();a.stopPropagation()};
  b.co=function(a){qb(this,a);h.Sg();if(this.no)console.log("Trying to end a gesture recursively.");else{this.no=!0;if(this.Gl)mb(this.wg,a,this.Ec);else if(this.ki)za(this.Ie,a,this.Ec);else if(this.Hl){var c=this.Pi;c.Cj(this.Ec);Va(c.m)}else if(this.ud&&!this.ai)this.ud.HE&&this.ud.HE(),this.ud.select&&this.ud.select();else if(vb(this)){c=this.ek;var d=this.Ld;wb(c)&&c.bp(d);xb(this)}else!this.dk||this.ai||vb(this)?this.dk||this.ud||this.ek||this.ai||(c=this.jw,h.selected&&pb(h.selected),c=this.Ib||
  c,h.h.Ga(new (h.h.get(h.h.mk))(null,c.id,"workspace"))):(this.ma&&this.ma.oj?this.ic.isEnabled()&&(h.h.Vb()||h.h.ta(!0),Da(ub(this.ma,this.ic))):(c=new (h.h.get(h.h.mk))(this.dk,this.Ib.id,"block"),h.h.Ga(c)),xb(this),h.h.ta(!1));a.preventDefault();a.stopPropagation();this.I()}};b.cancel=function(){if(!this.no){h.Sg();if(this.Gl)mb(this.wg,this.Ld,this.Ec);else if(this.ki)za(this.Ie,this.Ld,this.Ec);else if(this.Hl){var a=this.Pi;a.Cj(this.Ec);Va(a.m)}this.I()}};
  function ba(a,c){a.ic?(xb(a),h.ec(!!a.ma),a.ic.lm(c)):a.ud?a.ud.lm(c):a.Ib&&!a.ma&&(h.ec(),a.Ib.lm(c));c.preventDefault();c.stopPropagation();a.I()}function yb(a,c,d){if(a.bi)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");a.Ib||(a.Ib=d);a.Ld=c;a.jr(c)}function zb(a,c,d){if(a.bi)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");a.ma||(a.ma=d);yb(a,c,d.m)}function xb(a){a.ic&&!a.ma&&Ca(a.ic)}
  function Ab(a,c){a.dk||a.ud||(a.dk=c,c.Yc&&c!=c.me()?Bb(a,c.me()):Bb(a,c))}function Bb(a,c){c.Qa?Bb(a,c.getParent()):a.ic=c}function vb(a){return(a.ek?wb(a.ek):!1)&&!a.ai&&(!a.ma||!a.ma.oj)}b.Xc=function(){return this.Hl||this.ki||this.Gl};b.Fj=function(){return this.Ie?this.Ie.Fj():[]};h.Ce.gi=function(){for(var a=h.qb.getAll(),c=0,d;d=a[c];c++)if(d.oc)return!0;return!1};h.xd=function(a,c,d){this.ff=this.xp;this.Iy=this.Oy=null;this.vc=new h.g.gd(0,0);this.s=this.Bs=this.Ji=this.wc=this.Ob=this.Tc=this.Pf=this.Df=null;d&&this.Vk(d);this.setValue(a);c&&(this.Oy=c)};b=h.xd.prototype;b.xp=null;b.name=void 0;b.Ef=!1;b.Cx=50;b.M=null;b.Mg=!0;b.nh=!0;b.Tv=null;h.xd.Ru="\u00a0";b=h.xd.prototype;b.tk=!0;b.gv=!1;b.Vk=function(a){var c=a.tooltip;"string"==typeof c&&(c=h.g.ad(a.tooltip));c&&this.te(c)};
  b.ea=function(){!this.s&&this.M&&this.M.B&&this.M.B.ua&&(this.s=this.M.B.ob.ea());return this.s};b.ga=function(){return this.M};b.za=function(){this.Tc||(this.Tc=h.g.j.J(h.g.D.Nc,{},null),this.isVisible()||(this.Tc.style.display="none"),this.M.ra().appendChild(this.Tc),this.io(),Cb(this),this.te(this.Iy),h.G.pj(Db(this)),this.Bs=h.N.Ca(Db(this),"mousedown",this,this.Wg))};b.io=function(){Eb(this);Fb(this)};
  function Eb(a){a.Ob=h.g.j.J(h.g.D.Lb,{rx:a.ea().Vm,ry:a.ea().Vm,x:0,y:0,height:a.vc.height,width:a.vc.width,"class":"blocklyFieldRect"},a.Tc)}function Fb(a){a.wc=h.g.j.J(h.g.D.pv,{"class":"blocklyText"},a.Tc);a.ea().Cp&&a.wc.setAttribute("dominant-baseline","central");a.Ji=document.createTextNode("");a.wc.appendChild(a.Ji)}b.ql=function(a){this.setValue(a.textContent)};b.I=function(){h.C.Dl(this);h.aa.Dl(this);h.G.Nt(Db(this));this.Bs&&h.N.yb(this.Bs);h.g.j.removeNode(this.Tc);this.Ef=!0};
  function Cb(a){var c=a.Tc;a.tk&&c&&(a.M.Kd()?(h.g.j.Mb(c,"blocklyEditableText"),h.g.j.$c(c,"blocklyNonEditableText"),c.style.cursor=a.qk):(h.g.j.Mb(c,"blocklyNonEditableText"),h.g.j.$c(c,"blocklyEditableText"),c.style.cursor=""))}function wb(a){return!!a.M&&a.M.Kd()&&!!a.bp&&"function"===typeof a.bp}b.isVisible=function(){return this.nh};b.Hb=function(a){if(this.nh!=a){this.nh=a;var c=this.ra();c&&(c.style.display=a?"block":"none")}};b.ra=function(){return this.Tc};b.dc=function(){};
  b.kt=function(){this.Ji&&(this.Ji.nodeValue=Gb(this));this.My()};b.My=function(){var a=this.ea(),c=this.Ob?this.ea().vk:0,d=2*c,e=a.Wm,f=0;this.wc&&(f=h.g.j.Ir(this.wc,a.Ah,a.eg,a.dg),d+=f);this.Ob&&(e=Math.max(e,a.qu));this.vc.height=e;this.vc.width=d;Ib(this,c,f);Jb(this)};function Ib(a,c,d){if(a.wc){var e=a.ea(),f=a.vc.height/2;a.wc.setAttribute("x",a.M.L?a.vc.width-d-c:c);a.wc.setAttribute("y",e.Cp?f:f-e.Wm/2+e.Bp)}}
  function Jb(a){a.Ob&&(a.Ob.setAttribute("width",a.vc.width),a.Ob.setAttribute("height",a.vc.height),a.Ob.setAttribute("rx",a.ea().Vm),a.Ob.setAttribute("ry",a.ea().Vm))}b.If=function(){if(!this.isVisible())return new h.g.gd(0,0);this.Mg?(this.kt(),this.Mg=!1):this.nh&&0==this.vc.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.kt());return this.vc};
  function Gb(a){var c=Kb(a);if(!c)return h.xd.Ru;c.length>a.Cx&&(c=c.substring(0,a.Cx-2)+"\u2026");c=c.replace(/\s/g,h.xd.Ru);a.M&&a.M.L&&(c+="\u200f");return c}function Kb(a){if(a.Or){var c=a.Or.call(a);if(null!==c)return String(c)}return String(a.getValue())}b.Ol=function(){this.Mg=!0;this.s=null};function Lb(a){a.Mg=!0;a.M&&a.M.ua&&(a.M.Ja(),a.M.Sc(),a.Pt())}
  b.setValue=function(a){if(null!==a){var c=this.Un(a);a=Mb(this,a,c);if(!(a instanceof Error)){if(c=this.Oy)if(c=c.call(this,a),a=Mb(this,a,c),a instanceof Error)return;c=this.M;if(!c||!c.Ef){var d=this.getValue();d===a?this.hl(a):(c&&h.h.isEnabled()&&h.h.Ga(new (h.h.get(h.h.ph))(c,"field",this.name||null,d,a)),this.hl(a),this.Mg&&Lb(this))}}}};function Mb(a,c,d){if(null===d)return a.Mg&&Lb(a),Error();void 0!==d&&(c=d);return c}b.getValue=function(){return this.ff};
  b.Un=function(a){return null===a||void 0===a?null:a};b.hl=function(a){this.ff=a;this.Mg=!0};b.Wg=function(a){if(this.M&&this.M.B&&(a=this.M.B.Eg(a))){if(a.bi)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");a.ek||(a.ek=this)}};b.te=function(a){a||""===a||(a=this.M);var c=Db(this);c?c.Sd=a:this.Iy=a};function Db(a){return a.Tv||a.ra()}
  b.Se=function(){for(var a=null,c=this.M,d=c.T,e=0;e<c.T.length;e++)for(var f=d[e],g=f.eb,k=0;k<g.length;k++)if(g[k]===this){a=f;break}return a};b.Lw=function(){return!1};b.Sf=function(a){a?(this.Tc.appendChild(a),this.Df=a):this.Df=null};b.hh=function(a){a?(this.Tc.appendChild(a),this.Pf=a):this.Pf=null};b.Pt=function(){var a=this.M.B;a.Ll&&this.Df&&a.vl().draw();a.Ll&&this.Pf&&a.yl(h.Hk.Ku).draw()};h.Cg={};h.Cg.register=function(a,c){h.v.register(h.v.R.Ac,a,c)};h.Cg.unregister=function(a){h.v.unregister(h.v.R.Ac,a)};h.Cg.ba=function(a){var c=h.v.Lr(h.v.R.Ac,a.type);return c?c.ba(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.g.Ab={};h.g.Ab.bz="aria-";h.g.Ab.UA="role";h.g.Ab.hn={lG:"grid",mG:"gridcell",nG:"group",qA:"listbox",vA:"menu",wA:"menuitem",NG:"menuitemcheckbox",CA:"option",SH:"presentation",eq:"row",qI:"tree",rI:"treeitem"};h.g.Ab.State={Zy:"activedescendant",CF:"colcount",xz:"disabled",QF:"expanded",vG:"invalid",oA:"label",DG:"labelledby",GG:"level",LH:"orientation",RH:"posinset",YH:"rowcount",bj:"selected",bI:"setsize",uI:"valuemax",vI:"valuemin"};h.g.Ab.ih=function(a,c){a.setAttribute(h.g.Ab.UA,c)};
  h.g.Ab.$o=function(a,c,d){Array.isArray(d)&&(d=d.join(" "));a.setAttribute(h.g.Ab.bz+c,d)};h.g.ka={AI:0,IG:3,ez:8,hI:9,UG:12,Hz:13,kn:16,wh:17,Qi:18,NH:19,yF:20,Iz:27,XA:32,HA:33,GA:34,Gz:35,cA:36,Yb:37,gB:38,fd:39,yz:40,QH:43,TH:44,uG:45,yh:46,ZERO:48,ONE:49,sI:50,iI:51,kG:52,iG:53,eI:54,cI:55,OF:56,SG:57,gG:59,eG:61,dG:173,fG:163,UH:63,qF:64,lF:65,rF:66,tp:67,GF:68,E:69,RF:70,Nc:71,oG:72,qG:73,AG:74,BG:75,CG:76,HG:77,QG:78,jH:79,MH:80,Q:81,VH:82,ZH:83,gI:84,tI:85,pq:86,xI:87,tq:88,kB:89,lj:90,Yi:91,BI:92,FF:93,iH:96,bH:97,hH:98,gH:99,YG:100,XG:101,fH:102,eH:103,WG:104,aH:105,$G:106,dH:107,
  ZG:109,cH:110,VG:111,SF:112,WF:113,XF:114,YF:115,ZF:116,$F:117,aG:118,bG:119,cG:120,TF:121,UF:122,VF:123,TG:144,$H:145,hG:166,EG:183,aI:186,HF:189,PF:187,EF:188,OH:190,fI:191,pF:192,jI:192,dI:222,kH:219,sF:220,BF:221,zI:224,JG:224,KG:91,LG:93,yI:229,wI:252,PH:255};h.Qp=function(){this.oe=[];this.Ci=this.cb=this.Mo=this.Ho=this.Go=this.Bf=this.Io=this.ci=this.Ps=null};b=h.Qp.prototype;
  b.Ja=function(a){var c=document.createElement("div");c.className="blocklyMenu goog-menu blocklyNonSelectable";c.tabIndex=0;this.Ci&&h.g.Ab.ih(c,this.Ci);this.cb=c;for(var d=0,e;e=this.oe[d];d++)c.appendChild(e.Ua());this.Io=h.N.Ca(c,"mouseover",this,this.aD,!0);this.Bf=h.N.Ca(c,"click",this,this.WC,!0);this.Go=h.N.Ca(c,"mouseenter",this,this.ZC,!0);this.Ho=h.N.Ca(c,"mouseleave",this,this.$C,!0);this.Mo=h.N.Ca(c,"keydown",this,this.XC);a.appendChild(c)};
  b.focus=function(){var a=this.cb;a&&(a.focus({preventScroll:!0}),h.g.j.Mb(a,"blocklyFocused"))};b.ih=function(a){this.Ci=a};b.I=function(){this.Io&&(h.N.yb(this.Io),this.Io=null);this.Bf&&(h.N.yb(this.Bf),this.Bf=null);this.Go&&(h.N.yb(this.Go),this.Go=null);this.Ho&&(h.N.yb(this.Ho),this.Ho=null);this.Mo&&(h.N.yb(this.Mo),this.Mo=null);for(var a=0,c;c=this.oe[a];a++)c.I();this.cb=null};
  function Nb(a,c){for(var d=a.cb;c&&c!=d;){if(h.g.j.Rr(c,"blocklyMenuItem"))for(var e=0,f;f=a.oe[e];e++)if(f.cb==c)return f;c=c.parentElement}return null}b.se=function(a){var c=this.ci;c&&(c.se(!1),this.ci=null);a&&(a.se(!0),this.ci=a,c=this.cb,h.g.style.EE(a.cb,c),h.g.Ab.$o(c,h.g.Ab.State.Zy,a.pc()))};function Ob(a,c,d){c+=d;for(var e;e=a.oe[c];){if(e.isEnabled()){a.se(e);break}c+=d}}b.aD=function(a){(a=Nb(this,a.target))&&(a.isEnabled()?this.ci!=a&&this.se(a):this.se(null))};
  b.WC=function(a){var c=this.Ps;this.Ps=null;c&&"number"==typeof a.clientX&&1>h.g.U.ir(c,new h.g.U(a.clientX,a.clientY))||(a=Nb(this,a.target))&&a.isEnabled()&&a.Qk&&a.Qk(a)};b.ZC=function(){this.focus()};b.$C=function(){if(this.cb){var a=this.cb;a&&(a.blur(),h.g.j.$c(a,"blocklyFocused"));this.se(null)}};
  b.XC=function(a){if(this.oe.length&&!(a.shiftKey||a.ctrlKey||a.metaKey||a.altKey)){var c=this.ci;switch(a.keyCode){case h.g.ka.Hz:case h.g.ka.XA:c&&c.isEnabled()&&c.Qk&&c.Qk(c);break;case h.g.ka.gB:c=this.oe.indexOf(this.ci);Ob(this,0>c?this.oe.length:c,-1);break;case h.g.ka.yz:Ob(this,this.oe.indexOf(this.ci),1);break;case h.g.ka.HA:case h.g.ka.cA:Ob(this,-1,1);break;case h.g.ka.GA:case h.g.ka.Gz:Ob(this,this.oe.length,-1);break;default:return}a.preventDefault();a.stopPropagation()}};
  b.If=function(){var a=this.cb,c=h.g.style.If(a);c.height=a.scrollHeight;return c};h.Rp=function(a,c){this.Cf=a;this.ff=c;this.Xn=!0;this.cb=null;this.st=!1;this.Ci=null;this.ix=this.Oq=this.Nq=!1;this.Qk=null};b=h.Rp.prototype;
  b.Ua=function(){var a=document.createElement("div");a.id=h.g.Ck.Nw();this.cb=a;a.className="blocklyMenuItem goog-menuitem "+(this.Xn?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.Oq?"blocklyMenuItemSelected goog-option-selected ":"")+(this.ix?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.st?"blocklyMenuItemRtl goog-menuitem-rtl ":"");var c=document.createElement("div");c.className="blocklyMenuItemContent goog-menuitem-content";if(this.Nq){var d=document.createElement("div");
  d.className="blocklyMenuItemCheckbox goog-menuitem-checkbox";c.appendChild(d)}d=this.Cf;"string"==typeof this.Cf&&(d=document.createTextNode(this.Cf));c.appendChild(d);a.appendChild(c);this.Ci&&h.g.Ab.ih(a,this.Ci);h.g.Ab.$o(a,h.g.Ab.State.bj,this.Nq&&this.Oq||!1);h.g.Ab.$o(a,h.g.Ab.State.xz,!this.Xn);return a};b.I=function(){this.cb=null};b.pc=function(){return this.cb.id};b.getValue=function(){return this.ff};b.ih=function(a){this.Ci=a};
  b.se=function(a){this.ix=a;var c=this.cb;c&&this.isEnabled()&&(a?(h.g.j.Mb(c,"blocklyMenuItemHighlight"),h.g.j.Mb(c,"goog-menuitem-highlight")):(h.g.j.$c(c,"blocklyMenuItemHighlight"),h.g.j.$c(c,"goog-menuitem-highlight")))};b.isEnabled=function(){return this.Xn};b.af=function(a){this.Xn=a};function Pb(a,c,d){a.Qk=c.bind(d)};h.Wa=function(a,c,d){"function"!=typeof a&&h.Wa.Ny(a);this.Rl=a;this.Ft=this.$s=this.Zn=null;a=this.Rl;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.ad(g):(null!=g.alt&&(a[f][0].alt=h.g.ad(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.Ra.At(e);g=h.g.Ra.Vv(e,f);var k=h.g.Ra.Wv(e,f);!g&&!k||f<=g+k||(g&&(this.$s=e[0].substring(0,g-1)),k&&(this.Ft=e[0].substr(1-k)),this.Rl=h.Wa.zB(a,g,k))}}this.Zj=this.getOptions(!1)[0];
  h.Wa.A.constructor.call(this,this.Zj[1],c,d);this.fk=this.Bd=this.Hc=this.Jc=this.fm=null};h.g.object.W(h.Wa,h.xd);h.Wa.ba=function(a){return new h.Wa(a.options,void 0,a)};h.Wa.prototype.ql=function(a){Qb(this)&&this.getOptions(!1);this.setValue(a.textContent)};h.Wa.prototype.gv=!0;h.Wa.zF=25;h.Wa.MG=.45;h.Wa.gA=5;h.Wa.hA=2*h.Wa.gA;h.Wa.Im=h.g.userAgent.Hm?"\u25bc":"\u25be";b=h.Wa.prototype;b.qk="default";
  b.io=function(){!this.ea().tu||this.ea().tu&&!this.M.Qa?Eb(this):this.Tv=this.M.ra();Fb(this);this.Hc=h.g.j.J(h.g.D.Ak,{},this.Tc);this.ea().Tz?(this.fk=h.g.j.J(h.g.D.Ak,{height:this.ea().wk+"px",width:this.ea().wk+"px"},this.Tc),this.fk.setAttributeNS(h.g.j.hd,"xlink:href",this.ea().Uz)):(this.Bd=h.g.j.J(h.g.D.rv,{},this.wc),this.Bd.appendChild(document.createTextNode(this.M.L?h.Wa.Im+" ":" "+h.Wa.Im)),this.M.L?this.wc.insertBefore(this.Bd,this.Ji):this.wc.appendChild(this.Bd));this.Ob&&h.g.j.Mb(this.Ob,
  "blocklyDropdownRect")};
  b.bp=function(a){var c=new h.Qp;c.ih(h.g.Ab.hn.qA);var d=this.getOptions(!1);this.fm=null;for(var e=0;e<d.length;e++){var f=d[e][0],g=d[e][1];if("object"==typeof f){var k=new Image(f.width,f.height);k.src=f.src;k.alt=f.alt||"";f=k}f=new h.Rp(f,g);f.ih(h.g.Ab.hn.CA);f.st=this.M.L;f.Nq=!0;c.oe.push(f);f.Oq=g==this.ff;g==this.ff&&(this.fm=f);Pb(f,this.YC,this)}this.Jc=c;this.Jc.Ps=a&&"number"===typeof a.clientX?new h.g.U(a.clientX,a.clientY):null;this.Jc.Ja(h.C.MC());h.g.j.Mb(this.Jc.cb,"blocklyDropdownMenu");
  this.ea().Sz&&(a=this.M.Qa?this.M.getParent().Gr():this.M.Gr(),c=this.M.Qa?this.M.getParent().style.uj:this.M.style.uj,h.C.re(a,c));h.C.LE(this,this.sC.bind(this));this.Jc.focus();this.fm&&this.Jc.se(this.fm);this.dc()};b.sC=function(){this.Jc&&this.Jc.I();this.fm=this.Jc=null;this.dc()};b.YC=function(a){h.C.Dl(this,!0);this.setValue(a.getValue())};h.Wa.zB=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};
  function Qb(a){return"function"==typeof a.Rl}b=h.Wa.prototype;b.getOptions=function(a){return Qb(this)?(this.Zn&&a||(this.Zn=this.Rl.call(this),h.Wa.Ny(this.Zn)),this.Zn):this.Rl};b.Un=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.M&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.M.type+", Field name: "+this.name+", Value: "+a),null)};
  b.hl=function(a){h.Wa.A.hl.call(this,a);a=this.getOptions(!0);for(var c=0,d;d=a[c];c++)d[1]==this.ff&&(this.Zj=d)};b.dc=function(){this.Ob&&(this.Ob.setAttribute("stroke",this.M.style.uj),this.Jc?this.Ob.setAttribute("fill",this.M.style.uj):this.Ob.setAttribute("fill","transparent"));this.M&&this.Bd&&(this.Bd.style.fill=this.M.Qa?this.M.style.Gn:this.M.style.Ph)};
  b.kt=function(){this.Ji.nodeValue="";this.Hc.style.display="none";var a=this.Zj&&this.Zj[0];if(a&&"object"==typeof a){this.Hc.style.display="";this.Hc.setAttributeNS(h.g.j.hd,"xlink:href",a.src);this.Hc.setAttribute("height",a.height);this.Hc.setAttribute("width",a.width);var c=Number(a.height);a=Number(a.width);var d=!!this.Ob,e=Math.max(d?this.ea().su:0,c+h.Wa.hA);d=d?this.ea().vk:0;var f=this.fk?Rb(this,a+d,e/2-this.ea().wk/2):h.g.j.Ir(this.Bd,this.ea().Ah,this.ea().eg,this.ea().dg);this.vc.width=
  a+f+2*d;this.vc.height=e;var g=0;this.M.L?this.Hc.setAttribute("x",d+f):(g=a+f,this.wc.setAttribute("text-anchor","end"),this.Hc.setAttribute("x",d));this.Hc.setAttribute("y",e/2-c/2);Ib(this,g+d,a+f)}else this.Ji.nodeValue=Gb(this),h.g.j.Mb(this.wc,"blocklyDropdownText"),this.wc.setAttribute("text-anchor","start"),e=!!this.Ob,c=Math.max(e?this.ea().su:0,this.ea().Wm),a=h.g.j.Ir(this.wc,this.ea().Ah,this.ea().eg,this.ea().dg),e=e?this.ea().vk:0,d=0,this.fk&&(d=Rb(this,a+e,c/2-this.ea().wk/2)),this.vc.width=
  a+d+2*e,this.vc.height=c,Ib(this,e,a);Jb(this)};function Rb(a,c,d){if(!a.fk)return 0;var e=a.Ob?a.ea().vk:0,f=a.ea().Vz,g=a.ea().wk;a.fk.setAttribute("transform","translate("+(a.M.L?e:c+f)+","+d+")");return g+f}b.Or=function(){if(!this.Zj)return null;var a=this.Zj[0];return"object"==typeof a?a.alt:a};
  h.Wa.Ny=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.Cg.register("field_dropdown",h.Wa);h.h.sg=function(a,c){h.h.sg.A.constructor.call(this,c);this.gs=a};h.g.object.W(h.h.sg,h.h.Zd);h.h.sg.prototype.type=h.h.mq;h.h.sg.prototype.qa=function(){var a=h.h.sg.A.qa.call(this);a.isOpen=this.gs;return a};h.h.sg.prototype.ba=function(a){h.h.sg.A.ba.call(this,a);this.gs=a.isOpen};h.v.register(h.v.R.Fb,h.h.mq,h.h.sg);h.xG=function(){};h.yG=function(){};h.bc=function(a){this.m=a;this.zg=[];this.Re=null;0>=this.m.options.Eo||(a=new h.dd({scrollbars:!0,parentWorkspace:this.m,rtl:this.m.L,oneBasedIndex:this.m.options.Po,renderer:this.m.options.mt,rendererOverrides:this.m.options.nt,move:{scrollbars:!0}}),this.m.Vc?(a.Kc=this.m.Kc==h.g.V.Pa.Kh?h.g.V.Pa.Ri:h.g.V.Pa.Kh,this.Re=new (h.v.Dg(h.v.R.vu,this.m.options,!0))(a)):(a.Kc=this.m.Kc==h.g.V.Pa.fd?h.g.V.Pa.Yb:h.g.V.Pa.fd,this.Re=new (h.v.Dg(h.v.R.Ep,this.m.options,!0))(a)),C(this.m,this.OD.bind(this)))};
  b=h.bc.prototype;b.jj=47;b.lk=44;b.Dh=16;b.Op=20;b.Lu=20;b.Zm=10;b.gq=0;b.hq=32;b.aA=.1;h.bc.az=80;h.bc.Vt=4;h.bc.Uu=.4;h.bc.BA=.8;h.bc.Mu=45;b=h.bc.prototype;b.oo=!1;b.As=0;b.O=null;b.fp=null;b.os=0;b.Rg=0;b.wo=0;b.lh=0;
  b.Ua=function(){this.O=h.g.j.J(h.g.D.Nc,{"class":"blocklyTrash"},null);var a=String(Math.random()).substring(2);var c=h.g.j.J(h.g.D.cu,{id:"blocklyTrashBodyClipPath"+a},this.O);h.g.j.J(h.g.D.Lb,{width:this.jj,height:this.lk,y:this.Dh},c);var d=h.g.j.J(h.g.D.Ak,{width:h.cj.width,x:-this.gq,height:h.cj.height,y:-this.hq,"clip-path":"url(#blocklyTrashBodyClipPath"+a+")"},this.O);d.setAttributeNS(h.g.j.hd,"xlink:href",this.m.options.Uo+h.cj.url);c=h.g.j.J(h.g.D.cu,{id:"blocklyTrashLidClipPath"+a},this.O);
  h.g.j.J(h.g.D.Lb,{width:this.jj,height:this.Dh},c);this.fp=h.g.j.J(h.g.D.Ak,{width:h.cj.width,x:-this.gq,height:h.cj.height,y:-this.hq,"clip-path":"url(#blocklyTrashLidClipPath"+a+")"},this.O);this.fp.setAttributeNS(h.g.j.hd,"xlink:href",this.m.options.Uo+h.cj.url);h.N.bind(this.O,"mousedown",this,this.DB);h.N.bind(this.O,"mouseup",this,this.click);h.N.bind(d,"mouseover",this,this.FD);h.N.bind(d,"mouseout",this,this.DD);this.xq();return this.O};
  b.za=function(a){0<this.m.options.Eo&&(h.g.j.Oj(this.Re.Ua(h.g.D.ej),y(this.m)),this.Re.za(this.m));this.kp=this.Op+a;ya(this,!1);return this.kp+this.lk+this.Dh};b.I=function(){this.O&&(h.g.j.removeNode(this.O),this.O=null);this.m=this.fp=null;clearTimeout(this.os)};
  b.position=function(a,c){if(this.kp){this.wo=a.Hy.position==h.g.V.Pa.Yb||this.m.Vc&&!this.m.L?a.Ry.width+a.uq.left-this.jj-this.Lu-h.ya.fc:this.Lu+h.ya.fc;var d=this.lk+this.Dh,e=this.lh=a.uq.top+this.kp,f=a.uq.top+a.Ry.height-d-this.kp;this.lh=(a=a.Hy.position!==h.g.V.Pa.Ri)?f:e;for(var g=this.Yh(),k=0,l;l=c[k];k++)g.left>l.right||g.right<l.left||g.top>l.bottom||g.bottom<l.top||(this.lh=a?l.top-d-this.Op:l.bottom+this.Op,g=this.Yh(),k=-1);this.lh=h.g.qd.sj(e,this.lh,f);this.O.setAttribute("transform",
  "translate("+this.wo+","+this.lh+")")}};b.Yh=function(){return new h.g.Rect(this.lh,this.lh+this.lk+this.Dh,this.wo,this.wo+this.jj)};b.ul=function(){if(!this.O)return null;var a=this.O.getBoundingClientRect(),c=a.top+this.hq-this.Zm;a=a.left+this.gq-this.Zm;return new h.g.Rect(c,c+this.Dh+this.lk+2*this.Zm,a,a+this.jj+2*this.Zm)};function ya(a,c){a.oo!=c&&(clearTimeout(a.os),a.oo=c,a.xq())}
  b.xq=function(){var a=1/(h.bc.Vt+1);this.Rg+=this.oo?a:-a;this.Rg=Math.min(Math.max(this.Rg,this.As),1);Sb(this,this.Rg*h.bc.Mu);this.O.style.opacity=h.bc.Uu+this.Rg*(h.bc.BA-h.bc.Uu);this.Rg>this.As&&1>this.Rg&&(this.os=setTimeout(this.xq.bind(this),h.bc.az/h.bc.Vt))};function Sb(a,c){var d=a.m.Kc==h.g.V.Pa.fd||a.m.Vc&&a.m.L;a.fp.setAttribute("transform","rotate("+(d?-c:c)+","+(d?4:a.jj-4)+","+(a.Dh-2)+")")}b.Fn=function(){ya(this,!1)};
  b.click=function(){if(this.zg.length&&!this.Re.isVisible()){for(var a=[],c=0,d;d=this.zg[c];c++)a[c]=h.K.ue(d);this.Re.show(a);Tb(this,!0)}};function Tb(a,c){a=new (h.h.get(h.h.mq))(c,a.m.id);h.h.Ga(a)}b.DB=function(a){!this.Re.isVisible()&&this.zg.length&&a.stopPropagation()};b.FD=function(){this.zg.length&&ya(this,!0)};b.DD=function(){ya(this,!1)};
  b.OD=function(a){if(!(0>=this.m.options.Eo)&&a.type==h.h.pp&&a.Wj.tagName&&"shadow"!=a.Wj.tagName.toLowerCase()){for(var c=a=a.Wj.cloneNode(!0);c;){c.removeAttribute&&(c.removeAttribute("x"),c.removeAttribute("y"),c.removeAttribute("id"),c.removeAttribute("disabled"),"comment"==c.nodeName&&(c.removeAttribute("h"),c.removeAttribute("w"),c.removeAttribute("pinned")));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.K.Gd(a);
  if(-1==this.zg.indexOf(a)){for(this.zg.unshift(a);this.zg.length>this.m.options.Eo;)this.zg.pop();this.As=a=this.aA;this.oo||Sb(this,a*h.bc.Mu)}}};h.F=function(a,c,d){if(!c)throw Error("Cannot create a node without a location.");this.Am=a;this.Da=c;this.Xy=null;(a=d||null)&&a.Wy&&(this.Xy=a.Wy)};h.F.types={Ac:"field",Qb:"block",yd:"input",Gh:"output",lg:"next",ng:"previous",Jh:"stack",Pc:"workspace"};h.F.kg=!1;h.F.vz=-20;h.F.oJ=function(a){switch(a){case h.F.types.ng:case h.F.types.lg:case h.F.types.yd:case h.F.types.Gh:return!0}return!1};h.F.al=function(a){return a?new h.F(h.F.types.Ac,a):null};
  h.F.Bg=function(a){if(!a)return null;var c=a.type;return c==h.X.Rb||c==h.X.Sb&&a.Se()?h.F.Sh(a.Se()):c==h.X.Sb?new h.F(h.F.types.lg,a):c==h.X.cd?new h.F(h.F.types.Gh,a):c==h.X.ed?new h.F(h.F.types.ng,a):null};h.F.Sh=function(a){return a&&a.connection?new h.F(h.F.types.yd,a.connection):null};h.F.Ag=function(a){return a?new h.F(h.F.types.Qb,a):null};h.F.Mn=function(a){return a?new h.F(h.F.types.Jh,a):null};h.F.fC=function(a,c){return c&&a?new h.F(h.F.types.Pc,a,{Wy:c}):null};
  h.F.VI=function(a){var c=a.Y||a.S;return c?h.F.Bg(c):h.F.Ag(a)};b=h.F.prototype;b.vb=function(){return this.Am};function Ub(a,c){a=a.Da;a instanceof h.Yf||(a=a.ga());if(!a||!a.B)return null;var d=a.me();a=d.B.tb(!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.Mn(a[c]);throw Error("Couldn't find "+(c?"next":"previous")+" stack?!");}
  function Vb(a){if(!a)return null;do var c=a.Y&&a.Y.va();while(c&&t(c)==a&&(a=c));return(c=a.Y||a.S)&&c.Aa&&c.Aa.Se()?h.F.Sh(c.Aa.Se()):h.F.Mn(a)}b.ga=function(){return this.vb()===h.F.types.Qb?this.Da:this.vb()===h.F.types.Jh?this.Da:this.vb()===h.F.types.Pc?null:this.Da.ga()};
  b.next=function(){switch(this.Am){case h.F.types.Jh:return Ub(this,!0);case h.F.types.Gh:var a=this.Da;return h.F.Ag(a.ga());case h.F.types.Ac:a:{var c=this.Da,d=c.Se();a=c.ga();c=d.eb.indexOf(c)+1;d=a.T.indexOf(d);for(var e;e=a.T[d];d++){for(var f=e.eb;c<f.length;){if(wb(f[c])||h.F.kg){a=h.F.al(f[c]);break a}c++}c=0;if(e.connection){a=h.F.Sh(e);break a}}a=null}return a;case h.F.types.yd:a:{c=this.Da.Se();a=c.ga();for(c=a.T.indexOf(c)+1;d=a.T[c];c++){e=d.eb;f=0;for(var g;g=e[f];f++)if(wb(g)||h.F.kg){a=
  h.F.al(g);break a}if(d.connection){a=h.F.Sh(d);break a}}a=null}return a;case h.F.types.Qb:return h.F.Bg(this.Da.Z);case h.F.types.ng:return a=this.Da,h.F.Ag(a.ga());case h.F.types.lg:return a=this.Da,h.F.Bg(a.Aa)}return null};
  b.Kg=function(){switch(this.Am){case h.F.types.Pc:var a=this.Da.tb(!0);if(0<a.length)return h.F.Mn(a[0]);break;case h.F.types.Jh:a=this.Da;var c=a.Y||a.S;return c?h.F.Bg(c):h.F.Ag(a);case h.F.types.Qb:a=this.Da;a:{a=a.T;c=0;for(var d;d=a[c];c++){for(var e=d.eb,f=0,g;g=e[f];f++)if(wb(g)||h.F.kg){a=h.F.al(g);break a}if(d.connection){a=h.F.Sh(d);break a}}a=null}return a;case h.F.types.yd:return h.F.Bg(this.Da.Aa)}return null};
  b.bh=function(){switch(this.Am){case h.F.types.Jh:return Ub(this,!1);case h.F.types.Ac:a:{var a=this.Da;var c=a.Se();var d=a.ga();a=c.eb.indexOf(a)-1;for(var e=d.T.indexOf(c),f;f=d.T[e];e--){if(f.connection&&f!==c){c=h.F.Sh(f);break a}for(f=f.eb;-1<a;){if(wb(f[a])||h.F.kg){c=h.F.al(f[a]);break a}a--}0<=e-1&&(a=d.T[e-1].eb.length-1)}c=null}return c;case h.F.types.yd:a:{c=this.Da.Se();d=c.ga();for(a=d.T.indexOf(c);e=d.T[a];a--){if(e.connection&&e!==c){c=h.F.Sh(e);break a}e=e.eb;f=e.length-1;for(var g;g=
  e[f];f--)if(wb(g)||h.F.kg){c=h.F.al(g);break a}}c=null}return c;case h.F.types.Qb:return c=this.Da,h.F.Bg(c.Y||c.S);case h.F.types.ng:c=this.Da;if((c=c.Aa)&&!c.Se())return h.F.Bg(c);break;case h.F.types.lg:return c=this.Da,h.F.Ag(c.ga())}return null};
  b.Zg=function(){switch(this.Am){case h.F.types.Jh:var a=this.Da,c=a.Xa();return h.F.fC(a.B,new h.g.U(c.x,c.y+h.F.vz));case h.F.types.Gh:return a=this.Da,(c=a.Aa)?h.F.Bg(c):h.F.Mn(a.ga());case h.F.types.Ac:return h.F.Ag(this.Da.ga());case h.F.types.yd:return a=this.Da,h.F.Ag(a.ga());case h.F.types.Qb:return a=this.Da,Vb(a);case h.F.types.ng:return a=this.Da,Vb(a.ga());case h.F.types.lg:return a=this.Da,Vb(a.ga())}return null};h.Xb=Object.create(null);h.Ba={};h.Ba.kk={};h.Ba.register=function(a,c){if("string"!=typeof a||""==a.trim())throw Error('Error: Invalid extension name "'+a+'"');if(h.Ba.kk[a])throw Error('Error: Extension "'+a+'" is already registered.');if("function"!=typeof c)throw Error('Error: Extension "'+a+'" must be a function');h.Ba.kk[a]=c};h.Ba.BJ=function(a,c){if(!c||"object"!=typeof c)throw Error('Error: Mixin "'+a+'" must be a object');h.Ba.register(a,function(){this.Ug(c)})};
  h.Ba.CJ=function(a,c,d,e){var f='Error when registering mutator "'+a+'": ';h.Ba.Qv(f,c.Ff,"domToMutation");h.Ba.Qv(f,c.Md,"mutationToDom");var g=h.Ba.Sv(c,f);if(d&&"function"!=typeof d)throw Error('Extension "'+a+'" is not a function');h.Ba.register(a,function(){if(g){if(!h.yA)throw Error(f+"Missing require for Blockly.Mutator");this.wy(new h.yA(e||[]))}this.Ug(c);d&&d.apply(this)})};h.Ba.unregister=function(a){h.Ba.kk[a]?delete h.Ba.kk[a]:console.warn('No extension mapping for name "'+a+'" found to unregister')};
  h.Ba.apply=function(a,c,d){var e=h.Ba.kk[a];if("function"!=typeof e)throw Error('Error: Extension "'+a+'" not found.');if(d)h.Ba.PB(a,c);else var f=h.Ba.Kr(c);e.apply(c);if(d)h.Ba.NB('Error after applying mutator "'+a+'": ',c);else if(!h.Ba.ID(f,c))throw Error('Error when applying extension "'+a+'": mutation properties changed when applying a non-mutator extension.');};
  h.Ba.Qv=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.Ba.PB=function(a,c){if(h.Ba.Kr(c).length)throw Error('Error: tried to apply mutation "'+a+'" to a block that already has mutator functions.  Block id: '+c.id);};
  h.Ba.Sv=function(a,c){var d=void 0!==a.Sq,e=void 0!==a.Wq;if(d&&e){if("function"!=typeof a.Sq)throw Error(c+"compose must be a function.");if("function"!=typeof a.Wq)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.Ba.NB=function(a,c){if("function"!=typeof c.Ff)throw Error(a+'Applying a mutator didn\'t add "domToMutation"');if("function"!=typeof c.Md)throw Error(a+'Applying a mutator didn\'t add "mutationToDom"');h.Ba.Sv(c,a)};h.Ba.Kr=function(a){var c=[];void 0!==a.Ff&&c.push(a.Ff);void 0!==a.Md&&c.push(a.Md);void 0!==a.Sq&&c.push(a.Sq);void 0!==a.Wq&&c.push(a.Wq);return c};h.Ba.ID=function(a,c){c=h.Ba.Kr(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.Ba.GI=function(a,c){var d=[];"object"==typeof document&&h.g.sy(function(){for(var e in c)h.g.Rv(c[e])});return function(){this.type&&-1==d.indexOf(this.type)&&(h.Ba.OB(this,a,c),d.push(this.type));this.te(function(){var e=String($a(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.ad(f);return f}.bind(this))}};
  h.Ba.OB=function(a,c,d){var e=ka(a,c);if(!Qb(e)){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.Ba.HI=function(a,c){"object"==typeof document&&h.g.sy(function(){h.g.Rv(a)});return function(){this.te(function(){var d=ka(this,c);return h.g.ad(a).replace("%1",d?Kb(d):"")}.bind(this))}};
  h.Ba.wC=function(){this.$E=this.Sd;this.te(function(){var a=this.getParent();return a&&ua(a)&&a.Sd||this.$E}.bind(this))};h.Ba.register("parent_tooltip_when_inline",h.Ba.wC);h.bd=function(a,c,d){this.Bn=null;h.bd.A.constructor.call(this,a,null,d);d||(this.Bn=c||null)};h.g.object.W(h.bd,h.xd);h.bd.prototype.xp="";h.bd.ba=function(a){var c=h.g.ad(a.text);return new h.bd(c,void 0,a)};h.bd.prototype.tk=!1;h.bd.prototype.Vk=function(a){h.bd.A.Vk.call(this,a);this.Bn=a["class"]};h.bd.prototype.io=function(){Fb(this);this.Bn&&h.g.j.Mb(this.wc,this.Bn)};h.bd.prototype.Un=function(a){return null===a||void 0===a?null:String(a)};h.Cg.register("field_label",h.bd);h.Hu=function(a,c,d,e){if(a!=h.Ha.Ae&&!c)throw Error("Value inputs and statement inputs must have non-empty name.");this.type=a;this.name=c;this.M=d;this.connection=e;this.eb=[]};b=h.Hu.prototype;b.align=h.lb.Td.Yb;b.nh=!0;b.ga=function(){return this.M};function D(a,c,d){Wb(a,a.eb.length,c,d);return a}
  function Wb(a,c,d,e){if(0>c||c>a.eb.length)throw Error("index "+c+" out of bounds.");if(!(d||""==d&&e))return c;"string"==typeof d&&(d=h.Cg.ba({type:"field_label",text:d}));if(d.M)throw Error("Field already bound to a block.");d.M=a.M;a.M.ua&&(d.za(),d.dc());d.name=e;d.Hb(a.isVisible());d.$s&&(c=Wb(a,c,d.$s));a.eb.splice(c,0,d);++c;d.Ft&&(c=Wb(a,c,d.Ft));a.M.ua&&(a.M=a.M,a.M.Ja(),a.M.Sc());return c}b.isVisible=function(){return this.nh};
  b.Hb=function(a){if(this.nh!=a){this.nh=a;for(var c=0,d;d=this.eb[c];c++)d.Hb(a);if(this.connection){this.connection=this.connection;if(a)Xb(this.connection);else if(c=this.connection,Yb(c,!1),c.Aa)for(c=r(c.va(),!1),d=0;d<c.length;d++){for(var e=c[d],f=e.je(!0),g=0;g<f.length;g++)Yb(f[g],!1);e=va(e);for(g=0;g<e.length;g++)e[g].Hb(!1)}if(c=this.connection.va())c.ra().style.display=a?"block":"none"}}};b.Ol=function(){for(var a=0,c;c=this.eb[a];a++)c.Ol()};
  b.$j=function(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.$j(a)};b.jm=function(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.jm(a)};b.Ij=function(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.Ij()};b.za=function(){if(this.M.B.ua)for(var a=0;a<this.eb.length;a++)this.eb[a].za()};
  b.I=function(){for(var a=0,c;c=this.eb[a];a++)c.I();this.connection&&this.connection.I();this.M=null};h.Yf=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&&!a.Gc(d)?d:h.g.Hf();a.Dq[this.id]=this;this.Y=this.Z=this.S=null;this.T=[];this.Kf=void 0;this.disabled=!1;this.Sd="";this.contextMenu=!0;this.Ze=null;this.Af=[];this.Aw=this.Fx=this.nw=!0;this.Oh=this.Qa=!1;this.Qh=null;this.ce={text:null,Yx:!1,size:new h.g.gd(160,80)};this.Yy=new h.g.U(0,0);this.B=a;this.Yc=a.Lf;this.L=
  a.L;this.Sj=!1;this.Ue=void 0;this.ua=null;if(c){this.type=c;d=h.Xb[c];if(!d||"object"!=typeof d)throw TypeError("Unknown block type: "+c);h.g.object.Ug(this,d)}a.vn(this);a.Xf[this.type]||(a.Xf[this.type]=[]);a.Xf[this.type].push(this);(a=h.h.Vb())||h.h.ta(!0);c=h.h.Ma;try{"function"==typeof this.za&&(h.h.Ma=!1,this.za(),h.h.Ma=c),h.h.isEnabled()&&h.h.Ga(new (h.h.get(h.h.qh))(this))}finally{a||h.h.ta(!1),h.h.Ma=c}this.mD=this.Kf;if("function"==typeof this.onchange){if((a=this.onchange)&&"function"!=
  typeof a)throw Error("onchange must be a function.");this.Vl&&gb(this.B,this.Vl);if(this.onchange=a)this.Vl=a.bind(this),C(this.B,this.Vl)}};h.Yf.Pm=h.lb.Pm;h.Yf.Om=h.lb.Om;b=h.Yf.prototype;b.data=null;b.Ef=!1;b.Dd="#000000";b.rm=null;
  b.I=function(a){if(this.B){this.Vl&&gb(this.B,this.Vl);x(this,a);h.h.isEnabled()&&h.h.Ga(new (h.h.get(h.h.pp))(this));h.h.disable();try{if(this.B){this.B.Wo(this);var c=this.B;c.Xf[this.type].splice(c.Xf[this.type].indexOf(this),1);c.Xf[this.type].length||delete c.Xf[this.type];delete this.B.Dq[this.id];this.B=null}h.selected==this&&(h.selected=null);for(var d=this.Af.length-1;0<=d;d--)this.Af[d].I(!1);d=0;for(var e;e=this.T[d];d++)e.I();this.T.length=0;var f=this.je(!0);d=0;for(var g;g=f[d];d++)g.I()}finally{h.h.enable(),
  this.Ef=!0}}};function x(a,c){if(a.S){var d=null;a.S.isConnected()&&(d=a.S.Aa,a.S.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.X.Rb&&f.Aa){if(c){c=null;break a}c=f}}}c&&c.isConnected()&&!c.va().Qa&&(c=c.Aa,c.disconnect(),A(a.B.Me,c,d,!1)?d.connect(c):c.Lo(d))}}else a.Y&&(d=null,a.Y.isConnected()&&(d=a.Y.Aa,a.Y.disconnect()),e=t(a),c&&e&&!e.Qa&&(c=a.Z.Aa,c.disconnect(),d&&A(a.B.Me,d,c,!1)&&d.connect(c)))}
  b.je=function(){var a=[];this.S&&a.push(this.S);this.Y&&a.push(this.Y);this.Z&&a.push(this.Z);for(var c=0,d;d=this.T[c];c++)d.connection&&a.push(d.connection);return a};b.vo=function(){for(var a=this.Z;a;){var c=a.va();if(!c)return a;a=c.Z}return null};b.Sc=function(){};b.getParent=function(){return this.Ze};function ma(a,c){for(var d=0,e;e=a.T[d];d++)if(e.connection&&e.connection.va()==c)return e;return null}function Zb(a){do{var c=a;a=a.getParent();if(!a)return null}while(t(a)==c);return a}
  function t(a){return a.Z&&a.Z.va()}b.me=function(){var a=this;do{var c=a;a=c.Ze}while(a);return c};function ca(a,c){if(!c)return a.Af;c=[];for(var d=0,e;e=a.T[d];d++)e.connection&&(e=e.connection.va())&&c.push(e);(a=t(a))&&c.push(a);return c}
  b.Zo=function(a){if(a!=this.Ze){if(this.Ze){h.g.Rk(this.Ze.Af,this);if(this.Y&&this.Y.isConnected())throw Error("Still connected to previous block.");if(this.S&&this.S.isConnected())throw Error("Still connected to parent block.");this.Ze=null}else this.B.Wo(this);(this.Ze=a)?a.Af.push(this):this.B.vn(this)}};function r(a,c){var d=[a];a=ca(a,c);for(var e,f=0;e=a[f];f++)d.push.apply(d,r(e,c));return d}b.Wc=function(){return this.nw&&!this.Qa&&!(this.B&&this.B.options.readOnly)};
  b.rc=function(){return this.Fx&&!this.Qa&&!(this.B&&this.B.options.readOnly)};b.vt=function(a){this.Fx=a};b.yt=function(a){this.Qa=a};b.od=function(){return this.Sj};b.vy=function(a){this.Sj=a};b.Kd=function(){return this.Aw&&!(this.B&&this.B.options.readOnly)};b.ut=function(a){this.Aw=a;a=0;for(var c;c=this.T[a];a++)for(var d=0,e;e=c.eb[d];d++)Cb(e)};
  b.Jr=function(a,c){var d=this.je(!0);a=a.je(!0);if(d.length!=a.length)throw Error("Connection lists did not match in length.");for(var e=0;e<a.length;e++)if(a[e]==c)return d[e];return null};b.te=function(a){this.Sd=a};b.Gr=function(){return this.Dd};b.re=function(a){this.Dd=h.g.Ro(a).Cl};b.Hi=function(a){this.rm=a};function ka(a,c){for(var d=0,e;e=a.T[d];d++)for(var f=0,g;g=e.eb[f];f++)if(g.name==c)return g;return null}function ja(a){for(var c=0,d;d=a.T[c];c++)for(var e=0;d.eb[e];e++);return[]}
  function $a(a,c){return(a=ka(a,c))?a.getValue():null}b.Gi=function(a,c){if(a){void 0===c&&(c=null);if(!this.Y){if(this.S)throw Error("Remove output connection prior to adding previous connection.");this.Y=this.Nl(h.X.ed)}this.Y.$j(c)}else if(this.Y){if(this.Y.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.Y.I();this.Y=null}};
  b.bk=function(a,c){if(a)void 0===c&&(c=null),this.Z||(this.Z=this.Nl(h.X.Sb)),this.Z.$j(c);else if(this.Z){if(this.Z.isConnected())throw Error("Must disconnect next statement before removing connection.");this.Z.I();this.Z=null}};
  b.wt=function(a,c){if(a){void 0===c&&(c=null);if(!this.S){if(this.Y)throw Error("Remove previous connection prior to adding output connection.");this.S=this.Nl(h.X.cd)}this.S.$j(c)}else if(this.S){if(this.S.isConnected())throw Error("Must disconnect output value before removing connection.");this.S.I();this.S=null}};b.Fi=function(a){this.Kf!=a&&(h.h.Ga(new (h.h.get(h.h.ph))(this,"inline",null,this.Kf,a)),this.Kf=a)};
  function ua(a){if(void 0!=a.Kf)return a.Kf;for(var c=1;c<a.T.length;c++)if(a.T[c-1].type==h.Ha.Ae&&a.T[c].type==h.Ha.Ae)return!1;for(c=1;c<a.T.length;c++)if(a.T[c-1].type==h.Ha.He&&a.T[c].type==h.Ha.Ae)return!0;return!1}b.isEnabled=function(){return!this.disabled};b.af=function(a){this.isEnabled()!=a&&(h.h.Ga(new (h.h.get(h.h.ph))(this,"disabled",null,this.disabled,!a)),this.disabled=!a)};function $b(a){for(a=Zb(a);a;){if(a.disabled)return!0;a=Zb(a)}return!1}b.isCollapsed=function(){return this.Oh};
  b.Di=function(a){this.Oh!=a&&(h.h.Ga(new (h.h.get(h.h.ph))(this,"collapsed",null,this.Oh,a)),this.Oh=a)};
  b.toString=function(a,c){function d(n){var q=n.rj;!q&&n.Aa&&(q=n.Aa.rj);return!!q&&(-1!=q.indexOf("Boolean")||-1!=q.indexOf("Number"))}function e(){k&&k.vb()==l.vb()&&k.Da==l.Da&&(k=null)}var f=[];c=c||"?";var g=h.F.kg;h.F.kg=!0;for(var k=h.F.Ag(this),l=k;k;){switch(k.vb()){case h.F.types.yd:var m=k.Da;k.Kg()?d(m)&&f.push("("):f.push(c);break;case h.F.types.Ac:m=k.Da,m.name!=h.lb.Om&&f.push(Kb(m))}m=k;k=m.Kg()||m.next();if(!k){k=m.Zg();for(e();k&&!k.next();)k=k.Zg(),e(),k&&k.vb()==h.F.types.yd&&d(k.Da)&&
  f.push(")");k&&(k=k.next())}}h.F.kg=g;c=2;for(g=f.length;c<g;c++)"("==f[c-2]&&")"==f[c]&&(f[c-2]=f[c-1],f.splice(c-1,2),g-=2);f=f.join(" ").replace(/(\() | (\))/gmi,"$1$2").trim()||"???";a&&f.length>a&&(f=f.substring(0,a-3)+"...");return f};function ac(a,c){return a.xf(h.Ha.Ae,c||"")}
  function bc(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.Ue&&(a.Ue=c.style.Ue,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{a.Hi(e)}catch(Hb){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.re(e)}catch(Hb){console.warn(d+
  "Illegal colour value: ",e)}}for(e=0;void 0!==c["message"+e];){var f=a,g=c["args"+e]||[],k=c["lastDummyAlign"+e],l=d,m=h.g.ZE(c["message"+e]);var n=f;for(var q=m,p=g.length,u=[],H=0,K=0;K<q.length;K++){var I=q[K];if("number"==typeof I){if(1>I||I>p)throw Error('Block "'+n.type+'": Message index %'+I+" out of range.");if(u[I])throw Error('Block "'+n.type+'": Message index %'+I+" duplicated.");u[I]=!0;H++}}if(H!=p)throw Error('Block "'+n.type+'": Message does not reference all '+p+" arg(s).");n=g;g=
  [];for(q=0;q<m.length;q++){p=m[q];"number"==typeof p&&(p=n[p-1]);if("string"==typeof p&&(p=cc(p),!p))continue;g.push(p)}(m=g.length)&&!dc(g[m-1].type)&&(m={type:"input_dummy"},k&&(m.align=k),g.push(m));k=g;g=[];for(m=0;n=k[m];m++)if(dc(n.type)){q=f;p=n;u=l;H={LEFT:h.lb.Td.Yb,RIGHT:h.lb.Td.fd,CENTRE:h.lb.Td.Nm,CENTER:h.lb.Td.Nm};n=null;switch(p.type){case "input_value":n=q.xf(h.Ha.He,p.name);break;case "input_statement":n=q.xf(h.Ha.lc,p.name);break;case "input_dummy":n=ac(q,p.name)}n?(p.check&&n.$j(p.check),
  p.align&&(q=H[p.align.toUpperCase()],void 0===q?console.warn(u+"Illegal align value: ",p.align):(p=n,p.align=q,p.M.ua&&(p.M=p.M,p.M.Ja())))):n=null;if(n){for(q=0;p=g[q];q++)D(n,p[0],p[1]);g.length=0}}else(q=ec(f,n))&&g.push([q,n.name]);e++}void 0!==c.inputsInline&&a.Fi(c.inputsInline);void 0!==c.output&&a.wt(!0,c.output);void 0!==c.previousStatement&&a.Gi(!0,c.previousStatement);void 0!==c.nextStatement&&a.bk(!0,c.nextStatement);void 0!==c.tooltip&&(e=c.tooltip,e=h.g.ad(e),a.te(e));void 0!==c.enableContextMenu&&
  (e=c.enableContextMenu,a.contextMenu=!!e);void 0!==c.helpUrl&&(e=c.helpUrl,e=h.g.ad(e),a.Mj=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.Ba.apply(c.mutator,a,!0);if(Array.isArray(c.extensions))for(c=c.extensions,d=0;d<c.length;++d)h.Ba.apply(c[d],a,!1)}
  b.Ug=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.Ug(this,a)};function ec(a,c){var d=h.Cg.ba(c);return!d&&c.alt?"string"==typeof c.alt?(c=cc(c.alt))?ec(a,c):null:ec(a,c.alt):d}function dc(a){return"input_value"==a||"input_statement"==a||"input_dummy"==a}
  function cc(a){return(a=a.trim())?{type:"field_label",text:a}:null}b.xf=function(a,c){var d=null;if(a==h.Ha.He||a==h.Ha.lc)d=this.Nl(a);a=new h.Hu(a,c,this,d);this.T.push(a);return a};b.gt=function(a,c){for(var d=0,e;e=this.T[d];d++)if(e.name==a)return e.I(),this.T.splice(d,1),!0;if(c)return!1;throw Error("Input not found: "+a);};function ia(a,c){for(var d=0,e;e=a.T[d];d++)if(e.name==c)return e;return null}function fc(a,c){return(a=ia(a,c))&&a.connection&&a.connection.va()}
  b.ak=function(a){this.ce.text!=a&&(h.h.Ga(new (h.h.get(h.h.ph))(this,"comment",null,this.ce.text,a)),this.Qh=this.ce.text=a)};b.wy=function(){};b.Xa=function(){return this.Yy};b.moveBy=function(a,c){if(this.Ze)throw Error("Block has parent.");var d=new (h.h.get(h.h.rh))(this);this.Yy.translate(a,c);d.Ai();h.h.Ga(d)};b.Nl=function(a){return new h.xa(this,a)};h.i={};h.i.Dm=!1;h.i.register=function(a,c){h.v.register(h.v.R.RENDERER,a,c)};h.i.unregister=function(a){h.v.unregister(h.v.R.RENDERER,a)};h.i.SJ=function(){h.i.Dm=!0};h.i.TJ=function(){h.i.Dm=!1};h.i.za=function(a,c,d){a=new (h.v.Fr(h.v.R.RENDERER,a))(a);a.za(c,d);return a};h.sG=function(){};h.Sp=function(a){this.m=a};function gc(a){var c=0,d=0;a&&(c=a.zl(),d=a.qc);return new h.g.gd(c,d)}function hc(a){var c=gc(E(a.m,!0));return{width:c.width,height:c.height,position:a.m.Kc}}function ic(a){var c=gc(a.m.Na);return{width:c.width,height:c.height,position:a.m.Kc}}b=h.Sp.prototype;
  b.rl=function(){var a=0,c=ic(this),d=hc(this),e=!!this.m.Na,f=!!E(this.m,!0),g=e?c.position:d.position,k=g==h.g.V.Pa.Yb;g=g==h.g.V.Pa.Kh;e&&k?a=c.width:f&&k&&(a=d.width);k=0;e&&g?k=c.height:f&&g&&(k=d.height);return{top:k,left:a}};
  b.Te=function(a){a=a?this.m.scale:1;var c=jc(this.m),d=ic(this),e=hc(this),f=this.m.Na?d.position:e.position;if(this.m.Na)if(f==h.g.V.Pa.Kh||f==h.g.V.Pa.Ri)c.height-=d.height;else{if(f==h.g.V.Pa.Yb||f==h.g.V.Pa.fd)c.width-=d.width}else if(E(this.m,!0))if(f==h.g.V.Pa.Kh||f==h.g.V.Pa.Ri)c.height-=e.height;else if(f==h.g.V.Pa.Yb||f==h.g.V.Pa.fd)c.width-=e.width;return{height:c.height/a,width:c.width/a,top:-this.m.scrollY/a,left:-this.m.scrollX/a}};
  b.$n=function(){var a=this.m.scale,c=da(this.m);return{height:(c.bottom-c.top)*a,width:(c.right-c.left)*a,top:c.top*a,left:c.left*a}};b.Sr=function(){return!nb(this.m)||!ob(this.m)};
  b.Hj=function(a,c,d){a=a?this.m.scale:1;var e=c||this.Te(!1);d=d||this.$n();if(this.Sr()){c=nb(this.m);var f=ob(this.m),g=e||this.Te(!1);var k={};f||(k.top=g.top,k.bottom=g.top+g.height);c||(k.left=g.left,k.right=g.left+g.width);c=k}else c={};k=d.top+d.height;f=d.left+d.width;g=e.width;var l=e.height;var m=g/2,n=l/2;e=Math.min(d.top-n,k-l);k=Math.max(k+n,d.top+l);l=Math.min(d.left-m,f-g);d=Math.max(f+m,d.left+g);e=void 0!==c.top?c.top:e;f=void 0!==c.left?c.left:l;return{top:e/a,left:f/a,width:((void 0!==
  c.right?c.right:d)-f)/a,height:((void 0!==c.bottom?c.bottom:k)-e)/a}};b.ke=function(){var a=ic(this),c=hc(this),d=jc(this.m),e=this.rl(),f=this.Te(),g=this.$n(),k=this.Hj(!1,f,g);return{QI:g.height,TI:g.width,SI:g.top,RI:g.left,scrollHeight:k.height,scrollWidth:k.width,scrollTop:k.top,scrollLeft:k.left,Lc:f.height,yc:f.width,hf:f.top,gf:f.left,Qc:e.top,Dc:e.left,UJ:d.height,WJ:d.width,YJ:a.width,XJ:a.height,Kc:a.position,aJ:c.width,$I:c.height}};h.v.register(h.v.R.Pu,h.v.rk,h.Sp);
  h.Bh=function(a,c){this.ma=c;h.Bh.A.constructor.call(this,a)};h.g.object.W(h.Bh,h.Sp);h.Bh.prototype.$n=function(){try{var a=this.m.xb.getBBox()}catch(d){a={height:0,y:0,width:0,x:0}}var c=this.m.scale;return{height:a.height*c,width:a.width*c,top:a.y*c,left:a.x*c}};h.Bh.prototype.Hj=function(a,c,d){c=d||this.$n();d=this.ma.Eh*this.m.scale;a=a?this.m.scale:1;return{height:(c.height+2*d)/a,width:(c.width+c.left+d)/a,top:0,left:0}};
  h.Bh.prototype.Te=function(a){var c=jc(this.m);a=a?this.m.scale:1;if(this.ma.Vc){var d=c.width-2*this.ma.Kk;c=c.height-this.ma.Kk}else d=c.width-this.ma.Kk,c=c.height-2*this.ma.Kk;return{height:c/a,width:d/a,top:-this.m.scrollY/a,left:-this.m.scrollX/a}};h.Bh.prototype.rl=function(){var a=this.ma.Kk;return this.ma.Vc?{top:0,left:a}:{top:a,left:0}};h.i.wG=function(){};h.aa={};h.aa.Od=null;h.aa.Tn=null;h.aa.qe="";h.aa.ve="";h.aa.Ua=function(){h.aa.ab||(h.aa.ab=document.createElement("div"),h.aa.ab.className="blocklyWidgetDiv",(h.Qo||document.body).appendChild(h.aa.ab))};h.aa.show=function(a,c,d){h.aa.Ya();h.aa.Od=a;h.aa.Tn=d;a=h.aa.ab;a.style.direction=c?"rtl":"ltr";a.style.display="block";c=h.Fg();h.aa.qe=c.ob.ie();h.aa.ve=c.Jf().ie();h.g.j.Mb(a,h.aa.qe);h.g.j.Mb(a,h.aa.ve)};
  h.aa.Ya=function(){if(h.aa.isVisible()){h.aa.Od=null;var a=h.aa.ab;a.style.display="none";a.style.left="";a.style.top="";h.aa.Tn&&h.aa.Tn();h.aa.Tn=null;a.textContent="";h.aa.qe&&(h.g.j.$c(a,h.aa.qe),h.aa.qe="");h.aa.ve&&(h.g.j.$c(a,h.aa.ve),h.aa.ve="");Sa(h.Fg())}};h.aa.isVisible=function(){return!!h.aa.Od};h.aa.Dl=function(a){h.aa.Od==a&&h.aa.Ya()};h.aa.Zl=function(a,c,d){h.aa.ab.style.left=a+"px";h.aa.ab.style.top=c+"px";h.aa.ab.style.height=d+"px"};
  h.aa.aE=function(a,c,d,e){var f=h.aa.LB(a,c,d);a=h.aa.KB(a,c,d,e);0>f?h.aa.Zl(a,0,d.height+f):h.aa.Zl(a,f,d.height)};h.aa.KB=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.LB=function(a,c,d){return c.bottom+d.height>=a.bottom?c.top-d.height:c.bottom};h.Sa={};h.Sa.Nn=null;h.Sa.Jc=null;h.Sa.show=function(a,c,d){h.aa.show(h.Sa,d,h.Sa.I);if(c.length){var e=h.Sa.$D(c,d);h.Sa.Jc=e;h.Sa.bE(e,a,d);setTimeout(function(){e.focus()},1);h.Sa.Nn=null}else h.Sa.Ya()};h.Sa.$D=function(a,c){var d=new h.Qp;d.ih(h.g.Ab.hn.vA);for(var e=0,f;f=a[e];e++){var g=new h.Rp(f.text);g.st=c;g.ih(h.g.Ab.hn.wA);d.oe.push(g);g.af(f.enabled);f.enabled&&Pb(g,function(){h.Sa.Ya();this.gb(this.scope)},f)}return d};
  h.Sa.bE=function(a,c,d){var e=h.g.UC();c=new h.g.Rect(c.clientY+e.top,c.clientY+e.top,c.clientX+e.left,c.clientX+e.left);h.Sa.eC(a);var f=a.If();d&&(c.left+=f.width,c.right+=f.width,e.left+=f.width,e.right+=f.width);h.aa.aE(e,c,f,d);a.focus()};h.Sa.eC=function(a){a.Ja(h.aa.ab);var c=a.cb;h.g.j.Mb(c,"blocklyContextMenu");h.N.Ca(c,"contextmenu",null,h.g.MD);a.focus()};h.Sa.Ya=function(){h.aa.Dl(h.Sa);h.Sa.Nn=null};h.Sa.I=function(){h.Sa.Jc&&(h.Sa.Jc.I(),h.Sa.Jc=null)};
  h.Sa.JI=function(a,c){return function(){h.h.disable();try{var d=h.K.Bj(c,a.B),e=a.Xa();e.x=a.L?e.x-h.kc:e.x+h.kc;e.y+=2*h.kc;d.moveBy(e.x,e.y)}finally{h.h.enable()}h.h.isEnabled()&&!d.Qa&&h.h.Ga(new (h.h.get(h.h.qh))(d));d.select()}};h.Sa.NI=function(a){return{text:h.P.REMOVE_COMMENT,enabled:!0,gb:function(){h.h.ta(!0);a.I(!0,!0);h.h.ta(!1)}}};h.Sa.OI=function(a){return{text:h.P.DUPLICATE_COMMENT,enabled:!0,gb:function(){h.duplicate(a)}}};
  h.Sa.aK=function(a,c){if(!h.kj)throw Error("Missing require for Blockly.WorkspaceCommentSvg");var d={enabled:!h.g.userAgent.Wd};d.text=h.P.ADD_COMMENT;d.gb=function(){var e=new h.kj(a,h.P.WORKSPACE_COMMENT_DEFAULT_TEXT,h.kj.wz,h.kj.wz),f=aa(a).getBoundingClientRect();f=new h.g.U(c.clientX-f.left,c.clientY-f.top);var g=h.g.xl(a.xb);f=h.g.U.fl(f,g);f.scale(1/a.scale);e.moveBy(f.x,f.y);a.ua&&(e.Nj(),e.Ja(),e.select())};return d};h.Ea=function(){h.Ea.v=this;this.sd={}};h.Ea.Cc={Qb:"block",Pc:"workspace"};h.Ea.v=null;h.Ea.prototype.register=function(a){if(this.sd[a.id])throw Error('Menu item with id "'+a.id+'" is already registered.');this.sd[a.id]=a};h.Ea.prototype.unregister=function(a){if(this.sd[a])delete this.sd[a];else throw Error('Menu item with id "'+a+'" not found.');};h.Ea.prototype.getItem=function(a){return this.sd[a]?this.sd[a]:null};
  function kc(a,c){var d=[],e=h.Ea.v.sd;Object.keys(e).forEach(function(f){f=e[f];if(a==f.td){var g=f.Db(c);"hidden"!=g&&(f={text:"function"==typeof f.Fc?f.Fc(c):f.Fc,enabled:"enabled"==g,gb:f.gb,scope:c,weight:f.weight},d.push(f))}});d.sort(function(f,g){return f.weight-g.weight});return d}new h.Ea;h.h.pg=function(a,c,d){h.h.pg.A.constructor.call(this,d);this.Lx=a;this.Jx=c};h.g.object.W(h.h.pg,h.h.Zd);h.h.pg.prototype.type=h.h.bj;h.h.pg.prototype.qa=function(){var a=h.h.pg.A.qa.call(this);a.oldElementId=this.Lx;a.newElementId=this.Jx;return a};h.h.pg.prototype.ba=function(a){h.h.pg.A.ba.call(this,a);this.Lx=a.oldElementId;this.Jx=a.newElementId};h.v.register(h.v.R.Fb,h.h.bj,h.h.pg);h.Gb=function(a,c){h.Gb.A.constructor.call(this,a,c);this.Oe=a.B.Kn[c];this.kw=a.B.Kn[h.$i[c]];this.Qf=new h.g.U(0,0);this.Wf=h.Gb.Ge.yv;this.Aa=null};h.g.object.W(h.Gb,h.xa);h.Gb.Ge={yv:-1,uv:0,hj:1};b=h.Gb.prototype;b.I=function(){h.Gb.A.I.call(this);this.Wf==h.Gb.Ge.hj&&lc(this.Oe,this,this.y)};b.ga=function(){return h.Gb.A.ga.call(this)};b.va=function(){return h.Gb.A.va.call(this)};function Xa(a,c){var d=a.x-c.x;a=a.y-c.y;return Math.sqrt(d*d+a*a)}
  function mc(a,c){if(!a.M.B.Xc()){var d=a.M.me();if(!d.Yc){var e=!1;if(!d.rc()){d=c.ga().me();if(!d.rc())return;c=a;e=!0}var f=h.selected==d;f||d.un();var g=c.x+h.kc+Math.floor(Math.random()*h.sp)-a.x,k=c.y+h.kc+Math.floor(Math.random()*h.sp)-a.y;e&&(k=-k);d.L&&(g=c.x-h.kc-Math.floor(Math.random()*h.sp)-a.x);d.moveBy(g,k);f||d.dm()}}}
  b.moveTo=function(a,c){if(this.Wf==h.Gb.Ge.yv){var d=this.Oe;d.Cb.splice(nc(d,c),0,this);this.Wf=h.Gb.Ge.hj}else this.Wf==h.Gb.Ge.hj&&(lc(this.Oe,this,this.y),d=this.Oe,d.Cb.splice(nc(d,c),0,this));this.x=a;this.y=c};b.moveBy=function(a,c){this.moveTo(this.x+a,this.y+c)};function oc(a,c){a.moveTo(c.x+a.Qf.x,c.y+a.Qf.y)}function F(a,c,d){a.Qf.x=c;a.Qf.y=d}
  function pc(a){var c=a.Aa.x-a.x,d=a.Aa.y-a.y;if(0!=c||0!=d){a=a.va();var e=a.ra();if(!e)throw Error("block is not rendered.");e=h.g.le(e);a.ra().setAttribute("transform","translate("+(e.x-c)+","+(e.y-d)+")");Aa(a,-c,-d)}}
  b.closest=function(a,c){var d=this.kw;if(d.Cb.length){var e=this.y,f=this.x;this.x=f+c.x;this.y=e+c.y;var g=nc(d,this.y);c=null;for(var k=a,l,m=g-1;0<=m&&Math.abs(d.Cb[m].y-this.y)<=a;)l=d.Cb[m],A(d.aw,this,l,!0,k)&&(c=l,k=Xa(l,this)),m--;for(;g<d.Cb.length&&Math.abs(d.Cb[g].y-this.y)<=a;)l=d.Cb[g],A(d.aw,this,l,!0,k)&&(c=l,k=Xa(l,this)),g++;this.x=f;this.y=e;a={connection:c,Vo:k}}else a={connection:null,Vo:a};return a};
  function Yb(a,c){c&&a.Wf==h.Gb.Ge.hj||!c&&a.Wf==h.Gb.Ge.uv||a.M.Yc||(c?(c=a.Oe,c.Cb.splice(nc(c,a.y),0,a),a.Wf=h.Gb.Ge.hj):(a.Wf==h.Gb.Ge.hj&&lc(a.Oe,a,a.y),a.Wf=h.Gb.Ge.uv))}function Xb(a){Yb(a,!0);var c=[];if(a.type!=h.X.Rb&&a.type!=h.X.Sb)return c;if(a=a.va()){if(a.isCollapsed()){var d=[];a.S&&d.push(a.S);a.Z&&d.push(a.Z);a.Y&&d.push(a.Y)}else d=a.je(!0);for(var e=0;e<d.length;e++)c.push.apply(c,Xb(d[e]));c.length||(c[0]=a)}return c}b.Lo=function(a){mc(this,a)};
  b.er=function(a,c){h.Gb.A.er.call(this,a,c);a.ua&&a.Ja();c.ua&&(fa(c),c.Ja(),c.ra().style.display="block")};b.em=function(){h.Gb.A.em.call(this);var a=this.va();a&&(a.Nj(),a.Ja(!1),a=this.ga(),a.ua&&a.Ja())};b.Ix=function(a){return qc(this.kw,this,a)};b.In=function(a){h.Gb.A.In.call(this,a);var c=this.ga();a=a.ga();var d=c.ua,e=a.ua;d&&fa(c);e&&fa(a);d&&e&&(this.type==h.X.Sb||this.type==h.X.ed?a.Ja():c.Ja());if(c=ma(c,a))c=c.isVisible(),a.ra().style.display=c?"block":"none"};
  b.Rx=function(){!this.isConnected()||this.Aa&&A(this.M.B.Me,this,this.Aa,!1)||(x(Ba(this)?this.va():this.M),this.M.Sc())};h.an=function(){this.Hd=this.fe=this.sb=null;this.type="marker"};function rc(a,c){var d=a.fe;a.fe=c;a.Hd&&a.Hd.draw(d,a.fe)}h.an.prototype.draw=function(){this.Hd&&this.Hd.draw(this.fe,this.fe)};h.an.prototype.Ya=function(){this.Hd&&this.Hd.Ya()};h.an.prototype.I=function(){this.Hd&&this.Hd.I()};h.cg=function(){h.cg.A.constructor.call(this);this.type="cursor"};h.g.object.W(h.cg,h.an);h.cg.prototype.next=function(){var a=this.fe;if(!a)return null;for(a=a.next();a&&a.next()&&(a.vb()==h.F.types.lg||a.vb()==h.F.types.Qb);)a=a.next();a&&rc(this,a);return a};h.cg.prototype.Kg=function(){var a=this.fe;if(!a)return null;if(a.vb()==h.F.types.ng||a.vb()==h.F.types.Gh)a=a.next();(a=a.Kg())&&rc(this,a);return a};
  h.cg.prototype.bh=function(){var a=this.fe;if(!a)return null;for(a=a.bh();a&&a.bh()&&(a.vb()==h.F.types.lg||a.vb()==h.F.types.Qb);)a=a.bh();a&&rc(this,a);return a};h.cg.prototype.Zg=function(){var a=this.fe;if(!a)return null;(a=a.Zg())&&a.vb()==h.F.types.Qb&&(a=a.bh()||a);a&&rc(this,a);return a};h.v.register(h.v.R.qk,h.v.rk,h.cg);h.sh=function(){h.sh.A.constructor.call(this)};h.g.object.W(h.sh,h.cg);h.sh.wE="basicCursor";b=h.sh.prototype;b.next=function(){var a=this.fe;if(!a)return null;(a=sc(this,a,this.Qt))&&rc(this,a);return a};b.Kg=function(){return this.next()};b.bh=function(){var a=this.fe;if(!a)return null;(a=tc(this,a,this.Qt))&&rc(this,a);return a};b.Zg=function(){return this.bh()};
  function sc(a,c,d){if(!c)return null;var e=c.Kg()||c.next();if(d(e))return e;if(e)return sc(a,e,d);c=uc(a,c.Zg());return d(c)?c:c?sc(a,c,d):null}function tc(a,c,d){if(!c)return null;var e=c.bh();e=e?vc(a,e):c.Zg();return d(e)?e:e?tc(a,e,d):null}b.Qt=function(a){var c=!1;a=a&&a.vb();if(a==h.F.types.Gh||a==h.F.types.yd||a==h.F.types.Ac||a==h.F.types.lg||a==h.F.types.ng||a==h.F.types.Pc)c=!0;return c};function uc(a,c){if(!c)return null;var d=c.next();return d?d:uc(a,c.Zg())}
  function vc(a,c){if(!c.Kg())return c;for(c=c.Kg();c.next();)c=c.next();return vc(a,c)}h.v.register(h.v.R.qk,h.sh.wE,h.sh);h.nq=function(){h.nq.A.constructor.call(this)};h.g.object.W(h.nq,h.sh);h.nq.prototype.Qt=function(a){a&&a.vb();return!1};h.$a=function(a,c,d){this.O=h.g.j.J(h.g.D.Nc,{},null);this.O.zm="";this.style=wc(a.ob.ea(),null);this.wb=a.ob.Ax(this.O,this.style);this.jt=this.ua=!1;this.B=a;this.Y=this.Z=this.S=null;this.Em=h.g.ii()&&!!a.jd;var e=this.wb.Eb;e.Sd=this;h.G.pj(e);h.$a.A.constructor.call(this,a,c,d);this.O.dataset?this.O.dataset.id=this.id:h.g.userAgent.Wd&&this.O.setAttribute("data-id",this.id)};h.g.object.W(h.$a,h.Yf);h.$a.prototype.height=0;h.$a.prototype.width=0;h.$a.prototype.lp=null;h.$a.tG=-1;h.$a.DF="TEMP_COLLAPSED_WARNING_";
  b=h.$a.prototype;b.Nj=function(){if(!this.B.ua)throw TypeError("Workspace is headless.");for(var a=0,c;c=this.T[a];a++)c.za();c=va(this);for(a=0;a<c.length;a++)c[a].bC();this.dc();sa(this.wb,"blocklyDraggable",this.rc());a=this.ra();this.B.options.readOnly||this.vC||!a||h.N.Ca(a,"mousedown",this,this.Wg);this.vC=!0;a.parentNode||this.B.xb.appendChild(a)};
  b.select=function(){if(this.Qa&&this.getParent())this.getParent().select();else if(h.selected!=this){var a=null;if(h.selected){a=h.selected.id;h.h.disable();try{pb(h.selected)}finally{h.h.enable()}}a=new (h.h.get(h.h.bj))(a,this.id,this.B.id);h.h.Ga(a);h.selected=this;this.un()}};function pb(a){if(h.selected==a){var c=new (h.h.get(h.h.bj))(a.id,null,a.B.id);c.Wb=a.B.id;h.h.Ga(c);h.selected=null;a.dm()}}b.pe=null;b.Qh=null;b.Ed=null;b.Sy=null;
  function va(a){var c=[];a.pe&&c.push(a.pe);a.Ed&&c.push(a.Ed);a.Sy&&c.push(a.Sy);return c}b.Zo=function(a){var c=this.Ze;if(a!=c){h.g.j.pm();h.$a.A.Zo.call(this,a);h.g.j.qm();var d=this.ra();if(!this.B.ds&&d){var e=this.Xa();a?(a.ra().appendChild(d),a=this.Xa(),Aa(this,a.x-e.x,a.y-e.y)):c&&(this.B.xb.appendChild(d),this.translate(e.x,e.y));this.dc()}}};
  b.Xa=function(){var a=0,c=0,d=this.Em?this.B.jd.Vb():null,e=this.ra();if(e){do{var f=h.g.le(e);a+=f.x;c+=f.y;this.Em&&this.B.jd.Pe.firstChild==e&&(f=this.B.jd.Nr(),a+=f.x,c+=f.y);e=e.parentNode}while(e&&e!=this.B.xb&&e!=d)}return new h.g.U(a,c)};b.moveBy=function(a,c){if(this.Ze)throw Error("Block has parent.");var d=h.h.isEnabled();if(d)var e=new (h.h.get(h.h.rh))(this);var f=this.Xa();this.translate(f.x+a,f.y+c);Aa(this,a,c);d&&(e.Ai(),h.h.Ga(e));ha(this.B)};
  b.translate=function(a,c){this.ra().setAttribute("transform","translate("+a+","+c+")")};b.moveTo=function(a){var c=this.Xa();this.moveBy(a.x-c.x,a.y-c.y)};b.Cs=function(a){this.Em?this.B.jd.Ki(a.x,a.y):(this.O.zm="translate("+a.x+","+a.y+")",this.O.setAttribute("transform",this.O.zm+this.O.om))};
  function xc(a){if(a.B&&!a.B.Xc()&&!a.getParent()&&!a.Yc){var c=a.B.Id;if(c&&c.OE){var d=c.Ct,e=d/2,f=a.Xa();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)}}}b.Yh=function(){var a=this.Xa(),c=z(this);if(this.L){var d=a.x-c.width;var e=a.x}else d=a.x,e=a.x+c.width;return new h.g.Rect(a.y,a.y+c.height,d,e)};b.Ol=function(){this.wb.lb=this.B.ob.ea();for(var a=0,c;c=this.T[a];a++)c.Ol()};
  b.Di=function(a){this.Oh!=a&&(h.$a.A.Di.call(this,a),a?this.ua&&this.Ja():yc(this))};function yc(a){for(var c=a.isCollapsed(),d=h.lb.Pm,e=h.lb.Om,f=0,g;g=a.T[f];f++)g.name!=d&&g.Hb(!c);if(c){g=va(a);for(f=0;c=g[f];f++)c.Hb(!1);f=a.toString(h.jz);(g=ka(a,e))?g.setValue(f):(g=ia(a,d)||ac(a,d),D(g,new h.bd(f),e))}else fa(a),a.gt(d)}
  b.Wg=function(a){var c=this.B&&this.B.Eg(a);if(c){if(c.bi)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");Ab(c,this);c.Ld=a}};b.showHelp=function(){var a="function"==typeof this.Mj?this.Mj():this.Mj;a&&window.open(a)};b.lm=function(a){if(this.B.options.readOnly||!this.contextMenu)var c=null;else c=kc(h.Ea.Cc.Qb,{block:this}),this.gC&&this.gC(c);c&&c.length&&(h.Sa.show(a,c,this.L),h.Sa.Nn=this)};
  function Aa(a,c,d){if(a.ua){for(var e=a.je(!1),f=0;f<e.length;f++)e[f].moveBy(c,d);e=va(a);for(f=0;f<e.length;f++)e[f].VB();for(f=0;f<a.Af.length;f++)Aa(a.Af[f],c,d)}}b.gh=function(a){if(a){var c=this.ra();c.zm="";c.om="";h.Dj=h.Dj.concat(this.je(!0));h.g.j.Mb(this.O,"blocklyDragging")}else h.Dj=[],h.g.j.$c(this.O,"blocklyDragging");for(c=0;c<this.Af.length;c++)this.Af[c].gh(a)};b.vt=function(a){h.$a.A.vt.call(this,a);sa(this.wb,"blocklyDraggable",a)};
  b.ut=function(a){h.$a.A.ut.call(this,a);a=va(this);for(var c=0;c<a.length;c++)Cb(a[c])};b.yt=function(a){h.$a.A.yt.call(this,a);this.dc()};b.vy=function(a){this.Sj!=a&&(this.Sj=a)&&(this.re(this.B.ob.ea().Ip),sa(this.wb,"blocklyInsertionMarker",!0))};b.ra=function(){return this.O};
  b.I=function(a,c){if(this.B){h.G.I();h.G.Nt(this.wb.Eb);h.g.j.pm();var d=this.B;h.selected==this&&(pb(this),zc(this.B));h.Sa.Nn==this&&h.Sa.Ya();c&&this.ua&&(x(this,a),h.bb.nC(this));this.ua=!1;if(this.lp){for(var e in this.lp)clearTimeout(this.lp[e]);this.lp=null}c=va(this);for(e=0;e<c.length;e++)c[e].I();h.$a.A.I.call(this,!!a);h.g.j.removeNode(this.O);ha(d);this.O=null;h.g.j.qm()}};
  b.dc=function(){this.wb.dc(this);for(var a=va(this),c=0;c<a.length;c++)a[c].dc();for(a=0;c=this.T[a];a++)for(var d=0,e;e=c.eb[d];d++)e.dc()};function fa(a){var c=ca(a,!1);a.dc();if(!a.isCollapsed()){a=0;for(var d;d=c[a];a++)d.ua&&fa(d)}}b.KC=function(){return this.Ed};
  b.ak=function(a){if(!h.Comment)throw Error("Missing require for Blockly.Comment");this.ce.text!=a&&(h.$a.A.ak.call(this,a),a=null!=a,!!this.Ed==a?this.Ed.$J():(a?this.Qh=this.Ed=new h.Comment(this):(this.Ed.I(),this.Qh=this.Ed=null),this.ua&&(this.Ja(),this.Sc())))};b.wy=function(a){this.pe&&this.pe!==a&&this.pe.I();a&&(a.LJ(this),this.pe=a,a.bC());this.ua&&(this.Ja(),this.Sc())};b.af=function(a){this.isEnabled()!=a&&(h.$a.A.af.call(this,a),this.ua&&!$b(this)&&fa(this))};
  b.se=function(a){this.ua&&this.wb.Jy(a)};b.un=function(){sa(this.wb,"blocklySelected",!0)};b.dm=function(){sa(this.wb,"blocklySelected",!1)};b.hm=function(a){sa(this.wb,"blocklyDraggingDelete",a)};b.Gr=function(){return this.style.Ph};b.re=function(a){h.$a.A.re.call(this,a);a=Ac(this.B.ob.ea(),this.Dd);this.wb.Hi(a.style);this.style=a.style;this.rm=a.name;this.dc()};
  b.Hi=function(a){var c=wc(this.B.ob.ea(),a);this.rm=a;if(c)this.Ue=c.Ue,this.wb.Hi(c),this.Dd=c.Ph,this.style=c,this.dc();else throw Error("Invalid style name: "+a);};function Ca(a){do{var c=a.ra(),d=c.parentNode,e=d.childNodes;e[e.length-1]!==c&&d.appendChild(c);a=a.getParent()}while(a)}b.Gi=function(a,c){h.$a.A.Gi.call(this,a,c);this.ua&&(this.Ja(),this.Sc())};b.bk=function(a,c){h.$a.A.bk.call(this,a,c);this.ua&&(this.Ja(),this.Sc())};
  b.wt=function(a,c){h.$a.A.wt.call(this,a,c);this.ua&&(this.Ja(),this.Sc())};b.Fi=function(a){h.$a.A.Fi.call(this,a);this.ua&&(this.Ja(),this.Sc())};b.gt=function(a,c){a=h.$a.A.gt.call(this,a,c);this.ua&&(this.Ja(),this.Sc());return a};b.xf=function(a,c){a=h.$a.A.xf.call(this,a,c);this.ua&&(this.Ja(),this.Sc());return a};
  function ea(a,c){a.Y&&Yb(a.Y,c);a.S&&Yb(a.S,c);if(a.Z){Yb(a.Z,c);var d=a.Z.va();d&&ea(d,c)}if(!a.Oh)for(d=0;d<a.T.length;d++){var e=a.T[d].connection;e&&(Yb(e,c),(e=e.va())&&ea(e,c))}}b.je=function(a){var c=[];if(a||this.ua)if(this.S&&c.push(this.S),this.Y&&c.push(this.Y),this.Z&&c.push(this.Z),a||!this.Oh){a=0;for(var d;d=this.T[a];a++)d.connection&&c.push(d.connection)}return c};b.vo=function(){return h.$a.A.vo.call(this)};b.Jr=function(a,c){return h.$a.A.Jr.call(this,a,c)};
  b.Nl=function(a){return new h.Gb(this,a)};b.Sc=function(){if(this.B&&!this.B.Xc()){var a=this.me();if(!a.Yc)for(var c=this.je(!1),d=0,e;e=c[d];d++){e.isConnected()&&Ba(e)&&e.va().Sc();for(var f=e.Ix(h.kc),g=0,k;k=f[g];g++)e.isConnected()&&k.isConnected()||k.ga().me()!=a&&(Ba(e)?mc(k,e):mc(e,k))}}};function Da(a){var c=h.h.Vb();setTimeout(function(){h.h.ta(c);xc(a);h.h.ta(!1)},h.rp/2);setTimeout(function(){h.h.ta(c);a.Sc();h.h.ta(!1)},h.rp)}b.getParent=function(){return h.$a.A.getParent.call(this)};
  b.me=function(){return h.$a.A.me.call(this)};b.Ja=function(a){if(!this.jt){this.jt=!0;try{this.ua=!0;h.g.j.pm();this.isCollapsed()&&yc(this);this.B.ob.Ja(this);var c=this.Xa();this.Y&&oc(this.Y,c);this.S&&oc(this.S,c);for(var d=0;d<this.T.length;d++){var e=this.T[d].connection;e&&(oc(e,c),e.isConnected()&&pc(e))}this.Z&&(oc(this.Z,c),this.Z.isConnected()&&pc(this.Z));if(!1!==a){var f=this.getParent();f?f.Ja(!0):ha(this.B)}h.g.j.qm();this.Pt()}finally{this.jt=!1}}};
  b.Pt=function(){this.B.Ll&&this.wb.cl&&this.B.vl().draw();this.B.Ll&&this.wb.xs&&this.B.yl(h.Hk.Ku).draw()};b.Sf=function(a){this.wb.Sf(a)};b.hh=function(a){this.wb.hh(a)};function z(a){var c=a.height,d=a.width,e=t(a);e&&(e=z(e),a=a.B.ob.ea().Up,c+=e.height-a,d=Math.max(d,e.width));return{height:c,width:d}};h.Vi=function(a){this.Cb=[];this.aw=a};function Bc(a,c,d){if(!a.Cb.length)return-1;var e=nc(a,d);if(e>=a.Cb.length)return-1;d=c.y;for(var f=e;0<=f&&a.Cb[f].y==d;){if(a.Cb[f]==c)return f;f--}for(;e<a.Cb.length&&a.Cb[e].y==d;){if(a.Cb[e]==c)return e;e++}return-1}function nc(a,c){if(!a.Cb.length)return 0;for(var d=0,e=a.Cb.length;d<e;){var f=Math.floor((d+e)/2);if(a.Cb[f].y<c)d=f+1;else if(a.Cb[f].y>c)e=f;else{d=f;break}}return d}
  function lc(a,c,d){c=Bc(a,c,d);if(-1==c)throw Error("Unable to find connection in connectionDB.");a.Cb.splice(c,1)}function qc(a,c,d){function e(n){var q=g-f[n].x,p=k-f[n].y;Math.sqrt(q*q+p*p)<=d&&m.push(f[n]);return p<d}var f=a.Cb,g=c.x,k=c.y;a=0;for(var l=c=f.length-2;a<l;)f[l].y<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.Vi.za=function(a){var c=[];c[h.X.Rb]=new h.Vi(a);c[h.X.cd]=new h.Vi(a);c[h.X.Sb]=new h.Vi(a);c[h.X.ed]=new h.Vi(a);return c};h.h.rg=function(a,c){h.h.rg.A.constructor.call(this,c);this.Ey=a};h.g.object.W(h.h.rg,h.h.Zd);h.h.rg.prototype.type=h.h.kq;h.h.rg.prototype.qa=function(){var a=h.h.rg.A.qa.call(this);a.themeName=this.Ey;return a};h.h.rg.prototype.ba=function(a){h.h.rg.A.ba.call(this,a);this.Ey=a.themeName};h.v.register(h.v.R.Fb,h.h.kq,h.h.rg);h.h.ug=function(a,c,d,e,f){h.h.ug.A.constructor.call(this,e);this.hf=a;this.gf=c;this.scale=d;this.Js=f};h.g.object.W(h.h.ug,h.h.Zd);h.h.ug.prototype.type=h.h.rn;h.h.ug.prototype.qa=function(){var a=h.h.ug.A.qa.call(this);a.viewTop=this.hf;a.viewLeft=this.gf;a.scale=this.scale;a.oldScale=this.Js;return a};h.h.ug.prototype.ba=function(a){h.h.ug.A.ba.call(this,a);this.hf=a.viewTop;this.gf=a.viewLeft;this.scale=a.scale;this.Js=a.oldScale};h.v.register(h.v.R.Fb,h.h.rn,h.h.ug);h.Ch=function(a,c){this.Jj=a;this.Ct=c.spacing;this.yx=c.length;this.vD=(this.ps=a.firstChild)&&this.ps.nextSibling;this.OE=c.snap};h.Ch.prototype.fh=1;h.Ch.prototype.I=function(){this.Jj=null};h.Ch.prototype.update=function(a){this.fh=a;var c=this.Ct*a||100;this.Jj.setAttribute("width",c);this.Jj.setAttribute("height",c);c=Math.floor(this.Ct/2)+.5;var d=c-this.yx/2,e=c+this.yx/2;c*=a;d*=a;e*=a;Cc(this.ps,a,d,e,c,c);Cc(this.vD,a,c,c,d,e)};
  function Cc(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.Ch.prototype.moveTo=function(a,c){this.Jj.setAttribute("x",a);this.Jj.setAttribute("y",c);(h.g.userAgent.Wd||h.g.userAgent.zh)&&this.update(this.fh)};
  h.Ch.Ua=function(a,c,d){a=h.g.j.J(h.g.D.cv,{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},d);0<c.length&&0<c.spacing?(h.g.j.J(h.g.D.Ek,{stroke:c.colour},a),1<c.length&&h.g.j.J(h.g.D.Ek,{stroke:c.colour},a)):h.g.j.J(h.g.D.Ek,{},a);return a};h.Hk=function(a){this.Df=this.Fd=null;this.Pl={};this.m=a};h.Hk.Ku="local_marker_1";b=h.Hk.prototype;b.vl=function(){return this.Fd};b.yl=function(a){return this.Pl[a]};b.Sf=function(a){a?(this.m.xb.appendChild(a),this.Df=a):this.Df=null};b.hh=function(a){a?this.m.xb&&(this.Df?this.m.xb.insertBefore(a,this.Df):this.m.xb.appendChild(a)):this.Pf=null};
  b.I=function(){for(var a=Object.keys(this.Pl),c=0,d;d=a[c];c++){var e=this.Pl[d];if(e)e.I(),delete this.Pl[d];else throw Error("Marker with id "+d+" does not exist. Can only unregistermarkers that exist.");}this.Pl=null;this.Fd&&(this.Fd.I(),this.Fd=null)};h.og=function(){this.$x={};this.hp={}};function Dc(a,c){a.$x[c.id]=c;for(var d=0,e;e=c.types[d];d++)e=String(e).toLowerCase(),void 0===a.hp[e]?a.hp[e]=[c.id]:a.hp[e].push(c.id)}function Ec(a){var c=a.hp[String(h.og.R.Xp).toLowerCase()];if(!c)return[];var d=[],e=[],f=a.$x;c.forEach(function(g){e.push(f[g])});e.sort(function(g,k){return g.weight-k.weight});e.forEach(function(g){d.push(g.Zx)});return d}h.og.R=function(a){this.Ul=a};h.og.R.prototype.toString=function(){return this.Ul};h.og.R.Xp=new h.og.R("positionable");h.tv=function(a,c){this.m=a;this.Uf=c;this.sm=[];this.Ke=Object.create(null)};b=h.tv.prototype;b.Jf=function(){return this.Uf};b.km=function(a){var c=this.Uf;this.Uf=a;if(a=aa(this.m))c&&h.g.j.$c(a,c.ie()),h.g.j.Mb(a,this.Uf.ie());for(c=0;a=this.sm[c];c++)Fc(a);c=0;a=Object.keys(this.Ke);for(var d;d=a[c];c++)for(var e=0,f;f=this.Ke[d][e];e++)f.element.style[f.propertyName]=this.Uf&&Ya(this.Uf,d)||"";h.ec()};
  b.subscribe=function(a,c,d){this.Ke[c]||(this.Ke[c]=[]);this.Ke[c].push({element:a,propertyName:d});a.style[d]=this.Uf&&Ya(this.Uf,c)||""};b.unsubscribe=function(a){if(a)for(var c=Object.keys(this.Ke),d=0,e;e=c[d];d++){for(var f=this.Ke[e],g=f.length-1;0<=g;g--)f[g].element===a&&f.splice(g,1);this.Ke[e].length||delete this.Ke[e]}};b.I=function(){this.Ke=this.sm=this.Uf=this.Od=null};h.Oc=function(a,c){h.Oc.A.constructor.call(this,a,c);this.po=!1;this.kd=Object.create(null);this.Ay=this.$l=0;this.qx=this.Os=null};h.g.object.W(h.Oc,h.Ce);h.Oc.mB=5;h.Oc.nB=6;b=h.Oc.prototype;b.jr=function(a){this.qx=this.Ib.options.zb&&this.Ib.options.zb.Xx;h.Oc.A.jr.call(this,a);!this.no&&h.Touch.uo(a)&&Gc(this,a)};
  b.pj=function(a){this.Os=h.N.Ca(document,"mousedown",null,this.bD.bind(this),!0);this.No=h.N.Ca(document,"mousemove",null,this.Kj.bind(this),!0);this.Oo=h.N.Ca(document,"mouseup",null,this.co.bind(this),!0);a.preventDefault();a.stopPropagation()};b.bD=function(a){!this.Xc()&&h.Touch.uo(a)&&(Gc(this,a),this.po&&h.Sg())};
  b.Kj=function(a){if(this.Xc())h.Touch.Bt(a)&&h.Oc.A.Kj.call(this,a);else if(this.po){if(h.Touch.uo(a)){this.kd[h.Touch.ao(a)]=Hc(this,a);var c=Object.keys(this.kd);if(this.qx&&2===c.length){c=Object.keys(this.kd);c=h.g.U.ir(this.kd[c[0]],this.kd[c[1]])/this.Ay;if(0<this.$l&&Infinity>this.$l){var d=c-this.$l;d=0<d?d*h.Oc.mB:d*h.Oc.nB;var e=this.Ib,f=h.g.Tl(a,y(e),Ta(e));e.zoom(f.x,f.y,d)}this.$l=c;a.preventDefault()}else h.Oc.A.Kj.call(this,a)}h.Sg()}else h.Oc.A.Kj.call(this,a)};
  b.co=function(a){if(h.Touch.uo(a)&&!this.Xc()){var c=h.Touch.ao(a);this.kd[c]&&delete this.kd[c];2>Object.keys(this.kd).length&&(this.kd=Object.create(null),this.$l=0)}!this.po||this.Xc()?h.Touch.Bt(a)&&h.Oc.A.co.call(this,a):(a.preventDefault(),a.stopPropagation(),this.I())};b.I=function(){h.Oc.A.I.call(this);this.Os&&h.N.yb(this.Os)};function Gc(a,c){a.kd[h.Touch.ao(c)]=Hc(a,c);var d=Object.keys(a.kd);2==d.length&&(a.Ay=h.g.U.ir(a.kd[d[0]],a.kd[d[1]]),a.po=!0,c.preventDefault())}
  function Hc(a,c){return a.Ib?new h.g.U(c.pageX?c.pageX:c.changedTouches[0].pageX,c.pageY?c.pageY:c.changedTouches[0].pageY):null};h.Av=function(a){this.Ts=a;this.Lk=Object.create(null)};b=h.Av.prototype;b.ks=null;b.I=function(){this.Lk=this.Ts=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.Lk[c]=e)}};
  b.preload=function(){for(var a in this.Lk){var c=this.Lk[a];c.volume=.01;var d=c.play();void 0!==d?d.then(c.pause).catch(function(){}):c.pause();if(h.g.userAgent.Bk||h.g.userAgent.Fu)break}};b.play=function(a,c){var d=this.Lk[a];d?(a=new Date,null!=this.ks&&a-this.ks<h.WA||(this.ks=a,d=h.g.userAgent.Bk||h.g.userAgent.Hm?d:d.cloneNode(),d.volume=void 0===c?1:c,d.play())):this.Ts&&this.Ts.Rc.play(a,c)};h.Cv=function(a){this.Yk=a;this.Ua()};b=h.Cv.prototype;b.kb=null;b.Yk=null;b.Ua=function(){this.kb||(this.kb=h.g.j.J(h.g.D.ej,{xmlns:h.g.j.nn,"xmlns:html":h.g.j.Fp,"xmlns:xlink":h.g.j.hd,version:"1.1","class":"blocklyWsDragSurface blocklyOverflowVisible"},null),this.Yk.appendChild(this.kb))};b.Ki=function(a,c){a=a.toFixed(0);c=c.toFixed(0);this.kb.style.display="block";h.g.j.gm(this.kb,"translate3d("+a+"px, "+c+"px, 0px)")};b.Nr=function(){return h.g.le(this.kb)};
  b.Cn=function(a){if(!a)throw Error("Couldn't clear and hide the drag surface: missing new surface.");var c=this.kb.childNodes[0],d=this.kb.childNodes[1];if(!(c&&d&&h.g.j.Rr(c,"blocklyBlockCanvas")&&h.g.j.Rr(d,"blocklyBubbleCanvas")))throw Error("Couldn't clear and hide the drag surface. A node was missing.");null!=this.at?h.g.j.Oj(c,this.at):a.insertBefore(c,a.firstChild);h.g.j.Oj(d,c);this.kb.style.display="none";if(this.kb.childNodes.length)throw Error("Drag surface was not cleared.");h.g.j.gm(this.kb,
  "");this.at=null};
  h.cc=function(a,c,d){h.cc.A.constructor.call(this,a);this.rd=new (h.v.Dg(h.v.R.Pu,a,!0))(this);this.ke=a.ke||this.rd.ke.bind(this.rd);this.im=a.im||h.cc.JE;this.Ys=new h.og;this.Kn=h.Vi.za(this.Me);c&&(this.jd=c);d&&(this.Oi=d);this.jp=!!this.Oi&&h.g.ii();this.El=[];this.Rc=new h.Av(a.Zc);this.Id=this.options.Qr?new h.Ch(this.options.Qr,a.Yw):null;this.ne=new h.Hk(this);this.Kt={};this.Dw={};h.oa&&h.oa.Wh&&Ic(this,h.ij,h.oa.Wh);h.wv&&h.wv.Wh&&Ic(this,h.hB,h.wv.Wh);h.Ta&&h.Ta.Wh&&(Ic(this,h.dv,h.Ta.Wh),
  C(this,h.Ta.HD));this.jc=this.options.Zc?this.options.Zc.jc:new h.tv(this,this.options.XE||h.sf.$f);this.jc.sm.push(this);this.ob=h.i.za(this.options.mt||"geras",this.Jf(),this.options.nt);this.Jq=null;this.Ll=!1;this.xm=[];this.Iq=new h.g.gd(0,0)};h.g.object.W(h.cc,h.qb);b=h.cc.prototype;b.Xo=null;b.ua=!0;b.Nf=!0;b.Lf=!1;b.qo=!1;b.qt=!0;b.scrollX=0;b.scrollY=0;b.yw=null;b.scale=1;b.Ks=1;b.Qx=0;b.Nx=0;b.xc=null;b.ib=null;b.ma=null;b.Na=null;b.oc=null;b.jd=null;b.Oi=null;b.jp=!1;b.mo=!1;b.$r=null;
  b.xx=null;b.Ka=null;b.ox=null;b.bs=!0;b.Sf=function(a){this.ne.Sf(a)};b.hh=function(a){this.ne.hh(a)};b.yl=function(a){return this.ne?this.ne.yl(a):null};b.vl=function(){return this.ne?this.ne.vl():null};b.Jf=function(){return this.jc.Jf()};b.km=function(a){a||(a=h.sf.$f);this.jc.km(a)};function Fc(a){a.O&&a.ob.ct(a.O,a.Jf());Jc(B(a,!1).filter(function(c){return void 0!==c.rm}));Kc(a);a.Na&&Fc(a.Na);a.isVisible()&&a.Hb(!0);a=new (h.h.get(h.h.kq))(a.Jf().name,a.id);h.h.Ga(a)}
  function Jc(a){for(var c=0,d;d=a[c];c++){var e=d.rm;e&&(d.Hi(e),d.pe&&d.pe.ZJ())}}function Ta(a){if(a.bs){var c=y(a).getScreenCTM();c&&(a.ox=c.inverse(),a.bs=!1)}return a.ox}b.Cm=function(){this.bs=!0};b.isVisible=function(){return this.Nf};function na(a,c){var d=0,e=0,f=1;if(h.g.j.containsNode(a.xb,c)||h.g.j.containsNode(a.Tf,c))f=a.scale;do{var g=h.g.le(c);if(c==a.xb||c==a.Tf)f=1;d+=g.x*f;e+=g.y*f;c=c.parentNode}while(c&&c!=y(a));return new h.g.U(d,e)}
  function jc(a){a=a.Iq;return new h.g.gd(a.width,a.height)}function aa(a){if(!a.$r)for(var c=a.O;c;){if(-1!=(" "+(c.getAttribute("class")||"")+" ").indexOf(" injectionDiv ")){a.$r=c;break}c=c.parentNode}return a.$r}
  b.Ua=function(a){this.O=h.g.j.J(h.g.D.Nc,{"class":"blocklyWorkspace"},null);a&&(this.hc=h.g.j.J(h.g.D.Lb,{height:"100%",width:"100%","class":a},this.O),"blocklyMainBackground"==a&&this.Id?this.hc.style.fill="url(#"+this.Id.Jj.id+")":this.jc.subscribe(this.hc,"workspaceBackgroundColour","fill"));this.xb=h.g.j.J(h.g.D.Nc,{"class":"blocklyBlockCanvas"},this.O);this.Tf=h.g.j.J(h.g.D.Nc,{"class":"blocklyBubbleCanvas"},this.O);this.Lf||(h.N.Ca(this.O,"mousedown",this,this.Wg,!1,!0),h.N.Ca(this.O,"wheel",
  this,this.VD));this.options.Bl&&(this.Na=new (h.v.Dg(h.v.R.cB,this.options,!0))(this));this.Id&&this.Id.update(this.scale);Lc(this);var c=h.v.Dg(h.v.R.qk,this.options);c&&(a=this.ne,c=new c,a.Fd&&a.Fd.Hd&&a.Fd.Hd.I(),a.Fd=c,a.Fd&&(c=a.Fd,c=new h.i.hg(a.m,a.m.ob.ea(),c),a.Fd.Hd=c,a.Sf(a.Fd.Hd.Ua())));this.ob.Ua(this.O,this.Jf());return this.O};
  b.I=function(){this.ua=!1;this.oc&&this.oc.cancel();this.O&&(h.g.j.removeNode(this.O),this.O=null);this.Tf=this.xb=null;this.Na&&(this.Na.I(),this.Na=null);this.ma&&(this.ma.I(),this.ma=null);this.xc&&(this.xc.I(),this.xc=null);this.ib&&(this.ib.I(),this.ib=null);this.jk&&(this.jk.I(),this.jk=null);this.Rc&&(this.Rc.I(),this.Rc=null);this.Id&&(this.Id.I(),this.Id=null);this.ob.I();this.ne&&(this.ne.I(),this.ne=null);h.cc.A.I.call(this);if(this.jc){var a=this.jc,c=a.sm.indexOf(this);if(0>c)throw Error("Cannot unsubscribe a workspace that hasn't been subscribed.");
  a.sm.splice(c,1);this.jc.unsubscribe(this.hc);this.options.Zc||(this.jc.I(),this.jc=null)}this.Dw=this.Kt=this.Kn=null;this.options.Zc||(a=y(this))&&a.parentNode&&h.g.j.removeNode(a.parentNode);this.Xo&&(h.N.yb(this.Xo),this.Xo=null)};b.Ds=function(a,c){return new h.$a(this,a,c)};function E(a,c){return a.ma||c?a.ma:a.Na?E(a.Na):null}function ha(a){a.qt&&a.ua&&(a.ib&&a.ib.resize(),a.Cm())}
  b.resize=function(){this.Na&&this.Na.position();this.ma&&this.ma.position();var a=Ec(this.Ys);var c=this.rd;c={Ry:c.Te(),uq:c.rl(),Hy:ic(c)};for(var d=[],e=0,f;f=a[e];e++)f.position(c,d),d.push(f.Yh());this.ib&&this.ib.resize();this.Cm();Lc(this)};function tb(a){var c=h.g.OC();h.g.U.Gf(a.xx,c)||(a.xx=c,a.Cm(),Lc(a))}function Mc(a,c,d){var e=y(a);c&&(a.Iq.width=c,e.JB=c);d&&(a.Iq.height=d,e.IB=d)}
  function y(a){if(!a.Jq)for(var c=a.O;c;){if("svg"==c.tagName){a.Jq=c;break}c=c.parentNode}return a.Jq}function Ea(a){if(h.h.isEnabled()){var c=a.scale,d=-a.scrollY,e=-a.scrollX;if(!(c==a.Ks&&1>Math.abs(d-a.Qx)&&1>Math.abs(e-a.Nx))){var f=new (h.h.get(h.h.rn))(d,e,c,a.id,a.Ks);a.Ks=c;a.Qx=d;a.Nx=e;h.h.Ga(f)}}}
  b.translate=function(a,c){if(this.jp&&this.mo)this.Oi.Ki(a,c);else{var d="translate("+a+","+c+") scale("+this.scale+")";this.xb.setAttribute("transform",d);this.Tf.setAttribute("transform",d)}if(this.jd){d=this.jd;var e=this.scale;d.fh=e;d.Pe.setAttribute("transform","translate("+a.toFixed(0)+","+c.toFixed(0)+") scale("+e+")")}this.Id&&this.Id.moveTo(a,c);Ea(this)};
  function Va(a){if(a.jp){a.mo=!1;var c=a.Oi.Nr();a.Oi.Cn(a.O);c="translate("+c.x+","+c.y+") scale("+a.scale+")";a.xb.setAttribute("transform",c);a.Tf.setAttribute("transform",c)}}
  function Ua(a){if(a.jp&&!a.mo){a.mo=!0;var c=a.xb.previousSibling,d=parseInt(y(a).getAttribute("width"),10),e=parseInt(y(a).getAttribute("height"),10),f=h.g.le(a.xb),g=a.Oi,k=a.xb,l=a.Tf,m=a.scale;if(g.kb.childNodes.length)throw Error("Already dragging a block.");g.at=c;k.setAttribute("transform","translate(0, 0) scale("+m+")");l.setAttribute("transform","translate(0, 0) scale("+m+")");g.kb.setAttribute("width",d);g.kb.setAttribute("height",e);g.kb.appendChild(k);g.kb.appendChild(l);g.kb.style.display=
  "block";a.Oi.Ki(f.x,f.y)}}b.zl=function(){var a=this.ke();return a?a.yc/this.scale:0};b.Hb=function(a){this.Nf=a;if(this.O)if(this.ib&&this.ib.Ei(a),E(this)&&E(this).Ei(a),y(this).style.display=a?"block":"none",this.Na&&this.Na.Hb(a),a){a=B(this,!1);for(var c=a.length-1;0<=c;c--)a[c].Ol();this.Ja();this.Na&&this.Na.position()}else h.ec(!0)};b.Ja=function(){for(var a=B(this,!1),c=a.length-1;0<=c;c--)a[c].Ja(!1);if(this.oc)for(a=this.oc.Fj(),c=0;c<a.length;c++)a[c].Ja(!1);c=this.ne;c.m.Ll&&c.Df&&c.m.vl().draw()};
  function Nc(a,c){var d=w;if(void 0===c){for(var e=0,f;f=d.El[e];e++)f.se(!1);d.El.length=0}if(f=a?d.Gc(a):null)(a=void 0===c||c)?-1==d.El.indexOf(f)&&d.El.push(f):h.g.Rk(d.El,f),f.se(a)}
  b.So=function(a){if(this.ua&&a.tagName&&!(a.getElementsByTagName("block").length>=cb(this)))if(this.oc&&this.oc.cancel(),"comment"==a.tagName.toLowerCase()){h.h.disable();try{var c=h.kj.ql(a),d=parseInt(a.getAttribute("x"),10),e=parseInt(a.getAttribute("y"),10);isNaN(d)||isNaN(e)||(this.L&&(d=-d),c.moveBy(d+50,e+50))}finally{h.h.enable()}h.h.isEnabled()&&h.Bv.ZI(c);c.select()}else{h.h.disable();try{var f=h.K.Bj(a,this),g=parseInt(a.getAttribute("x"),10),k=parseInt(a.getAttribute("y"),10);if(!isNaN(g)&&
  !isNaN(k)){this.L&&(g=-g);do{a=!1;var l=B(this,!1);c=0;for(var m;m=l[c];c++){var n=m.Xa();if(1>=Math.abs(g-n.x)&&1>=Math.abs(k-n.y)){a=!0;break}}if(!a){var q=f.je(!1);c=0;for(var p;p=q[c];c++)if(p.closest(h.kc,new h.g.U(g,k)).connection){a=!0;break}}a&&(g=this.L?g-h.kc:g+h.kc,k+=2*h.kc)}while(a);f.moveBy(g,k)}}finally{h.h.enable()}h.h.isEnabled()&&!f.Qa&&h.h.Ga(new (h.h.get(h.h.qh))(f));f.select()}};function Kc(a){(a=a.Lf?a.Ka:a)&&!a.oc&&a.Na&&E(a.Na)&&a.Na.AJ()}
  b.Bi=function(a,c){h.cc.A.Bi.call(this,a,c);Kc(this)};b.zj=function(a){h.cc.A.zj.call(this,a);Kc(this)};b.ee=function(a,c,d){a=h.cc.A.ee.call(this,a,c,d);Kc(this);return a};function Lc(a){a.pw=a.xc&&a.O.parentNode?a.xc.ul():null;a.ow=a.ma?a.ma.ul():a.Na&&"function"==typeof a.Na.ul?a.Na.ul():null}function xa(a,c){return a.pw&&a.pw.contains(c.clientX,c.clientY)?h.yp:a.ow&&a.ow.contains(c.clientX,c.clientY)?h.nu:h.mu}b.Wg=function(a){var c=this.Eg(a);c&&yb(c,a,this)};
  b.Dt=function(a,c){a=h.g.Tl(a,y(this),Ta(this));a.x/=this.scale;a.y/=this.scale;this.yw=h.g.U.fl(c,a)};b.Xc=function(){return null!=this.oc&&this.oc.Xc()};b.rc=function(){return this.options.uc&&!!this.options.uc.scrollbars||this.options.uc&&this.options.uc.ik||this.options.uc&&this.options.uc.Cj||this.options.zb&&this.options.zb.ik||this.options.zb&&this.options.zb.Xx};function nb(a){var c=!!a.ib;return a.rc()&&(!c||c&&!!a.ib.mb)}function ob(a){var c=!!a.ib;return a.rc()&&(!c||c&&!!a.ib.Va)}
  b.VD=function(a){if(h.Ce.gi())a.preventDefault(),a.stopPropagation();else{var c=this.options.zb&&this.options.zb.ik,d=this.options.uc&&this.options.uc.ik;if(c||d){var e=h.g.Sw(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.Tl(a,y(this),Ta(this)),this.zoom(c.x,c.y,e));a.preventDefault()}}};
  function da(a){a=[].concat(a.xm);if(!a.length)return new h.g.Rect(0,0,0,0);for(var c=a[0].Yh(),d=1;d<a.length;d++){var e=a[d];e.od&&e.od()||(e=e.Yh(),e.top<c.top&&(c.top=e.top),e.bottom>c.bottom&&(c.bottom=e.bottom),e.left<c.left&&(c.left=e.left),e.right>c.right&&(c.right=e.right))}return c}b.lm=function(a){if(!this.options.readOnly&&!this.Lf){var c=kc(h.Ea.Cc.Pc,{B:this});this.WB&&this.WB(c,a);h.Sa.show(a,c,this.L)}};
  function Sa(a){if(a.options.Zc)Sa(a.options.Zc);else{h.Ml=a;document.activeElement&&document.activeElement.blur&&document.activeElement.blur();try{y(a).focus({preventScroll:!0})}catch(c){try{y(a).parentNode.setActive()}catch(d){y(a).parentNode.focus({preventScroll:!0})}}}}
  b.zoom=function(a,c,d){d=Math.pow(this.options.zb.DE,d);var e=this.scale*d;if(this.scale!=e){e>this.options.zb.Ql?d=this.options.zb.Ql/this.scale:e<this.options.zb.Sl&&(d=this.options.zb.Sl/this.scale);var f=this.xb.getCTM(),g=y(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.zb.Ql&&a>this.options.zb.Ql?a=this.options.zb.Ql:this.options.zb.Sl&&a<this.options.zb.Sl&&(a=this.options.zb.Sl);this.scale=a;h.ec(!1);this.ma&&(this.ma.bt(),Lc(this));this.Id&&this.Id.update(this.scale);a=this.ke();this.scrollX-=a.Dc;this.scrollY-=a.Qc;a.gf+=a.Dc;a.hf+=a.Qc;this.scroll(this.scrollX,this.scrollY);if(this.ib)if(this.ma){var c=this.ib;c.mb&&Na(c.mb,a);c.Va&&Pa(c.Va,a)}else c=this.ib,c.mb&&Oa(c.mb,a),c.Va&&Qa(c.Va,a)};
  b.scroll=function(a,c){h.ec(!0);var d=this.ke();a=Math.min(a,-d.scrollLeft);c=Math.min(c,-d.scrollTop);var e=d.scrollTop+Math.max(0,d.scrollHeight-d.Lc);a=Math.max(a,-(d.scrollLeft+Math.max(0,d.scrollWidth-d.yc)));c=Math.max(c,-e);this.scrollX=a;this.scrollY=c;this.ib&&this.ib.set(-(a+d.scrollLeft),-(c+d.scrollTop),!1);a+=d.Dc;c+=d.Qc;this.translate(a,c)};
  h.cc.JE=function(a){var c=this.ke();"number"==typeof a.x&&(this.scrollX=-(c.scrollLeft+(c.scrollWidth-c.yc)*a.x));"number"==typeof a.y&&(this.scrollY=-(c.scrollTop+(c.scrollHeight-c.Lc)*a.y));this.translate(this.scrollX+c.Dc,this.scrollY+c.Qc)};b=h.cc.prototype;b.Gc=function(a){return h.cc.A.Gc.call(this,a)};b.tb=function(a){return h.cc.A.tb.call(this,a)};b.vn=function(a){this.xm.push(a);h.cc.A.vn.call(this,a)};b.Wo=function(a){h.g.Rk(this.xm,a);h.cc.A.Wo.call(this,a)};
  b.Zb=function(a){var c=!this.qt&&a;this.qt=a;c&&ha(this)};b.clear=function(){this.Zb(!1);h.cc.A.clear.call(this);this.xm=[];this.Zb(!0)};function Oc(a,c){if("function"!=typeof c)throw TypeError("Button callbacks must be functions.");a.Dw.CREATE_VARIABLE=c}function Ic(a,c,d){if("function"!=typeof d)throw TypeError("Toolbox category callbacks must be functions.");a.Kt[c]=d}
  b.Eg=function(a){var c="mousedown"==a.type||"touchstart"==a.type||"pointerdown"==a.type,d=this.oc;return d?c&&d.bi?(console.warn("Tried to start the same gesture twice."),d.cancel(),null):d:c?this.oc=new h.Oc(a,this):null};function zc(a){a.oc&&a.oc.cancel()};h.zk=function(a){a.im=this.IE.bind(this);var c=this.m=new h.cc(a),d=new h.Bh(this.m,this);c.rd=d;c.ke=c.rd.ke.bind(c.rd);this.m.Lf=!0;this.m.Hb(this.Nf);this.L=!!a.L;this.Vc=!1;this.kh=a.Kc;this.wr=[];this.Co=[];this.Sk=[];this.Ic=[];this.Xs=[];this.gk=this.m.ob.ea().pn;this.Ka=null};b=h.zk.prototype;b.oj=!0;b.Nf=!1;b.Rh=!0;b.pb=8;b.Eh=h.zk.prototype.pb;b.Yz=3*h.zk.prototype.Eh;b.Zz=3*h.zk.prototype.Eh;b.Kk=2;b.jb=0;b.qc=0;b.rC=70;
  b.Ua=function(a){this.O=h.g.j.J(a,{"class":"blocklyFlyout",style:"display: none"},null);this.hc=h.g.j.J(h.g.D.Ee,{"class":"blocklyFlyoutBackground"},this.O);this.O.appendChild(this.m.Ua());this.m.jc.subscribe(this.hc,"flyoutBackgroundColour","fill");this.m.jc.subscribe(this.hc,"flyoutOpacity","fill-opacity");return this.O};
  b.za=function(a){this.Ka=a;this.m.Ka=a;this.m.ib=new h.iq(this.m,this.Vc,!this.Vc,"blocklyFlyoutScrollbar");this.Ya();Array.prototype.push.apply(this.wr,h.N.Ca(this.O,"wheel",this,this.iF));this.oj||(this.Yn=this.xr.bind(this),C(this.Ka,this.Yn));Array.prototype.push.apply(this.wr,h.N.Ca(this.hc,"mousedown",this,this.Wg));this.m.Eg=this.Ka.Eg.bind(this.Ka);this.m.zt(this.Ka.Oa);a=this.m;a.Yj=new h.rq(a)};
  b.I=function(){this.Ya();h.N.yb(this.wr);this.Yn&&(gb(this.Ka,this.Yn),this.Yn=null);this.m&&(this.m.jc.unsubscribe(this.hc),this.m.Ka=null,this.m.I(),this.m=null);this.O&&(h.g.j.removeNode(this.O),this.O=null);this.Ka=this.hc=null};b.zl=function(){return this.jb};b.isVisible=function(){return this.Nf};b.Hb=function(a){var c=a!=this.isVisible();this.Nf=a;c&&this.Bm()};b.Ei=function(a){var c=a!=this.Rh;this.Rh=a;c&&this.Bm()};
  b.Bm=function(){var a=this.Rh?this.isVisible():!1;this.O.style.display=a?"block":"none";this.m.ib.Ei(a)};b.Ya=function(){if(this.isVisible()){this.Hb(!1);for(var a=0,c;c=this.Ic[a];a++)h.N.yb(c);this.Ic.length=0;this.dh&&(gb(this.m,this.dh),this.dh=null)}};
  b.show=function(a){this.m.Zb(!1);this.Ya();Pc(this);"string"==typeof a&&(a=Qc(this,a));this.Hb(!0);a=h.g.V.fw(a);a=Rc(this,a);Sc(this,a.$B,a.EC);this.Ic.push(h.N.Ca(this.hc,"mouseover",this,function(){for(var c=this.m.tb(!1),d=0,e;e=c[d];d++)e.dm()}));this.Vc?this.qc=0:this.jb=0;this.m.Zb(!0);this.bt();this.xr();this.position();this.dh=this.bt.bind(this);C(this.m,this.dh)};
  function Rc(a,c){var d=[],e=[];a.Xs.length=0;for(var f=a.Vc?a.Yz:a.Zz,g=0,k;k=c[g];g++){if(k.custom){var l=Qc(a,k.custom);l=h.g.V.fw(l);c.splice.apply(c,[g,1].concat(l));k=c[g]}switch(k.kind.toUpperCase()){case "BLOCK":l=k;var m=l;k=null;var n=m.blockxml;n&&"string"!=typeof n?k=n:n&&"string"==typeof n?(k=h.K.ue(n),m.blockxml=k):m.type&&(k=h.g.xml.createElement("xml"),k.setAttribute("type",m.type),k.setAttribute("disabled",m.disabled),m.blockxml=k);if(!k)throw Error("Error: Invalid block definition. Block definition must have blockxml or type.");
  m=k;k=a;n=h.K.Bj(m,k.m);n.isEnabled()||k.Xs.push(n);k=n;l=parseInt(l.gap||m.getAttribute("gap"),10);e.push(isNaN(l)?f:l);d.push({type:"block",block:k});break;case "SEP":l=e;m=f;k=parseInt(k.gap,10);!isNaN(k)&&0<l.length?l[l.length-1]=k:l.push(m);break;case "LABEL":l=Tc(a,k,!0);d.push({type:"button",button:l});e.push(f);break;case "BUTTON":l=Tc(a,k,!1),d.push({type:"button",button:l}),e.push(f)}}return{$B:d,EC:e}}
  function Qc(a,c){c=a.m.Ka.Kt[c]||null;if("function"!=typeof c)throw TypeError("Couldn't find a callback function when opening a toolbox category.");a=c(a.m.Ka);if(!Array.isArray(a))throw new TypeError("Result of toolbox category callback must be an array.");return a}function Tc(a,c,d){if(!h.Xz)throw Error("Missing require for Blockly.FlyoutButton");return new h.Xz(a.m,a.Ka,c,d)}
  function Pc(a){for(var c=a.m.tb(!1),d=0,e;e=c[d];d++)e.B==a.m&&e.I(!1,!1);for(d=0;d<a.Co.length;d++)if(c=a.Co[d])h.G.Nt(c),h.g.j.removeNode(c);for(d=a.Co.length=0;c=a.Sk[d];d++)c.I();a.Sk.length=0;a.m.Yj.clear()}function Uc(a,c){return function(d){var e=a.Ka.Eg(d);e&&(Ab(e,c),zb(e,d,a))}}b.Wg=function(a){var c=this.Ka.Eg(a);c&&zb(c,a,this)};
  function ub(a,c){var d=null;h.h.disable();var e=a.Ka.Xh();a.Ka.Zb(!1);try{var f=a.Ka;if(!c.ra())throw Error("oldBlock is not rendered.");var g=h.K.yf(c,!0);f.Zb(!1);var k=h.K.Bj(g,f);if(!k.ra())throw Error("block is not rendered.");var l=h.g.xl(f.xb),m=h.g.xl(a.m.xb),n=c.Xa();n.scale(a.m.scale);var q=h.g.U.sum(m,n),p=h.g.U.fl(q,l);p.scale(1/f.scale);k.moveBy(p.x,p.y);d=k}finally{h.h.enable()}h.ec();c=h.oa.Hw(a.Ka,e);if(h.h.isEnabled()){h.h.ta(!0);for(e=0;e<c.length;e++)f=c[e],h.h.Ga(new (h.h.get(h.h.Nk))(f));
  h.h.Ga(new (h.h.get(h.h.qh))(d))}a.oj?a.Ya():a.xr();return d}b.xr=function(){for(var a=this.m.tb(!1),c=0,d;d=a[c];c++)if(-1==this.Xs.indexOf(d))for(var e=db(this.Ka,h.g.Dr(d));d;)d.af(e),d=t(d)};
  b.bt=function(){this.dh&&gb(this.m,this.dh);this.m.scale=this.Ka.scale;for(var a=0,c=this.m.tb(!1),d=0,e;e=c[d];d++){var f=z(e).width;e.S&&(f-=this.gk);a=Math.max(a,f)}for(d=0;e=this.Sk[d];d++)a=Math.max(a,e.width);a+=1.5*this.Eh+this.gk;a*=this.m.scale;a+=h.ya.fc;if(this.jb!=a){for(d=0;e=c[d];d++){if(this.L){f=e.Xa().x;var g=a/this.m.scale-this.Eh;e.S||(g-=this.gk);e.moveBy(g-f,0)}e.Ew&&(f=e.Ew,g=e,e=z(g),f.setAttribute("width",e.width),f.setAttribute("height",e.height),g=g.Xa(),f.setAttribute("y",
  g.y),f.setAttribute("x",this.L?g.x-e.width:g.x))}if(this.L)for(d=0;e=this.Sk[d];d++)c=e.hJ().y,e.moveTo(a/this.m.scale-e.width-this.Eh-this.gk,c);this.Ka.Kc!=this.kh||this.kh!=h.g.V.Pa.Yb||this.Ka.Na||this.Ka.translate(this.Ka.scrollX+a,this.Ka.scrollY);this.jb=a;this.position()}this.dh&&C(this.m,this.dh)};function sb(a){return a.m.ib?a.m.ib.isVisible():!1};h.Ok=function(a){h.Ok.A.constructor.call(this,a)};h.g.object.W(h.Ok,h.zk);h.Ok.DJ="verticalFlyout";b=h.Ok.prototype;b.IE=function(a){if(this.isVisible()){var c=this.m.rd,d=c.Hj(),e=c.Te();c=c.rl();"number"==typeof a.y&&(this.m.scrollY=-(d.top+(d.height-e.height)*a.y));this.m.translate(this.m.scrollX+c.left,this.m.scrollY+c.top)}};
  b.position=function(){if(this.isVisible()&&this.Ka.isVisible()){var a=this.Ka.rd.Te();this.qc=a.height;var c=this.jb-this.pb;a=a.height-2*this.pb;var d=this.kh==h.g.V.Pa.fd,e=c+this.pb;e=["M "+(d?e:0)+",0"];e.push("h",d?-c:c);e.push("a",this.pb,this.pb,0,0,d?0:1,d?-this.pb:this.pb,this.pb);e.push("v",Math.max(0,a));e.push("a",this.pb,this.pb,0,0,d?0:1,d?this.pb:-this.pb,this.pb);e.push("h",d?c:-c);e.push("z");this.hc.setAttribute("d",e.join(" "));this.isVisible()?(d=this.Ka.rd,c=d.rl(),a=d.Te(),d=
  ic(d),d=this.Ka.Kc==this.kh?this.Ka.Na?this.kh==h.g.V.Pa.Yb?d.width:a.width-this.jb:this.kh==h.g.V.Pa.Yb?0:a.width:this.kh==h.g.V.Pa.Yb?0:a.width+c.left-this.jb):d=0;c=this.jb;a=this.qc;this.O.setAttribute("width",c);this.O.setAttribute("height",a);Mc(this.m,c,a);"svg"==this.O.tagName?h.g.j.gm(this.O,"translate("+d+"px,0px)"):this.O.setAttribute("transform","translate("+d+",0)");if(c=this.m.ib)c.Yo(d,0),c.resize(),c.mb&&c.mb.setPosition(c.mb.position.x,c.mb.position.y),c.Va&&c.Va.setPosition(c.Va.position.x,
  c.Va.position.y)}};b.ty=function(){var a=this.m.ib;a.Va&&a.Va.set(0,!0)};b.iF=function(a){var c=h.g.Sw(a);if(c.y){var d=this.m.rd,e=d.Hj();c=d.Te().top-e.top+c.y;d=this.m.ib;d.Va&&d.Va.set(c,!0);h.aa.Ya();h.C.ho()}a.preventDefault();a.stopPropagation()};
  function Sc(a,c,d){a.m.scale=a.Ka.scale;for(var e=a.Eh,f=a.L?e:e+a.gk,g=0,k;k=c[g];g++)if("block"==k.type){k=k.block;for(var l=r(k,!1),m=0,n;n=l[m];m++)n.Yc=!0;k.Ja();n=k.ra();l=z(k);m=k.S?f-a.gk:f;k.moveBy(m,e);var q=a,p=k,u=g;m=h.g.j.J(h.g.D.Lb,{"fill-opacity":0,x:a.L?m-l.width:m,y:e,height:l.height,width:l.width},null);m.Sd=p;h.G.pj(m);q.m.xb.insertBefore(m,p.ra());p.Ew=m;q.Co[u]=m;q=a;q.Ic.push(h.N.Ca(n,"mousedown",null,Uc(q,k)));q.Ic.push(h.N.Ca(m,"mousedown",null,Uc(q,k)));q.Ic.push(h.N.bind(n,
  "mouseenter",k,k.un));q.Ic.push(h.N.bind(n,"mouseleave",k,k.dm));q.Ic.push(h.N.bind(m,"mouseenter",k,k.un));q.Ic.push(h.N.bind(m,"mouseleave",k,k.dm));e+=l.height+d[g]}else"button"==k.type&&(l=a,m=k.button,n=f,q=e,p=m.Ua(),m.moveTo(n,q),m.show(),l.Ic.push(h.N.Ca(p,"mousedown",l,l.Wg)),l.Sk.push(m),e+=k.button.height+d[g])}b.ul=function(){if(!this.O)return null;var a=this.O.getBoundingClientRect(),c=a.left;return this.kh==h.g.V.Pa.Yb?new h.g.Rect(-1E9,1E9,-1E9,c+a.width):new h.g.Rect(-1E9,1E9,c,1E9)};
  h.v.register(h.v.R.Ep,h.v.rk,h.Ok);h.h.yk=function(a){this.nd="undefined"==typeof a;this.Wb=a?a.id:"";this.group=h.h.Vb();this.Ma=!1};h.g.object.W(h.h.yk,h.h.Abstract);h.h.yk.prototype.type=h.h.Dp;h.h.yk.prototype.qa=function(){var a={type:this.type};this.group&&(a.group=this.group);this.Wb&&(a.workspaceId=this.Wb);return a};h.h.yk.prototype.ba=function(a){this.nd=!1;this.Wb=a.workspaceId;this.group=a.group};h.v.register(h.v.R.Fb,h.h.Dp,h.h.yk);h.au=function(a){this.Yk=a;this.Ua()};b=h.au.prototype;b.kb=null;b.Pe=null;b.Yk=null;b.fh=1;b.tm=null;b.Ua=function(){this.kb||(this.kb=h.g.j.J(h.g.D.ej,{xmlns:h.g.j.nn,"xmlns:html":h.g.j.Fp,"xmlns:xlink":h.g.j.hd,version:"1.1","class":"blocklyBlockDragSurface"},this.Yk),this.Pe=h.g.j.J(h.g.D.Nc,{},this.kb))};function rb(a,c){if(a.Pe.childNodes.length)throw Error("Already dragging a block.");a.Pe.appendChild(c);a.kb.style.display="block";a.tm=new h.g.U(0,0)}
  b.Ki=function(a,c){this.tm=new h.g.U(a*this.fh,c*this.fh);a=this.tm.x;c=this.tm.y;a=a.toFixed(0);c=c.toFixed(0);this.kb.style.display="block";h.g.j.gm(this.kb,"translate3d("+a+"px, "+c+"px, 0px)")};b.Nr=function(){var a=h.g.le(this.kb);return new h.g.U(a.x/this.fh,a.y/this.fh)};b.Vb=function(){return this.Pe};
  b.Cn=function(a){a?a.appendChild(this.Pe.firstChild):this.Pe.removeChild(this.Pe.firstChild);this.kb.style.display="none";if(this.Pe.childNodes.length)throw Error("Drag group was not cleared.");this.tm=null};h.Ud={};h.Ud.Zr=!1;h.Ud.register=function(a){if(h.Ud.Zr)throw Error("CSS already injected");Array.prototype.push.apply(h.Ud.vp,a);a.length=0};h.Ud.Lg=function(a,c){if(!h.Ud.Zr){h.Ud.Zr=!0;var d=h.Ud.vp.join("\n");h.Ud.vp.length=0;a&&(a=c.replace(/[\\/]$/,""),d=d.replace(/<<<PATH>>>/g,a),a=document.createElement("style"),a.id="blockly-common-style",d=document.createTextNode(d),a.appendChild(d),document.head.insertBefore(a,document.head.firstChild))}};
  h.Ud.vp=[".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: 9pt sans-serif;","opacity: .9;","padding: 2px;","position: absolute;","z-index: 100000;","}",".blocklyDropDownDiv {","position: absolute;","left: 0;","top: 0;","z-index: 1000;","display: none;","border: 1px solid;","border-color: #dadce0;","background-color: #fff;","border-radius: 2px;","padding: 4px;","box-shadow: 0 0 3px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv.blocklyFocused {","box-shadow: 0 0 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownContent {",
  "max-height: 300px;","overflow: auto;","overflow-x: hidden;","position: relative;","}",".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;","}",".blocklyArrowTop {","border-top: 1px solid;",
  "border-left: 1px solid;","border-top-left-radius: 4px;","border-color: inherit;","}",".blocklyArrowBottom {","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>.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;","}",".blocklyMultilineText {","font-family: monospace;","}",".blocklyNonEditableText>text {","pointer-events: none;","}",".blocklyFlyout {","position: absolute;","z-index: 20;","}",".blocklyText text {","cursor: default;","}",".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;","}",".blocklyHtmlInput {","border: none;","border-radius: 4px;","height: 100%;","margin: 0;","outline: none;","padding: 0;","width: 100%;","text-align: center;","display: block;","box-sizing: border-box;","}",".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;","}",".blocklyVerticalMarker {","stroke-width: 3px;","fill: rgba(255,255,255,.5);","pointer-events: none;","}",".blocklyComputeCanvas {","position: absolute;","width: 0;","height: 0;","}",".blocklyNoPointerEvents {","pointer-events: none;","}",".blocklyContextMenu {","border-radius: 4px;","max-height: 100%;","}",".blocklyDropdownMenu {","border-radius: 2px;","padding: 0 !important;","}",
  ".blocklyDropdownMenu .blocklyMenuItem {","padding-left: 28px;","}",".blocklyDropdownMenu .blocklyMenuItemRtl {","padding-left: 5px;","padding-right: 28px;","}",".blocklyWidgetDiv .blocklyMenu {","background: #fff;","border: 1px solid transparent;","box-shadow: 0 0 3px 1px rgba(0,0,0,.3);","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;","}",".blocklyWidgetDiv .blocklyMenu.blocklyFocused {",
  "box-shadow: 0 0 6px 1px rgba(0,0,0,.3);","}",".blocklyDropDownDiv .blocklyMenu {","background: inherit;","border: inherit;",'font: normal 13px "Helvetica Neue", Helvetica, sans-serif;',"outline: none;","position: relative;","z-index: 20000;","}",".blocklyMenuItem {","border: none;","color: #000;","cursor: pointer;","list-style: none;","margin: 0;","min-width: 7em;","padding: 6px 15px;","white-space: nowrap;","}",".blocklyMenuItemDisabled {","color: #ccc;","cursor: inherit;","}",".blocklyMenuItemHighlight {",
  "background-color: rgba(0,0,0,.1);","}",".blocklyMenuItemCheckbox {","height: 16px;","position: absolute;","width: 16px;","}",".blocklyMenuItemSelected .blocklyMenuItemCheckbox {","background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px;","float: left;","margin-left: -24px;","position: static;","}",".blocklyMenuItemRtl .blocklyMenuItemCheckbox {","float: right;","margin-right: -24px;","}"];
  h.C=function(){};h.C.Gq=null;h.C.Od=null;h.C.jy=null;h.C.Jm=16;h.C.Zt=1;h.C.Xt=12;h.C.av=16;h.C.op=.25;h.C.yq=null;h.C.zi=null;h.C.qe="";h.C.ve="";
  h.C.Ua=function(){if(!h.C.ze){var a=document.createElement("div");a.className="blocklyDropDownDiv";(h.Qo||document.body).appendChild(a);h.C.ze=a;var c=document.createElement("div");c.className="blocklyDropDownContent";a.appendChild(c);h.C.Cf=c;c=document.createElement("div");c.className="blocklyDropDownArrow";a.appendChild(c);h.C.Bd=c;h.C.ze.style.opacity=0;h.C.ze.style.transition="transform "+h.C.op+"s, opacity "+h.C.op+"s";a.addEventListener("focusin",function(){h.g.j.Mb(a,"blocklyFocused")});a.addEventListener("focusout",
  function(){h.g.j.$c(a,"blocklyFocused")})}};h.C.FE=function(a){h.C.Gq=a};h.C.MC=function(){return h.C.Cf};h.C.RB=function(){h.C.Cf.textContent="";h.C.Cf.style.width=""};h.C.re=function(a,c){h.C.ze.style.backgroundColor=a;h.C.ze.style.borderColor=c};h.C.QJ=function(a,c,d,e){return h.C.xy(h.C.Qw(c),a,d,e)};h.C.LE=function(a,c){h.C.jy=!0;h.C.xy(h.C.Rw(a),a,c,void 0)};
  h.C.Qw=function(a){var c=a.ra(),d=c.getBBox(),e=a.B.scale;a=d.height*e;d=d.width*e;c=h.g.style.$h(c);return new h.g.Rect(c.y,c.y+a,c.x,c.x+d)};
  h.C.Rw=function(a){if(a.Ob)c=a.Ob.getBoundingClientRect(),a=h.g.style.$h(a.Ob),e=c.width,c=c.height;else{var c=z(a.M);var d=a.M.B.scale;a=h.g.style.$h(Db(a));var e=c.width*d;c=c.height*d;h.g.userAgent.$z?(a.x+=1.5*d,a.y+=1.5*d):h.g.userAgent.zh||h.g.userAgent.Wd||(a.x-=.5*d,a.y-=.5*d);e+=1*d;c+=1*d}d=new h.g.Rect(a.y,a.y+c,a.x,a.x+e);return new h.g.Rect(d.top,d.bottom,d.left,d.right)};
  h.C.xy=function(a,c,d,e){var f=a.left+(a.right-a.left)/2,g=a.bottom;a=a.top;e&&(a+=e);e=c.ga();for(var k=e.B;k.options.Zc;)k=k.options.Zc;h.C.FE(y(k).parentNode);return h.C.show(c,e.L,f,g,f,a,d)};h.C.show=function(a,c,d,e,f,g,k){h.C.Od=a;h.C.zi=k||null;a=h.C.ze;a.style.direction=c?"rtl":"ltr";c=h.Fg();h.C.qe=c.ob.ie();h.C.ve=c.Jf().ie();h.g.j.Mb(a,h.C.qe);h.g.j.Mb(a,h.C.ve);return h.C.Zl(d,e,f,g)};
  h.C.HC=function(){var a=h.g.style.$h(h.C.Gq),c=h.g.style.If(h.C.Gq);return{left:a.x,right:a.x+c.width,top:a.y,bottom:a.y+c.height,width:c.width,height:c.height}};h.C.QC=function(a,c,d,e){var f=h.C.HC(),g=h.g.style.If(h.C.ze);return c+g.height<f.bottom?h.C.Pw(a,c,f,g):e-g.height>f.top?h.C.Ow(d,e,f,g):c+g.height<document.documentElement.clientHeight?h.C.Pw(a,c,f,g):e-g.height>document.documentElement.clientTop?h.C.Ow(d,e,f,g):h.C.RC(a,f,g)};
  h.C.Pw=function(a,c,d,e){a=h.C.Mr(a,d.left,d.right,e.width);return{Xr:a.Aj,Yr:c,yr:a.Aj,zr:c+h.C.av,mj:a.mj,Aq:-(h.C.Jm/2+h.C.Zt),xn:!0,zq:!0}};h.C.Ow=function(a,c,d,e){a=h.C.Mr(a,d.left,d.right,e.width);return{Xr:a.Aj,Yr:c-e.height,yr:a.Aj,zr:c-e.height-h.C.av,mj:a.mj,Aq:e.height-2*h.C.Zt-h.C.Jm/2,xn:!1,zq:!0}};h.C.RC=function(a,c,d){a=h.C.Mr(a,c.left,c.right,d.width);return{Xr:a.Aj,Yr:0,yr:a.Aj,zr:0,xn:null,mj:null,Aq:null,zq:!1}};
  h.C.Mr=function(a,c,d,e){var f=a;a=h.g.qd.sj(c,a-e/2,d-e);f-=h.C.Jm/2;c=h.g.qd.sj(h.C.Xt,f-a,e-h.C.Xt-h.C.Jm);return{mj:c,Aj:a}};h.C.isVisible=function(){return!!h.C.Od};h.C.Dl=function(a,c){h.C.Od===a&&(c?h.C.ho():h.C.Ya())};h.C.Ya=function(){var a=h.C.ze;a.style.transform="translate(0, 0)";a.style.opacity=0;h.C.yq=setTimeout(function(){h.C.ho()},1E3*h.C.op);h.C.zi&&(h.C.zi(),h.C.zi=null)};
  h.C.ho=function(){if(h.C.isVisible()){h.C.yq&&clearTimeout(h.C.yq);var a=h.C.ze;a.style.transform="";a.style.left="";a.style.top="";a.style.opacity=0;a.style.display="none";a.style.backgroundColor="";a.style.borderColor="";h.C.zi&&(h.C.zi(),h.C.zi=null);h.C.RB();h.C.Od=null;h.C.qe&&(h.g.j.$c(a,h.C.qe),h.C.qe="");h.C.ve&&(h.g.j.$c(a,h.C.ve),h.C.ve="");Sa(h.Fg())}};
  h.C.Zl=function(a,c,d,e){a=h.C.QC(a,c,d,e);a.zq?(h.C.Bd.style.display="",h.C.Bd.style.transform="translate("+a.mj+"px,"+a.Aq+"px) rotate(45deg)",h.C.Bd.setAttribute("class",a.xn?"blocklyDropDownArrow blocklyArrowTop":"blocklyDropDownArrow blocklyArrowBottom")):h.C.Bd.style.display="none";c=Math.floor(a.Xr);d=Math.floor(a.Yr);e=Math.floor(a.yr);var f=Math.floor(a.zr),g=h.C.ze;g.style.left=c+"px";g.style.top=d+"px";g.style.display="block";g.style.opacity=1;g.style.transform="translate("+(e-c)+"px,"+
  (f-d)+"px)";return!!a.xn};h.C.GJ=function(){if(h.C.Od){var a=h.C.Od,c=a.ga();a=h.C.jy?h.C.Rw(a):h.C.Qw(c);c=a.left+(a.right-a.left)/2;h.C.Zl(c,a.bottom,c,a.top)}else h.C.Ya()};h.Lg=function(a,c){h.MB();"string"==typeof a&&(a=document.getElementById(a)||document.querySelector(a));if(!a||!h.g.j.containsNode(document,a))throw Error("Error: container is not in current document.");c=new h.dd(c||{});var d=document.createElement("div");d.className="injectionDiv";d.tabIndex=0;h.g.Ab.$o(d,h.g.Ab.State.oA,h.P.WORKSPACE_ARIA_LABEL);a.appendChild(d);a=h.$k(d,c);var e=new h.au(d),f=new h.Cv(d),g=h.cC(a,c,e,f);h.kD(g);h.Ml=g;h.vm(g);d.addEventListener("focusin",function(){h.Ml=g});return g};
  h.$k=function(a,c){a.setAttribute("dir","LTR");h.Ud.Lg(c.cD,c.Uo);a=h.g.j.J(h.g.D.ej,{xmlns:h.g.j.nn,"xmlns:html":h.g.j.Fp,"xmlns:xlink":h.g.j.hd,version:"1.1","class":"blocklySvg",tabindex:"0"},a);var d=h.g.j.J(h.g.D.lu,{},a);c.Qr=h.Ch.Ua(String(Math.random()).substring(2),c.Yw,d);return a};
  h.cC=function(a,c,d,e){c.Zc=null;c=new h.cc(c,d,e);d=c.options;c.scale=d.zb.SE;a.appendChild(c.Ua("blocklyMainBackground"));h.g.j.Mb(aa(c),c.ob.ie());h.g.j.Mb(aa(c),c.Jf().ie());if(!d.Bl&&d.oi){e=h.g.D.ej;var f=new h.dd({parentWorkspace:c,rtl:c.L,oneBasedIndex:c.options.Po,horizontalLayout:c.Vc,renderer:c.options.mt,rendererOverrides:c.options.nt,move:{scrollbars:!0}});f.Kc=c.options.Kc;c.ma=c.Vc?new (h.v.Dg(h.v.R.vu,c.options,!0))(f):new (h.v.Dg(h.v.R.Ep,c.options,!0))(f);c.ma.oj=!1;c.ma.m.Hb(!0);
  e=c.ma.Ua(e);h.g.j.Oj(e,a)}if(d.bx){if(!h.bc)throw Error("Missing require for Blockly.Trashcan");c.xc=new h.bc(c);e=c.xc.Ua();c.O.insertBefore(e,c.xb);Dc(c.Ys,{id:"trashcan",Zx:c.xc,weight:1,types:[h.og.R.Xp]})}if(d.zb&&d.zb.controls){if(!h.oB)throw Error("Missing require for Blockly.ZoomControls");c.jk=new h.oB(c);d=c.jk.Ua();c.O.appendChild(d);Dc(c.Ys,{id:"zoomControls",Zx:c.jk,weight:2,types:[h.og.R.Xp]})}c.jc.subscribe(a,"workspaceBackgroundColour","background-color");c.translate(0,0);C(c,h.HB(c));
  h.vm(c);h.aa.Ua();h.C.Ua();h.G.Ua();return c};h.xC=function(a,c){var d=null;switch(c.type){case h.h.qh:case h.h.rh:(d=a.Gc(c.fb))&&(d=d.me());break;case h.h.Qm:case h.h.nk:d=a.Hn[c.Je]||null}return d};h.Ov=function(a){var c=a.rd;if(c.Sr()&&!a.Xc()){c=c.Hj(!0);for(var d=[].concat(a.xm),e=0,f;f=d[e];e++)h.Nv(a,c,f)}};
  h.HB=function(a){return function(c){var d=a.rd;if(d.Sr&&!a.Xc())if(-1!==h.h.iz.indexOf(c.type)){d=d.Hj(!0);var e=h.xC(a,c);if(e){var f=h.h.Vb();h.h.ta(c.group);h.Nv(a,d,e)&&!c.group&&console.warn("Moved object in bounds but there was no event group. This may break undo.");null!==f&&h.h.ta(f)}}else c.type===h.h.rn&&c.scale>c.Js&&h.Ov(a)}};
  h.Nv=function(a,c,d){var e=d.Yh(),f=h.g.qd.sj(c.top,e.top,c.top+c.height-(e.bottom-e.top))-e.top,g=c.left;c=c.left+c.width-(e.right-e.left);a.L?g=Math.min(c,g):c=Math.max(g,c);return(a=h.g.qd.sj(g,e.left,c)-e.left)||f?(d.moveBy(a,f),!0):!1};
  h.kD=function(a){var c=a.options,d=y(a);h.N.Ca(d.parentNode,"contextmenu",null,function(f){h.g.so(f)||f.preventDefault()});d=h.N.Ca(window,"resize",null,function(){h.ec(!0);h.vm(a);h.Ov(a)});a.Xo=d;h.Lg.BB();if(c.oi){d=a.Na;var e=E(a,!0);d?d.za():e&&(e.za(a),e.show(c.oi),"function"==typeof e.ty&&e.ty())}d=h.ya.fc;c.bx&&(d=a.xc.za(d));c.zb&&c.zb.controls&&a.jk.za(d);c.uc&&c.uc.scrollbars?(a.ib=new h.iq(a,!0===c.uc.scrollbars||!!c.uc.scrollbars.Wr,!0===c.uc.scrollbars||!!c.uc.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),
  a.ib.resize()):a.im({x:.5,y:.5});c.eD&&h.Lg.wD(c.Uo,a)};h.Lg.BB=function(){h.oC||(h.N.Ca(document,"scroll",null,function(){for(var a=h.qb.getAll(),c=0,d;d=a[c];c++)d.Cm&&d.Cm()}),h.N.Ca(document,"keydown",null,h.Ls),h.N.bind(document,"touchend",null,h.Sg),h.N.bind(document,"touchcancel",null,h.Sg),h.g.userAgent.Bk&&h.N.Ca(window,"orientationchange",document,function(){h.vm(h.Fg())}));h.oC=!0};
  h.Lg.wD=function(a,c){function d(){for(;f.length;)h.N.yb(f.pop());e.preload()}var e=c.Rc;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.N.Ca(document,"mousemove",null,d,!0));f.push(h.N.Ca(document,"touchstart",null,d,!0))};h.Ad=function(a,c){this.Py=c||"";this.py=Object.create(null);if(a)for(a=a.split(","),c=0;c<a.length;c++)this.py[a[c]]=!0;this.reset()};h.Ad.zp="DEVELOPER_VARIABLE";h.Ad.prototype.reset=function(){this.Oe=Object.create(null);this.lw=Object.create(null);this.Oa=null};h.Ad.prototype.zt=function(a){this.Oa=a};
  function Vc(a,c){var d=h.H.Fm;if(c==h.ij){var e=a;d.Oa?e=(e=d.Oa.Hg(e))?e.name:null:(console.log("Deprecated call to Blockly.Names.prototype.getName without defining a variable map. To fix, add the following 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.ij||c==h.Ad.zp?d.Py:"";if(e in d.Oe)return f+d.Oe[e];a?(a=encodeURI(a.replace(/ /g,"_")).replace(/[^\w]/g,"_"),-1!=
  "0123456789".indexOf(a[0])&&(a="my_"+a)):a=h.P.UNNAMED_KEY||"unnamed";for(var g="";d.lw[a+g]||a+g in d.py;)g=g?g+1:2;a+=g;d.lw[a]=!0;c=(c==h.ij||c==h.Ad.zp?d.Py:"")+a;d.Oe[e]=c.substr(f.length);return c}h.Ad.Gf=function(a,c){return a.toLowerCase()==c.toLowerCase()};h.Ta={};h.Ta.Qu=h.dv;h.Ta.uz="x";h.Ta.sB=function(a){var c=bb(a,"procedures_defnoreturn").map(function(d){return d.Gj()});a=bb(a,"procedures_defreturn").map(function(d){return d.Gj()});c.sort(h.Ta.ky);a.sort(h.Ta.ky);return[c,a]};h.Ta.ky=function(a,c){return a[0].toLowerCase().localeCompare(c[0].toLowerCase())};h.Ta.zC=function(a,c){if(c.Yc)return a;for(a=a||h.P.UNNAMED_KEY||"unnamed";!h.Ta.pD(a,c.B,c);){var d=a.match(/^(.*?)(\d+)$/);a=d?d[1]+(parseInt(d[2],10)+1):a+"2"}return a};
  h.Ta.pD=function(a,c,d){return!h.Ta.rD(a,c,d)};h.Ta.rD=function(a,c,d){c=B(c,!1);for(var e=0;e<c.length;e++)if(c[e]!=d&&c[e].Gj){var f=c[e].Gj();if(h.Ad.Gf(f[0],a))return!0}return!1};h.Ta.FJ=function(a){a=a.trim();var c=h.Ta.zC(a,this.ga()),d=this.getValue();if(d!=a&&d!=c){a=B(this.ga().B,!1);for(var e=0;e<a.length;e++)a[e].xE&&a[e].xE(d,c)}return c};
  h.Ta.Wh=function(a){function c(g,k){for(var l=0;l<g.length;l++){var m=g[l][0],n=g[l][1],q=h.g.xml.createElement("block");q.setAttribute("type",k);q.setAttribute("gap",16);var p=h.g.xml.createElement("mutation");p.setAttribute("name",m);q.appendChild(p);for(m=0;m<n.length;m++){var u=h.g.xml.createElement("arg");u.setAttribute("name",n[m]);p.appendChild(u)}d.push(q)}}var d=[];if(h.Xb.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.P.PROCEDURES_DEFNORETURN_PROCEDURE));e.appendChild(f);d.push(e)}h.Xb.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.P.PROCEDURES_DEFRETURN_PROCEDURE)),e.appendChild(f),d.push(e));h.Xb.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.Ta.sB(a);c(a[0],"procedures_callnoreturn");c(a[1],"procedures_callreturn");return d};
  h.Ta.Ky=function(a){for(var c=[],d=bb(a,"procedures_mutatorarg"),e=0,f;f=d[e];e++)c.push($a(f,"NAME"));d=h.g.xml.createElement("xml");e=h.g.xml.createElement("block");e.setAttribute("type","procedures_mutatorarg");f=h.g.xml.createElement("field");f.setAttribute("name","NAME");c=h.g.xml.createTextNode(h.oa.Gw(h.Ta.uz,c));f.appendChild(c);e.appendChild(f);d.appendChild(e);if(c=h.g.V.gw(d)){if(!a.options.oi)throw Error("Existing toolbox is null.  Can't create new toolbox.");if(h.g.V.Bl(c)){if(!a.Na)throw Error("Existing toolbox has no categories.  Can't change mode.");
  a.options.oi=c;a.Na.Ja(c)}else{if(!a.ma)throw Error("Existing toolbox has categories.  Can't change mode.");a.options.oi=c;a.ma.show(c)}}else if(a.options.oi)throw Error("Can't nullify an existing toolbox.");};h.Ta.HD=function(a){if(a.type==h.h.$t&&"mutator"===a.FI&&a.gs){a=h.qb.tl(a.Wb).Gc(a.fb);var c=a.type;if("procedures_defnoreturn"==c||"procedures_defreturn"==c)a=a.pe.m,h.Ta.Ky(a),C(a,h.Ta.GD)}};h.Ta.GD=function(a){a.type!=h.h.qh&&a.type!=h.h.pp&&a.type!=h.h.ph||h.Ta.Ky(h.qb.tl(a.Wb))};
  h.Ta.IC=function(a,c){var d=[];c=B(c,!1);for(var e=0;e<c.length;e++)if(c[e].SC){var f=c[e].SC();f&&h.Ad.Gf(f,a)&&d.push(c[e])}return d};h.Ta.xJ=function(a){var c=h.h.Ma,d=a.Gj()[0],e=a.Md(!0);a=h.Ta.IC(d,a.B);d=0;for(var f;f=a[d];d++){var g=f.Md();g=g&&h.K.Gd(g);f.Ff(e);var k=f.Md();k=k&&h.K.Gd(k);g!=k&&(h.h.Ma=!1,h.h.Ga(new (h.h.get(h.h.ph))(f,"mutation",null,g,k)),h.h.Ma=c)}};h.Ta.dJ=function(a,c){c=c.tb(!1);for(var d=0;d<c.length;d++)if(c[d].Gj){var e=c[d].Gj();if(e&&h.Ad.Gf(e[0],a))return c[d]}return null};h.Tb=function(){h.Tb.v=this;this.sd=Object.create(null);this.Vj=Object.create(null)};h.Tb.Fo={Shift:h.g.ka.kn,Control:h.g.ka.wh,Alt:h.g.ka.Qi,Meta:h.g.ka.Yi};h.Tb.prototype.register=function(a,c){if(this.sd[a.name]&&!c)throw Error('Shortcut with name "'+a.name+'" already exists.');this.sd[a.name]=a};
  h.Tb.prototype.unregister=function(a){if(!this.sd[a])return console.warn('Keyboard shortcut with name "'+a+'" not found.'),!1;for(var c in this.Vj){var d=c,e=this.Vj[d],f=e.indexOf(a);-1<f&&(e.splice(f,1),0==e.length&&delete this.Vj[d])}delete this.sd[a];return!0};function G(a,c){var d=h.Tb.v;a=String(a);var e=d.Vj[a];if(e)throw Error('Shortcut with name "'+c+'" collides with shortcuts '+e.toString());d.Vj[a]=[c]}
  h.Tb.prototype.Ls=function(a,c){var d="";for(e in h.Tb.Fo)c.getModifierState(e)&&(""!=d&&(d+="+"),d+=e);""!=d&&c.keyCode?d=d+"+"+c.keyCode:c.keyCode&&(d=c.keyCode.toString());d=this.Vj[d]||[];if(!d)return!1;var e=0;for(var f;f=d[e];e++)if(f=this.sd[f],(!f.Db||f.Db(a))&&f.gb&&f.gb(a,c,f))return!0;return!1};
  function J(a,c){var d="";if(c){for(var e=h.g.object.values(h.Tb.Fo),f=0,g;g=c[f];f++)if(0>e.indexOf(g))throw Error(g+" is not a valid modifier key.");for(var k in h.Tb.Fo)-1<c.indexOf(h.Tb.Fo[k])&&(""!=d&&(d+="+"),d+=k)}""!=d&&a?d=d+"+"+a:a&&(d=a.toString());return d}new h.Tb;h.sn=function(a,c,d,e){this.B=a;this.name=c;this.type=d||"";this.hD=e||h.g.Hf();h.h.Ga(new (h.h.get(h.h.Nk))(this))};h.sn.prototype.pc=function(){return this.hD};h.sn.UB=function(a,c){a=a.name.toLowerCase();c=c.name.toLowerCase();return a<c?-1:a==c?0:1};h.oa={};h.oa.Qu=h.ij;h.oa.Jv=function(a){var c=B(a,!1);a=Object.create(null);for(var d=0;d<c.length;d++){var e=ja(c[d]);if(e)for(var f=0;f<e.length;f++){var g=e[f],k=g.pc();k&&(a[k]=g)}}c=[];for(k in a)c.push(a[k]);return c};h.oa.Ut={};
  h.oa.qB=function(a){a=B(a,!1);for(var c=Object.create(null),d=0,e;e=a[d];d++){var f=e.eJ;!f&&e.NC&&(f=e.NC,h.oa.Ut[e.type]||(console.warn("Function getDeveloperVars() deprecated. Use getDeveloperVariables() (block type '"+e.type+"')"),h.oa.Ut[e.type]=!0));if(f)for(e=f(),f=0;f<e.length;f++)c[e[f]]=!0}return Object.keys(c)};
  h.oa.Wh=function(a){var c=[],d=document.createElement("button");d.setAttribute("text","%{BKY_NEW_VARIABLE}");d.setAttribute("callbackKey","CREATE_VARIABLE");Oc(a,function(e){h.oa.iw(e.iJ())});c.push(d);a=h.oa.CC(a);return c=c.concat(a)};
  h.oa.CC=function(a){a=a.bo("");var c=[];if(0<a.length){var d=a[a.length-1];if(h.Xb.variables_set){var e=h.g.xml.createElement("block");e.setAttribute("type","variables_set");e.setAttribute("gap",h.Xb.math_change?8:24);e.appendChild(h.oa.Br(d));c.push(e)}h.Xb.math_change&&(e=h.g.xml.createElement("block"),e.setAttribute("type","math_change"),e.setAttribute("gap",h.Xb.variables_get?20:8),e.appendChild(h.oa.Br(d)),d=h.K.ue('<value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value>'),
  e.appendChild(d),c.push(e));if(h.Xb.variables_get){a.sort(h.sn.UB);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.oa.Br(f)),c.push(e)}}return c};h.oa.vv="ijkmnopqrstuvwxyzabcdefgh";h.oa.FC=function(a){return h.oa.Gw(h.oa.vv.charAt(0),a.Cr())};
  h.oa.Gw=function(a,c){if(!c.length)return a;for(var d=h.oa.vv,e="",f=d.indexOf(a);;){for(var g=!1,k=0;k<c.length;k++)if(c[k].toLowerCase()==a){g=!0;break}if(!g)return a;f++;f==d.length&&(f=0,e=Number(e)+1);a=d.charAt(f)+e}};
  h.oa.iw=function(a,c,d){function e(g){h.oa.ly(h.P.NEW_VARIABLE_TITLE,g,function(k){if(k){var l=h.oa.JD(k,a);if(l){if(l.type==f)var m=h.P.VARIABLE_ALREADY_EXISTS.replace("%1",l.name);else m=h.P.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE,m=m.replace("%1",l.name).replace("%2",l.type);h.alert(m,function(){e(k)})}else a.ee(k,f),c&&c(k)}else c&&c(null)})}var f=d||"";e("")};h.oa.ee=h.oa.iw;
  h.oa.ny=function(a,c){function d(e){var f=h.P.RENAME_VARIABLE_TITLE.replace("%1",c.name);h.oa.ly(f,e,function(g){if(g){var k=h.oa.KD(g,c.type,a);k?(k=h.P.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE.replace("%1",k.name).replace("%2",k.type),h.alert(k,function(){d(g)})):a.Bi(c.pc(),g)}})}d("")};h.oa.ly=function(a,c,d){h.prompt(a,c,function(e){e&&(e=e.replace(/[\s\xa0]+/g," ").trim(),e==h.P.RENAME_VARIABLE||e==h.P.NEW_VARIABLE)&&(e=null);d(e)})};
  h.oa.KD=function(a,c,d){d=d.Oa.Xh();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.oa.JD=function(a,c){c=c.Oa.Xh();a=a.toLowerCase();for(var d=0,e;e=c[d];d++)if(e.name.toLowerCase()==a)return e;return null};h.oa.Br=function(a){var c=h.g.xml.createElement("field");c.setAttribute("name","VAR");c.setAttribute("id",a.pc());c.setAttribute("variabletype",a.type);a=h.g.xml.createTextNode(a.name);c.appendChild(a);return c};
  h.oa.gJ=function(a,c,d,e){var f=h.oa.Gg(a,c,d,e);f||(f=h.oa.dC(a,c,d,e));return f};h.oa.Gg=function(a,c,d,e){var f=a.Yj,g=null;if(c&&(g=a.Hg(c),!g&&f&&(g=f.Hg(c)),g))return g;if(d){if(void 0==e)throw Error("Tried to look up a variable by name without a type");g=a.Gg(d,e);!g&&f&&(g=f.Gg(d,e))}return g};h.oa.dC=function(a,c,d,e){var f=a.Yj;d||(d=h.oa.FC(a.Lf?a.Ka:a));return f?f.ee(d,e,c):a.ee(d,e,c)};
  h.oa.Hw=function(a,c){a=a.Xh();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.VERSION="uncompiled";h.Ml=null;h.selected=null;h.Dj=[];h.tj=null;h.En=null;h.Pq=null;h.II=null;h.Qo=null;h.VJ=function(a){h.g.Qn.warn("Blockly.svgSize","March 2021","March 2022","workspace.getCachedParentSvgSize");return new h.g.gd(a.JB,a.IB)};h.HJ=function(a){ha(a)};
  h.vm=function(a){for(;a.options.Zc;)a=a.options.Zc;var c=y(a),d=jc(a),e=c.parentNode;if(e){var f=e.offsetWidth;e=e.offsetHeight;d.width!=f&&(c.setAttribute("width",f+"px"),Mc(a,f,null));d.height!=e&&(c.setAttribute("height",e+"px"),Mc(a,null,e));a.resize()}};h.Ls=function(a){var c=h.Ml;!c||h.g.so(a)||c.ua&&!c.isVisible()||h.Tb.v.Ls(c,a)};h.qw=function(){var a=h.selected;a.B.Lf||(h.h.ta(!0),h.ec(),a.I(!0,!0),h.h.ta(!1))};
  h.Tq=function(a){if(a.Sj)a=null;else{var c=h.K.yf(a,!0);h.K.jC(c);var d=a.Xa();c.setAttribute("x",a.L?-d.x:d.x);c.setAttribute("y",d.y);a={xml:c,source:a.B,dF:h.g.Dr(a,!0)}}a&&(h.tj=a.xml,h.En=a.source,h.Pq=a.dF)};h.So=function(){if(!h.tj)return!1;var a=h.En;a.Lf&&(a=a.Ka);return h.Pq&&db(a,h.Pq)?(h.h.ta(!0),a.So(h.tj),h.h.ta(!1),!0):!1};h.duplicate=function(a){var c=h.tj,d=h.En;h.Tq(a);a.B.So(h.tj);h.tj=c;h.En=d};h.yJ=function(a){h.g.so(a)||a.preventDefault()};
  h.ec=function(a){h.G.Ya();h.aa.Ya();h.C.ho();if(!a){a=h.Fg();if(a.xc&&a.xc.Re){var c=a.xc;c.Re.isVisible()&&(c.Re.Ya(),Tb(c,!1))}(a=a.Na)&&E(a)&&E(a).oj&&a.KI()}};h.Fg=function(){return h.Ml};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.uD=function(a){return function(){bc(this,a)}};
  h.WI=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.Xb[e]&&console.warn("Block definition #"+c+' in JSON array overwrites prior definition of "'+e+'".'),h.Xb[e]={za:h.uD(d)})}else console.warn("Block definition #"+c+" in JSON array is "+d+". Skipping.")}};h.sD=function(a){return/^\s*-?\d+(\.\d+)?\s*$/.test(a)};h.lJ=function(a){return h.g.sb.lx(a)};
  h.MB=function(){h.mc("LOGIC_HUE",["Blocks","logic","HUE"],void 0);h.mc("LOGIC_HUE",["Constants","Logic","HUE"],210);h.mc("LOOPS_HUE",["Blocks","loops","HUE"],void 0);h.mc("LOOPS_HUE",["Constants","Loops","HUE"],120);h.mc("MATH_HUE",["Blocks","math","HUE"],void 0);h.mc("MATH_HUE",["Constants","Math","HUE"],230);h.mc("TEXTS_HUE",["Blocks","texts","HUE"],void 0);h.mc("TEXTS_HUE",["Constants","Text","HUE"],160);h.mc("LISTS_HUE",["Blocks","lists","HUE"],void 0);h.mc("LISTS_HUE",["Constants","Lists","HUE"],
  260);h.mc("COLOUR_HUE",["Blocks","colour","HUE"],void 0);h.mc("COLOUR_HUE",["Constants","Colour","HUE"],20);h.mc("VARIABLES_HUE",["Blocks","variables","HUE"],void 0);h.mc("VARIABLES_HUE",["Constants","Variables","HUE"],330);h.mc("VARIABLES_DYNAMIC_HUE",["Constants","VariablesDynamic","HUE"],310);h.mc("PROCEDURES_HUE",["Blocks","procedures","HUE"],void 0)};
  h.mc=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))};h.PJ=function(a){h.Qo=a};h.Nh=h.N.bind;h.ip=h.N.yb;h.EI=h.N.Ca;h.nF=h.lb.Td.Yb;h.mF=h.lb.Td.Nm;h.oF=h.lb.Td.fd;h.Rb=h.X.Rb;h.cd=h.X.cd;h.Sb=h.X.Sb;h.ed=h.X.ed;h.NF=h.Ha.Ae;h.nI=h.g.V.Pa.Kh;h.kI=h.g.V.Pa.Ri;h.lI=h.g.V.Pa.Yb;h.mI=h.g.V.Pa.fd;var Wc={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",eo:"Esperanto",es:"Espa\u00f1ol",eu:"Euskara",fa:"\u0641\u0627\u0631\u0633\u06cc",fi:"Suomi",fo:"F\u00f8royskt",
  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",ti:"\u1275\u130d\u122d\u129b",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"},Xc="ace ar fa he mzn ps ur".split(" "),L=window.BlocklyGamesLang,Yc=window.BlocklyGamesLanguages,Zc=/\.html$/.test(window.location.pathname);function $c(a,c,d){var e=Number;a=(a=window.location.search.match(new RegExp("[?&]"+a+"=([^&]+)")))?decodeURIComponent(a[1].replace(/\+/g,"%20")):"NaN";e=e(a);return isNaN(e)?c:h.g.qd.sj(c,e,d)}function ad(){return-1!=Xc.indexOf(L)}
  var M=$c("level",1,10);
  function bd(){document.title=document.getElementById("title").textContent;document.dir=ad()?"rtl":"ltr";document.head.parentElement.setAttribute("lang",L);var a=document.getElementById("languageMenu");if(a){for(var c=[],d=0;d<Yc.length;d++){var e=Yc[d];c.push([Wc[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==L&&(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=!!cd(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(dd,1)}function cd(a){var c=ed;try{var d=window.localStorage[c+a]}catch(e){}return d}function N(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 fd(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 dd(){if(!Zc){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.na={};h.na.ft=function(){h.Ea.v.register({Fc:function(){return h.P.UNDO},Db:function(a){return 0<a.B.Li.length?"enabled":"disabled"},gb:function(a){fb(a.B,!1)},td:h.Ea.Cc.Pc,id:"undoWorkspace",weight:1})};h.na.et=function(){h.Ea.v.register({Fc:function(){return h.P.REDO},Db:function(a){return 0<a.B.cm.length?"enabled":"disabled"},gb:function(a){fb(a.B,!0)},td:h.Ea.Cc.Pc,id:"redoWorkspace",weight:2})};
  h.na.fE=function(){h.Ea.v.register({Fc:function(){return h.P.CLEAN_UP},Db:function(a){return a.B.rc()?1<a.B.tb(!1).length?"enabled":"disabled":"hidden"},gb:function(a){a=a.B;a.Zb(!1);h.h.ta(!0);for(var c=a.tb(!0),d=0,e=0,f;f=c[e];e++)if(f.rc()){var g=f.Xa();f.moveBy(-g.x,d-g.y);xc(f);d=f.Xa().y+z(f).height+a.ob.ea().Fk}h.h.ta(!1);a.Zb(!0)},td:h.Ea.Cc.Pc,id:"cleanWorkspace",weight:3})};h.na.Gy=function(a,c){for(var d=0,e=0;e<c.length;e++)for(var f=c[e];f;)setTimeout(f.Di.bind(f,a),d),f=t(f),d+=10};
  h.na.gE=function(){h.Ea.v.register({Fc:function(){return h.P.COLLAPSE_ALL},Db:function(a){if(a.B.options.collapse){a=a.B.tb(!1);for(var c=0;c<a.length;c++)for(var d=a[c];d;){if(!d.isCollapsed())return"enabled";d=t(d)}return"disabled"}return"hidden"},gb:function(a){h.na.Gy(!0,a.B.tb(!0))},td:h.Ea.Cc.Pc,id:"collapseWorkspace",weight:4})};
  h.na.rE=function(){h.Ea.v.register({Fc:function(){return h.P.EXPAND_ALL},Db:function(a){if(a.B.options.collapse){a=a.B.tb(!1);for(var c=0;c<a.length;c++)for(var d=a[c];d;){if(d.isCollapsed())return"enabled";d=t(d)}return"disabled"}return"hidden"},gb:function(a){h.na.Gy(!1,a.B.tb(!0))},td:h.Ea.Cc.Pc,id:"expandWorkspace",weight:5})};h.na.Gv=function(a,c){if(a.Wc())Array.prototype.push.apply(c,r(a,!1));else{a=ca(a,!1);for(var d=0;d<a.length;d++)h.na.Gv(a[d],c)}};
  h.na.Hr=function(a){var c=[];a=a.tb(!0);for(var d=0;d<a.length;d++)h.na.Gv(a[d],c);return c};h.na.Pn=function(a,c){h.h.ta(c);var d=a.shift();d&&(d.B?(d.I(!1,!0),setTimeout(h.na.Pn,10,a,c)):h.na.Pn(a,c));h.h.ta(!1)};
  h.na.nE=function(){h.Ea.v.register({Fc:function(a){if(a.B)return a=h.na.Hr(a.B).length,1==a?h.P.DELETE_BLOCK:h.P.DELETE_X_BLOCKS.replace("%1",String(a))},Db:function(a){if(a.B)return 0<h.na.Hr(a.B).length?"enabled":"disabled"},gb:function(a){if(a.B){zc(a.B);var c=h.na.Hr(a.B),d=h.g.Hf();2>c.length?h.na.Pn(c,d):h.confirm(h.P.DELETE_ALL_BLOCKS.replace("%1",c.length),function(e){e&&h.na.Pn(c,d)})}},td:h.Ea.Cc.Pc,id:"workspaceDelete",weight:6})};
  h.na.vE=function(){h.na.ft();h.na.et();h.na.fE();h.na.gE();h.na.rE();h.na.nE()};h.na.pE=function(){h.Ea.v.register({Fc:function(){return h.P.DUPLICATE_BLOCK},Db:function(a){a=a.block;return!a.Yc&&a.Wc()&&a.rc()?(eb(a.B)?db(a.B,h.g.Dr(a,!0)):1)?"enabled":"disabled":"hidden"},gb:function(a){a.block&&h.duplicate(a.block)},td:h.Ea.Cc.Qb,id:"blockDuplicate",weight:1})};
  h.na.iE=function(){h.Ea.v.register({Fc:function(a){return a.block.Ed?h.P.REMOVE_COMMENT:h.P.ADD_COMMENT},Db:function(a){a=a.block;return h.g.userAgent.Wd||a.Yc||!a.B.options.TB||a.isCollapsed()||!a.Kd()?"hidden":"enabled"},gb:function(a){a=a.block;a.Ed?a.ak(null):a.ak("")},td:h.Ea.Cc.Qb,id:"blockComment",weight:2})};
  h.na.tE=function(){h.Ea.v.register({Fc:function(a){return ua(a.block)?h.P.EXTERNAL_INPUTS:h.P.INLINE_INPUTS},Db:function(a){a=a.block;if(!a.Yc&&a.rc()&&!a.isCollapsed())for(var c=1;c<a.T.length;c++)if(a.T[c-1].type!=h.Ha.lc&&a.T[c].type!=h.Ha.lc)return"enabled";return"hidden"},gb:function(a){a.block.Fi(!ua(a.block))},td:h.Ea.Cc.Qb,id:"blockInline",weight:3})};
  h.na.hE=function(){h.Ea.v.register({Fc:function(a){return a.block.isCollapsed()?h.P.EXPAND_BLOCK:h.P.COLLAPSE_BLOCK},Db:function(a){a=a.block;return!a.Yc&&a.rc()?"enabled":"hidden"},gb:function(a){a.block.Di(!a.block.isCollapsed())},td:h.Ea.Cc.Qb,id:"blockCollapseExpand",weight:4})};
  h.na.oE=function(){h.Ea.v.register({Fc:function(a){return a.block.isEnabled()?h.P.DISABLE_BLOCK:h.P.ENABLE_BLOCK},Db:function(a){a=a.block;return!a.Yc&&a.B.options.disable&&a.Kd()?$b(a)?"disabled":"enabled":"hidden"},gb:function(a){a=a.block;var c=h.h.Vb();c||h.h.ta(!0);a.af(!a.isEnabled());c||h.h.ta(!1)},td:h.Ea.Cc.Qb,id:"blockDisable",weight:5})};
  h.na.dt=function(){h.Ea.v.register({Fc:function(a){var c=a.block;a=r(c,!1).length;(c=t(c))&&(a-=r(c,!1).length);return 1==a?h.P.DELETE_BLOCK:h.P.DELETE_X_BLOCKS.replace("%1",String(a))},Db:function(a){return!a.block.Yc&&a.block.Wc()?"enabled":"hidden"},gb:function(a){h.h.ta(!0);a.block.I(!0,!0);h.h.ta(!1)},td:h.Ea.Cc.Qb,id:"blockDelete",weight:6})};
  h.na.sE=function(){h.Ea.v.register({Fc:function(){return h.P.HELP},Db:function(a){a=a.block;return("function"==typeof a.Mj?a.Mj():a.Mj)?"enabled":"hidden"},gb:function(a){a.block.showHelp()},td:h.Ea.Cc.Qb,id:"blockHelp",weight:7})};h.na.eE=function(){h.na.pE();h.na.iE();h.na.tE();h.na.hE();h.na.oE();h.na.dt();h.na.sE()};h.na.lE=function(){h.na.vE();h.na.eE()};h.na.lE();h.ub={};h.ub.names={Jz:"escape",yh:"delete",mz:"copy",rz:"cut",IA:"paste",fB:"undo",TA:"redo"};h.ub.qE=function(){var a={name:h.ub.names.Jz,Db:function(c){return!c.options.readOnly},gb:function(){h.ec();return!0}};h.Tb.v.register(a);G(h.g.ka.Iz,a.name)};h.ub.dt=function(){var a={name:h.ub.names.yh,Db:function(c){return!c.options.readOnly&&h.selected&&h.selected.Wc()},gb:function(c,d){d.preventDefault();if(h.Ce.gi())return!1;h.qw();return!0}};h.Tb.v.register(a);G(h.g.ka.yh,a.name);G(h.g.ka.ez,a.name)};
  h.ub.jE=function(){var a={name:h.ub.names.mz,Db:function(d){return!d.options.readOnly&&!h.Ce.gi()&&h.selected&&h.selected.Wc()&&h.selected.rc()},gb:function(){h.ec();h.Tq(h.selected);return!0}};h.Tb.v.register(a);var c=J(h.g.ka.tp,[h.g.ka.wh]);G(c,a.name);c=J(h.g.ka.tp,[h.g.ka.Qi]);G(c,a.name);c=J(h.g.ka.tp,[h.g.ka.Yi]);G(c,a.name)};
  h.ub.kE=function(){var a={name:h.ub.names.rz,Db:function(d){return!d.options.readOnly&&!h.Ce.gi()&&h.selected&&h.selected.Wc()&&h.selected.rc()&&!h.selected.B.Lf},gb:function(){h.Tq(h.selected);h.qw();return!0}};h.Tb.v.register(a);var c=J(h.g.ka.tq,[h.g.ka.wh]);G(c,a.name);c=J(h.g.ka.tq,[h.g.ka.Qi]);G(c,a.name);c=J(h.g.ka.tq,[h.g.ka.Yi]);G(c,a.name)};
  h.ub.uE=function(){var a={name:h.ub.names.IA,Db:function(d){return!d.options.readOnly&&!h.Ce.gi()},gb:function(){return h.So()}};h.Tb.v.register(a);var c=J(h.g.ka.pq,[h.g.ka.wh]);G(c,a.name);c=J(h.g.ka.pq,[h.g.ka.Qi]);G(c,a.name);c=J(h.g.ka.pq,[h.g.ka.Yi]);G(c,a.name)};
  h.ub.ft=function(){var a={name:h.ub.names.fB,Db:function(d){return!d.options.readOnly&&!h.Ce.gi()},gb:function(d){h.ec();fb(d,!1);return!0}};h.Tb.v.register(a);var c=J(h.g.ka.lj,[h.g.ka.wh]);G(c,a.name);c=J(h.g.ka.lj,[h.g.ka.Qi]);G(c,a.name);c=J(h.g.ka.lj,[h.g.ka.Yi]);G(c,a.name)};
  h.ub.et=function(){var a={name:h.ub.names.TA,Db:function(d){return!h.Ce.gi()&&!d.options.readOnly},gb:function(d){h.ec();fb(d,!0);return!0}};h.Tb.v.register(a);var c=J(h.g.ka.lj,[h.g.ka.kn,h.g.ka.wh]);G(c,a.name);c=J(h.g.ka.lj,[h.g.ka.kn,h.g.ka.Qi]);G(c,a.name);c=J(h.g.ka.lj,[h.g.ka.kn,h.g.ka.Yi]);G(c,a.name);c=J(h.g.ka.kB,[h.g.ka.wh]);G(c,a.name)};h.ub.mE=function(){h.ub.qE();h.ub.dt();h.ub.jE();h.ub.kE();h.ub.uE();h.ub.ft();h.ub.et()};h.ub.mE();h.g.u={};h.g.u.Ia=function(a,c){return" "+a+","+c+" "};h.g.u.curve=function(a,c){return" "+a+c.join("")};h.g.u.moveTo=function(a,c){return" M "+a+","+c+" "};h.g.u.moveBy=function(a,c){return" m "+a+","+c+" "};h.g.u.lineTo=function(a,c){return" l "+a+","+c+" "};h.g.u.line=function(a){return" l"+a.join("")};h.g.u.$=function(a,c){return" "+a+" "+c+" "};h.g.u.arc=function(a,c,d,e){return a+" "+d+" "+d+" "+c+e};h.i.nf=function(){this.De=0;this.VA=3;this.zd=5;this.Ou=8;this.Bc=10;this.ov=this.zd;this.Mk=15;this.gj=5;this.pn=8;this.AA=15;this.Up=4;this.xA=12;this.Cz=16;this.Bz=this.ou=this.Mk;this.pb=8;this.aB=this.Ik=15;this.kv=0;this.nv=20;this.fz=4;this.dB=this.zd;this.eB=this.Bc;this.hz=this.zd;this.gz=this.Bc;this.Gm=!1;this.ZA=15;this.$A=100;this.YA=15;this.Fk=24;this.Ez=14.5;this.Dz=this.Mk+11;this.Kz=2;this.Fz=this.Fk;this.jv=h.g.u.moveBy(0,0);this.lA=12;this.mA=6;this.Ah=11;this.eg="normal";this.dg=
  "sans-serif";this.Bp=this.Wm=-1;this.Vm=4;this.qu=16;this.vk=5;this.Rz="#fff";this.Cp=!h.g.userAgent.Wd&&!h.g.userAgent.zh;this.su=this.qu;this.Tz=this.Sz=this.tu=!1;this.Vz=this.vk;this.wk=12;this.Uz="data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaGVpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLWFycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuNDEsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTDAuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNzFDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMCwxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNzlhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYzAuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMzdBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";
  this.bm=String(Math.random()).substring(2);this.Wn="";this.vr=null;this.vw="";this.cr=null;this.mw="";this.bl=this.Vq=null;this.Rm="#cc0a0a";this.$m="#4286f4";this.Tm=100;this.zv=5;this.Sm=10;this.oz=2;this.qz=4;this.Ip="#000000";this.Xm=.2;this.hv={KA:1,Zi:2}};b=h.i.nf.prototype;
  b.za=function(){this.Xi=this.ts();this.Zi=this.us();this.dj=this.ws();this.Zp=this.vs();var a=this.pb,c=h.g.u.arc("a","0 0,0",a,h.g.u.Ia(-a,a)),d=h.g.u.arc("a","0 0,0",a,h.g.u.Ia(a,a));this.Ym={width:a,height:a,Vs:c,To:d};a=this.pb;c=h.g.u.moveBy(0,a)+h.g.u.arc("a","0 0,1",a,h.g.u.Ia(a,-a));d=h.g.u.arc("a","0 0,1",a,h.g.u.Ia(a,a));var e=h.g.u.arc("a","0 0,1",a,h.g.u.Ia(-a,-a)),f=h.g.u.arc("a","0 0,1",a,h.g.u.Ia(-a,a));this.Jk={Lt:c,aF:d,EB:f,Fq:e,AE:a}};
  b.km=function(a){this.vg={};var c=a.vg,d;for(d in c)this.vg[d]=gd(c[d]);this.dg=a.fontStyle&&void 0!=a.fontStyle.family?a.fontStyle.family:this.dg;this.eg=a.fontStyle&&void 0!=a.fontStyle.weight?a.fontStyle.weight:this.eg;this.Ah=a.fontStyle&&void 0!=a.fontStyle.size?a.fontStyle.size:this.Ah;c=h.g.j.AD(this.Ah+"pt",this.eg,this.dg);this.Wm=c.height;this.Bp=c.$d;this.Rm=Ya(a,"cursorColour")||this.Rm;this.$m=Ya(a,"markerColour")||this.$m;this.Ip=Ya(a,"insertionMarkerColour")||this.Ip;this.Xm=Number(Ya(a,
  "insertionMarkerOpacity"))||this.Xm;this.Gm=null!=a.Et?a.Et:this.Gm};function Ac(a,c){var d="auto_"+c;a.vg[d]||(a.vg[d]=gd({colourPrimary:c}));return{style:a.vg[d],name:d}}function wc(a,c){return a.vg[c||""]||(c&&0==c.indexOf("auto_")?Ac(a,c.substring(5)).style:gd({colourPrimary:"#000000"}))}
  function gd(a){var c={};a&&h.g.object.Ug(c,a);a=h.g.Ro(c.colourPrimary||"#000");c.Ph=a.Cl;c.colourSecondary?a=h.g.Ro(c.colourSecondary).Cl:(a=c.Ph,a=h.g.sb.Cq("#fff",a,.6)||a);c.Gn=a;c.colourTertiary?a=h.g.Ro(c.colourTertiary).Cl:(a=c.Ph,a=h.g.sb.Cq("#fff",a,.3)||a);c.uj=a;c.Ue=c.hat||"";return c}b.I=function(){this.vr&&h.g.j.removeNode(this.vr);this.cr&&h.g.j.removeNode(this.cr);this.Vq&&h.g.j.removeNode(this.Vq);this.bl=null};
  b.ts=function(){var a=this.lA,c=this.mA,d=h.g.u.line([h.g.u.Ia(c,a/4),h.g.u.Ia(2*-c,a/2),h.g.u.Ia(c,a/4)]);return{height:a,width:c,path:d}};b.ws=function(){var a=this.ZA,c=this.$A,d=h.g.u.curve("c",[h.g.u.Ia(30,-a),h.g.u.Ia(70,-a),h.g.u.Ia(c,0)]);return{height:a,width:c,path:d}};
  b.vs=function(){function a(g){g=g?-1:1;var k=-g,l=d/2,m=h.g.u.Ia(c,g*l);return h.g.u.curve("c",[h.g.u.Ia(0,g*(l+2.5)),h.g.u.Ia(-c,k*(l+.5)),h.g.u.Ia(-c,g*l)])+h.g.u.curve("s",[h.g.u.Ia(c,2.5*k),m])}var c=this.pn,d=this.Mk,e=a(!0),f=a(!1);return{type:this.hv.KA,width:c,height:d,Pd:f,Xl:e}};b.us=function(){function a(k){return h.g.u.line([h.g.u.Ia(k*e,d),h.g.u.Ia(3*k,0),h.g.u.Ia(k*e,-d)])}var c=this.AA,d=this.Up,e=(c-3)/2,f=a(1),g=a(-1);return{type:this.hv.Zi,width:c,height:d,ah:f,Wx:g}};
  function ta(a,c){switch(c.type){case h.X.Rb:case h.X.cd:return a.Zp;case h.X.ed:case h.X.Sb:return a.Zi;default:throw Error("Unknown connection type");}}
  b.Ua=function(a,c,d){d=this.Er(d);c="blockly-renderer-style-"+c;this.bl=document.getElementById(c);var e=d.join("\n");this.bl?this.bl.firstChild.textContent=e:(d=document.createElement("style"),d.id=c,c=document.createTextNode(e),d.appendChild(c),document.head.insertBefore(d,document.head.firstChild),this.bl=d);a=h.g.j.J(h.g.D.lu,{},a);c=h.g.j.J(h.g.D.uu,{id:"blocklyEmbossFilter"+this.bm},a);h.g.j.J(h.g.D.Oz,{"in":"SourceAlpha",stdDeviation:1,result:"blur"},c);d=h.g.j.J(h.g.D.Qz,{"in":"blur",surfaceScale:1,
  specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},c);h.g.j.J(h.g.D.Pz,{x:-5E3,y:-1E4,z:2E4},d);h.g.j.J(h.g.D.Ap,{"in":"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},c);h.g.j.J(h.g.D.Ap,{"in":"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},c);this.Wn=c.id;this.vr=c;c=h.g.j.J(h.g.D.cv,{id:"blocklyDisabledPattern"+this.bm,patternUnits:"userSpaceOnUse",width:10,height:10},a);h.g.j.J(h.g.D.Lb,{width:10,height:10,fill:"#aaa"},c);h.g.j.J(h.g.D.Ee,
  {d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},c);this.vw=c.id;this.cr=c;h.i.Mc&&(a=h.g.j.J(h.g.D.uu,{id:"blocklyDebugFilter"+this.bm,height:"160%",width:"180%",y:"-30%",x:"-40%"},a),c=h.g.j.J(h.g.D.Lz,{result:"outBlur"},a),h.g.j.J(h.g.D.Nz,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},c),h.g.j.J(h.g.D.Mz,{"flood-color":"#ff0000","flood-opacity":.5,result:"outColor"},a),h.g.j.J(h.g.D.Ap,{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},a),this.mw=a.id,this.Vq=a)};
  b.Er=function(a){return[a+" .blocklyText, ",a+" .blocklyFlyoutLabelText {","font: "+this.eg+" "+this.Ah+"pt "+this.dg+";","}",a+" .blocklyText {","fill: #fff;","}",a+" .blocklyNonEditableText>rect,",a+" .blocklyEditableText>rect {","fill: "+this.Rz+";","fill-opacity: .6;","stroke: none;","}",a+" .blocklyNonEditableText>text,",a+" .blocklyEditableText>text {","fill: #000;","}",a+" .blocklyFlyoutLabelText {","fill: #000;","}",a+" .blocklyText.blocklyBubbleText {","fill: #000;","}",a+" .blocklyEditableText:not(.editing):hover>rect {",
  "stroke: #fff;","stroke-width: 2;","}",a+" .blocklyHtmlInput {","font-family: "+this.dg+";","font-weight: "+this.eg+";","}",a+" .blocklySelected>.blocklyPath {","stroke: #fc3;","stroke-width: 3px;","}",a+" .blocklyHighlightedConnectionPath {","stroke: #fc3;","}",a+" .blocklyReplaceable .blocklyPath {","fill-opacity: .5;","}",a+" .blocklyReplaceable .blocklyPathLight,",a+" .blocklyReplaceable .blocklyPathDark {","display: none;","}",a+" .blocklyInsertionMarker>.blocklyPath {","fill-opacity: "+this.Xm+
  ";","stroke: none;","}"]};h.i.o={NONE:0,Ac:1,xu:2,Au:4,fq:8,Yt:16,Eu:32,pu:64,yd:128,Cu:256,mv:512,lz:1024,Yp:2048,Tp:4096,EA:8192,wp:16384,Mp:32768,Lp:65536,cq:131072,bq:262144,Iu:524288,eq:1048576,lq:2097152,qp:4194304,Du:8388608};h.i.o.FG=h.i.o.Mp|h.i.o.Lp;h.i.o.XH=h.i.o.cq|h.i.o.bq;h.i.o.Gs=16777216;h.i.o.vb=function(){Object.prototype.hasOwnProperty.call(h.i.o,void 0)||(h.i.o[void 0]=h.i.o.Gs,h.i.o.Gs<<=1);return h.i.o[void 0]};h.i.o.Xe=function(a){return a.type&h.i.o.Ac};h.i.o.mi=function(a){return a.type&h.i.o.xu};
  h.i.o.Qj=function(a){return a.type&h.i.o.Au};h.i.o.pd=function(a){return a.type&h.i.o.fq};h.i.o.qJ=function(a){return a.type&h.i.o.Eu};h.i.o.Mf=function(a){return a.type&h.i.o.yd};h.i.o.Il=function(a){return a.type&h.i.o.pu};h.i.o.Ng=function(a){return a.type&h.i.o.Cu};h.i.o.ni=function(a){return a.type&h.i.o.mv};h.i.o.Uj=function(a){return a.type&h.i.o.Yp};h.i.o.Pg=function(a){return a.type&h.i.o.Tp};h.i.o.tD=function(a){return a.type&(h.i.o.Yp|h.i.o.Tp)};h.i.o.Og=function(a){return a.type&h.i.o.Lp};
  h.i.o.sx=function(a){return a.type&h.i.o.bq};h.i.o.Jl=function(a){return a.type&h.i.o.Mp};h.i.o.rJ=function(a){return a.type&h.i.o.cq};h.i.o.pJ=function(a){return a.type&h.i.o.wp};h.i.o.px=function(a){return a.type&h.i.o.Iu};h.i.o.tJ=function(a){return a.type&h.i.o.eq};h.i.o.nD=function(a){return a.type&h.i.o.Yt};h.i.o.to=function(a){return a.type&h.i.o.lq};h.i.o.lo=function(a){return a.type&h.i.o.qp};h.i.o.ux=function(a){return a.type&(h.i.o.lq|h.i.o.qp)};h.i.o.oD=function(a){return a.type&h.i.o.Du};h.i.jg=function(a){this.height=this.width=0;this.type=h.i.o.NONE;this.xg=this.sa=0;this.s=a;this.Nd=this.s.Ik};h.i.xa=function(a,c){h.i.xa.A.constructor.call(this,a);this.nc=c;this.shape=ta(this.s,c);this.li=!!this.shape.isDynamic;this.type|=h.i.o.lz};h.g.object.W(h.i.xa,h.i.jg);h.i.Wp=function(a,c){h.i.Wp.A.constructor.call(this,a,c);this.type|=h.i.o.EA;this.height=this.li?0:this.shape.height;this.Rd=this.width=this.li?0:this.shape.width;this.ld=this.s.gj;this.Xk=0};h.g.object.W(h.i.Wp,h.i.xa);
  h.i.$p=function(a,c){h.i.$p.A.constructor.call(this,a,c);this.type|=h.i.o.Yp;this.height=this.shape.height;this.width=this.shape.width};h.g.object.W(h.i.$p,h.i.xa);h.i.Vp=function(a,c){h.i.Vp.A.constructor.call(this,a,c);this.type|=h.i.o.Tp;this.height=this.shape.height;this.width=this.shape.width};h.g.object.W(h.i.Vp,h.i.xa);h.i.Dk=function(a,c){h.i.Dk.A.constructor.call(this,a,c.connection);this.type|=h.i.o.yd;this.input=c;this.align=c.align;(this.yg=c.connection&&c.connection.va()?c.connection.va():null)?(a=z(this.yg),this.Wk=a.width,this.Jn=a.height):this.Jn=this.Wk=0;this.ld=this.Xk=0};h.g.object.W(h.i.Dk,h.i.xa);
  h.i.fg=function(a,c){h.i.fg.A.constructor.call(this,a,c);this.type|=h.i.o.Cu;this.yg?(this.width=this.Wk,this.height=this.Jn):(this.height=this.s.Dz,this.width=this.s.Ez);this.vj=this.li?this.shape.height(this.height):this.shape.height;this.Ne=this.li?this.shape.width(this.height):this.shape.width;this.yg||(this.width+=this.Ne*(this.li?2:1));this.ld=this.li?this.shape.ld(this.vj):this.s.gj;this.Xk=this.li?this.shape.Xk(this.Ne):0};h.g.object.W(h.i.fg,h.i.Dk);
  h.i.qg=function(a,c){h.i.qg.A.constructor.call(this,a,c);this.type|=h.i.o.mv;this.height=this.yg?this.Jn+this.s.kv:this.s.Fz;this.width=this.s.aB+this.shape.width};h.g.object.W(h.i.qg,h.i.Dk);h.i.Um=function(a,c){h.i.Um.A.constructor.call(this,a,c);this.type|=h.i.o.pu;this.height=this.yg?this.Jn-this.s.gj-this.s.zd:this.shape.height;this.width=this.shape.width+this.s.Kz;this.ld=this.s.gj;this.vj=this.shape.height;this.Ne=this.shape.width};h.g.object.W(h.i.Um,h.i.Dk);h.i.Jp=function(a,c){h.i.Jp.A.constructor.call(this,a);this.icon=c;this.isVisible=c.isVisible();this.type|=h.i.o.Au;a=c.cJ();this.height=a.height;this.width=a.width};h.g.object.W(h.i.Jp,h.i.jg);h.i.Kp=function(a){h.i.Kp.A.constructor.call(this,a);this.type|=h.i.o.Iu;this.height=this.s.Xi.height;this.width=this.s.Xi.width};h.g.object.W(h.i.Kp,h.i.jg);
  h.i.xd=function(a,c){h.i.xd.A.constructor.call(this,a);this.Ej=c;this.Kd=c.tk;this.BC=c.Lw();this.type|=h.i.o.Ac;a=this.Ej.If();this.height=a.height;this.width=a.width};h.g.object.W(h.i.xd,h.i.jg);h.i.Gp=function(a){h.i.Gp.A.constructor.call(this,a);this.type|=h.i.o.xu;this.height=this.s.dj.height;this.width=this.s.dj.width;this.nj=this.height};h.g.object.W(h.i.Gp,h.i.jg);
  h.i.fj=function(a,c){h.i.fj.A.constructor.call(this,a);this.type=(c&&"left"!=c?h.i.o.cq:h.i.o.Mp)|h.i.o.wp;this.width=this.height=this.s.De};h.g.object.W(h.i.fj,h.i.jg);h.i.jn=function(a,c){h.i.jn.A.constructor.call(this,a);this.type=(c&&"left"!=c?h.i.o.bq:h.i.o.Lp)|h.i.o.wp;this.width=this.s.pb;this.height=this.s.pb/2};h.g.object.W(h.i.jn,h.i.jg);h.i.pf=function(a,c){h.i.pf.A.constructor.call(this,a);this.type=this.type|h.i.o.fq|h.i.o.Eu;this.width=c;this.height=this.s.YA};h.g.object.W(h.i.pf,h.i.jg);h.i.Hh=function(a){this.type=h.i.o.eq;this.elements=[];this.sa=this.Kb=this.wd=this.minWidth=this.minHeight=this.width=this.height=0;this.$w=this.Lj=this.Tr=this.Pb=this.Jg=!1;this.s=a;this.Nd=this.s.Ik;this.align=null};h.i.Hh.prototype.measure=function(){throw Error("Unexpected attempt to measure a base Row.");};function O(a){for(var c=a.elements.length-1,d;d=a.elements[c];c--)if(h.i.o.Mf(d))return d;return null}h.i.Hh.prototype.ep=function(){return!0};h.i.Hh.prototype.jl=function(){return!0};
  h.i.Mh=function(a){h.i.Mh.A.constructor.call(this,a);this.type|=h.i.o.lq;this.nj=this.zf=0;this.dD=!1;this.connection=null};h.g.object.W(h.i.Mh,h.i.Hh);h.i.Mh.prototype.Ur=function(a){var c=(a.Ue?"cap"===a.Ue:this.s.Gm)&&!a.S&&!a.Y,d=a.Y&&a.Y.va();return!!a.S||c||(d?t(d)==a:!1)};
  h.i.Mh.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.i.o.pd(f)||(h.i.o.mi(f)?d=Math.max(d,f.nj):a=Math.max(a,f.height));this.width=Math.max(this.minWidth,c);this.height=Math.max(this.minHeight,a)+d;this.zf=this.nj=d;this.wd=this.width};h.i.Mh.prototype.ep=function(){return!1};h.i.Mh.prototype.jl=function(){return!1};h.i.vh=function(a){h.i.vh.A.constructor.call(this,a);this.type|=h.i.o.qp;this.ax=!1;this.connection=null;this.$d=this.dl=0};
  h.g.object.W(h.i.vh,h.i.Hh);h.i.vh.prototype.Ur=function(a){return!!a.S||!!t(a)};h.i.vh.prototype.measure=function(){for(var a=0,c=0,d=0,e=0,f;f=this.elements[e];e++)c+=f.width,h.i.o.pd(f)||(h.i.o.Pg(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.dl=d;this.wd=this.width};h.i.vh.prototype.ep=function(){return!1};h.i.vh.prototype.jl=function(){return!1};
  h.i.on=function(a,c,d){h.i.on.A.constructor.call(this,a);this.type=this.type|h.i.o.fq|h.i.o.Yt;this.width=d;this.height=c;this.Fw=!1;this.wd=0;this.elements=[new h.i.pf(this.s,d)]};h.g.object.W(h.i.on,h.i.Hh);h.i.on.prototype.measure=function(){};h.i.Wi=function(a){h.i.Wi.A.constructor.call(this,a);this.type|=h.i.o.Du;this.$v=0};h.g.object.W(h.i.Wi,h.i.Hh);
  h.i.Wi.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.i.o.Mf(d)&&(h.i.o.ni(d)?a+=d.Wk:h.i.o.Il(d)&&0!=d.Wk&&(a+=d.Wk-d.Ne)),h.i.o.pd(d)||(this.height=Math.max(this.height,d.height));this.$v=a;this.wd=this.width+a};h.i.Wi.prototype.jl=function(){return!this.Jg&&!this.Pb};h.i.Yd=function(a,c){this.Fa=c;this.ob=a;this.s=this.ob.ea();this.S=c.S?new h.i.Wp(this.s,c.S):null;this.Rj=ua(c)&&!c.isCollapsed();this.isCollapsed=c.isCollapsed();this.od=c.od();this.L=c.L;this.jh=this.width=this.oh=this.height=0;this.rows=[];this.nx=[];this.hx=[];this.Jb=new h.i.Mh(this.s);this.rb=new h.i.vh(this.s);this.cp=this.Rd=0};b=h.i.Yd.prototype;
  b.measure=function(){var a=!!this.Fa.Y,c=(this.Fa.Ue?"cap"===this.Fa.Ue:this.s.Gm)&&!this.S&&!a;this.Jb.Ur(this.Fa)?this.Jb.elements.push(new h.i.fj(this.s)):this.Jb.elements.push(new h.i.jn(this.s));c?(a=new h.i.Gp(this.s),this.Jb.elements.push(a),this.Jb.zf=a.nj):a&&(this.Jb.dD=!0,this.Jb.connection=new h.i.$p(this.s,this.Fa.Y),this.Jb.elements.push(this.Jb.connection));this.Fa.T.length&&this.Fa.T[0].type==h.Ha.lc&&!this.Fa.isCollapsed()?this.Jb.minHeight=this.s.eB:this.Jb.minHeight=this.s.dB;this.Jb.elements.push(new h.i.fj(this.s,
  "right"));this.rows.push(this.Jb);a=new h.i.Wi(this.s);this.nx.push(a);var d=va(this.Fa);if(d.length){c=0;for(var e;e=d[c];c++){var f=new h.i.Jp(this.s,e);this.isCollapsed&&e.MI?this.hx.push(f):a.elements.push(f)}}e=null;for(c=0;d=this.Fa.T[c];c++)if(d.isVisible()){!e||d.type!=h.Ha.lc&&e.type!=h.Ha.lc&&(d.type!=h.Ha.He&&d.type!=h.Ha.Ae||this.Rj)||(this.rows.push(a),a=new h.i.Wi(this.s),this.nx.push(a));for(e=0;f=d.eb[e];e++)a.elements.push(new h.i.xd(this.s,f,d));this.Iv(d,a);e=d}this.isCollapsed&&
  (a.$w=!0,a.elements.push(new h.i.Kp(this.s)));(a.elements.length||a.Lj)&&this.rows.push(a);this.Zs();this.rows.push(this.rb);this.Hv();a=this.rows;this.rows=[];for(c=0;c<a.length;c++)if(this.rows.push(a[c]),c!=a.length-1){d=this.rows;e=d.push;f=a[c];var g=a[c+1],k=new h.i.on(this.s,this.Uw(f,g),this.width-this.Rd);f.Pb&&(k.Fw=!0);g.Pb&&(k.zJ=!0);e.call(d,k)}for(e=d=c=a=0;f=this.rows[e];e++)f.measure(),c=Math.max(c,f.width),f.Pb&&(a=Math.max(a,f.width-O(f).width)),d=Math.max(d,f.wd);this.jh=a;this.width=
  c;for(e=0;f=this.rows[e];e++)f.Pb&&(f.jh=this.jh);this.oh=Math.max(c,d);this.S&&(this.Rd=this.S.width,this.width+=this.S.width,this.oh+=this.S.width);this.wq();this.Bw()};
  b.Zs=function(){this.rb.ax=!!this.Fa.Z;this.rb.minHeight=this.Fa.T.length&&this.Fa.T[this.Fa.T.length-1].type==h.Ha.lc?this.s.gz:this.s.hz;this.rb.Ur(this.Fa)?this.rb.elements.push(new h.i.fj(this.s)):this.rb.elements.push(new h.i.jn(this.s));this.rb.ax&&(this.rb.connection=new h.i.Vp(this.s,this.Fa.Z),this.rb.elements.push(this.rb.connection));this.rb.elements.push(new h.i.fj(this.s,"right"))};
  b.Iv=function(a,c){this.Rj&&a.type==h.Ha.He?(c.elements.push(new h.i.fg(this.s,a)),c.Tr=!0):a.type==h.Ha.lc?(c.elements.push(new h.i.qg(this.s,a)),c.Pb=!0):a.type==h.Ha.He?(c.elements.push(new h.i.Um(this.s,a)),c.Jg=!0):a.type==h.Ha.Ae&&(c.minHeight=Math.max(c.minHeight,a.ga()&&a.ga().Qa?this.s.Bz:this.s.ou),c.Lj=!0);null==c.align&&(c.align=a.align)};
  b.Hv=function(){for(var a=0,c;c=this.rows[a];a++){var d=c.elements;c.elements=[];c.ep()&&c.elements.push(new h.i.pf(this.s,this.Zh(null,d[0])));if(d.length){for(var e=0;e<d.length-1;e++)c.elements.push(d[e]),c.elements.push(new h.i.pf(this.s,this.Zh(d[e],d[e+1])));c.elements.push(d[d.length-1]);c.jl()&&c.elements.push(new h.i.pf(this.s,this.Zh(d[d.length-1],null)))}}};
  b.Zh=function(a,c){if(!a&&c&&h.i.o.ni(c))return this.s.nv;if(a&&h.i.o.Mf(a)&&!c){if(h.i.o.Il(a))return this.s.De;if(h.i.o.Ng(a))return this.s.Bc;if(h.i.o.ni(a))return this.s.De}return a&&h.i.o.Jl(a)&&c&&(h.i.o.Uj(c)||h.i.o.Pg(c))?c.Nd:a&&h.i.o.Og(a)&&c&&(h.i.o.Uj(c)||h.i.o.Pg(c))?c.Nd-this.s.pb:this.s.zd};b.wq=function(){for(var a=0,c;c=this.rows[a];a++)if(c.Pb)hd(this,c);else{var d=this.wl(c)-c.width;0<d&&id(c,d);h.i.o.ux(c)&&(c.wd=c.width)}};b.wl=function(){return this.width-this.Rd};
  function id(a,c){a:{var d=0;for(var e;e=a.elements[d];d++)if(h.i.o.pd(e)){d=e;break a}d=null}a:{e=a.elements.length-1;for(var f;f=a.elements[e];e--)if(h.i.o.pd(f)){e=f;break a}e=null}if(a.Jg||a.Pb)a.wd+=c;a.align==h.lb.Td.Yb?e.width+=c:a.align==h.lb.Td.Nm?(d.width+=c/2,e.width+=c/2):a.align==h.lb.Td.fd?d.width+=c:e.width+=c;a.width+=c}
  function hd(a,c){var d=O(c),e=c.width-d.width,f=a.jh;e=f-e;0<e&&id(c,e);e=c.width;f=a.wl(c);d.width+=f-e;d.height=Math.max(d.height,c.height);c.width+=f-e;c.wd=Math.max(c.width,a.jh+c.$v)}b.Uw=function(){return this.s.zd};b.Kw=function(a,c){return h.i.o.pd(c)?a.Kb+c.height/2:h.i.o.lo(a)?(a=a.Kb+a.height-a.dl,h.i.o.Pg(c)?a+c.height/2:a-c.height/2):h.i.o.to(a)?h.i.o.mi(c)?a.zf-c.height/2:a.zf+c.height/2:a.Kb+a.height/2};
  function jd(a,c){for(var d=c.sa,e=0,f;f=c.elements[e];e++)h.i.o.pd(f)&&(f.height=c.height),f.sa=d,f.xg=a.Kw(c,f),d+=f.width}b.Bw=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++)e.Kb=c,e.sa=this.Rd,c+=e.height,a=Math.max(a,e.wd),jd(this,e);this.S&&this.Fa.Z&&this.Fa.Z.isConnected()&&(a=Math.max(a,z(this.Fa.Z.va()).width));this.oh=a+this.Rd;this.height=c;this.cp=this.Jb.zf;this.rb.$d=c-this.rb.dl};h.i.Mc=function(a){this.ge=[];this.ef=null;this.s=a};h.i.Mc.Le={CE:!0,tC:!0,rows:!0,uC:!0,cw:!0,CB:!0,Zv:!0,Ja:!0};
  function kd(a,c,d){if(h.i.Mc.Le.uC){var e=c.sa;d&&(e=-(e+c.width));d=c.xg-c.height/2;a.ge.push(h.g.j.J(h.g.D.Lb,{"class":"rowRenderingRect blockRenderDebug",x:e,y:d,width:c.width,height:c.height,stroke:"black",fill:"none","stroke-width":"1px"},a.ef));h.i.o.Xe(c)&&c.Ej instanceof h.bd&&a.ge.push(h.g.j.J(h.g.D.Lb,{"class":"rowRenderingRect blockRenderDebug",x:e,y:d+a.s.Bp,width:c.width,height:"0.1px",stroke:"red",fill:"none","stroke-width":"0.5px"},a.ef))}h.i.o.Mf(c)&&h.i.Mc.Le.cw&&ld(a,c.nc)}
  function ld(a,c){if(h.i.Mc.Le.cw){if(c.type==h.X.Rb){var d=4;var e="magenta";var f="none"}else c.type==h.X.cd?(d=2,f=e="magenta"):c.type==h.X.Sb?(d=4,e="goldenrod",f="none"):c.type==h.X.ed&&(d=2,f=e="goldenrod");a.ge.push(h.g.j.J(h.g.D.bu,{"class":"blockRenderDebug",cx:c.Qf.x,cy:c.Qf.y,r:d,fill:f,stroke:e},a.ef))}}
  function md(a,c,d){for(var e=0,f;f=a.ge[e];e++)h.g.j.removeNode(f);a.ge=[];a.ef=c.ra();a.dE="#"+Math.floor(16777215*Math.random()).toString(16);f=e=0;for(var g;g=d.rows[f];f++){if(h.i.o.nD(g)){var k=e;if(h.i.Mc.Le.CE){var l=Math.abs(g.height),m=0>g.height;m&&(k-=l);a.ge.push(h.g.j.J(h.g.D.Lb,{"class":"rowSpacerRect blockRenderDebug",x:d.L?-(g.sa+g.width):g.sa,y:k,width:g.width,height:l,stroke:m?"black":"blue",fill:"blue","fill-opacity":"0.5","stroke-width":"1px"},a.ef))}}else{m=a;l=g;k=d.L;for(var n=
  0,q=l.elements.length;n<q;n++){var p=l.elements[n];if(p)if(h.i.o.pd(p)){if(h.i.Mc.Le.tC){var u=Math.abs(p.width),H=0>p.width,K=H?p.sa-u:p.sa;k&&(K=-(K+u));m.ge.push(h.g.j.J(h.g.D.Lb,{"class":"elemSpacerRect blockRenderDebug",x:K,y:p.xg-p.height/2,width:u,height:p.height,stroke:"pink",fill:H?"black":"pink","fill-opacity":"0.5","stroke-width":"1px"},m.ef))}}else kd(m,p,k);else console.warn("A row has an undefined or null element.",l,p)}h.i.Mc.Le.rows&&(m.ge.push(h.g.j.J(h.g.D.Lb,{"class":"elemRenderingRect blockRenderDebug",
  x:k?-(l.sa+l.width):l.sa,y:l.Kb,width:l.width,height:l.height,stroke:"red",fill:"none","stroke-width":"1px"},m.ef)),h.i.o.ux(l)||h.i.Mc.Le.Zv&&m.ge.push(h.g.j.J(h.g.D.Lb,{"class":"connectedBlockWidth blockRenderDebug",x:k?-(l.sa+l.wd):l.sa,y:l.Kb,width:l.wd,height:l.height,stroke:m.dE,fill:"none","stroke-width":"1px","stroke-dasharray":"3,3"},m.ef)))}e+=g.height}c.Y&&ld(a,c.Y);c.Z&&ld(a,c.Z);c.S&&ld(a,c.S);d.BE&&kd(a,d.BE,d.L);h.i.Mc.Le.CB&&(e=d.L?-d.width:0,a.ge.push(h.g.j.J(h.g.D.Lb,{"class":"blockBoundingBox blockRenderDebug",
  x:e,y:0,width:d.width,height:d.height,stroke:"black",fill:"none","stroke-width":"1px","stroke-dasharray":"5,5"},a.ef)),h.i.Mc.Le.Zv&&(e=d.L?-d.oh:0,a.ge.push(h.g.j.J(h.g.D.Lb,{"class":"blockRenderDebug",x:e,y:0,width:d.oh,height:d.height,stroke:"#DF57BC",fill:"none","stroke-width":"1px","stroke-dasharray":"3,3"},a.ef))));nd(a,c.wb.Eb)}function nd(a,c){h.i.Mc.Le.Ja&&(c.setAttribute("filter","url(#"+a.s.mw+")"),setTimeout(function(){c.setAttribute("filter","")},100))};h.i.zc=function(a,c){this.Fa=a;this.pa=c;a.Xa();this.jo=this.La="";this.s=c.ob.ea()};b=h.i.zc.prototype;b.draw=function(){od(this);pd(this);qd(this);this.Fa.wb.xt(this.La+"\n"+this.jo);this.pa.L&&this.Fa.wb.Ar();h.i.Dm&&md(this.Fa.ot,this.Fa,this.pa);rd(this)};function rd(a){a.Fa.height=a.pa.height;a.Fa.width=a.pa.oh}function od(a){for(var c=0,d;d=a.pa.hx[c];c++)d.icon.gD.setAttribute("display","none")}
  function pd(a){a.qr();for(var c=1;c<a.pa.rows.length-1;c++){var d=a.pa.rows[c];d.$w?a.il(d):d.Pb?a.pr(d):d.Jg?a.rr(d):a.zw(d)}a.lr();a.nr()}
  b.qr=function(){var a=this.pa.Jb,c=a.elements,d=this.pa.Jb;if(d.connection){var e=d.sa+d.Nd;F(d.connection.nc,this.pa.L?-e:e,0)}this.La+=h.g.u.moveBy(a.sa,this.pa.cp);for(d=0;e=c[d];d++)h.i.o.Og(e)?this.La+=this.s.Jk.Lt:h.i.o.sx(e)?this.La+=this.s.Jk.aF:h.i.o.Uj(e)?this.La+=e.shape.ah:h.i.o.mi(e)?this.La+=this.s.dj.path:h.i.o.pd(e)&&(this.La+=h.g.u.$("h",e.width));this.La+=h.g.u.$("v",a.height)};b.il=function(a){this.La+=this.s.Xi.path+h.g.u.$("v",a.height-this.s.Xi.height)};
  b.rr=function(a){var c=O(a);this.by(a);var d="function"==typeof c.shape.Pd?c.shape.Pd(c.height):c.shape.Pd;this.La+=h.g.u.$("H",c.sa+c.width)+d+h.g.u.$("v",a.height-c.vj)};b.pr=function(a){var c=O(a);this.La+=h.g.u.$("H",c.sa+c.Nd+c.shape.width)+(c.shape.Wx+h.g.u.$("h",-(c.Nd-this.s.Ym.width))+this.s.Ym.Vs)+h.g.u.$("v",a.height-2*this.s.Ym.height)+this.s.Ym.To+h.g.u.$("H",a.sa+a.width);this.iy(a)};b.zw=function(a){this.La+=h.g.u.$("V",a.Kb+a.height)};
  b.lr=function(){var a=this.pa.rb,c=a.elements;this.gy();for(var d=0,e="",f=c.length-1,g;g=c[f];f--)h.i.o.Pg(g)?e+=g.shape.Wx:h.i.o.Jl(g)?e+=h.g.u.$("H",a.sa):h.i.o.Og(g)?e+=this.s.Jk.Fq:h.i.o.sx(g)?(e+=this.s.Jk.EB,d=this.s.Jk.AE):h.i.o.pd(g)&&(e+=h.g.u.$("h",-1*g.width));this.La+=h.g.u.$("V",a.$d-d);this.La+=e};
  b.nr=function(){var a=this.pa.S;if(this.pa.S){var c=this.pa.Rd+this.pa.S.Xk;F(this.Fa.S,this.pa.L?-c:c,this.pa.S.ld)}a&&(c=a.ld+a.height,a="function"==typeof a.shape.Xl?a.shape.Xl(a.height):a.shape.Xl,this.La+=h.g.u.$("V",c)+a);this.La+="z"};
  function qd(a){for(var c=0,d;d=a.pa.rows[c];c++)for(var e=0,f;f=d.elements[e];e++)if(h.i.o.Ng(f))a.mr(f);else if(h.i.o.Qj(f)||h.i.o.Xe(f)){var g=a;if(h.i.o.Xe(f))var k=f.Ej.ra();else h.i.o.Qj(f)&&(k=f.icon.gD);var l=f.xg-f.height/2,m=f.sa,n="";g.pa.L&&(m=-(m+f.width),f.BC&&(m+=f.width,n="scale(-1 1)"));h.i.o.Qj(f)?(k.setAttribute("display","block"),k.setAttribute("transform","translate("+m+","+l+")"),f.icon.VB()):k.setAttribute("transform","translate("+m+","+l+")"+n);g.pa.od&&k.setAttribute("display",
  "none")}}b.mr=function(a){var c=a.width,d=a.height,e=a.ld,f=a.vj+e;this.jo+=h.g.u.moveTo(a.sa+a.Ne,a.xg-d/2)+h.g.u.$("v",e)+a.shape.Pd+h.g.u.$("v",d-f)+h.g.u.$("h",c-a.Ne)+h.g.u.$("v",-d)+"z";this.ey(a)};b.ey=function(a){var c=a.xg-a.height/2;if(a.nc){var d=a.sa+a.Ne+a.Xk;this.pa.L&&(d*=-1);F(a.nc,d,c+a.ld)}};b.iy=function(a){var c=O(a);if(c.nc){var d=a.sa+a.jh+c.Nd;this.pa.L&&(d*=-1);F(c.nc,d,a.Kb)}};b.by=function(a){var c=O(a);if(c.nc){var d=a.sa+a.width;this.pa.L&&(d*=-1);F(c.nc,d,a.Kb)}};
  b.gy=function(){var a=this.pa.rb;if(a.connection){var c=a.connection,d=c.sa;F(c.nc,this.pa.L?-d:d,a.$d)}};h.h.gg=function(a,c,d,e){var f=a?a.B.id:void 0;e&&e.vb()==h.F.types.Pc&&(f=e.Da.id);h.h.gg.A.constructor.call(this,f);this.fb=a?a.id:null;this.Ox=d;this.Kx=e;this.We=c};h.g.object.W(h.h.gg,h.h.Zd);h.h.gg.prototype.type=h.h.Pp;h.h.gg.prototype.qa=function(){var a=h.h.gg.A.qa.call(this);a.isCursor=this.We;a.blockId=this.fb;a.oldNode=this.Ox;a.newNode=this.Kx;return a};h.h.gg.prototype.ba=function(a){h.h.gg.A.ba.call(this,a);this.We=a.isCursor;this.fb=a.blockId;this.Ox=a.oldNode;this.Kx=a.newNode};
  h.v.register(h.v.R.Fb,h.h.Pp,h.h.gg);h.i.hg=function(a,c,d){this.m=a;this.ys=d;this.Wl=null;this.s=c;this.xj=null;a=this.We()?this.s.Rm:this.s.$m;this.Dd=d.sb||a};h.i.hg.pz="blocklyCursor";h.i.hg.tA="blocklyMarker";h.i.hg.bA=.75;b=h.i.hg.prototype;b.ra=function(){return this.O};b.yl=function(){return this.ys};b.We=function(){return"cursor"==this.ys.type};
  b.Ua=function(){var a=this.We()?h.i.hg.pz:h.i.hg.tA;this.O=h.g.j.J(h.g.D.Nc,{"class":a},null);this.Pf=h.g.j.J(h.g.D.Nc,{width:this.s.Tm,height:this.s.zv},this.O);this.Tg=h.g.j.J(h.g.D.Lb,{width:this.s.Tm,height:this.s.zv,style:"display: none"},this.Pf);this.si=h.g.j.J(h.g.D.Lb,{"class":"blocklyVerticalMarker",rx:10,ry:10,style:"display: none"},this.Pf);this.ri=h.g.j.J(h.g.D.Ee,{transform:"",style:"display: none"},this.Pf);this.Of=h.g.j.J(h.g.D.Ee,{transform:"",style:"display: none",fill:"none","stroke-width":this.s.qz},
  this.Pf);this.We()&&(a={attributeType:"XML",attributeName:"fill",dur:"1s",values:this.Dd+";transparent;transparent;",repeatCount:"indefinite"},h.g.j.J(h.g.D.np,a,this.Tg),h.g.j.J(h.g.D.np,a,this.ri),a.attributeName="stroke",h.g.j.J(h.g.D.np,a,this.Of));return this.O};function sd(a,c){a.We()?(a.Wl&&a.Wl.Sf(null),c.Sf(a.ra())):(a.Wl&&a.Wl.hh(null),c.hh(a.ra()));a.Wl=c}
  b.draw=function(a,c){if(c){this.s=this.m.ob.ea();var d=this.We()?this.s.Rm:this.s.$m;this.Dd=this.ys.sb||d;this.Tg.setAttribute("fill",this.Dd);this.si.setAttribute("stroke",this.Dd);this.ri.setAttribute("fill",this.Dd);this.Of.setAttribute("stroke",this.Dd);this.We()&&(d=this.Dd+";transparent;transparent;",this.Tg.firstChild.setAttribute("values",d),this.ri.firstChild.setAttribute("values",d),this.Of.firstChild.setAttribute("values",d));d=c.Da.type;if(c.vb()==h.F.types.Qb)td(this,c);else if(c.vb()==
  h.F.types.Gh)td(this,c);else if(d==h.X.Rb){var e=c.Da;d=e.ga();var f=e.Qf.x,g=e.Qf.y;e=h.g.u.moveTo(0,0)+ta(this.s,e).Pd;this.ri.setAttribute("d",e);this.ri.setAttribute("transform","translate("+f+","+g+")"+(this.m.L?" scale(-1 1)":""));this.xj=this.ri;sd(this,d);ud(this)}else if(d==h.X.Sb)g=c.Da,d=g.ga(),f=0,g=g.Qf.y,e=z(d).width,this.m.L&&(f=-e),vd(this,f,g,e),sd(this,d),ud(this);else if(c.vb()==h.F.types.ng)td(this,c);else if(c.vb()==h.F.types.Ac)d=c.Da,f=d.If().width,g=d.If().height,wd(this,0,
  0,f,g),sd(this,d),ud(this);else if(c.vb()==h.F.types.Pc)f=c.Xy,d=f.x,f=f.y,this.m.L&&(d-=this.s.Tm),vd(this,d,f,this.s.Tm),sd(this,this.m),ud(this);else if(c.vb()==h.F.types.Jh){d=c.Da;g=z(d);f=g.width+this.s.Sm;g=g.height+this.s.Sm;var k=e=-this.s.Sm/2,l=-this.s.Sm/2;this.m.L&&(k=-(f+e));wd(this,k,l,f,g);sd(this,d);ud(this)}d=c.ga();a=new (h.h.get(h.h.Pp))(d,this.We(),a,c);h.h.Ga(a);a=this.xj.childNodes[0];void 0!==a&&a.beginElement&&a.beginElement()}else this.Ya()};
  function td(a,c){c=c.ga();var d=c.width,e=c.height,f=e*h.i.hg.bA,g=a.s.oz;if(c.Y){var k=ta(a.s,c.Y);e=k;d=h.g.u.moveBy(-g,f)+h.g.u.$("V",-g)+h.g.u.$("H",a.s.Ik)+e.ah+h.g.u.$("H",d+2*g)+h.g.u.$("V",f);a.Of.setAttribute("d",d)}else c.S?(f=k=ta(a.s,c.S),d=h.g.u.moveBy(d,0)+h.g.u.$("h",-(d-f.width))+h.g.u.$("v",a.s.gj)+f.Pd+h.g.u.$("V",e)+h.g.u.$("H",d),a.Of.setAttribute("d",d)):(d=h.g.u.moveBy(-g,f)+h.g.u.$("V",-g)+h.g.u.$("H",d+2*g)+h.g.u.$("V",f),a.Of.setAttribute("d",d));a.m.L&&a.ol(a.Of);a.xj=a.Of;
  sd(a,c);ud(a)}function ud(a){a.Ya();a.xj.style.display=""}function vd(a,c,d,e){a.Tg.setAttribute("x",c);a.Tg.setAttribute("y",d);a.Tg.setAttribute("width",e);a.xj=a.Tg}function wd(a,c,d,e,f){a.si.setAttribute("x",c);a.si.setAttribute("y",d);a.si.setAttribute("width",e);a.si.setAttribute("height",f);a.xj=a.si}b.ol=function(a){a.setAttribute("transform","scale(-1 1)")};b.Ya=function(){this.Tg.style.display="none";this.si.style.display="none";this.ri.style.display="none";this.Of.style.display="none"};
  b.I=function(){this.O&&h.g.j.removeNode(this.O)};h.i.qf=function(a,c,d){this.lb=d;this.df=a;this.Eb=h.g.j.J(h.g.D.Ee,{"class":"blocklyPath"},this.df);this.style=c;this.xs=this.cl=null};b=h.i.qf.prototype;b.xt=function(a){this.Eb.setAttribute("d",a)};b.Ar=function(){this.Eb.setAttribute("transform","scale(-1 1)")};b.Sf=function(a){a?(this.df.appendChild(a),this.cl=a):this.cl=null};b.hh=function(a){a?(this.cl?this.df.insertBefore(a,this.cl):this.df.appendChild(a),this.xs=a):this.xs=null};
  b.dc=function(a){this.Eb.setAttribute("stroke",this.style.uj);this.Eb.setAttribute("fill",this.style.Ph);this.Ly(a.Qa);this.Ot(!a.isEnabled()||$b(a))};b.Hi=function(a){this.style=a};function sa(a,c,d){d?h.g.j.Mb(a.df,c):h.g.j.$c(a.df,c)}b.Jy=function(a){a?this.Eb.setAttribute("filter","url(#"+this.lb.Wn+")"):this.Eb.setAttribute("filter","none")};b.Ly=function(a){a&&(this.Eb.setAttribute("stroke","none"),this.Eb.setAttribute("fill",this.style.Gn))};
  b.Ot=function(a){sa(this,"blocklyDisabled",a);a&&this.Eb.setAttribute("fill","url(#"+this.lb.vw+")")};h.zG=function(){};h.i.rf=function(a){this.name=a;this.Ss=this.s=null};b=h.i.rf.prototype;b.ie=function(){return this.name+"-renderer"};b.za=function(a,c){this.s=this.ss();c&&(this.Ss=c,h.g.object.Ug(this.s,c));this.s.km(a);this.s.za()};b.Ua=function(a,c){this.s.Ua(a,this.name+"-"+c.name,"."+this.ie()+"."+c.ie())};b.ct=function(a,c){var d=this.ea();d.I();this.s=this.ss();this.Ss&&h.g.object.Ug(this.s,this.Ss);this.s.bm=d.bm;this.s.km(c);this.s.za();this.Ua(a,c)};b.I=function(){this.s&&this.s.I()};b.ss=function(){return new h.i.nf};
  b.Bx=function(a){return new h.i.Yd(this,a)};b.zx=function(a,c){return new h.i.zc(a,c)};b.Ax=function(a,c){return new h.i.qf(a,c,this.s)};b.ea=function(){return this.s};b.Ja=function(a){if(h.i.Dm&&!a.ot){if(!h.i.Mc)throw Error("Missing require for Blockly.blockRendering.Debug");var c=new h.i.Mc(this.ea());a.ot=c}c=this.Bx(a);c.measure();this.zx(a,c).draw()};h.ca={};h.ca.nf=function(){h.ca.nf.A.constructor.call(this);this.Cp=!1;this.$b=1;this.uA=30;this.kv=-this.Up/2};h.g.object.W(h.ca.nf,h.i.nf);h.ca.nf.prototype.Er=function(a){return h.ca.nf.A.Er.call(this,a).concat([a+" .blocklyInsertionMarker>.blocklyPathLight,",a+" .blocklyInsertionMarker>.blocklyPathDark {","fill-opacity: "+this.Xm+";","stroke: none;","}"])};h.ca.zu=function(a){this.pa=a;this.Fl=this.la="";this.ac=this.pa.L;a=a.ob;this.s=a.ea();this.md=a.md;this.Uc=this.md.OFFSET;this.Rs=this.md.FA;this.Pj=this.md.kA;this.am=this.md.Zp;this.ND=this.md.Zi;this.RE=this.md.dj;this.vx=this.md.Xi};h.ca.zu.prototype.il=function(a){this.pa.L&&(this.la+=this.vx.ah+h.g.u.$("v",a.height-this.vx.height-this.Uc))};
  function xd(a,c){var d=c.sa+c.width-a.Uc;c.Fw&&(a.la+=h.g.u.$("H",d));a.ac&&(a.la+=h.g.u.$("H",d),c.height>a.Uc&&(a.la+=h.g.u.$("V",c.Kb+c.height-a.Uc)))};h.ca.fg=function(a,c){h.ca.fg.A.constructor.call(this,a,c);this.yg&&(this.width+=this.s.$b,this.height+=this.s.$b)};h.g.object.W(h.ca.fg,h.i.fg);h.ca.qg=function(a,c){h.ca.qg.A.constructor.call(this,a,c);this.yg&&(this.height+=this.s.$b)};h.g.object.W(h.ca.qg,h.i.qg);h.ca.Yd=function(a,c){h.ca.Yd.A.constructor.call(this,a,c)};h.g.object.W(h.ca.Yd,h.i.Yd);b=h.ca.Yd.prototype;b.Zs=function(){h.ca.Yd.A.Zs.call(this);this.Fa.T.length&&this.Fa.T[this.Fa.T.length-1].type==h.Ha.lc||(this.rb.minHeight=this.s.zd-this.s.$b)};
  b.Iv=function(a,c){this.Rj&&a.type==h.Ha.He?(c.elements.push(new h.ca.fg(this.s,a)),c.Tr=!0):a.type==h.Ha.lc?(c.elements.push(new h.ca.qg(this.s,a)),c.Pb=!0):a.type==h.Ha.He?(c.elements.push(new h.i.Um(this.s,a)),c.Jg=!0):a.type==h.Ha.Ae&&(c.minHeight=Math.max(c.minHeight,this.s.ou),c.Lj=!0);this.Rj||null!=c.align||(c.align=a.align)};
  b.Hv=function(){for(var a=!1,c=0,d;d=this.rows[c];c++)d.Jg&&(a=!0);for(c=0;d=this.rows[c];c++){var e=d.elements;d.elements=[];d.ep()&&d.elements.push(new h.i.pf(this.s,this.Zh(null,e[0])));if(e.length){for(var f=0;f<e.length-1;f++){d.elements.push(e[f]);var g=this.Zh(e[f],e[f+1]);d.elements.push(new h.i.pf(this.s,g))}d.elements.push(e[e.length-1]);d.jl()&&(g=this.Zh(e[e.length-1],null),a&&d.Lj&&(g+=this.s.pn),d.elements.push(new h.i.pf(this.s,g)))}}};
  b.Zh=function(a,c){if(!a)return c&&h.i.o.Xe(c)&&c.Kd?this.s.zd:c&&h.i.o.Ng(c)?this.s.Ou:c&&h.i.o.ni(c)?this.s.nv:this.s.Bc;if(!h.i.o.Mf(a)&&(!c||h.i.o.ni(c)))return h.i.o.Xe(a)&&a.Kd?this.s.zd:h.i.o.Qj(a)?2*this.s.Bc+1:h.i.o.mi(a)?this.s.De:h.i.o.tD(a)?this.s.Bc:h.i.o.Og(a)?this.s.xA:h.i.o.px(a)?this.s.De:this.s.Bc;if(h.i.o.Mf(a)&&!c){if(h.i.o.Il(a))return this.s.De;if(h.i.o.Ng(a))return this.s.Bc;if(h.i.o.ni(a))return this.s.De}if(!h.i.o.Mf(a)&&c&&h.i.o.Mf(c)){if(h.i.o.Xe(a)&&a.Kd){if(h.i.o.Ng(c)||
  h.i.o.Il(c))return this.s.VA}else{if(h.i.o.Ng(c)||h.i.o.Il(c))return this.s.Ou;if(h.i.o.ni(c))return this.s.Bc}return this.s.Bc-1}if(h.i.o.Qj(a)&&c&&!h.i.o.Mf(c))return this.s.Bc;if(h.i.o.Ng(a)&&c&&h.i.o.Xe(c))return c.Kd?this.s.zd:this.s.Bc;if(h.i.o.Jl(a)&&c){if(h.i.o.mi(c))return this.s.De;if(h.i.o.Uj(c))return c.Nd;if(h.i.o.Pg(c))return a=(this.L?1:-1)*this.s.$b/2,c.Nd+a}if(h.i.o.Og(a)&&c){if(h.i.o.Uj(c))return c.Nd-this.s.pb;if(h.i.o.Pg(c))return a=(this.L?1:-1)*this.s.$b/2,c.Nd-this.s.pb+a}return h.i.o.Xe(a)&&
  c&&h.i.o.Xe(c)&&a.Kd==c.Kd||c&&h.i.o.px(c)?this.s.Bc:this.s.zd};b.Uw=function(a,c){return h.i.o.to(a)&&h.i.o.lo(c)?this.s.Cz:h.i.o.to(a)||h.i.o.lo(c)?this.s.De:a.Jg&&c.Jg?this.s.Bc:!a.Pb&&c.Pb?this.s.fz:a.Pb&&c.Pb||!a.Pb&&c.Lj||a.Lj?this.s.Bc:this.s.zd};
  b.Kw=function(a,c){if(h.i.o.pd(c))return a.Kb+c.height/2;if(h.i.o.lo(a))return a=a.Kb+a.height-a.dl,h.i.o.Pg(c)?a+c.height/2:a-c.height/2;if(h.i.o.to(a))return h.i.o.mi(c)?a.zf-c.height/2:a.zf+c.height/2;var d=a.Kb;h.i.o.Xe(c)||h.i.o.Qj(c)?(d+=c.height/2,(a.Tr||a.Pb)&&c.height+this.s.ov<=a.height&&(d+=this.s.ov)):d=h.i.o.Ng(c)?d+c.height/2:d+a.height/2;return d};
  b.wq=function(){if(this.Rj){for(var a=0,c=null,d=this.rows.length-1,e;e=this.rows[d];d--)e.Fs=a,h.i.o.oD(e)&&(e.Pb&&hd(this,e),c&&c.Pb&&e.width<c.width?e.Fs=c.width:a=e.width,c=e);for(d=a=0;e=this.rows[d];d++)e.Pb?a=this.wl(e):h.i.o.pd(e)?e.width=Math.max(a,e.Fs):(a=Math.max(a,e.Fs)-e.width,0<a&&id(e,a),a=e.width)}else h.ca.Yd.A.wq.call(this)};b.wl=function(a){return this.Rj&&a.Pb?this.jh+this.s.uA+this.Rd:h.ca.Yd.A.wl.call(this,a)};
  b.Bw=function(){for(var a=0,c=0,d=0,e;e=this.rows[d];d++){e.Kb=c;e.sa=this.Rd;c+=e.height;a=Math.max(a,e.wd);var f=c-this.Jb.nj;e==this.rb&&f<this.s.Fk&&(f=this.s.Fk-f,this.rb.height+=f,c+=f);jd(this,e)}this.S&&this.Fa.Z&&this.Fa.Z.isConnected()&&(a=Math.max(a,z(this.Fa.Z.va()).width-this.s.$b));this.rb.$d=c-this.rb.dl;this.oh=a+this.Rd+this.s.$b;this.width+=this.s.$b;this.height=c+this.s.$b;this.cp=this.Jb.zf};h.ca.zc=function(a,c){h.ca.zc.A.constructor.call(this,a,c);this.Ve=new h.ca.zu(c)};h.g.object.W(h.ca.zc,h.i.zc);b=h.ca.zc.prototype;b.draw=function(){od(this);pd(this);qd(this);var a=this.Fa.wb;a.xt(this.La+"\n"+this.jo);var c=this.Ve;a.Ii.setAttribute("d",c.la+"\n"+c.Fl);this.pa.L&&a.Ar();h.i.Dm&&md(this.Fa.ot,this.Fa,this.pa);rd(this)};
  b.qr=function(){var a=this.Ve,c=this.pa.Jb;a.la+=h.g.u.moveBy(c.sa,a.pa.cp);for(var d=0,e;e=c.elements[d];d++)h.i.o.Jl(e)?a.la+=a.md.jv:h.i.o.Og(e)?a.la+=a.Rs.Lt(a.ac):h.i.o.Uj(e)?a.la+=a.ND.ah:h.i.o.mi(e)?a.la+=a.RE.path(a.ac):h.i.o.pd(e)&&0!=e.width&&(a.la+=h.g.u.$("H",e.sa+e.width-a.Uc));a.la+=h.g.u.$("H",c.sa+c.width-a.Uc);xd(this.Ve,this.pa.Jb);h.ca.zc.A.qr.call(this)};b.il=function(a){this.Ve.il(a);h.ca.zc.A.il.call(this,a)};
  b.rr=function(a){var c=this.Ve,d=O(a);if(c.ac){var e=a.height-d.vj;c.la+=h.g.u.moveTo(d.sa+d.width-c.Uc,a.Kb)+c.am.Pd(c.ac)+h.g.u.$("v",e)}else c.la+=h.g.u.moveTo(d.sa+d.width,a.Kb)+c.am.Pd(c.ac);h.ca.zc.A.rr.call(this,a)};
  b.pr=function(a){var c=this.Ve,d=O(a);if(c.ac){var e=a.height-2*c.Pj.height;c.la+=h.g.u.moveTo(d.sa,a.Kb)+c.Pj.Vs(c.ac)+h.g.u.$("v",e)+c.Pj.To(c.ac)+h.g.u.lineTo(a.width-d.sa-c.Pj.width,0)}else c.la+=h.g.u.moveTo(d.sa,a.Kb+a.height)+c.Pj.To(c.ac)+h.g.u.lineTo(a.width-d.sa-c.Pj.width,0);h.ca.zc.A.pr.call(this,a)};b.zw=function(a){xd(this.Ve,a);this.La+=h.g.u.$("H",a.sa+a.width)+h.g.u.$("V",a.Kb+a.height)};
  b.lr=function(){var a=this.Ve,c=this.pa.rb;if(a.ac)a.la+=h.g.u.$("V",c.$d-a.Uc);else{var d=a.pa.rb.elements[0];h.i.o.Jl(d)?a.la+=h.g.u.moveTo(c.sa+a.Uc,c.$d-a.Uc):h.i.o.Og(d)&&(a.la+=h.g.u.moveTo(c.sa,c.$d),a.la+=a.Rs.Fq())}h.ca.zc.A.lr.call(this)};
  b.nr=function(){var a=this.Ve,c=a.pa.S;c&&(c=c.ld+c.height,a.ac?a.la+=h.g.u.moveTo(a.pa.Rd,c):(a.la+=h.g.u.moveTo(a.pa.Rd+a.Uc,a.pa.rb.$d-a.Uc),a.la+=h.g.u.$("V",c)),a.la+=a.am.Xl(a.ac));a.ac||(c=a.pa.Jb,a.la=h.i.o.Og(c.elements[0])?a.la+h.g.u.$("V",a.Rs.height):a.la+h.g.u.$("V",c.zf+a.Uc));h.ca.zc.A.nr.call(this)};
  b.mr=function(a){var c=this.Ve,d=c.Uc,e=a.sa+a.Ne,f=a.xg-a.height/2,g=a.width-a.Ne,k=f+d;if(c.ac){f=a.ld-d;var l=a.height-(a.ld+a.vj)+d;c.Fl+=h.g.u.moveTo(e-d,k)+h.g.u.$("v",f)+c.am.Pd(c.ac)+h.g.u.$("v",l)+h.g.u.$("h",g)}else c.Fl+=h.g.u.moveTo(a.sa+a.width+d,k)+h.g.u.$("v",a.height)+h.g.u.$("h",-g)+h.g.u.moveTo(e,f+a.ld)+c.am.Pd(c.ac);h.ca.zc.A.mr.call(this,a)};b.ey=function(a){var c=a.xg-a.height/2;if(a.nc){var d=a.sa+a.Ne+this.s.$b;this.pa.L&&(d*=-1);F(a.nc,d,c+a.ld+this.s.$b)}};
  b.iy=function(a){var c=O(a);if(c.nc){var d=a.sa+a.jh+c.Nd;d=this.pa.L?-1*d:d+this.s.$b;F(c.nc,d,a.Kb+this.s.$b)}};b.by=function(a){var c=O(a);if(c.nc){var d=a.sa+a.width+this.s.$b;this.pa.L&&(d*=-1);F(c.nc,d,a.Kb)}};b.gy=function(){var a=this.pa.rb;if(a.connection){var c=a.connection,d=c.sa;F(c.nc,(this.pa.L?-d:d)+this.s.$b/2,a.$d+this.s.$b)}};h.ca.yu=function(a){this.wj=a;this.OFFSET=.5;this.jv=h.g.u.moveBy(this.OFFSET,this.OFFSET)};b=h.ca.yu.prototype;b.za=function(){this.kA=yd(this);this.FA=zd(this);this.Zp=this.vs();this.Zi=this.us();this.Xi=this.ts();this.dj=this.ws()};
  function yd(a){var c=a.wj.pb;a=a.OFFSET;var d=(1-Math.SQRT1_2)*(c+a)-a,e=h.g.u.moveBy(d,d)+h.g.u.arc("a","0 0,0",c,h.g.u.Ia(-d-a,c-d)),f=h.g.u.arc("a","0 0,0",c+a,h.g.u.Ia(c+a,c+a)),g=h.g.u.moveBy(d,-d)+h.g.u.arc("a","0 0,0",c+a,h.g.u.Ia(c-d,d+a));return{width:c+a,height:c,Vs:function(k){return k?e:""},To:function(k){return k?f:g}}}
  function zd(a){var c=a.wj.pb;a=a.OFFSET;var d=(1-Math.SQRT1_2)*(c-a)+a,e=h.g.u.moveBy(d,d)+h.g.u.arc("a","0 0,1",c-a,h.g.u.Ia(c-d,-d+a)),f=h.g.u.moveBy(a,c)+h.g.u.arc("a","0 0,1",c-a,h.g.u.Ia(c,-c+a)),g=-d,k=h.g.u.moveBy(d,g)+h.g.u.arc("a","0 0,1",c-a,h.g.u.Ia(-d+a,-g-c));return{height:c,Lt:function(l){return l?e:f},Fq:function(){return k}}}
  b.vs=function(){var a=this.wj.pn,c=this.wj.Mk,d=h.g.u.moveBy(-2,-c+3.4)+h.g.u.lineTo(-.45*a,-2.1),e=h.g.u.$("v",2.5)+h.g.u.moveBy(.97*-a,2.5)+h.g.u.curve("q",[h.g.u.Ia(.05*-a,10),h.g.u.Ia(.3*a,9.5)])+h.g.u.moveBy(.67*a,-1.9)+h.g.u.$("v",2.5),f=h.g.u.$("v",-1.5)+h.g.u.moveBy(-.92*a,-.5)+h.g.u.curve("q",[h.g.u.Ia(-.19*a,-5.5),h.g.u.Ia(0,-11)])+h.g.u.moveBy(.92*a,1),g=h.g.u.moveBy(-5,c-.7)+h.g.u.lineTo(.46*a,-2.1);return{width:a,height:c,Xl:function(k){return k?d:f},Pd:function(k){return k?e:g}}};
  b.us=function(){return{ah:h.g.u.$("h",this.OFFSET)+this.wj.Zi.ah}};b.ts=function(){return{ah:h.g.u.lineTo(5.1,2.6)+h.g.u.moveBy(-10.2,6.8)+h.g.u.lineTo(5.1,2.6),height:12,width:10.2}};b.ws=function(){var a=this.wj.dj.height,c=h.g.u.moveBy(25,-8.7)+h.g.u.curve("c",[h.g.u.Ia(29.7,-6.2),h.g.u.Ia(57.2,-.5),h.g.u.Ia(75,8.7)]),d=h.g.u.curve("c",[h.g.u.Ia(17.8,-9.2),h.g.u.Ia(45.3,-14.9),h.g.u.Ia(75,-8.7)])+h.g.u.moveTo(100.5,a+.5);return{path:function(e){return e?c:d}}};h.ca.qf=function(a,c,d){this.lb=d;this.df=a;this.um=h.g.j.J(h.g.D.Ee,{"class":"blocklyPathDark",transform:"translate(1,1)"},this.df);this.Eb=h.g.j.J(h.g.D.Ee,{"class":"blocklyPath"},this.df);this.Ii=h.g.j.J(h.g.D.Ee,{"class":"blocklyPathLight"},this.df);this.Qq="#000000";this.style=c};h.g.object.W(h.ca.qf,h.i.qf);b=h.ca.qf.prototype;b.xt=function(a){this.Eb.setAttribute("d",a);this.um.setAttribute("d",a)};
  b.Ar=function(){this.Eb.setAttribute("transform","scale(-1 1)");this.Ii.setAttribute("transform","scale(-1 1)");this.um.setAttribute("transform","translate(1,1) scale(-1 1)")};b.dc=function(a){this.Ii.style.display="";this.um.style.display="";this.Ii.setAttribute("stroke",this.style.uj);this.um.setAttribute("fill",this.Qq);h.ca.qf.A.dc.call(this,a);this.Eb.setAttribute("stroke","none")};b.Hi=function(a){this.style=a;this.Qq=h.g.sb.Cq("#000",this.style.Ph,.2)||this.Qq};
  b.Jy=function(a){a?(this.Eb.setAttribute("filter","url(#"+this.lb.Wn+")"),this.Ii.style.display="none"):(this.Eb.setAttribute("filter","none"),this.Ii.style.display="inline")};b.Ly=function(a){a&&(this.Ii.style.display="none",this.um.setAttribute("fill",this.style.Gn),this.Eb.setAttribute("stroke","none"),this.Eb.setAttribute("fill",this.style.Gn))};b.Ot=function(a){h.ca.qf.A.Ot.call(this,a);a&&this.Eb.setAttribute("stroke","none")};h.ca.rf=function(a){h.ca.rf.A.constructor.call(this,a);this.md=null};h.g.object.W(h.ca.rf,h.i.rf);b=h.ca.rf.prototype;b.za=function(a,c){h.ca.rf.A.za.call(this,a,c);this.md=new h.ca.yu(this.ea());this.md.za()};b.ct=function(a,c){h.ca.rf.A.ct.call(this,a,c);this.md.za()};b.ss=function(){return new h.ca.nf};b.Bx=function(a){return new h.ca.Yd(this,a)};b.zx=function(a,c){return new h.ca.zc(a,c)};b.Ax=function(a,c){return new h.ca.qf(a,c,this.ea())};h.i.register("geras",h.ca.rf);h.P.ADD_COMMENT="\u0414\u0430\u0434\u0430\u0446\u044c \u043a\u0430\u043c\u0435\u043d\u0442\u0430\u0440\u044b\u0439";h.P.CANNOT_DELETE_VARIABLE_PROCEDURE="\u041d\u0435\u043c\u0430\u0433\u0447\u044b\u043c\u0430 \u0432\u044b\u0434\u0430\u043b\u0456\u0446\u044c \u043f\u0435\u0440\u0430\u043c\u0435\u043d\u043d\u0443\u044e '%1', \u043f\u0430\u043a\u043e\u043b\u044c\u043a\u0456 \u044f\u043d\u0430 \u0437'\u044f\u045e\u043b\u044f\u0435\u0446\u0446\u0430 \u0447\u0430\u0441\u0442\u043a\u0430\u0439 \u0432\u044b\u0437\u043d\u0430\u0447\u044d\u043d\u043d\u044f \u0444\u0443\u043d\u043a\u0446\u044b\u0456 '%2'";
  h.P.CLEAN_UP="\u0412\u044b\u0440\u0430\u045e\u043d\u0430\u0432\u0430\u0446\u044c \u0431\u043b\u043e\u043a\u0456";h.P.COLLAPSE_ALL="\u0417\u0433\u0430\u0440\u043d\u0443\u0446\u044c \u0431\u043b\u043e\u043a\u0456";h.P.COLLAPSE_BLOCK="\u0417\u0433\u0430\u0440\u043d\u0443\u0446\u044c \u0431\u043b\u043e\u043a";h.P.DELETE_ALL_BLOCKS="\u0412\u044b\u0434\u0430\u043b\u0456\u0446\u044c \u0443\u0441\u0435 \u0431\u043b\u043e\u043a\u0456 %1?";h.P.DELETE_BLOCK="\u0412\u044b\u0434\u0430\u043b\u0456\u0446\u044c \u0431\u043b\u043e\u043a";
  h.P.DELETE_VARIABLE_CONFIRMATION="\u0412\u044b\u0434\u0430\u043b\u0456\u0446\u044c %1 \u0432\u044b\u043a\u0430\u0440\u044b\u0441\u0442\u0430\u043d\u043d\u044f \u043f\u0435\u0440\u0430\u043c\u0435\u043d\u043d\u0430\u0439 '%2'?";h.P.DELETE_X_BLOCKS="\u0412\u044b\u0434\u0430\u043b\u0456\u0446\u044c %1 \u0431\u043b\u043e\u043a\u0430\u045e";h.P.DISABLE_BLOCK="\u0410\u0434\u043a\u043b\u044e\u0447\u044b\u0446\u044c \u0431\u043b\u043e\u043a";h.P.DUPLICATE_BLOCK="\u0414\u0443\u0431\u043b\u044f\u0432\u0430\u0446\u044c";
  h.P.DUPLICATE_COMMENT="Duplicate Comment";h.P.ENABLE_BLOCK="\u0423\u043a\u043b\u044e\u0447\u044b\u0446\u044c \u0431\u043b\u043e\u043a";h.P.EXPAND_ALL="\u0420\u0430\u0437\u0433\u0430\u0440\u043d\u0443\u0446\u044c \u0431\u043b\u043e\u043a\u0456";h.P.EXPAND_BLOCK="\u0420\u0430\u0437\u0433\u0430\u0440\u043d\u0443\u0446\u044c \u0431\u043b\u043e\u043a";h.P.EXTERNAL_INPUTS="\u0417\u043d\u0435\u0448\u043d\u0456\u044f \u045e\u0432\u0430\u0445\u043e\u0434\u044b";h.P.HELP="\u0414\u0430\u0432\u0435\u0434\u043a\u0430";
  h.P.INLINE_INPUTS="\u0423\u0431\u0443\u0434\u0430\u0432\u0430\u043d\u044b\u044f \u045e\u0432\u0430\u0445\u043e\u0434\u044b";h.P.NEW_VARIABLE="\u0421\u0442\u0432\u0430\u0440\u044b\u0446\u044c \u043f\u0435\u0440\u0430\u043c\u0435\u043d\u043d\u0443\u044e...";h.P.NEW_VARIABLE_TITLE="\u041d\u043e\u0432\u0430\u044f \u043d\u0430\u0437\u0432\u0430 \u043f\u0435\u0440\u0430\u043c\u0435\u043d\u043d\u0430\u0439:";h.P.PROCEDURES_DEFNORETURN_PROCEDURE="\u0432\u044b\u043a\u0430\u043d\u0430\u0446\u044c \u043d\u0435\u0448\u0442\u0430";
  h.P.REDO="\u041f\u0430\u045e\u0442\u0430\u0440\u044b\u0446\u044c";h.P.REMOVE_COMMENT="\u0412\u044b\u0434\u0430\u043b\u0456\u0446\u044c \u043a\u0430\u043c\u0435\u043d\u0442\u0430\u0440";h.P.RENAME_VARIABLE="\u041f\u0435\u0440\u0430\u0439\u043c\u0435\u043d\u0430\u0432\u0430\u0446\u044c \u043f\u0435\u0440\u0430\u043c\u0435\u043d\u043d\u0443\u044e...";h.P.RENAME_VARIABLE_TITLE="\u041f\u0435\u0440\u0430\u0439\u043c\u0435\u043d\u0430\u0432\u0430\u0446\u044c \u0443\u0441\u0435 \u043f\u0435\u0440\u0430\u043c\u0435\u043d\u043d\u044b\u044f '%1' \u0434\u0430:";
  h.P.UNDO="\u0410\u0434\u043a\u0430\u0446\u0456\u0446\u044c";h.P.UNNAMED_KEY="unnamed";h.P.VARIABLE_ALREADY_EXISTS="\u041f\u0435\u0440\u0430\u043c\u0435\u043d\u043d\u0430\u044f \u0437 \u043d\u0430\u0437\u0432\u0430\u0439 '%1' \u0443\u0436\u043e \u0456\u0441\u043d\u0443\u0435.";h.P.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE="\u041d\u0430\u0437\u0432\u0430 \u043f\u0435\u0440\u0430\u043c\u0435\u043d\u043d\u0430\u0439 '%1' \u0443\u0436\u043e \u0432\u044b\u043a\u0430\u0440\u044b\u0441\u0442\u043e\u045e\u0432\u0430\u0435\u0446\u0446\u0430 \u0456\u043d\u0448\u0430\u0439 \u043f\u0435\u0440\u0430\u043c\u0435\u043d\u043d\u0430\u0439 \u0442\u044b\u043f\u0443 '%2'.";
  h.P.WORKSPACE_ARIA_LABEL="Blockly Workspace";h.P.WORKSPACE_COMMENT_DEFAULT_TEXT="Say something...";h.P.PROCEDURES_DEFRETURN_PROCEDURE=h.P.PROCEDURES_DEFNORETURN_PROCEDURE;var BlocklyStorage={},Ad=null,Bd=null,Cd=null;function Dd(){var a=Ad();Ed("xml="+encodeURIComponent(a),Fd)}var Gd={};
  function Ed(a,c){Gd["/storage"]&&Gd["/storage"].abort();Gd["/storage"]=new XMLHttpRequest;Gd["/storage"].onload=function(){200===this.status?c&&c.call(this):Hd(N("Games_httpRequestError")+"\nXHR status: "+this.status);Gd["/storage"]=null};Gd["/storage"].open("POST","/storage");Gd["/storage"].setRequestHeader("Content-Type","application/x-www-form-urlencoded");Gd["/storage"].send(a)}
  function Fd(){window.location.hash=this.responseText.trim();Hd(N("Games_linkAlert").replace("%1",window.location.href));Cd=Ad()}function Id(){var a=this.responseText.trim();a.length?Bd(a):Hd(N("Games_hashError").replace("%1",window.location.hash));Cd=Ad()}function Hd(a){if("object"===typeof P){var c=document.getElementById("linkButton");P.UE(c,a)}else alert(a)};var w=null,Jd="",Kd="";function Ld(){bd();var a=document.getElementById("linkButton");a&&(Zc?a.style.display="none":(Ad=Md,Bd=Nd,fd(a,Dd)));(a=document.getElementById("languageMenu"))&&a.addEventListener("change",Od,!0)}
  function Pd(){var a='<xml><block movable="'+(1!=M)+'" type="go_east" x="70" y="70"></block></xml>';if(!Zc&&1<window.location.hash.length)Ed("key="+encodeURIComponent(window.location.hash.substring(1)),Id);else{var c=null;try{c=window.sessionStorage.qs}catch(e){}c&&delete window.sessionStorage.qs;var d=cd(M);(a=c||d||a)&&Nd(a)}}function Nd(a){a=h.K.ue(a);w.clear();h.K.Uh(a,w);a=w;a.Li.length=0;a.cm.length=0;h.h.SB()}
  function Md(){var a=h.K.Ty(!0);if(1==w.tb(!1).length&&a.querySelector){var c=a.querySelector("block");c&&(c.removeAttribute("x"),c.removeAttribute("y"))}return h.K.Gd(a)}function Qd(){"object"==typeof BlocklyStorage&&null!==Cd&&Cd!=Md()&&(window.location.hash="",Cd=null)}function Rd(a){var c=document.getElementById("toolbox");c&&(a.toolbox=c);a.media="third-party/blockly/media/";a.oneBasedIndex=!1;w=h.Lg("blockly",a);C(w,Qd)}function Sd(){window.location=(Zc?"index.html":"./")+"?lang="+L}
  function Od(){window.sessionStorage&&(window.sessionStorage.qs=Md());var a=document.getElementById("languageMenu");a=encodeURIComponent(a.options[a.selectedIndex].value);var c=window.location.search;c=1>=c.length?"?lang="+a:/[?&]lang=[^&]*/.test(c)?c.replace(/([?&]lang=)[^&]*/,"$1"+a):c.replace(/\?/,"?lang="+a+"&");window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+c}
  function Td(){10>M?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+L+"&level="+(M+1):Sd()}function Ud(a){if(a){var c=a.match(/^block_id_([^']+)$/);c&&(a=c[1])}Nc(a,void 0)}function Vd(a){a=a.replace(/(,\s*)?'block_id_[^']+'\)/g,")");return a.replace(/\s+$/,"")}function Wd(a){if("click"==a.type&&"touchend"==Xd&&Yd+2E3>Date.now()||Xd==a.type&&Yd+400>Date.now())return a.preventDefault(),a.stopPropagation(),!0;Xd=a.type;Yd=Date.now();return!1}
  var Xd=null,Yd=0;function Zd(){setTimeout(function(){var a=document.createElement("script");a.type="text/javascript";a.src="third-party/JS-Interpreter/compressed.js";document.head.appendChild(a)},1)}function $d(){setTimeout(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)},1)};var P={ji:!1,sw:null,Rn:null,mm:function(a,c,d,e,f,g){function k(){P.ji&&(l.style.visibility="visible",l.style.zIndex=10,m.style.visibility="hidden")}if(!a)throw TypeError("Content not found: "+a);P.ji&&P.Jd(!1);h.Fg()&&h.ec(!0);P.ji=!0;P.sw=c;P.Rn=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),P.Xq=h.Nh(e,"mousedown",null,P.kC));l.appendChild(a);a.className=a.className.replace("dialogHiddenContent","");d&&c?(P.Bo(c,!1,.2),P.Bo(l,!0,.8),setTimeout(k,175)):k()},tw:0,uw:0,kC:function(a){P.$q();if(!h.g.Kl(a)){var c=document.getElementById("dialog");P.tw=c.offsetLeft-a.clientX;P.uw=c.offsetTop-a.clientY;P.Zq=h.Nh(document,"mouseup",null,P.$q);P.Yq=h.Nh(document,"mousemove",null,P.lC);a.stopPropagation()}},lC:function(a){var c=document.getElementById("dialog"),
  d=P.tw+a.clientX;a=P.uw+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"},$q:function(){P.Zq&&(h.ip(P.Zq),P.Zq=null);P.Yq&&(h.ip(P.Yq),P.Yq=null)},Jd:function(a){function c(){e.style.zIndex=-1;e.style.visibility="hidden";document.getElementById("dialogBorder").style.visibility="hidden"}if(P.ji){P.$q();P.Xq&&(h.ip(P.Xq),P.Xq=null);P.ji=!1;P.Rn&&P.Rn();P.Rn=null;var d=!1===a?
  null:P.sw;a=document.getElementById("dialog");var e=document.getElementById("dialogShadow");e.style.opacity=0;d&&a?(P.Bo(a,!1,.8),P.Bo(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)}},Bo: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=P.Iw(a);c?(f.className="dialogAnimate",setTimeout(e,1)):(f.className="",e());f.style.visibility="visible"}},Iw:function(a){var c=h.g.style.$h(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},UE: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");P.mm(d,a,!0,!0,{width:"50%",left:"25%",top:"5em"},P.Cy);P.zy()},Ev:function(){if(!cd(M))if(P.ji||w.Xc())setTimeout(P.Ev,15E3);else{var a=document.getElementById("dialogAbort"),c=document.getElementById("abortCancel");c.addEventListener("click",P.Jd,!0);c.addEventListener("touchend",P.Jd,!0);c=document.getElementById("abortOk");c.addEventListener("click",Sd,!0);c.addEventListener("touchend",Sd,
  !0);P.mm(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",P.Dv,!0)});document.body.addEventListener("keydown",P.Dv,!0)}},XB:function(){var a=document.getElementById("dialogDone");if(w){var c=document.getElementById("dialogLinesText");c.textContent="";var d=Kd;d=Vd(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?N("Games_linesOfCode1"):N("Games_linesOfCode2").replace("%1",String(e));c.appendChild(document.createTextNode(d))}d=10>M?N("Games_nextLevel").replace("%1",String(M+1)):N("Games_finalLevel");c=document.getElementById("doneCancel");c.addEventListener("click",P.Jd,!0);c.addEventListener("touchend",P.Jd,!0);c=document.getElementById("doneOk");c.addEventListener("click",Td,!0);c.addEventListener("touchend",
  Td,!0);P.mm(a,null,!1,!0,{width:"40%",left:"30%",top:"3em"},function(){document.body.removeEventListener("keydown",P.Yv,!0)});document.body.addEventListener("keydown",P.Yv,!0);document.getElementById("dialogDoneText").textContent=d},rw:function(a){!P.ji||13!=a.keyCode&&27!=a.keyCode&&32!=a.keyCode||(P.Jd(!0),a.stopPropagation(),a.preventDefault())},zy:function(){document.body.addEventListener("keydown",P.rw,!0)},Cy:function(){document.body.removeEventListener("keydown",P.rw,!0)},Yv:function(a){if(13==
  a.keyCode||27==a.keyCode||32==a.keyCode)P.Jd(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&Td()},Dv:function(a){if(13==a.keyCode||27==a.keyCode||32==a.keyCode)P.Jd(!0),a.stopPropagation(),a.preventDefault(),27!=a.keyCode&&Sd()}};window.BlocklyDialogs=P;P.hideDialog=P.Jd;h.Generator=function(a){this.Ul=a};h.Generator.Qu="generated_function";b=h.Generator.prototype;b.Bu=null;b.ln=null;b.mn=null;b.iA="  ";b.kz=60;b.gn=[];b.fs=null;function ae(a,c){return c+a.replace(/(?!\n$)\n/g,"\n"+c)}
  function be(a,c){!1===a.fs&&console.warn("Generator init was not called before blockToCode was called.");if(!c)return"";if(!c.isEnabled())return be(a,t(c));if(c.od())return be(a,ca(c,!1)[0]);var d=a[c.type];if("function"!=typeof d)throw Error('Language "'+a.Ul+'" does not know how to generate  code for block type "'+c.type+'".');d=d.call(c,c);if(Array.isArray(d)){if(!c.S)throw TypeError("Expecting string from statement block: "+c.type);return[a.tt(c,d[0],void 0),d[1]]}if("string"==typeof d)return a.ln&&
  !c.Gt&&(d=ce(a.ln,c)+d),a.mn&&!c.Gt&&(d+=ce(a.mn,c)),a.tt(c,d,void 0);if(null===d)return"";throw SyntaxError("Invalid code generated: "+d);}
  function de(a,c,d){var e=h.H;if(isNaN(d))throw TypeError("Expecting valid order from block: "+a.type);var f=fc(a,c);if(!f)return"";c=be(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.gn.length;g++)if(e.gn[g][0]==d&&e.gn[g][1]==c){f=!1;break}f&&(a=
  "("+a+")");return a}function ee(a,c){var d=h.H;a=fc(a,c);c=be(d,a);if("string"!=typeof c)throw TypeError("Expecting code from statement block: "+(a&&a.type));c&&(c=ae(c,d.iA));return c}function ce(a,c){c=c.id.replace(/\$/g,"$$$$");return a.replace(/%1/g,"'"+c+"'")}b.aq="";function fe(a,c){a.aq+=c+","}b.za=function(){};b.tt=function(a,c){return c};b.finish=function(a){return a};b.uy=function(a){return a};h.H=new h.Generator("JavaScript");fe(h.H,"break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,new,return,super,switch,this,throw,try,typeof,var,void,while,with,yield,enum,implements,interface,let,package,private,protected,public,static,await,null,true,false,arguments,"+Object.getOwnPropertyNames(h.g.global).join(","));h.H.nH=0;h.H.FH=1.1;h.H.fn=1.2;h.H.dn=2;h.H.CH=3;h.H.wH=3;h.H.qH=4.1;h.H.IH=4.2;h.H.$u=4.3;h.H.Wu=4.4;
  h.H.HH=4.5;h.H.JH=4.6;h.H.xH=4.7;h.H.oH=4.8;h.H.AH=5;h.H.Yu=5.1;h.H.yH=5.2;h.H.EH=5.3;h.H.Zu=6.1;h.H.cn=6.2;h.H.sH=7;h.H.GH=8;h.H.BH=8;h.H.DH=8;h.H.zH=9;h.H.pH=10;h.H.tH=11;h.H.rH=12;h.H.Vu=13;h.H.Xu=14;h.H.vH=15;h.H.mH=16;h.H.KH=17;h.H.uH=18;h.H.DA=99;h.H.gn=[[h.H.dn,h.H.fn],[h.H.dn,h.H.dn],[h.H.fn,h.H.fn],[h.H.fn,h.H.dn],[h.H.Wu,h.H.Wu],[h.H.Yu,h.H.Yu],[h.H.cn,h.H.cn],[h.H.Vu,h.H.Vu],[h.H.Xu,h.H.Xu]];h.H.fs=!1;
  h.H.za=function(a){h.H.On=Object.create(null);h.H.DC=Object.create(null);h.H.Fm?h.H.Fm.reset():h.H.Fm=new h.Ad(h.H.aq);h.H.Fm.zt(a.Oa);for(var c=[],d=h.oa.qB(a),e=0;e<d.length;e++)c.push(Vc(d[e],h.Ad.zp));a=h.oa.Jv(a);for(e=0;e<a.length;e++)c.push(Vc(a[e].pc(),h.ij));c.length&&(h.H.On.variables="var "+c.join(", ")+";");this.fs=!0};h.H.finish=function(a){var c=[],d;for(d in h.H.On)c.push(h.H.On[d]);delete h.H.On;delete h.H.DC;h.H.Fm.reset();return c.join("\n\n")+"\n\n\n"+a};
  h.H.uy=function(a){return a+";\n"};h.H.cE=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/'/g,"\\'");return"'"+a+"'"};h.H.wJ=function(a){return a.split(/\n/g).map(h.H.cE).join(" + '\\n' +\n")};
  h.H.tt=function(a,c,d){var e="";if(!a.S||!a.S.Aa){var f=a.ce.text;f&&(f=h.g.Ra.Uy(f,h.H.kz-3),e+=ae(f+"\n","// "));for(var g=0;g<a.T.length;g++)if(a.T[g].type==h.Ha.He){var k=a.T[g].connection.va();if(k){f=[];k=r(k,!0);for(var l=0;l<k.length;l++){var m=k[l].ce.text;m&&f.push(m)}f.length&&f.push("");(f=f.join("\n"))&&(e+=ae(f,"// "))}}}a=a.Z&&a.Z.va();d=d?"":be(h.H,a);return e+c+d};
  h.H.bJ=function(a,c,d,e,f){d=d||0;f=f||h.H.DA;a.B.options.Po&&d--;var g=a.B.options.Po?"1":"0";a=0<d?de(a,c,h.H.cn)||g:0>d?de(a,c,h.H.Zu)||g:e?de(a,c,h.H.$u)||g:de(a,c,f)||g;if(h.sD(a))a=Number(a)+d,e&&(a=-a);else{if(0<d){a=a+" + "+d;var k=h.H.cn}else 0>d&&(a=a+" - "+-d,k=h.H.Zu);e&&(a=d?"-("+a+")":"-"+a,k=h.H.$u);k=Math.floor(k);f=Math.floor(f);k&&f>=k&&(a="("+a+")")}return a};h.Vd=function(a,c,d,e,f,g,k){if(!a)throw Error("Src value of an image field is required");a=h.g.ad(a);d=Number(h.g.ad(d));c=Number(h.g.ad(c));if(isNaN(d)||isNaN(c))throw Error("Height and width values of an image field must cast to numbers.");if(0>=d||0>=c)throw Error("Height and width values of an image field must be greater than 0.");this.ol=!1;this.wn="";h.Vd.A.constructor.call(this,a,null,k);k||(this.ol=!!g,this.wn=h.g.ad(e)||"");this.vc=new h.g.gd(c,d+h.Vd.lB);this.iD=d;this.Bf=null;"function"==
  typeof f&&(this.Bf=f);this.Hc=null};h.g.object.W(h.Vd,h.xd);h.Vd.prototype.xp="";h.Vd.ba=function(a){return new h.Vd(a.src,a.width,a.height,void 0,void 0,void 0,a)};h.Vd.lB=1;b=h.Vd.prototype;b.tk=!1;b.Mg=!1;b.Vk=function(a){h.Vd.A.Vk.call(this,a);this.ol=!!a.flipRtl;this.wn=h.g.ad(a.alt)||""};b.io=function(){this.Hc=h.g.j.J(h.g.D.Ak,{height:this.iD+"px",width:this.vc.width+"px",alt:this.wn},this.Tc);this.Hc.setAttributeNS(h.g.j.hd,"xlink:href",this.ff);this.Bf&&(this.Hc.style.cursor="pointer")};
  b.My=function(){};b.Un=function(a){return"string"!=typeof a?null:a};b.hl=function(a){this.ff=a;this.Hc&&this.Hc.setAttributeNS(h.g.j.hd,"xlink:href",String(this.ff))};b.Lw=function(){return this.ol};b.bp=function(){this.Bf&&this.Bf(this)};b.Or=function(){return this.wn};h.Cg.register("field_image",h.Vd);var ge={},Q,he,ie,R,S,T,je;
  h.Xb.maze_goEast={za:function(){bc(this,{type:"go_east",lastDummyAlign0:"CENTRE",message0:"%1 %2",args0:[{type:"field_label_serializable",name:"go-east-text",text:"E"},{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADpCAMAAABx2AnXAAAAwFBMVEUUJzX///8REiQTIzIAGizc3uCqsLMAESUAABwAAAAAABoODyIAAB0AFScAFykAFCcAABcADCKXnaEABR8AABSHjpMAHS2UlJr19/dcZW0AAAwJIDA4RVDx8/MUJzZhanJUXmdvb3h7e4IfIC9+hYu9wcSNlJk9SVNveH5MV2Cdo6cXGClKSlScnKDV1dkpKjhWV18fMj/JzM3l5ugoN0NDUFxpc3l1foM6PEc0M0BZWmVnaHGqq66GiJJNUFk/QU+m9w3kAAAHbUlEQVR4nO2dDXuaOhiGLWLlww8QBCc9WkDbKSjWtmcoUv//vzpBXadVFEgHbzi5d9Xqirvy7H3yEGJIKxUKhUKhUCgUCoVCoVAoFArl/4fWkhUZ0dSMopvyjbCNl+HT/XI+n487Px+4ZtHt+R6qdXm07N190qt1XpQSlK1pTI9UHRg/yEW3C5OqPPrnTFbEvaYNim4cBhq7vCgL8fpeL7p12WGfX+N0IX4Ra0dtct67julyRbcwG9rDdV1IWaPoNmZCu+bDgzKl6EZmQB7f1EVkzdifCXSRqKx1+fxFvBtbT8l0kVazAZewYHeEpb72b2JdZNVMSRKJnzwRo2ygJXciUTUzJql0kaNM+5VSGClubHfSCiOkZvJ9amFkpH6iceJXSHBjJmEkuDGLFe9IcGOG8NjxBH1ErCW7ZrmgDHjNUp+gP+lyoGflBuztaYG4msF2Y7pB8Kky0G7UhpmFAXejkG54f1ozyG5ku9mFwXZj0smcGGVw3cimmRw4VwZ3dDXACMY72G5MMMVNpjLj7daHEteVwXUj+4wTIJBrVl5ltz8iI1UZ+4BXsxL3M7Bnapa6MUZZed0oFC0gFurGOGVgr88GmG7sQK5ZSd04wFTWAetG3GzsAM7GZzw3AlaG6Ua4Z2oNL/XhZiNu6sPNRuzUh+tGzDEIXDfS2YJYZZBTH8+NgPtZWccgA2w3pp4HqWpNWW6xfx35JVc3atzLsDOe1/IAa1o/lRsHLeHnEssheZJcGat1iVEVkdSN3BDPG/mTqGbVRralT4WSQJkxmBfdyizcnC0wBrWi25iNWzVrElmviOvKsq2ZhMG1bGyPim4dDvHXZ9WXotuGR6wbGwQbcUeMG42HohuGzfSiGzMuSgbFRTcOsC4fgHAhQVLd5QWX6Vk/K4MTI766cdAmdDB1xtm4kahrsGsMtWNZ1bei2/NtzNsnZ7HnotvzfbxVj4Vlvp8BHhOjpMLejZJa8TQUCR/aHzE+2admYJRhRBXRezjdD6pO7KzAF4atUyvWp0W36Hv48XXDJOOx6CZ9C8PzjaBapE0AX+KCrkoz402ikDjz4d6MxA+DL9Urig/SSxajC5mR7F72GLuBnEZ0MF7uX3vkxNsRwSPWhzs4Yic+4n24RyVU2Y/2dV3IjUSOrK778KCMwPnFa7nxh5ZB2ocTjzd9uKfKvRMlLYkPDxjy2xMxl2e3c+Okai1FeR9N73NggzcFndSHx3Vjm/W/D48XVunqlSMKpi6oGwzLqfdPOyGDD/MBUxdYH8pZN0A66ALrQzxd1Ic5o2D6EKiuAfUhWbpK6kOahzG6oP5OFKWkOU99eFkX9WG+YOZ8WX04gaoL14dNoNsBUR9eZAI2D7HuV+j9AKurpOP5svoQT1cP7HijibFX8B3gcRTm7SVgz8sVFueDhx7Y3MBcGgNXF97qVbg+xLq7pAc25xEsxuozsHmIYDGGUoB9WKk0Yn8xKNm6qpk37ACc8xHZFxtDzo0KRhcDrqvSzrY6C+649zcZz2LgdWXcwOC9dftfLpgswuD7EFHPYEXYOX+gmX6h8TsB9cpw53jvEX7/ikh9LyERPoyQ092nQEAeHqhvUsjqTYjRle6GXWJ8GCEln8ohx4cRiXORJB/ukJOtnCZivHFCwl4G/TrlAkqCiUXifLhDuTnvQcp44yutW8lIoA93GNpVZT2ycv4YQ7tyXfb6zBbdvuxUldjrl7Gh3X4/YOS3ixHyOhSqt98MGkMankmrjVpkl2uPVn/oHA1DXjeTFrGp8QWj3eCef3Wm085o0hbqxu13EITBtprtJlsuURQKhUKhUCgUCoVCoVAoFCyqJaXClBQqjDTKLkw8fDFH3xlGUBjxzyv0TBT+vATOXpjoi4zoOfvnK+fwM2mxUD3/txTHFUVvvSJF2V4YFwSC1JVUiZFUPnQUVRUEld8gzBmv8rwo8PxqzvN+uAUrTPx82HGomB2qtmXpIW/ppqWvdN1yZx+1D543X9f6fO5t53N3vEXfc66YIqLegPqDGD1y0RPx98P+7xGOiHqIIjoMOjY66FgYo+pOYJqSaQY8Hza6DG+ai/52WbNM3VvywWbs897rXBDEfHUJo77FOZJn+5ytiJbp2owj2YFvi44tRn8cMQgDN1xb1jp03NFqthqthWNhwnodLvQgsLaCGiqzvhSErtLnGzVLd+95f7zsq0iYnbcPRdcKZpvADHTLHIWmqS9C9BhubCdcWKEZTnV/YYaqGcz0heWaJj8LZuaJMFHZWHYoep4u2uvAXDP6+oObmd3ltubNzbGl31v+0q31cxbGqPer2cIM1iM9mC3Wo+mHHnbX4cz39Y/QslCXCexItKuH6L+gO3PNrjVTj4UxnGlzXtcSvK7ZD/ggtL2VstAtSV27DT1Q+8iSJm/6uZfME8St6oorlNu27fdXttffeorveStn5Tie53Irz/vw0XNfkGxni44QT4QxHOqLkrD7EhhOijqookoig7qVijqkoIroB/lH4klMHGLk60uUHbuDmP2RzKmwskGFkUZphf0HfWf286DDURUAAAAASUVORK5CYII=",width:15,
  height:15,alt:"*",flipRtl:!1}],inputsInline:!1,previousStatement:null,nextStatement:null,colour:160,tooltip:"",helpUrl:""})}};h.H.go_east=function(a){return"go_east('block_id_"+a.id+"');\n"};
  h.Yf.maze_goSouth={za:function(){bc(this,{type:"go_south",lastDummyAlign0:"CENTRE",message0:"%1 %2",args0:[{type:"field_label_serializable",name:"go-south-text",text:"S"},{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADpCAMAAABx2AnXAAAAwFBMVEUAAAD///8REiQHBw7Kysr5+fn8/PwPECNMTExXV1f39/dHR0dSUlI+Pj4MDSEAABdqamoAABpmZmZhYWGAgIAAABOoqKjT09Ovr6+UlJrIyMhdXV3x8fFEREQ5OTkAABgYGBiMjIxBQUx7e4KCgosjIyO5ubmPj4/f399ycnKenp6TlJkpKjhtbnYAAB8dHSxQUFlaWmR6eno0M0BiY2sZGiypqa83OUZCRFGbnaRxcnp9foY3OEMkJTSzs7lnZ28sJ+7yAAAHzElEQVR4nO2dDXeaPBiGgVbZ2jWWtkhxtlahrZtQZH6jvvz/f/Wi8bMiJCGQ4Mm1c5xTsc/V3AkBXJQkgUAgELDg/fX29vWddRWU+V03mvKaplH/zboaWrzVN1JbmvU31jXRoC7HUGddVWbum3FeUavds64sG7HNdQGN1jjvJcsN1tWRYyR5ybLBuj5SPpK9ZPmDdYVkfKZ5yfIn6xpJeEn3kuUX1lUS0EUR67KuEp8HFC9ZfmBdJzZIDVbCJvuJ5iXLP1lXiskzqtgz60oxQUxi6bKINNZDyjXi/0EX+8O6ViwSZvXfKdcsP3WauKdcE8bE45VjynX0co0uds26ViyEmBDjBCEmxDhBiAkxThBiQowThJgQ4wQhJsQ4QYgJMU4QYkKME4SYEOMEISbEOEGICTFOEGJCjBOEmBDjBCEmxDhBiAkxThBiQowThJgQ4wQhJsQ4QYgJMU4QYkKME4SYEOMEISbEOKFEYo/t54ZhNJ7bSOs50BZ72P70x2wW3/lnVA9KMZ5SN6Aq9nS49k7V+EfDaMVbvXJSTT1lETd6Yu+n/1e88veNhtdT7JJZleTlbqiJfd7EbdNMz0wqZ5dg6iY1GiWx97M/PevST7dnVjhbUUlYY4SO2M/TPrCjeZvFK+md5aQFb6iIPSZul/R7TeOumvjWsnx28KUhluwVjY93pF5vCTnccG7NPQpi96lbNt8IxVCqO5PG7GIoyz8RTlqekOqKT2NmsbQcQshG/eSBY0dsGrOKpedwTYXE6y9qZXFmGcUQlyGT5b8EYogNJsemMZsYWg5XEDQZWg+DnLZZJjHEHK7B72UYpcWYZRHD8cKfWiHsww75nsYMYug5XIG9L/uN9fYnbUYuhtVeEbjrRLcx3/+bGbEYrpfcxhRDXm1vx1EaScXwcrgCd7U/jBWzthy2GaEY8v5rD+56XViD4oZ7os0PxLBzKOPPF0nEDmbERGIE7VWQ2N6MRIzIC1sMf/BYs00jgRhJDmX8waNN9mO2ZvhihF7YcyrcHfSOBzIxshzK+DtozCnVAfckYqTtRXB6gGz0WHGPL0bsRXB2AOew5RsPuGLEOSQ6OYB+oHnCHzwxjCVqv0NybgD51EAMjzhrmOLPD/eQnBrI0mRVjKGnmXZWNgGikzlZellREF50IR8YC4L0Ki/5vqwYiE9xp1+UYAr5RYnUy0hMyXIZCeOLBoon41cb/GBd/zl+ZPPiNY3Zcrgx43AEqVL5ig0O05g5h5BfnKWx8ouOF29ppJNDCFdppJRDCD9ppJdDCC9ppJlDCCdppJrDjRkHbVbNwYuHOQiN+UYcv1iLUR439twyTWM10wf5kmGZxrxyCGGYxtxyCGGVxjxzCGEzB6E934g1Y9Bm1QK8ojQWL5Z7DiFFp7GIHG7MCk1jMTmEYHzpYnYK/drGH4WlsZLLvPc8RfWz4vrXloLGxoLGw0OKSGPROYTkn8bicwjJPY0Mcrgxy7XNKsy88k0jqxxCcjx3xWTc2POS0+yqyvxrovNJI9scQnJJI+McQuh/tiDL5wFoQnsOwma+EQfds9/5nMcmg2YaeckhhF4a+ckhhJYZb1600shXDiG3ses44HHDcN57nuxp5C+HkKxp5DGHkGxp5DOHkCxp5DWHEPKjGPbHKcm8ELZZhXOvKI1E/eyG6xxCSNLIew4hd9hprHA7zh+Dm8Yy5BCCdwU+/+vm9HjFSGPllXW1OKDPQXieb8SBmsYy5RDyimRWLVUOIShpLFsOIenXYlheT8lCWhrLmEPIS2Iab0oxj4onKY1lzSHk/J66XPvlU86lscw5hMSP+uUc54+JO4opy3FKMncnbXZzEV6nabyEHEKO03gZOYS8HrTZTcnH+WP2abycHELuNusWNC8ohxs+u81mN3lpcoFAIBDkxtWFIikXihArG5cuBlRFUTcPgd2TmqaA/b+ie6oGlJIAxcACKKrjwfuDrWLN93VnsVUZ9YG69AdlMYNiWjjUamZNryktXWqPgK63gC6NI4KZpEsSAJI0MCRpYk+LFlMRXqHuXqjuXg7FVM/UvbnVs6W5GczNgWla01m/25ckt+mbhuF0DGPa6BjOdFKomApUsCoc3kYdQ40qjx5cPbR+XFWApmiqNor+UjSgRT1n47bpY7qphG5QC9xQkuyvniIFgX/VMbpzt+dcS8NxYyI5TSPartgGa9lXc82rOd5CW2rACqaeMqotw4UHRkvgRX9GIAxd33b9WX+uuGFgTqx561BMG/q2bw5Da6rpNpjptdDua1fSV3fe639Ii49rXXe6xrLoHIKp5c7GQ3fYswPbdt2eb0a39thT7P7cdu2ZOen/F9iavXTHVse1ZoodhNqhmArGlmcCxzGBNxy6vmL6fW3m9hqdrmMEDav3YXWup129YDFV/28w84Pot26GM9+3x33T/vTtWWdi9m3bGvR64WgWzELb8mzLNtum5fqmfiimaK6nOW0LOL1AD6XQ9pwB6PfmLd2ffplDXY8i6UpBp/AmczTQ0adgACaqt5zog6Vz1XG0hbMcjBYjZbnsRM9fTXUHaB39a6lO9A446mORWdQPW1H3rEVdUdFqIHpe01vRDVB1Leq4+qqXFj/WR4MBiG7AasRQ17erXSuA96PnwOolq6FlvZtdv1Y5Frs0hFjZuFix/wFtUcKJ9MtjTQAAAABJRU5ErkJggg==",width:15,
  height:15,alt:"*",flipRtl:!1}],inputsInline:!1,previousStatement:null,nextStatement:null,colour:160,tooltip:"",helpUrl:""})}};h.H.go_south=function(a){return"go_south('block_id_"+a.id+"');\n"};
  h.Xb.maze_goWest={za:function(){bc(this,{type:"go_west",lastDummyAlign0:"CENTRE",message0:"%1 %2",args0:[{type:"field_label_serializable",name:"go-west-text",text:"W"},{type:"field_image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADpCAMAAABx2AnXAAAAwFBMVEUUJzX///8REiQTIzIAGizc3uCqsLMAESUAABsODyIAAAAAAB0AFigAFCcAABoAABgADSOYnaJXYWkAHS2SmJ0AABSHjZNcZm0ABiCNjZX19/dTXWZMV2AHCR+UlJo3RU+5vcGdo6dCTlfIy85zfIIyQExocHft7/Cmq6/k5ueCgorV1dkpKjhBQUxtbnZlZm5TU14AAA4fIC8eMT59hYq/xMcjNkJud340M0BKSlQ3OUZ5eYFNUFkhIzFpaXReXmg0VOvFAAAHPElEQVR4nO2di1biMBCGSQHpBShdqFLWlJsK9AooK9DFvv9bbbjoinJpG5ZOuvnOURCOOv+Zf6YhTdpcjsPhcDgcDofD4XA4HA6Hw8k0+XqlRmjWyvW0Q7kg+bLYftU6tm33O427Z6WQdkCXIa88a8UW+qBlv5RKaQd1AUrtDvpKq5svpx0XJfX68JusNYOXWtqhUVHqjQ7qIvQLDLeR2sMxWeuktZltIsrtCV2k0u4ZVXZGF1H2yKQbm+d0ITRiUdjZfK2ZsdcbI+lC6JW1MouoCw0YO1BH1YVQgyll0XWhgZh2sDGIoQuhJ3Y6YyxdqNNMO96oxNOFBqxkLKYuhO7ZUBZbF3pgQlh8XUirpB10BBLoQjcMDKuURnxdqANfWJJ8sSAsmS50A33KqpnEhwQN+GgxYb7IJxfY7T6xLuAH6ET9cAPsIVVyXbAHwcl9CPtjC0W+0EBNO/rjiBS60C3cZi9S+BAN4M5S0fgQ8vQblQ9RR0k7/mPQ9EPIU9x0uuCelKCrr0E7m7paPaiNg6rPoxbYE5q0PoSqi67PA/ahSaMLgc1X0nmAXb7A6qLz4aAHtc9T1hfYfFEev8DqqlL6EKou7kO2dGXVh3S6Wlkdz4P1oajR6II77qX0Idj6ovThI1hdlD6E2jdox71Q80U53siqD8HqohxvgO3zKvfhoXz9qhX+OeVas1zPx9SlUulCg+I1sGeNp2cl1iGFzofXpNV/VaOfR6Tz4bVp3dYjFjSlD6/P6CnSOTe6Pp8OQ+V8F2HLh+/YuXNNhDkf7ijmTueMnX74Ffvkclw2fbjl1EKmKsO6EHo5ekBjtb52tJ6PlBnLPtxwZAmJ0k07MGrah1LGuA83HFrPTzd/CIRBJn245tsSzyz4cM1XLzYzogsV94cf9ae0A7oUrf2EVey0A7oYvz43/PyvtMO5HL09J96nHc7l2NuDke+lHc7l2N9c8px2OJdjf1BVmqUdz8V43uuK+Xbr/K8wweDLKLh8l3ZEF8L+upWwlBFl3W97JDOi7Of3SbhMKBsdmusu/Ug7LHq0g7t12c9Z68hsMPPKDieMfTeOjs8FV5jO2YGWmAk3Nk7u82fXjTdnTv5VGFXW0U/rYtWNWoQLabDoxqdIFwhhzo2dqMsG2Or6s16EM+vvbmRGmX372IyzNofSjcXhzb9n2H3pNZvlmKupKN34JJf+OZVKIe4SsTWUbnyCe8mOyk8qZQ9wr9BE6cbsKnsFrIy78X9T9prZ3gi5zujGINl14wN34/XhXf+Ysuy6MbPKuBtTgPJ4BtmNdMtcALux/INqbQF3YwpwNx5TBjhnmXVjmbuROWWUbryDe8lZyt4I9pIRxI0/adxYhLqnPUfrxgbgO2XQ9ca0oz9FhcaNQ8g3XqDp+i3AVUbXG1+AK0ucsz7Yq1ZvqCR244H9a6BI7sZT69QgkLjrwy6yXPLe+H0VOTQSzjfCvzdSrpxoJxMLdz9NNCJmIGNrZfGFgb+b1YYEbmTk3qfx3Qj5Vjufid0be+f/JgxiunHEQu/YUo41Ih6yIyzeJ0/Y91X7Qgw3FgHfzeoA0d3ISk98J2rXtxmqsC0RP8UwVWFbIrlRg3vG5TgR3NhnUVcENxbZGCV+p9w7mTM79tVUwVBoj47r6rCrK5er1zvHdDWaDOsiqHcHk9Z/ZO4A9pV6+aX4Tdadyna6thQK98NPabMbjzX2DsuHqZeqlfsXrdttPLRFJe5mKODUC+VKJf71sjkcDofD4XA4HA6Hw+FwOP8Z+YySEzIKF8YaWRcm7b6ET4+CgLEg4b8/kbfw3zeBsxUmLYkEZ7p9Pn9/Tw3HurP8ULbA0iqcs6JsK0zx/apqqLoqqLpsTLGuq1iXhwRPk3VZxliW57YsLw0Xn/mDUNhlbGroUyswLTkwA8ucm2aw0H4Xf8vy2yA0bdtxbXsxc8nj8roZw5JE/qG0RpBEUhfSrh6k9xfJa5ig4G3lCFXpszBBNwXP81TP82XZUgxB9oLxxO0XLc90+rI/nC1lZ2RX8ZVrTA0ED0uiM1+tNZpvc2kqqU44FfBKIIVDXp0vuq5vLg3feCPRL7oTa4w/CxPD0AhN/y1wsW40tYnuWws8kZViYC468rLTn0yIsNW1fahaY7+rBb4VWtb6u7Ygj6Fh6gtrbFlmYFjjRWDI5mLo+ZbrWVPNCfaFSXgYTA3sOKY0DUMvFMxwrGie0XeLju3NArMTuP1FcXJlYZI0E8yxOX7zLSNYeSaRYxiupU3DYGwY2soPAuxr5pi8PTY8k+Rm3A3Uz8IE0ZuKzm2AHSOY+LJvTJ05/m1aqh4uFDPUJ8SSnuy51+6J0go7c9EV5yvSs+eOsJoL+oI8k5YrZ+UI09VSdLE7dlxxNderK2euvpvq4wAtkkJUq5uvqqCo68LEukqKEUu6IghVXap+FOY1lQnrQIRdo9g84I/nwq594M3Dpsl8/GLWRx7ZgwtjjT8LDezXZFI9owAAAABJRU5ErkJggg==",width:15,
  height:15,alt:"*",flipRtl:!1}],inputsInline:!1,previousStatement:null,nextStatement:null,colour:160,tooltip:"",helpUrl:""})}};h.H.go_west=function(a){return"go_west('block_id_"+a.id+"');\n"};
  h.Yf.maze_goNorth={za:function(){bc(this,{type:"go_north",lastDummyAlign0:"CENTRE",message0:"%1 %2",args0:[{type:"field_label_serializable",name:"go-north-text",text:"N"},{type:"field_image",src:"https://toppng.com/uploads/preview/curved-white-arrow-png-white-up-arrow-icon-115628934127okaaohywg.png",width:15,height:15,alt:"*",flipRtl:!1}],inputsInline:!1,previousStatement:null,nextStatement:null,colour:160,tooltip:"",helpUrl:""})}};h.H.go_north=function(a){return"go_north('block_id_"+a.id+"');\n"};
  h.Xb.maze_moveForward={za:function(){bc(this,{message0:N("Maze_moveForward"),previousStatement:null,nextStatement:null,colour:290,tooltip:N("Maze_moveForwardTooltip")})}};h.H.maze_moveForward=function(a){return"moveForward('block_id_"+a.id+"');\n"};h.Xb.maze_turn={za:function(){var a=[[N("Maze_turnLeft"),"turnLeft"],[N("Maze_turnRight"),"turnRight"]];a[0][0]+=" \u21ba";a[1][0]+=" \u21bb";this.re(290);D(ac(this),new h.Wa(a),"DIR");this.Gi(!0);this.bk(!0);this.te(N("Maze_turnTooltip"))}};
  h.H.maze_turn=function(a){return $a(a,"DIR")+"('block_id_"+a.id+"');\n"};h.Xb.maze_if={za:function(){var a=[[N("Maze_pathAhead"),"isPathForward"],[N("Maze_pathLeft"),"isPathLeft"],[N("Maze_pathRight"),"isPathRight"]];a[1][0]+=" \u21ba";a[2][0]+=" \u21bb";this.re(210);D(ac(this),new h.Wa(a),"DIR");D(this.xf(h.Ha.lc,"DO"),N("Maze_doCode"));this.te(N("Maze_ifTooltip"));this.Gi(!0);this.bk(!0)}};h.H.maze_if=function(a){var c=$a(a,"DIR")+"('block_id_"+a.id+"')";a=ee(a,"DO");return"if ("+c+") {\n"+a+"}\n"};
  h.Xb.maze_ifElse={za:function(){var a=[[N("Maze_pathAhead"),"isPathForward"],[N("Maze_pathLeft"),"isPathLeft"],[N("Maze_pathRight"),"isPathRight"]];a[1][0]+=" \u21ba";a[2][0]+=" \u21bb";this.re(210);D(ac(this),new h.Wa(a),"DIR");D(this.xf(h.Ha.lc,"DO"),N("Maze_doCode"));D(this.xf(h.Ha.lc,"ELSE"),N("Maze_elseCode"));this.te(N("Maze_ifelseTooltip"));this.Gi(!0);this.bk(!0)}};
  h.H.maze_ifElse=function(a){var c=$a(a,"DIR")+"('block_id_"+a.id+"')",d=ee(a,"DO");a=ee(a,"ELSE");return"if ("+c+") {\n"+d+"} else {\n"+a+"}\n"};h.Xb.maze_forever={za:function(){this.re(120);D(D(ac(this),N("Maze_repeatUntil")),new h.Vd(U.Ao,12,16));D(this.xf(h.Ha.lc,"DO"),N("Maze_doCode"));this.Gi(!0);this.te(N("Maze_whileTooltip"))}};h.H.maze_forever=function(a){var c=ee(a,"DO");h.H.Bu&&(c=h.H.Bu.replace(/%1/g,"'block_id_"+a.id+"'")+c);return"while (notDone()) {\n"+c+"}\n"};var ke=ke||{};function le(a,c){function d(){}d.prototype=c.prototype;a.A=c.prototype;a.prototype=new d;a.prototype.constructor=a;a.DI=function(e,f,g){return c.prototype[f].apply(e,Array.prototype.slice.call(arguments,2))}}if(!me){var me,ne="";"undefined"!==typeof navigator&&navigator&&"string"==typeof navigator.userAgent&&(ne=navigator.userAgent);var pe=0==ne.indexOf("Opera");me={vJ:{pG:"ScriptEngine"in window},lH:pe,Wd:!pe&&-1!=ne.indexOf("MSIE"),xv:!pe&&-1!=ne.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=ke.sz?{IJ:!0}:{},xe=ke.sz?{JJ:!0}:{};function ye(){throw Error("Do not instantiate directly");}ye.prototype.dw=null;ye.prototype.toString=function(){return this.content};function ze(a){if(null!=a)switch(a.dw){case 1:return 1;case -1:return-1;case 0:return 0}return null}function Ae(){ye.call(this)}le(Ae,ye);Ae.prototype.ew=we;
  function V(a){return null!=a&&a.ew===we?a:Be(String(String(a)).replace(Ce,De),ze(a))}var Be=function(a){function c(){}c.prototype=a.prototype;return function(d,e){var f=new c;f.content=String(d);void 0!==e&&(f.dw=e);return f}}(Ae),Ee={"\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 De(a){return Ee[a]}var Ce=/[\x00\x22\x26\x27\x3c\x3e]/g;function Fe(){return'<div class="farSide" style="padding: 1ex 3ex 0"><button class="secondary" onclick="BlocklyDialogs.hideDialog(true)">\u0414\u043e\u0431\u0440\u0430</button></div>'};function Ge(){var a="skin="+V(He),c='<table width="100%"><tr><td><h1><span id="title">'+((Zc?'<a href="index.html?lang='+V(L)+'">':'<a href="./?lang='+V(L)+'">')+"\u0413\u0443\u043b\u044c\u043d\u0456 Blockly</a> : "+V("\u041b\u0430\u0431\u0456\u0440\u044b\u043d\u0442")+"</span>");if(M){a=""+(a?V(a):"");for(var d=" &nbsp; ",e=1;11>e;e++){var f="?lang="+V(L)+"&level="+V(e)+(a?"&"+V(a):"");d+=" "+(e==M?'<span class="level_number level_done" id="level'+V(e)+'">'+V(e)+"</span>":10==e?'<a class="level_number" id="level'+
  V(e)+'" href="'+V(f)+'">'+V(e)+"</a>":'<a class="level_dot" id="level'+V(e)+'" href="'+V(f)+'"></a>')}a=d}else a="";return'<div style="display: none"><span id="Games_name">\u0413\u0443\u043b\u044c\u043d\u0456 Blockly</span><span id="Games_puzzle">\u0413\u0430\u043b\u0430\u0432\u0430\u043b\u043e\u043c\u043a\u0430</span><span id="Games_maze">\u041b\u0430\u0431\u0456\u0440\u044b\u043d\u0442</span><span id="Games_bird">\u041f\u0442\u0443\u0448\u043a\u0430</span><span id="Games_turtle">\u0427\u0430\u0440\u0430\u043f\u0430\u0448\u043a\u0430</span><span id="Games_movie">\u0424\u0456\u043b\u044c\u043c</span><span id="Games_music">\u041c\u0443\u0437\u044b\u043a\u0430</span><span id="Games_pondTutor">\u0421\u0430\u0436\u0430\u043b\u043a\u0430 Tutor</span><span id="Games_pond">\u0421\u0430\u0436\u0430\u043b\u043a\u0430</span><span id="Games_genetics">\u0413\u0435\u043d\u0435\u0442\u044b\u043a\u0430</span><span id="Games_linesOfCode1">\u0422\u044b \u0432\u044b\u0440\u0430\u0448\u044b\u045e \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430 \u0433\u044d\u0442\u044b\u043c \u0443\u0437\u0440\u043e\u045e\u043d\u0456 \u0430\u0434\u043d\u044b\u043c \u0440\u0430\u0434\u043a\u043e\u043c \u043d\u0430 JavaScript:</span><span id="Games_linesOfCode2">\u0422\u044b \u0432\u044b\u0440\u0430\u0448\u044b\u045e \u0433\u044d\u0442\u044b \u045e\u0437\u0440\u043e\u0432\u0435\u043d\u044c. \u041b\u0456\u043a \u0440\u0430\u0434\u043a\u043e\u045e \u043a\u043e\u0434\u0430 \u043d\u0430 JavaScript \u2014 %1:</span><span id="Games_nextLevel">\u0422\u044b \u0433\u0430\u0442\u043e\u0432\u044b \u0434\u0430 \u045e\u0437\u0440\u043e\u045e\u043d\u044f %1?</span><span id="Games_finalLevel">\u0422\u044b \u0433\u0430\u0442\u043e\u0432\u044b \u0434\u0430 \u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0430\u0433\u0430 \u0432\u044b\u043f\u0440\u0430\u0431\u0430\u0432\u0430\u043d\u043d\u044f?</span><span id="Games_submitTitle">Title:</span><span id="Games_linkTooltip">\u0417\u0430\u0445\u0430\u0432\u0430\u0446\u044c \u0456 \u043f\u0430\u043a\u0430\u0437\u0430\u0446\u044c \u0441\u043f\u0430\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0431\u043b\u043e\u043a\u0456.</span><span id="Games_runTooltip">\u0417\u0430\u043f\u0443\u0441\u0446\u0456 \u043d\u0430\u043f\u0456\u0441\u0430\u043d\u0443\u044e \u0442\u0430\u0431\u043e\u0439 \u043f\u0440\u0430\u0433\u0440\u0430\u043c\u0443.</span><span id="Games_runProgram">\u0417\u0430\u043f\u0443\u0441\u0446\u0456\u0446\u044c \u043f\u0440\u0430\u0433\u0440\u0430\u043c\u0443</span><span id="Games_resetTooltip">\u041f\u0435\u0440\u0430\u043f\u044b\u043d\u044f\u0435 \u043f\u0440\u0430\u0433\u0440\u0430\u043c\u0443 \u0456 \u0441\u043a\u0456\u0434\u0430\u0435 \u045e \u0437\u044b\u0445\u043e\u0434\u043d\u044b \u0441\u0442\u0430\u043d.</span><span id="Games_resetProgram">\u0421\u043a\u0456\u043d\u0443\u0446\u044c</span><span id="Games_help">\u0414\u0430\u0432\u0435\u0434\u043a\u0430</span><span id="Games_dialogOk">\u0414\u043e\u0431\u0440\u0430</span><span id="Games_dialogCancel">\u0410\u0434\u043c\u044f\u043d\u0456\u0446\u044c</span><span id="Games_catLogic">\u041b\u043e\u0433\u0456\u043a\u0430</span><span id="Games_catLoops">\u0426\u044b\u043a\u043b\u044b</span><span id="Games_catMath">\u041c\u0430\u0442\u044d\u043c\u0430\u0442\u044b\u043a\u0430</span><span id="Games_catText">\u0422\u044d\u043a\u0441\u0442</span><span id="Games_catLists">\u0421\u043f\u0456\u0441\u044b</span><span id="Games_catColour">\u041a\u043e\u043b\u0435\u0440</span><span id="Games_catVariables">\u041f\u0435\u0440\u0430\u043c\u0435\u043d\u043d\u044b\u044f</span><span id="Games_catProcedures">\u0424\u0443\u043d\u043a\u0446\u044b\u0456</span><span id="Games_httpRequestError">\u0410\u0434\u0431\u044b\u043b\u0430\u0441\u044f \u043f\u0440\u0430\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u044b \u0437\u0430\u043f\u044b\u0446\u0435.</span><span id="Games_linkAlert">\u041f\u0430\u0434\u0437\u044f\u043b\u0456\u0446\u0435\u0441\u044f \u0441\u0432\u0430\u0456\u043c\u0456 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u043f\u0430 \u0433\u044d\u0442\u0430\u0439 \u0441\u0441\u044b\u043b\u043a\u0435:\n\n%1</span><span id="Games_hashError">\u041d\u0430 \u0436\u0430\u043b\u044c, \'%1\' \u043d\u0435 \u0430\u0434\u043f\u0430\u0432\u044f\u0434\u0430\u0435 \u043d\u0456\u0432\u043e\u0434\u043d\u0430\u043c\u0443 \u0437\u0430\u0445\u0430\u0432\u0430\u043d\u0430\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u0411\u043b\u043e\u043a\u043b\u0456.</span><span id="Games_xmlError">\u041d\u0435 \u0430\u0442\u0440\u044b\u043c\u0430\u043b\u0430\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u0456\u0446\u044c \u0412\u0430\u0448 \u0437\u0431\u0435\u0440\u0430\u0436\u043e\u043d\u044b \u0444\u0430\u0439\u043b. \u041c\u0430\u0433\u0447\u044b\u043c\u0430, \u0451\u043d \u0431\u044b\u045e \u0441\u0442\u0432\u043e\u0440\u0430\u043d\u044b \u045e \u0456\u043d\u0448\u0430\u0439 \u0432\u0435\u0440\u0441\u0456\u0456 \u0411\u043b\u043e\u043a\u043b\u0456?</span><span id="Games_submitted">Thank you for this program!  If our staff of trained monkeys like it, they will publish it to the gallery within a couple of days.</span><span id="Games_listVariable">\u0441\u043f\u0456\u0441</span><span id="Games_textVariable">\u0442\u044d\u043a\u0441\u0442</span><span id="Games_breakLink">\u042f\u043a \u0442\u043e\u043b\u044c\u043a\u0456 \u0412\u044b \u043f\u0430\u0447\u043d\u0435\u0446\u0435 \u0440\u044d\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044c JavaScript, \u0412\u044b \u043d\u0435 \u0437\u043c\u043e\u0436\u0430\u0446\u0435 \u0432\u044f\u0440\u043d\u0443\u0446\u0446\u0430 \u0434\u0430 \u0440\u044d\u0434\u0430\u0433\u0430\u0432\u0430\u043d\u043d\u044f \u0431\u043b\u043e\u043a\u0430\u045e. \u041f\u0440\u0430\u0446\u044f\u0433\u043d\u0443\u0446\u044c?</span><span id="Games_blocks">\u0411\u043b\u043e\u043a\u0456</div></div><div style="display: none"><span id="Maze_moveForward">\u0441\u0442\u0443\u043f\u0456\u0446\u044c \u043d\u0430\u043f\u0435\u0440\u0430\u0434</span><span id="Maze_turnLeft">\u043f\u0430\u0432\u044f\u0440\u043d\u0443\u0446\u044c \u043d\u0430\u043b\u0435\u0432\u0430</span><span id="Maze_turnRight">\u043f\u0430\u0432\u044f\u0440\u043d\u0443\u0446\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u0430</span><span id="Maze_doCode">\u0432\u044b\u043a\u043e\u043d\u0432\u0430\u0446\u044c</span><span id="Maze_elseCode">\u0456\u043d\u0430\u043a\u0448</span><span id="Maze_helpIfElse">\u041a\u0430\u043c\u0430\u043d\u0434\u0430 "\u043a\u0430\u043b\u0456-\u0456\u043d\u0430\u043a\u0448" \u0432\u044b\u043a\u0430\u043d\u0430\u0435 \u0430\u0434\u043d\u043e \u0446\u0456 \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u0437\u0435\u044f\u043d\u043d\u0435.</span><span id="Maze_pathAhead">\u043a\u0430\u043b\u0456 \u0448\u043b\u044f\u0445 \u043d\u0430\u043f\u0435\u0440\u0430\u0434\u0437\u0435</span><span id="Maze_pathLeft">\u043a\u0430\u043b\u0456 \u0448\u043b\u044f\u0445 \u0437\u043b\u0435\u0432\u0430</span><span id="Maze_pathRight">\u043a\u0430\u043b\u0456 \u0448\u043b\u044f\u0445 c\u043f\u0440\u0430\u0432\u0430</span><span id="Maze_repeatUntil">\u043f\u0430\u045e\u0442\u0430\u0440\u0430\u0446\u044c, \u043f\u0430\u043a\u0443\u043b\u044c \u043d\u0435</span><span id="Maze_moveForwardTooltip">\u041f\u0440\u0430\u0441\u043e\u045e\u0432\u0430\u0435 \u0432\u0430\u043d\u0434\u0440\u043e\u045e\u043d\u0456\u043a\u0430 \u043d\u0430\u043f\u0435\u0440\u0430\u0434 \u043d\u0430 \u0430\u0434\u0437\u0456\u043d \u043a\u0440\u043e\u043a.</span><span id="Maze_turnTooltip">\u041f\u0430\u0432\u044f\u0440\u043d\u0443\u0446\u044c \u0432\u0430\u043d\u0434\u0440\u043e\u045e\u043d\u0456\u043a\u0430 \u043d\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u045e \u043d\u0430\u043b\u0435\u0432\u0430 \u0430\u0431\u043e \\n\u043d\u0430\u043f\u0440\u0430\u0432\u0430. </span><span id="Maze_ifTooltip">\u041a\u0430\u043b\u0456 \u0448\u043b\u044f\u0445 \u0443 \u0437\u0433\u0430\u0434\u0430\u043d\u044b\u043c \u043a\u0456\u0440\u0443\u043d\u043a\u0443 \u0430\u0434\u043a\u0440\u044b\u0442\u044b, \\n\u0442\u043e \u0432\u044b\u043a\u0430\u043d\u0430\u0446\u044c \u043d\u0435\u043a\u0430\u0442\u043e\u0440\u044b\u044f \u0434\u0437\u0435\u044f\u043d\u043d\u0456. </span><span id="Maze_ifelseTooltip">\u041a\u0430\u043b\u0456 \u0448\u043b\u044f\u0445 \u0443 \u0437\u0433\u0430\u0434\u0430\u043d\u044b\u043c \u043a\u0456\u0440\u0443\u043d\u043a\u0443 \u0430\u0434\u043a\u0440\u044b\u0442\u044b, \\n\u0442\u043e \u0432\u044b\u043a\u0430\u043d\u0430\u0446\u044c \u043f\u0435\u0440\u0448\u044b \u0431\u043b\u043e\u043a \u0434\u0437\u0435\u044f\u043d\u043d\u044f\u045e. \\n\u0406\u043d\u0430\u043a\u0448, \u0432\u044b\u043a\u0430\u043d\u0430\u0446\u044c \u0434\u0440\u0443\u0433\u0456 \u0431\u043b\u043e\u043a \u0434\u0437\u0435\u044f\u043d\u043d\u044f\u045e. </span><span id="Maze_whileTooltip">\u041f\u0430\u045e\u0442\u0430\u0440\u0430\u0446\u044c \u0434\u0437\u0435\u044f\u043d\u043d\u0456, \u0441\u043a\u043b\u0430\u0434\u0437\u0435\u043d\u044b\u044f \u045e \u0431\u043b\u043e\u043a\u0443, \\n\u0434\u0430 \u0434\u0430\u0441\u044f\u0433\u043d\u0435\u043d\u043d\u044f \u043a\u0430\u043d\u0447\u0430\u0442\u043a\u043e\u0432\u0430\u0439 \u043a\u0440\u043e\u043f\u043a\u0456. </span><span id="Maze_capacity0">\u0423 \u0412\u0430\u0441 \u0437\u0430\u0441\u0442\u0430\u043b\u043e\u0441\u044f %0 \u0431\u043b\u043e\u043a\u0430\u045e.</span><span id="Maze_capacity1">\u0423 \u0412\u0430\u0441 \u0437\u0430\u0441\u0442\u0430\u045e\u0441\u044f %1 \u0431\u043b\u043e\u043a.</span><span id="Maze_capacity2">\u0423 \u0412\u0430\u0441 \u0437\u0430\u0441\u0442\u0430\u043b\u043e\u0441\u044f %2 \u0431\u043b\u043e\u043a\u0430.</span></div>'+
  (c+a+'</h1></td><td id="header_cta" class="farSide"><select id="languageMenu"></select>&nbsp;<button id="linkButton" title="\u0417\u0430\u0445\u0430\u0432\u0430\u0446\u044c \u0456 \u043f\u0430\u043a\u0430\u0437\u0430\u0446\u044c \u0441\u043f\u0430\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0431\u043b\u043e\u043a\u0456."><img src="common/1x1.gif" class="link icon21"></button>&nbsp;'+('<button id="pegmanButton"><img src="common/1x1.gif"><span id="pegmanButtonArrow"></span></button>'.ew===xe?"zSoyz":
  '<button id="pegmanButton"><img src="common/1x1.gif"><span id="pegmanButtonArrow"></span></button>')+'</td></tr></table><div id="visualization"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="svgMaze" width="400px" height="400px"><g id="look"><path d="M 0,-15 a 15 15 0 0 1 15 15" /><path d="M 0,-35 a 35 35 0 0 1 35 35" /><path d="M 0,-55 a 55 55 0 0 1 55 55" /></g></svg><div id="capacityBubble"><div id="capacity"></div></div></div><table width="400"><tr><td style="width: 190px; text-align: center; vertical-align: top;"><td><button id="runButton" class="primary" title="\u0412\u0430\u043d\u0434\u0440\u043e\u045e\u043d\u0456\u043a \u0437\u0440\u043e\u0431\u0456\u0446\u044c \u0443\u0441\u0451, \u0448\u0442\u043e \u0441\u043a\u0430\u0436\u0443\u0446\u044c \u044f\u043c\u0443 \u0431\u043b\u043e\u043a\u0456."><img src="common/1x1.gif" class="run icon21"> \u0417\u0430\u043f\u0443\u0441\u0446\u0456\u0446\u044c \u043f\u0440\u0430\u0433\u0440\u0430\u043c\u0443</button><button id="resetButton" class="primary" style="display: none" title="\u0412\u044f\u0440\u043d\u0443\u0446\u044c \u0432\u0430\u043d\u0434\u0440\u043e\u045e\u043d\u0456\u043a\u0430 \u045e \u043f\u0430\u0447\u0430\u0442\u0430\u043a \u043b\u0430\u0431\u0456\u0440\u044b\u043d\u0442\u0430."><img src="common/1x1.gif" class="stop icon21"> \u0421\u043a\u0456\u043d\u0443\u0446\u044c</button></td></tr></table><xml id="toolbox" xmlns="https://developers.google.com/blockly/xml"><block type="maze_moveForward"></block><block type="maze_turn"><field name="DIR">turnLeft</field></block><block type="maze_turn"><field name="DIR">turnRight</field></block>')+
  ((2<M?'<block type="maze_forever"></block>'+(6==M?'<block type="maze_if"><field name="DIR">isPathLeft</field></block>':6<M?'<block type="maze_if"></block>'+(8<M?'<block type="maze_ifElse"></block>':""):""):"")+'</xml><div id="blockly"></div><div id="pegmanMenu"></div><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;">\u0412\u0456\u043d\u0448\u0443\u0435\u043c!</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">\u0410\u0434\u043c\u044f\u043d\u0456\u0446\u044c</button><button id="doneOk" class="secondary">\u0414\u043e\u0431\u0440\u0430</button></div></div><div id="dialogAbort" class="dialogHiddenContent">\u0413\u044d\u0442\u044b \u045e\u0437\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u0435\u043b\u044c\u043c\u0456 \u0441\u043a\u043b\u0430\u0434\u0430\u043d\u044b. \u041c\u043e\u0436\u0430, \u0412\u044b \u0445\u043e\u0447\u0430\u0446\u0435 \u043f\u0440\u0430\u043f\u0443\u0441\u0446\u0456\u0446\u044c \u044f\u0433\u043e \u0456 \u043f\u0435\u0440\u0430\u0439\u0441\u0446\u0456 \u0434\u0430 \u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0430\u0439 \u0433\u0443\u043b\u044c\u043d\u0456? \u0412\u0456 \u0437\u0430\u045e\u0441\u0451\u0434\u044b \u043c\u043e\u0436\u0430\u0446\u0435 \u0432\u044f\u0440\u043d\u0443\u0446\u0446\u0430 \u0441\u044e\u0434\u044b \u043f\u0430\u0437\u043d\u0435\u0439.<div class="farSide" style="padding: 1ex 3ex 0"><button id="abortCancel">\u0410\u0434\u043c\u044f\u043d\u0456\u0446\u044c</button><button id="abortOk" class="secondary">\u0414\u043e\u0431\u0440\u0430</button></div></div><div id="dialogStorage" class="dialogHiddenContent"><div id="containerStorage"></div>')+
  (Fe()+"</div>")+(1==M?'<div id="dialogHelpStack" class="dialogHiddenContent"><table><tr><td><img src="common/help.png"></td><td>&nbsp;</td><td>\u0417\u0433\u0440\u0443\u043f\u0443\u0439\u0446\u0435 \u043d\u0435\u043a\u0430\u043b\u044c\u043a\u0456 \u0431\u043b\u043e\u043a\u0430\u045e \u00ab\u0441\u0442\u0443\u043f\u0456\u0446\u044c \u043d\u0430\u043f\u0435\u0440\u0430\u0434\u00bb, \u043a\u0430\u0431 \u0434\u0430\u043f\u0430\u043c\u0430\u0433\u0447\u044b \u043c\u043d\u0435 \u0434\u0430\u0441\u044f\u0433\u043d\u0443\u0446\u044c \u043c\u044d\u0442\u044b.</td><td valign="top"><img src="maze/help_stack.png" class="mirrorImg" height=63 width=136></td></tr></table></div><div id="dialogHelpOneTopBlock" class="dialogHiddenContent"><table><tr><td><img src="common/help.png"></td><td>&nbsp;</td><td>\u041d\u0430 \u0434\u0430\u0434\u0437\u0435\u043d\u044b\u043c \u0443\u0437\u0440\u043e\u045e\u043d\u0456 \u0432\u0430\u043c \u043d\u0435\u0430\u0431\u0445\u043e\u0434\u043d\u0430 \u0441\u043a\u043b\u0430\u0441\u0446\u0456 \u0440\u0430\u0437\u0430\u043c \u0443\u0441\u0435 \u0431\u043b\u043e\u043a\u0456 \u043d\u0430 \u0431\u0435\u043b\u044b\u043c \u043f\u0440\u0430\u0446\u043e\u045e\u043d\u044b\u043c \u043f\u043e\u043b\u0456.<div id="sampleOneTopBlock" class="readonly"></div></td></tr></table></div><div id="dialogHelpRun" class="dialogHiddenContent"><table><tr><td>\u0417\u0430\u043f\u0443\u0441\u0446\u0456\u0446\u0435 \u043f\u0440\u0430\u0433\u0440\u0430\u043c\u0443, \u043a\u0430\u0431 \u043f\u0430\u0433\u043b\u044f\u0434\u0437\u0435\u0446\u044c \u0448\u0442\u043e \u0430\u0434\u0431\u044b\u0432\u0430\u0435\u0446\u0446\u0430.</td><td rowspan=2><img src="common/help.png"></td></tr><tr><td><div><img src="maze/help_run.png" class="mirrorImg" height=27 width=141></div></td></tr></table></div>':
  2==M?'<div id="dialogHelpReset" class="dialogHiddenContent"><table><tr><td>\u0412\u0430\u0448\u0430 \u043f\u0440\u0430\u0433\u0440\u0430\u043c\u0430 \u043d\u0435 \u0432\u044b\u0440\u0430\u0448\u044b\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0443. \u041d\u0430\u0446\u0456\u0441\u043d\u0456\u0446\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u0421\u043a\u0456\u043d\u0443\u0446\u044c\u00bb \u0456 \u043f\u0430\u0441\u043f\u0440\u0430\u0431\u0443\u0439\u0446\u0435 \u0437\u043d\u043e\u045e.</td><td rowspan=2><img src="common/help.png"></td></tr><tr><td><div><img src="maze/help_run.png" class="mirrorImg" height=27 width=141></div></td></tr></table></div>':
  3==M||4==M?(3==M?'<div id="dialogHelpRepeat" class="dialogHiddenContent"><table><tr><td><img src="maze/help_up.png"></td><td>\u041f\u0440\u0430\u0439\u0434\u0437\u0456\u0446\u0435 \u0434\u0430 \u043a\u0430\u043d\u0446\u0430 \u0433\u044d\u0442\u0430\u0433\u0430 \u0448\u043b\u044f\u0445\u0443, \u0432\u044b\u043a\u0430\u0440\u044b\u0441\u0442\u043e\u045e\u0432\u0430\u044e\u0447\u044b \u0442\u043e\u043b\u044c\u043a\u0456 \u0434\u0432\u0430 \u0431\u043b\u043e\u043a\u0456. \u0414\u043b\u044f \u0432\u044b\u043a\u0430\u043d\u0430\u043d\u043d\u044f \u0431\u043b\u043e\u043a\u0430 \u0431\u043e\u043b\u044c\u0448 \u0437\u0430 \u0430\u0434\u0437\u0456\u043d \u0440\u0430\u0437 \u0432\u044b\u043a\u0430\u0440\u044b\u0441\u0442\u043e\u045e\u0432\u0430\u0439\u0446\u0435 \u00ab\u043f\u0430\u045e\u0442\u0430\u0440\u0430\u0446\u044c\u00bb.</td><td><img src="common/help.png"></td></tr></table></div>':
  "")+'<div id="dialogHelpCapacity" class="dialogHiddenContent"><table><tr><td><img src="common/help.png"></td><td>&nbsp;</td><td>\u0412\u044b \u0432\u044b\u043a\u0430\u0440\u044b\u0441\u0442\u043e\u045e\u0432\u0430\u043b\u0456 \u045e\u0441\u0435 \u0431\u043b\u043e\u043a\u0456 \u0434\u043b\u044f \u0433\u044d\u0442\u0430\u0433\u0430 \u045e\u0437\u0440\u043e\u045e\u043d\u044e. \u041a\u0430\u0431 \u0434\u0430\u0434\u0430\u0446\u044c \u043d\u043e\u0432\u044b \u0431\u043b\u043e\u043a, \u0441\u043f\u0430\u0447\u0430\u0442\u043a\u0443 \u043d\u0435\u0430\u0431\u0445\u043e\u0434\u043d\u0430 \u0432\u044b\u0434\u0430\u043b\u0456\u0446\u044c \u0456\u0441\u043d\u0443\u044e\u0447\u044b.</td></tr></table></div><div id="dialogHelpRepeatMany" class="dialogHiddenContent"><table><tr><td><img src="maze/help_up.png"></td><td>\u0412\u044b \u043c\u043e\u0436\u0430\u0446\u0435 \u0440\u0430\u0437\u043c\u044f\u0441\u0446\u0456\u0446\u044c \u0431\u043e\u043b\u044c\u0448 \u0430\u0434\u043d\u0430\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u045e\u043d\u0443\u0442\u0440\u044b \u0431\u043b\u043e\u043a\u0430 \u00ab\u043f\u0430\u045e\u0442\u0430\u0440\u0430\u0446\u044c\u00bb.</td><td><img src="common/help.png"></td></tr></table></div>':
  5==M?'<div id="dialogHelpSkins" class="dialogHiddenContent"><table><tr><td><img src="common/help.png"></td><td width="95%">\u0412\u044b\u0431\u0435\u0440\u044b\u0446\u0435 \u045e \u0433\u044d\u0442\u044b\u043c \u043c\u0435\u043d\u044e \u0441\u0432\u0430\u0439\u0433\u043e \u043b\u044e\u0431\u0456\u043c\u0430\u0433\u0430 \u0432\u0430\u043d\u0434\u0440\u043e\u045e\u043d\u0456\u043a\u0430.</td><td><img src="maze/help_up.png"></td></tr></table></div>':6==M?'<div id="dialogHelpIf" class="dialogHiddenContent"><table><tr><td><img src="maze/help_up.png"></td><td>\u0411\u043b\u043e\u043a "\u043a\u0430\u043b\u0456" \u0432\u044b\u043a\u0430\u043d\u0430\u0435 \u043d\u0435\u0448\u0442\u0430 \u0442\u043e\u043b\u044c\u043a\u0456 \u045e \u0432\u044b\u043f\u0430\u0434\u043a\u0443 \u0432\u0435\u0440\u043d\u0430\u0439 \u045e\u043c\u043e\u0432\u044b. \u041f\u0430\u0441\u043f\u0440\u0430\u0431\u0443\u0439\u0446\u0435 \u0437\u0432\u044f\u0440\u043d\u0443\u0446\u044c \u043d\u0430\u043b\u0435\u0432\u0430, \u043a\u0430\u043b\u0456 \u0448\u043b\u044f\u0445 \u043d\u0430\u043b\u0435\u0432\u0430 \u0434\u0430\u0441\u0442\u0443\u043f\u043d\u044b.</td><td><img src="common/help.png"></td></tr></table></div>':
  7==M?'<div id="dialogHelpMenu" class="dialogHiddenContent"><table><tr><td><img src="maze/help_up.png"></td><td id="helpMenuText">\u041d\u0430\u0446\u0456\u0441\u043d\u0456\u0446\u0435 \u043d\u0430 %1 \u0443 \u0431\u043b\u043e\u043a\u0443 \'\u043a\u0430\u043b\u0456\' \u0434\u043b\u044f \u0437\u043c\u0435\u043d\u044b \u044f\u0433\u043e \u045e\u043c\u043e\u0432\u044b.</td><td><img src="common/help.png"></td></tr></table></div>':9==M?'<div id="dialogHelpIfElse" class="dialogHiddenContent"><table><tr><td><img src="maze/help_down.png"></td><td>\u041a\u0430\u043c\u0430\u043d\u0434\u0430 "\u043a\u0430\u043b\u0456-\u0456\u043d\u0430\u043a\u0448" \u0432\u044b\u043a\u0430\u043d\u0430\u0435 \u0430\u0434\u043d\u043e \u0446\u0456 \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u0437\u0435\u044f\u043d\u043d\u0435.</td><td><img src="common/help.png"></td></tr></table></div>':
  10==M?'<div id="dialogHelpWallFollow" class="dialogHiddenContent"><table><tr><td><img src="common/help.png"></td><td>&nbsp;</td><td>\u0426\u0456 \u043c\u043e\u0436\u0430\u0448 \u0442\u044b \u0432\u044b\u0440\u0430\u0448\u044b\u0446\u044c \u0433\u044d\u0442\u044b \u0441\u043a\u043b\u0430\u0434\u0430\u043d\u044b \u043b\u0430\u0431\u0456\u0440\u044b\u043d\u0442? \u041f\u0430\u0441\u043f\u0440\u0430\u0431\u0443\u0439 \u043f\u0440\u044b\u0442\u0440\u044b\u043c\u043b\u0456\u0432\u0430\u0446\u0446\u0430 \u043b\u0435\u0432\u0430\u0439 \u0441\u0446\u044f\u043d\u044b. \u0422\u043e\u043b\u044c\u043a\u0456 \u0434\u043b\u044f \u0434\u0430\u0441\u0432\u0435\u0434\u0447\u0430\u043d\u044b\u0445 \u043f\u0440\u0430\u0433\u0440\u0430\u043c\u0456\u0441\u0442\u0430\u045e!'+
  Fe()+"</td></tr></table></div>":"")};var ed="maze";Td=function(){10>M?window.location=window.location.protocol+"//"+window.location.host+window.location.pathname+"?lang="+L+"&level="+(M+1)+"&skin="+He:Sd()};
  var Ie=[void 0,Infinity,Infinity,2,5,5,5,5,10,7,10][M],Je=[{ck:"maze/pegman.png",Ht:"maze/tiles_pegman.png",Ao:"maze/marker.png",background:!1,rs:"#000",Rt:["maze/win.mp3","maze/win.ogg"],Uq:["maze/fail_pegman.mp3","maze/fail_pegman.ogg"],Ln:1},{ck:"maze/astro.png",Ht:"maze/tiles_astro.png",Ao:"maze/marker.png",background:"maze/bg_astro.jpg",rs:"#fff",Rt:["maze/win.mp3","maze/win.ogg"],Uq:["maze/fail_astro.mp3","maze/fail_astro.ogg"],Ln:2},{ck:"maze/panda.png",Ht:"maze/tiles_panda.png",Ao:"maze/marker.png",
  background:"maze/bg_panda.jpg",rs:"#000",Rt:["maze/win.mp3","maze/win.ogg"],Uq:["maze/fail_panda.mp3","maze/fail_panda.ogg"],Ln:3}],He=$c("skin",0,Je.length),U=Je[He],W=[void 0,[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,2,1,3,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,1,3,0,0,0],[0,0,2,1,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,
  0,0,0,0],[0,2,1,1,1,1,3,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,1],[0,0,0,0,0,0,1,1],[0,0,0,0,0,3,1,0],[0,0,0,0,1,1,0,0],[0,0,0,1,1,0,0,0],[0,0,1,1,0,0,0,0],[0,2,1,0,0,0,0,0],[1,1,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,3,0,0],[0,0,0,0,0,1,0,0],[0,0,0,0,0,1,0,0],[0,0,0,0,0,1,0,0],[0,0,0,0,0,1,0,0],[0,0,0,2,1,1,0,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,1,1,1,1,1,0,0],[0,1,0,0,0,1,0,0],[0,1,1,3,0,1,0,0],[0,0,0,0,0,1,0,0],[0,2,1,1,1,1,0,0],
  [0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,1,1,0],[0,2,1,1,1,1,0,0],[0,0,0,0,0,1,1,0],[0,1,1,3,0,1,0,0],[0,1,0,1,0,1,0,0],[0,1,1,1,1,1,1,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,1,1,1,1,0,0,0],[0,1,0,0,1,1,0,0],[0,1,1,1,0,1,0,0],[0,0,0,1,0,1,0,0],[0,2,1,1,0,3,0,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,1,1,1,1,1,0,0],[0,0,1,0,0,0,0,0],[3,1,1,1,1,1,1,0],[0,1,0,1,0,1,1,0],[1,1,1,1,1,0,1,0],[0,1,0,1,0,2,1,0],[0,0,0,0,0,0,0,0]],[[0,0,0,0,0,0,0,0],[0,1,1,0,3,0,1,0],[0,1,1,
  0,1,1,1,0],[0,1,0,1,0,1,0,0],[0,1,1,1,1,1,1,0],[0,0,0,1,0,0,1,0],[0,2,1,1,1,0,1,0],[0,0,0,0,0,0,0,0]]][M],Ke=W.length,Le=W[0].length,Me=50*Le,Ne=50*Ke,X=0,Y=[],Oe={10010:[4,0],10001:[3,3],11E3:[0,1],10100:[0,2],11010:[4,1],10101:[3,2],10110:[0,0],10011:[2,0],11001:[4,2],11100:[2,3],11110:[1,1],10111:[1,0],11011:[2,1],11101:[1,2],11111:[2,2],null0:[4,3],null1:[3,0],null2:[3,1],null3:[0,3],null4:[1,3]};
  function Pe(){function a(m,n){return 0>m||m>=Le||0>n||n>=Ke?"0":0==W[n][m]?"0":"1"}var c=document.getElementById("svgMaze"),d=50*Math.max(Ke,Le);c.setAttribute("viewBox","0 0 "+d+" "+d);h.g.j.J("rect",{height:Ne,width:Me,fill:"#F1EEE7","stroke-width":1,stroke:"#CCB"},c);if(U.background){var e=h.g.j.J("image",{height:Ne,width:Me,x:0,y:0},c);e.setAttributeNS(h.g.j.hd,"xlink:href",U.background)}for(var f=d=0;f<Ke;f++)for(var g=0;g<Le;g++){var k=a(g,f)+a(g,f-1)+a(g+1,f)+a(g,f+1)+a(g-1,f);Oe[k]||(k="00000"==
  k&&.3<Math.random()?"null0":"null"+Math.floor(1+4*Math.random()));e=Oe[k][0];k=Oe[k][1];var l=h.g.j.J("clipPath",{id:"tileClipPath"+d},c);h.g.j.J("rect",{height:50,width:50,x:50*g,y:50*f},l);e=h.g.j.J("image",{height:200,width:250,"clip-path":"url(#tileClipPath"+d+")",x:50*(g-e),y:50*(f-k)},c);e.setAttributeNS(h.g.j.hd,"xlink:href",U.Ht);d++}h.g.j.J("image",{id:"finish",height:34,width:20},c).setAttributeNS(h.g.j.hd,"xlink:href",U.Ao);d=h.g.j.J("clipPath",{id:"pegmanClipPath"},c);h.g.j.J("rect",{id:"clipRect",
  height:52,width:49},d);h.g.j.J("image",{id:"pegman",height:52,width:1029,"clip-path":"url(#pegmanClipPath)"},c).setAttributeNS(h.g.j.hd,"xlink:href",U.ck)}
  function Qe(a){if(!(a&&a.hs||w.Xc()||1==X||cd(M))){a=ad();var c=h.K.Gd(h.K.Ty()),d=w.ma.m.tb(!0),e=null,f=null,g=null;if(1==M)2>B(w).length?(e=document.getElementById("dialogHelpStack"),g={width:"370px",top:"130px"},g[a?"right":"left"]="215px",f=d[0].ra()):(d=w.tb(!0),1<d.length?(e='<xml>;<block type="go_east" x="10" y="10">;<next>;<block type="go_east"></block>;</next>;</block>;</xml>'.split(";"),f=document.getElementById("sampleOneTopBlock"),f.firstChild||(f=h.Lg(f,{rtl:ad(),readOnly:!0}),"string"!=
  typeof e&&(e=e.join("")),h.K.Uh(h.K.ue(e),f)),e=document.getElementById("dialogHelpOneTopBlock"),g={width:"360px",top:"120px"},g[a?"right":"left"]="225px",f=d[0].ra()):0==X&&(e=document.getElementById("dialogHelpRun"),g={width:"360px",top:"410px"},g[a?"right":"left"]="400px",f=document.getElementById("runButton")));else if(2==M)0!=X&&"none"==document.getElementById("runButton").style.display&&(e=document.getElementById("dialogHelpReset"),g={width:"360px",top:"410px"},g[a?"right":"left"]="400px",f=
  document.getElementById("resetButton"));else if(3==M)-1==c.indexOf("maze_forever")&&(0==cb(w)?(e=document.getElementById("dialogHelpCapacity"),g={width:"430px",top:"310px"},g[a?"right":"left"]="50px",f=document.getElementById("capacityBubble")):(e=document.getElementById("dialogHelpRepeat"),g={width:"360px",top:"360px"},g[a?"right":"left"]="425px",f=d[3].ra()));else if(4==M)if(0==cb(w)&&(-1==c.indexOf("maze_forever")||1<w.tb(!1).length))e=document.getElementById("dialogHelpCapacity"),g={width:"430px",
  top:"310px"},g[a?"right":"left"]="50px",f=document.getElementById("capacityBubble");else{c=!0;for(var k=B(w),l=0;l<k.length;l++){var m=k[l];if("maze_forever"==m.type){for(var n=0;m;)m=ca(m),m=m.length?m[0]:null,n++;if(2<n){c=!1;break}}}c&&(e=document.getElementById("dialogHelpRepeatMany"),g={width:"360px",top:"360px"},g[a?"right":"left"]="425px",f=d[3].ra())}else if(5==M)0!=He||Re.pB||(e=document.getElementById("dialogHelpSkins"),g={width:"360px",top:"60px"},g[a?"left":"right"]="20px",f=document.getElementById("pegmanButton"));
  else if(6==M)-1==c.indexOf("maze_if")&&(e=document.getElementById("dialogHelpIf"),g={width:"360px",top:"430px"},g[a?"right":"left"]="425px",f=d[4].ra());else if(7==M){if(!Qe.lD){k=document.createElement("span");k.className="helpMenuFake";l=[N("Maze_pathAhead"),N("Maze_pathLeft"),N("Maze_pathRight")];n=h.g.Ra.Vv(l);m=h.g.Ra.Wv(l);k.textContent=(m?l[0].slice(n,-m):l[0].substring(n))+" "+h.Wa.Im;n=document.getElementById("helpMenuText");l=n.textContent;n.textContent="";m=l.split(/%\d/);for(l=0;l<m.length;l++)n.appendChild(document.createTextNode(m[l])),
  l!=m.length-1&&n.appendChild(k.cloneNode(!0));Qe.lD=!0}-1==c.indexOf("isPathRight")&&(e=document.getElementById("dialogHelpMenu"),g={width:"360px",top:"430px"},g[a?"right":"left"]="425px",f=d[4].ra())}else 9==M&&-1==c.indexOf("maze_ifElse")&&(e=document.getElementById("dialogHelpIfElse"),g={width:"360px",top:"305px"},g[a?"right":"left"]="425px",f=d[5].ra());e?e.parentNode!=document.getElementById("dialog")&&P.mm(e,f,!0,!1,g,null):P.Jd(!1)}}
  function Re(a){var c=document.getElementById("pegmanMenu");"block"==c.style.display?Se(a):Wd(a)||(a=document.getElementById("pegmanButton"),a.classList.add("buttonHover"),c.style.top=a.offsetTop+a.offsetHeight+"px",c.style.left=a.offsetLeft+"px",c.style.display="block",ge.Ws=h.Nh(document.body,"mousedown",null,Se),(c=document.getElementById("dialogHelpSkins"))&&"dialogHiddenContent"!=c.className&&P.Jd(!1),Re.pB=!0)}
  function Se(a){Wd(a)||(document.getElementById("pegmanMenu").style.display="none",document.getElementById("pegmanButton").classList.remove("buttonHover"),ge.Ws&&(h.ip(ge.Ws),delete ge.Ws))}
  function Te(a){for(var c=0;c<Y.length;c++)clearTimeout(Y[c]);Y=[];R=he.x;S=he.y;a?(T=2,Ue(!1),Y.push(setTimeout(function(){Q=100;Ve([R,S,4*T-4]);T++},5*Q))):(T=1,Z(R,S,4*T));c=document.getElementById("finish");c.setAttribute("x",50*(ie.x+.5)-c.getAttribute("width")/2);c.setAttribute("y",50*(ie.y+.6)-c.getAttribute("height"));c=document.getElementById("look");c.style.display="none";c.parentNode.appendChild(c);a=c.getElementsByTagName("path");c=0;for(var d;d=a[c];c++)d.setAttribute("stroke",U.rs)}
  function We(a){if(!Wd(a))if(P.Jd(!1),1==M&&1<w.tb(!1).length&&1!=X&&!cd(M))Qe();else{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";Te(!1);Xe()}}function Ye(a){Wd(a)||(document.getElementById("runButton").style.display="inline",document.getElementById("resetButton").style.display="none",Nc(null),Te(!1),Qe())}
  function Ze(a,c){var d=function(e){$e(0,e)};a.setProperty(c,"go_east",a.createNativeFunction(d));d=function(e){$e(2,e)};a.setProperty(c,"go_west",a.createNativeFunction(d));d=function(e){af(0,e)};a.setProperty(c,"go_north",a.createNativeFunction(d));d=function(e){af(1,e)};a.setProperty(c,"go_south",a.createNativeFunction(d));d=function(e){return bf(0,e)};a.setProperty(c,"isPathForward",a.createNativeFunction(d));d=function(e){return bf(1,e)};a.setProperty(c,"isPathRight",a.createNativeFunction(d));
  d=function(e){return bf(2,e)};a.setProperty(c,"isPathBackward",a.createNativeFunction(d));d=function(e){return bf(3,e)};a.setProperty(c,"isPathLeft",a.createNativeFunction(d));a.setProperty(c,"notDone",a.createNativeFunction(function(){return R!=ie.x||S!=ie.y}))}
  function Xe(){if("Interpreter"in window){je=[];h.selected&&pb(h.selected);var a=h.H;var c=w;c||(console.warn("No workspace specified in workspaceToCode call.  Guessing."),c=h.Fg());var d=[];a.za(c);c=c.tb(!0);for(var e=0,f;f=c[e];e++){var g=be(a,f);Array.isArray(g)&&(g=g[0]);g&&(f.S&&(g=a.uy(g),a.ln&&!f.Gt&&(g=ce(a.ln,f)+g),a.mn&&!f.Gt&&(g+=ce(a.mn,f))),d.push(g))}d=d.join("\n");d=a.finish(d);d=d.replace(/^\s+\n/,"");d=d.replace(/\n\s+$/,"\n");Kd=a=d=d.replace(/[ \t]+\n/g,"\n");Jd=Md();X=0;a=new Interpreter(a,
  Ze);try{for(d=1E4;a.step();)if(0==d--)throw Infinity;X=R!=ie.x||S!=ie.y?-1:1}catch(k){Infinity===k?X=2:!1===k?X=-2:(X=-2,alert(k))}1==X?(Q=100,je.push(["finish",null])):Q=150;Te(!1);Y.push(setTimeout(cf,100))}else setTimeout(Xe,250)}
  function cf(){var a=je.shift();if(a){Ud(a[1]);switch(a[0]){case "north":Ve([R,S-1,4*T]);S--;break;case "east":Ve([R+1,S,4*T]);R++;break;case "south":Ve([R,S+1,4*T]);S++;break;case "west":Ve([R-1,S,4*T]);R--;break;case "look_north":df(0);break;case "look_east":df(1);break;case "look_south":df(2);break;case "look_west":df(3);break;case "fail_forward":ef(!0);break;case "fail_backward":ef(!1);break;case "left":Ve([R,S,4*T-4]);T=ff(T-1);break;case "right":Ve([R,S,4*T+4]);T=ff(T+1);break;case "finish":Ue(!0),
  window.localStorage&&(window.localStorage[ed+M]=Jd),setTimeout(P.XB,1E3)}Y.push(setTimeout(cf,5*Q))}else Ud(null),Qe()}function gf(a){if("dialogHiddenContent"!=document.getElementById("dialogDone").className){var c=document.getElementById("pegSpin"),d=P.Iw(c),e=a.clientX-(d.x+d.width/2-window.pageXOffset);a=h.g.qd.YE(Math.atan((a.clientY-(d.y+d.height/2-window.pageYOffset))/e));e=Math.round((0<e?a+90:a+270)/360*16);16==e&&(e=15);c.style.backgroundPosition=49*-e+"px 0px"}}
  function Ve(a){var c=[R,S,4*T],d=[(a[0]-c[0])/4,(a[1]-c[1])/4,(a[2]-c[2])/4];Z(c[0]+d[0],c[1]+d[1],hf(c[2]+d[2]));Y.push(setTimeout(function(){Z(c[0]+2*d[0],c[1]+2*d[1],hf(c[2]+2*d[2]))},Q));Y.push(setTimeout(function(){Z(c[0]+3*d[0],c[1]+3*d[1],hf(c[2]+3*d[2]))},2*Q));Y.push(setTimeout(function(){Z(a[0],a[1],hf(a[2]))},3*Q))}
  function ef(a){var c=0,d=0;switch(T){case 0:d=-1;break;case 1:c=1;break;case 2:d=1;break;case 3:c=-1}a||(c=-c,d=-d);if(1==U.Ln){c/=4;d/=4;var e=hf(4*T);Z(R+c,S+d,e);w.Rc.play("fail",.5);Y.push(setTimeout(function(){Z(R,S,e)},Q));Y.push(setTimeout(function(){Z(R+c,S+d,e);w.Rc.play("fail",.5)},2*Q));Y.push(setTimeout(function(){Z(R,S,e)},3*Q))}else{var f=10*(Math.random()-.5),g=(Math.random()-.5)/2;c+=(Math.random()-.5)/4;d+=(Math.random()-.5)/4;c/=8;d/=8;var k=0;3==U.Ln&&(k=.01);Y.push(setTimeout(function(){w.Rc.play("fail",
  .5)},2*Q));a=function(m){return function(){Z(R+c*m,S+d*m,hf(4*T+g*m),f*m);d+=k}};for(var l=1;100>l;l++)Y.push(setTimeout(a(l),Q*l/2))}}function Ue(a){var c=hf(4*T);Z(R,S,16);a&&w.Rc.play("win",.5);Q=150;Y.push(setTimeout(function(){Z(R,S,18)},Q));Y.push(setTimeout(function(){Z(R,S,16)},2*Q));Y.push(setTimeout(function(){Z(R,S,c)},3*Q))}
  function Z(a,c,d,e){var f=document.getElementById("pegman");f.setAttribute("x",50*a-49*d+1);f.setAttribute("y",50*(c+.5)-26-8);e?f.setAttribute("transform","rotate("+e+", "+(50*a+25)+", "+(50*c+25)+")"):f.setAttribute("transform","rotate(0, 0, 0)");c=document.getElementById("clipRect");c.setAttribute("x",50*a+1);c.setAttribute("y",f.getAttribute("y"))}
  function df(a){var c=R,d=S;switch(a){case 0:c+=.5;break;case 1:c+=1;d+=.5;break;case 2:c+=.5;d+=1;break;case 3:d+=.5}c*=50;d*=50;var e=90*a-45;a=document.getElementById("look");a.setAttribute("transform","translate("+c+", "+d+") rotate("+e+" 0 0) scale(.4)");c=a.getElementsByTagName("path");a.style.display="inline";for(d=0;a=c[d];d++)jf(a,Q*d)}function jf(a,c){Y.push(setTimeout(function(){a.style.display="inline";setTimeout(function(){a.style.display="none"},2*Q)},c))}
  function ff(a){a=Math.round(a)%4;0>a&&(a+=4);return a}function hf(a){a=Math.round(a)%16;0>a&&(a+=16);return a}function $e(a,c){if(!bf(a,null))throw je.push(["fail_"+(a?"backward":"forward"),c]),!1;switch(ff(T+a)){case 0:S--;var d="north";break;case 1:R++;d="east";break;case 2:S++;d="south";break;case 3:R--,d="west"}je.push([d,c])}function af(a,c){a?(T++,je.push(["right",c])):(T--,je.push(["left",c]));T=ff(T)}
  function bf(a,c){switch(ff(T+a)){case 0:var d=W[S-1]&&W[S-1][R];var e="look_north";break;case 1:d=W[S][R+1];e="look_east";break;case 2:d=W[S+1]&&W[S+1][R];e="look_south";break;case 3:d=W[S][R-1],e="look_west"}c&&je.push([e,c]);return 0!==d&&void 0!==d}
  window.addEventListener("load",function(){function a(){l.style.top=Math.max(10,m.offsetTop-window.pageYOffset)+"px";l.style.left=k?"10px":"420px";l.style.width=window.innerWidth-440+"px"}function c(n){return function(){window.sessionStorage&&(window.sessionStorage.qs=Md());location=location.protocol+"//"+location.host+location.pathname+"?lang="+L+"&level="+M+"&skin="+n}}document.body.innerHTML=Ge();Ld();document.querySelector("#pegmanButton>img").style.backgroundImage="url("+U.ck+")";for(var d=document.getElementById("pegmanMenu"),
  e=0;e<Je.length;e++)if(e!=He){var f=document.createElement("div"),g=document.createElement("img");g.src="common/1x1.gif";g.style.backgroundImage="url("+Je[e].ck+")";f.appendChild(g);d.appendChild(f);h.Nh(f,"mousedown",null,c(e))}h.Nh(window,"resize",null,Se);d=document.getElementById("pegmanButton");h.Nh(d,"mousedown",null,Re);d=document.getElementById("pegmanButtonArrow");e=document.createTextNode(h.Wa.Im);d.appendChild(e);var k=ad(),l=document.getElementById("blockly"),m=document.getElementById("visualization");
  window.addEventListener("scroll",function(){a(null);h.vm(w)});window.addEventListener("resize",a);a(null);Rd({maxBlocks:Ie,rtl:k,trashcan:!0,zoom:{startScale:1+(1-M/10)/3}});w.Rc.load(U.Rt,"win");w.Rc.load(U.Uq,"fail");fe(h.H,"go_east,go_west,go_south,go_north,isPathForward,isPathRight,isPathBackward,isPathLeft");Pe();Pd();for(d=0;d<Ke;d++)for(e=0;e<Le;e++)2==W[d][e]?he={x:e,y:d}:3==W[d][e]&&(ie={x:e,y:d});Te(!0);C(w,function(){var n=cb(w),q=document.getElementById("capacity");if(Infinity==n)q.style.display=
  "none";else{q.style.display="inline";q.innerHTML="";n=Number(n);var p=document.createElement("span");p.className="capacityNumber";p.appendChild(document.createTextNode(n));n=(0==n?N("Maze_capacity0"):1==n?N("Maze_capacity1"):N("Maze_capacity2")).split(/%\d/);for(var u=0;u<n.length;u++)q.appendChild(document.createTextNode(n[u])),u!=n.length-1&&q.appendChild(p.cloneNode(!0))}});document.body.addEventListener("mousemove",gf,!0);fd("runButton",We);fd("resetButton",Ye);1==M&&(h.kc*=2,h.gu=h.kc);10==M?
  cd(M)||(d=document.getElementById("dialogHelpWallFollow"),P.mm(d,null,!1,!0,{width:"30%",left:"35%",top:"12em"},P.Cy),P.zy(),setTimeout(P.Ev,3E5)):setTimeout(function(){C(w,Qe);Qe()},5E3);d=document.getElementById("dialogDoneButtons");e=document.createElement("img");e.id="pegSpin";e.src="common/1x1.gif";e.style.backgroundImage="url("+U.ck+")";d.parentNode.insertBefore(e,d);Zd();$d()});
  
  