text: // Do not edit this file; automatically generated by build.py.
  'use strict';
  
  /*
  
   Visual Blocks Editor
  
   Copyright 2016 Massachusetts Institute of Technology
   All rights reserved.
  
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
  
     http://www.apache.org/licenses/LICENSE-2.0
  
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
  */
  Blockly.Colours={motion:{primary:"#4C97FF",secondary:"#4280D7",tertiary:"#3373CC"},looks:{primary:"#9966FF",secondary:"#855CD6",tertiary:"#774DCB"},sounds:{primary:"#CF63CF",secondary:"#C94FC9",tertiary:"#BD42BD"},control:{primary:"#FFAB19",secondary:"#EC9C13",tertiary:"#CF8B17"},event:{primary:"#FFBF00",secondary:"#E6AC00",tertiary:"#CC9900"},sensing:{primary:"#5CB1D6",secondary:"#47A8D1",tertiary:"#2E8EB8"},pen:{primary:"#0fBD8C",secondary:"#0DA57A",tertiary:"#0B8E69"},operators:{primary:"#59C059",
  secondary:"#46B946",tertiary:"#389438"},data:{primary:"#FF8C1A",secondary:"#FF8000",tertiary:"#DB6E00"},data_lists:{primary:"#FF661A",secondary:"#FF5500",tertiary:"#E64D00"},more:{primary:"#FF6680",secondary:"#FF4D6A",tertiary:"#FF3355"},arduino:{primary:"#00979C",secondary:"#008184",tertiary:"#0CA1A6"},text:"#575E75",workspace:"#F9F9F9",toolboxHover:"#4C97FF",toolboxSelected:"#e9eef2",toolboxText:"#575E75",toolbox:"#FFFFFF",flyout:"#F9F9F9",scrollbar:"#CECDCE",scrollbarHover:"#CECDCE",textField:"#FFFFFF",
  insertionMarker:"#000000",insertionMarkerOpacity:.2,dragShadowOpacity:.3,stackGlow:"#FFF200",stackGlowSize:4,stackGlowOpacity:1,replacementGlow:"#FFFFFF",replacementGlowSize:2,replacementGlowOpacity:1,colourPickerStroke:"#FFFFFF",fieldShadow:"rgba(0,0,0,0.1)",dropDownShadow:"rgba(0, 0, 0, .3)",numPadBackground:"#547AB2",numPadBorder:"#435F91",numPadActiveBackground:"#435F91",numPadText:"white",valueReportBackground:"#FFFFFF",valueReportBorder:"#AAAAAA"};
  Blockly.Colours.overrideColours=function(a){if(a)for(var b in a)if(a.hasOwnProperty(b)&&Blockly.Colours.hasOwnProperty(b)){var c=a[b];if(goog.isObject(c))for(var d in c)c.hasOwnProperty(d)&&Blockly.Colours[b].hasOwnProperty(d)&&(Blockly.Colours[b][d]=c[d]);else Blockly.Colours[b]=c}};
  Blockly.constants={};Blockly.DRAG_RADIUS=3;Blockly.FLYOUT_DRAG_RADIUS=10;Blockly.SNAP_RADIUS=48;Blockly.CONNECTING_SNAP_RADIUS=68;Blockly.CURRENT_CONNECTION_PREFERENCE=20;Blockly.BUMP_DELAY=0;Blockly.COLLAPSE_CHARS=30;Blockly.LONGPRESS=750;Blockly.LINE_SCROLL_MULTIPLIER=15;Blockly.SOUND_LIMIT=100;Blockly.DRAG_STACK=!0;Blockly.HSV_SATURATION=.45;Blockly.HSV_VALUE=.65;Blockly.SPRITE={width:96,height:124,url:"sprites.png"};Blockly.SVG_NS="http://www.w3.org/2000/svg";Blockly.HTML_NS="http://www.w3.org/1999/xhtml";
  Blockly.INPUT_VALUE=1;Blockly.OUTPUT_VALUE=2;Blockly.NEXT_STATEMENT=3;Blockly.PREVIOUS_STATEMENT=4;Blockly.DUMMY_INPUT=5;Blockly.ALIGN_LEFT=-1;Blockly.ALIGN_CENTRE=0;Blockly.ALIGN_RIGHT=1;Blockly.DRAG_NONE=0;Blockly.DRAG_STICKY=1;Blockly.DRAG_BEGIN=1;Blockly.DRAG_FREE=2;Blockly.OPPOSITE_TYPE=[];Blockly.OPPOSITE_TYPE[Blockly.INPUT_VALUE]=Blockly.OUTPUT_VALUE;Blockly.OPPOSITE_TYPE[Blockly.OUTPUT_VALUE]=Blockly.INPUT_VALUE;Blockly.OPPOSITE_TYPE[Blockly.NEXT_STATEMENT]=Blockly.PREVIOUS_STATEMENT;
  Blockly.OPPOSITE_TYPE[Blockly.PREVIOUS_STATEMENT]=Blockly.NEXT_STATEMENT;Blockly.TOOLBOX_AT_TOP=0;Blockly.TOOLBOX_AT_BOTTOM=1;Blockly.TOOLBOX_AT_LEFT=2;Blockly.TOOLBOX_AT_RIGHT=3;Blockly.OUTPUT_SHAPE_HEXAGONAL=1;Blockly.OUTPUT_SHAPE_ROUND=2;Blockly.OUTPUT_SHAPE_SQUARE=3;Blockly.Categories={motion:"motion",looks:"looks",sound:"sounds",pen:"pen",data:"data",dataLists:"data-lists",event:"events",control:"control",sensing:"sensing",operators:"operators",more:"more"};Blockly.DELETE_AREA_NONE=null;
  Blockly.DELETE_AREA_TRASH=1;Blockly.DELETE_AREA_TOOLBOX=2;Blockly.VARIABLE_CATEGORY_NAME="VARIABLE";Blockly.PROCEDURE_CATEGORY_NAME="PROCEDURE";Blockly.RENAME_VARIABLE_ID="RENAME_VARIABLE_ID";Blockly.DELETE_VARIABLE_ID="DELETE_VARIABLE_ID";Blockly.NEW_BROADCAST_MESSAGE_ID="NEW_BROADCAST_MESSAGE_ID";Blockly.BROADCAST_MESSAGE_VARIABLE_TYPE="broadcast_msg";Blockly.LIST_VARIABLE_TYPE="list";Blockly.SCALAR_VARIABLE_TYPE="";Blockly.PROCEDURES_DEFINITION_BLOCK_TYPE="procedures_definition";
  Blockly.PROCEDURES_PROTOTYPE_BLOCK_TYPE="procedures_prototype";Blockly.PROCEDURES_CALL_BLOCK_TYPE="procedures_call";Blockly.StatusButtonState={READY:"ready",NOT_READY:"not ready"};
  Blockly.ScratchBlocks={};Blockly.ScratchBlocks.VerticalExtensions={};Blockly.ScratchBlocks.VerticalExtensions.colourHelper=function(a){var b=Blockly.Colours[a];if(!(b&&b.primary&&b.secondary&&b.tertiary))throw Error('Could not find colours for category "'+a+'"');return function(){this.setColourFromRawValues_(b.primary,b.secondary,b.tertiary)}};Blockly.ScratchBlocks.VerticalExtensions.COLOUR_TEXTFIELD=function(){this.setColourFromRawValues_(Blockly.Colours.textField,Blockly.Colours.textField,Blockly.Colours.textField)};
  Blockly.ScratchBlocks.VerticalExtensions.SHAPE_STATEMENT=function(){this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null)};Blockly.ScratchBlocks.VerticalExtensions.SHAPE_HAT=function(){this.setInputsInline(!0);this.setNextStatement(!0,null)};Blockly.ScratchBlocks.VerticalExtensions.SHAPE_END=function(){this.setInputsInline(!0);this.setPreviousStatement(!0,null)};
  Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_NUMBER=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.setOutput(!0,"Number")};Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_STRING=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);this.setOutput(!0,"String")};Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_BOOLEAN=function(){this.setInputsInline(!0);this.setOutputShape(Blockly.OUTPUT_SHAPE_HEXAGONAL);this.setOutput(!0,"Boolean")};
  Blockly.ScratchBlocks.VerticalExtensions.PROCEDURE_DEF_CONTEXTMENU={customContextMenu:function(a){a.push(Blockly.Procedures.makeEditOption(this));for(var b=0,c;c=a[b];b++)if(c.text==Blockly.Msg.DELETE_BLOCK){var d=this.getInput("custom_block");if(d&&d.connection&&d.connection.targetBlock())var e=d.connection.targetBlock().getProcCode();else return;var f=this;c.callback=function(){Blockly.Procedures.deleteProcedureDefCallback(e,f)||alert(Blockly.Msg.PROCEDURE_USED)}}for(b=0;c=a[b];b++)if(c.text==Blockly.Msg.DUPLICATE){a.splice(b,
  1);break}}};Blockly.ScratchBlocks.VerticalExtensions.PROCEDURE_CALL_CONTEXTMENU={customContextMenu:function(a){a.push(Blockly.Procedures.makeEditOption(this))}};Blockly.ScratchBlocks.VerticalExtensions.SCRATCH_EXTENSION=function(){this.isScratchExtension=!0};
  Blockly.ScratchBlocks.VerticalExtensions.registerAll=function(){for(var a="control data data_lists sounds motion looks event sensing pen operators more".split(" "),b=0;b<a.length;b++){var c=a[b];Blockly.Extensions.register("colours_"+c,Blockly.ScratchBlocks.VerticalExtensions.colourHelper(c))}Blockly.Extensions.register("colours_textfield",Blockly.ScratchBlocks.VerticalExtensions.COLOUR_TEXTFIELD);Blockly.Extensions.register("shape_statement",Blockly.ScratchBlocks.VerticalExtensions.SHAPE_STATEMENT);
  Blockly.Extensions.register("shape_hat",Blockly.ScratchBlocks.VerticalExtensions.SHAPE_HAT);Blockly.Extensions.register("shape_end",Blockly.ScratchBlocks.VerticalExtensions.SHAPE_END);Blockly.Extensions.register("output_number",Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_NUMBER);Blockly.Extensions.register("output_string",Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_STRING);Blockly.Extensions.register("output_boolean",Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_BOOLEAN);Blockly.Extensions.registerMixin("procedure_def_contextmenu",
  Blockly.ScratchBlocks.VerticalExtensions.PROCEDURE_DEF_CONTEXTMENU);Blockly.Extensions.registerMixin("procedure_call_contextmenu",Blockly.ScratchBlocks.VerticalExtensions.PROCEDURE_CALL_CONTEXTMENU);Blockly.Extensions.register("scratch_extension",Blockly.ScratchBlocks.VerticalExtensions.SCRATCH_EXTENSION)};Blockly.ScratchBlocks.VerticalExtensions.registerAll();Blockly.Blocks.control={};Blockly.Blocks.control_forever={init:function(){this.jsonInit({id:"control_forever",message0:Blockly.Msg.CONTROL_FOREVER,message1:"%1",message2:"%1",lastDummyAlign2:"RIGHT",args1:[{type:"input_statement",name:"SUBSTACK"}],args2:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"repeat.svg",width:24,height:24,alt:"*",flip_rtl:!0}],category:Blockly.Categories.control,extensions:["colours_control","shape_end"]})}};
  Blockly.Blocks.control_repeat={init:function(){this.jsonInit({id:"control_repeat",message0:Blockly.Msg.CONTROL_REPEAT,message1:"%1",message2:"%1",lastDummyAlign2:"RIGHT",args0:[{type:"input_value",name:"TIMES"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args2:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"repeat.svg",width:24,height:24,alt:"*",flip_rtl:!0}],category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};
  Blockly.Blocks.control_if={init:function(){this.jsonInit({type:"control_if",message0:Blockly.Msg.CONTROL_IF,message1:"%1",args0:[{type:"input_value",name:"CONDITION",check:"Boolean"}],args1:[{type:"input_statement",name:"SUBSTACK"}],category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};
  Blockly.Blocks.control_if_else={init:function(){this.jsonInit({type:"control_if_else",message0:Blockly.Msg.CONTROL_IF,message1:"%1",message2:Blockly.Msg.CONTROL_ELSE,message3:"%1",args0:[{type:"input_value",name:"CONDITION",check:"Boolean"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args3:[{type:"input_statement",name:"SUBSTACK2"}],category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};
  Blockly.Blocks.control_stop={init:function(){var a=new Blockly.FieldDropdown(function(){return this.sourceBlock_&&this.sourceBlock_.nextConnection&&this.sourceBlock_.nextConnection.isConnected()?[[Blockly.Msg.CONTROL_STOP_OTHER,"other scripts in sprite"]]:[[Blockly.Msg.CONTROL_STOP_ALL,"all"],[Blockly.Msg.CONTROL_STOP_THIS,"this script"],[Blockly.Msg.CONTROL_STOP_OTHER,"other scripts in sprite"]]},function(a){Blockly.Events.setGroup(!0);var b=Blockly.Xml.domToText(this.sourceBlock_.mutationToDom());
  this.sourceBlock_.setNextStatement("other scripts in sprite"==a);var d=Blockly.Xml.domToText(this.sourceBlock_.mutationToDom());Blockly.Events.fire(new Blockly.Events.BlockChange(this.sourceBlock_,"mutation",null,b,d));this.setValue(a);Blockly.Events.setGroup(!1);return null});this.appendDummyInput().appendField(Blockly.Msg.CONTROL_STOP).appendField(a,"STOP_OPTION");this.setCategory(Blockly.Categories.control);this.setColour(Blockly.Colours.control.primary,Blockly.Colours.control.secondary,Blockly.Colours.control.tertiary);
  this.setPreviousStatement(!0)},mutationToDom:function(){var a=document.createElement("mutation");a.setAttribute("hasnext",null!=this.nextConnection);return a},domToMutation:function(a){a="true"==a.getAttribute("hasnext");this.setNextStatement(a)}};Blockly.Blocks.control_wait={init:function(){this.jsonInit({id:"control_wait",message0:Blockly.Msg.CONTROL_WAIT,args0:[{type:"input_value",name:"DURATION"}],category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};
  Blockly.Blocks.control_wait_until={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROL_WAITUNTIL,args0:[{type:"input_value",name:"CONDITION",check:"Boolean"}],category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};
  Blockly.Blocks.control_repeat_until={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROL_REPEATUNTIL,message1:"%1",message2:"%1",lastDummyAlign2:"RIGHT",args0:[{type:"input_value",name:"CONDITION",check:"Boolean"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args2:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"repeat.svg",width:24,height:24,alt:"*",flip_rtl:!0}],category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};
  Blockly.Blocks.control_while={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROL_WHILE,message1:"%1",message2:"%1",lastDummyAlign2:"RIGHT",args0:[{type:"input_value",name:"CONDITION",check:"Boolean"}],args1:[{type:"input_statement",name:"SUBSTACK"}],args2:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"repeat.svg",width:24,height:24,alt:"*",flip_rtl:!0}],category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};
  Blockly.Blocks.control_for_each={init:function(){this.jsonInit({type:"control_for_each",message0:Blockly.Msg.CONTROL_FOREACH,message1:"%1",args0:[{type:"field_variable",name:"VARIABLE"},{type:"input_value",name:"VALUE"}],args1:[{type:"input_statement",name:"SUBSTACK"}],category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};
  Blockly.Blocks.control_start_as_clone={init:function(){this.jsonInit({id:"control_start_as_clone",message0:Blockly.Msg.CONTROL_STARTASCLONE,args0:[],category:Blockly.Categories.control,extensions:["colours_control","shape_hat"]})}};Blockly.Blocks.control_create_clone_of_menu={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"CLONE_OPTION",options:[[Blockly.Msg.CONTROL_CREATECLONEOF_MYSELF,"_myself_"]]}],extensions:["colours_control","output_string"]})}};
  Blockly.Blocks.control_create_clone_of={init:function(){this.jsonInit({id:"control_start_as_clone",message0:Blockly.Msg.CONTROL_CREATECLONEOF,args0:[{type:"input_value",name:"CLONE_OPTION"}],category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};Blockly.Blocks.control_delete_this_clone={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROL_DELETETHISCLONE,args0:[],category:Blockly.Categories.control,extensions:["colours_control","shape_end"]})}};
  Blockly.Blocks.control_get_counter={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROL_COUNTER,category:Blockly.Categories.control,extensions:["colours_control","output_number"]})}};Blockly.Blocks.control_incr_counter={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROL_INCRCOUNTER,category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};
  Blockly.Blocks.control_clear_counter={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROL_CLEARCOUNTER,category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};Blockly.Blocks.control_all_at_once={init:function(){this.jsonInit({message0:Blockly.Msg.CONTROL_ALLATONCE,message1:"%1",args1:[{type:"input_statement",name:"SUBSTACK"}],category:Blockly.Categories.control,extensions:["colours_control","shape_statement"]})}};Blockly.Blocks.data={};Blockly.Constants={};Blockly.Constants.Data={};Blockly.Blocks.data_variable={init:function(){this.jsonInit({message0:"%1",lastDummyAlign0:"CENTRE",args0:[{type:"field_variable_getter",text:"",name:"VARIABLE",variableType:""}],category:Blockly.Categories.data,checkboxInFlyout:!0,extensions:["contextMenu_getVariableBlock","colours_data","output_string"]})}};
  Blockly.Blocks.data_setvariableto={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_SETVARIABLETO,args0:[{type:"field_variable",name:"VARIABLE"},{type:"input_value",name:"VALUE"}],category:Blockly.Categories.data,extensions:["colours_data","shape_statement"]})}};
  Blockly.Blocks.data_changevariableby={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_CHANGEVARIABLEBY,args0:[{type:"field_variable",name:"VARIABLE"},{type:"input_value",name:"VALUE"}],category:Blockly.Categories.data,extensions:["colours_data","shape_statement"]})}};
  Blockly.Blocks.data_showvariable={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_SHOWVARIABLE,args0:[{type:"field_variable",name:"VARIABLE"}],previousStatement:null,nextStatement:null,category:Blockly.Categories.data,colour:Blockly.Colours.data.primary,colourSecondary:Blockly.Colours.data.secondary,colourTertiary:Blockly.Colours.data.tertiary})}};
  Blockly.Blocks.data_hidevariable={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_HIDEVARIABLE,args0:[{type:"field_variable",name:"VARIABLE"}],previousStatement:null,nextStatement:null,category:Blockly.Categories.data,colour:Blockly.Colours.data.primary,colourSecondary:Blockly.Colours.data.secondary,colourTertiary:Blockly.Colours.data.tertiary})}};
  Blockly.Blocks.data_listcontents={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_variable_getter",text:"",name:"LIST",variableType:Blockly.LIST_VARIABLE_TYPE}],category:Blockly.Categories.dataLists,extensions:["contextMenu_getListBlock","colours_data_lists","output_string"],checkboxInFlyout:!0})}};
  Blockly.Blocks.data_listindexall={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_numberdropdown",name:"INDEX",value:"1",min:1,precision:1,options:[["1","1"],[Blockly.Msg.DATA_INDEX_LAST,"last"],[Blockly.Msg.DATA_INDEX_ALL,"all"]]}],category:Blockly.Categories.data,extensions:["colours_textfield","output_string"]})}};
  Blockly.Blocks.data_listindexrandom={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_numberdropdown",name:"INDEX",value:"1",min:1,precision:1,options:[["1","1"],[Blockly.Msg.DATA_INDEX_LAST,"last"],[Blockly.Msg.DATA_INDEX_RANDOM,"random"]]}],category:Blockly.Categories.data,extensions:["colours_textfield","output_string"]})}};
  Blockly.Blocks.data_addtolist={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_ADDTOLIST,args0:[{type:"input_value",name:"ITEM"},{type:"field_variable",name:"LIST",variableTypes:[Blockly.LIST_VARIABLE_TYPE]}],category:Blockly.Categories.dataLists,extensions:["colours_data_lists","shape_statement"]})}};
  Blockly.Blocks.data_deleteoflist={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_DELETEOFLIST,args0:[{type:"input_value",name:"INDEX"},{type:"field_variable",name:"LIST",variableTypes:[Blockly.LIST_VARIABLE_TYPE]}],category:Blockly.Categories.dataLists,extensions:["colours_data_lists","shape_statement"]})}};
  Blockly.Blocks.data_deletealloflist={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_DELETEALLOFLIST,args0:[{type:"field_variable",name:"LIST",variableTypes:[Blockly.LIST_VARIABLE_TYPE]}],category:Blockly.Categories.dataLists,extensions:["colours_data_lists","shape_statement"]})}};
  Blockly.Blocks.data_insertatlist={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_INSERTATLIST,args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"INDEX"},{type:"field_variable",name:"LIST",variableTypes:[Blockly.LIST_VARIABLE_TYPE]}],category:Blockly.Categories.dataLists,extensions:["colours_data_lists","shape_statement"]})}};
  Blockly.Blocks.data_replaceitemoflist={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_REPLACEITEMOFLIST,args0:[{type:"input_value",name:"INDEX"},{type:"field_variable",name:"LIST",variableTypes:[Blockly.LIST_VARIABLE_TYPE]},{type:"input_value",name:"ITEM"}],category:Blockly.Categories.dataLists,extensions:["colours_data_lists","shape_statement"]})}};
  Blockly.Blocks.data_itemoflist={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_ITEMOFLIST,args0:[{type:"input_value",name:"INDEX"},{type:"field_variable",name:"LIST",variableTypes:[Blockly.LIST_VARIABLE_TYPE]}],output:null,category:Blockly.Categories.dataLists,extensions:["colours_data_lists"],outputShape:Blockly.OUTPUT_SHAPE_ROUND})}};
  Blockly.Blocks.data_itemnumoflist={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_ITEMNUMOFLIST,args0:[{type:"input_value",name:"ITEM"},{type:"field_variable",name:"LIST",variableTypes:[Blockly.LIST_VARIABLE_TYPE]}],output:null,category:Blockly.Categories.dataLists,extensions:["colours_data_lists"],outputShape:Blockly.OUTPUT_SHAPE_ROUND})}};
  Blockly.Blocks.data_lengthoflist={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_LENGTHOFLIST,args0:[{type:"field_variable",name:"LIST",variableTypes:[Blockly.LIST_VARIABLE_TYPE]}],category:Blockly.Categories.dataLists,extensions:["colours_data_lists","output_number"]})}};
  Blockly.Blocks.data_listcontainsitem={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_LISTCONTAINSITEM,args0:[{type:"field_variable",name:"LIST",variableTypes:[Blockly.LIST_VARIABLE_TYPE]},{type:"input_value",name:"ITEM"}],category:Blockly.Categories.dataLists,extensions:["colours_data_lists","output_boolean"]})}};
  Blockly.Blocks.data_showlist={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_SHOWLIST,args0:[{type:"field_variable",name:"LIST",variableTypes:[Blockly.LIST_VARIABLE_TYPE]}],category:Blockly.Categories.dataLists,extensions:["colours_data_lists","shape_statement"]})}};
  Blockly.Blocks.data_hidelist={init:function(){this.jsonInit({message0:Blockly.Msg.DATA_HIDELIST,args0:[{type:"field_variable",name:"LIST",variableTypes:[Blockly.LIST_VARIABLE_TYPE]}],category:Blockly.Categories.dataLists,extensions:["colours_data_lists","shape_statement"]})}};
  Blockly.Constants.Data.CUSTOM_CONTEXT_MENU_GET_VARIABLE_MIXIN={customContextMenu:function(a){if(!this.isCollapsed()){var b=this.getField("VARIABLE").text_;if(this.isInFlyout){var c={text:Blockly.Msg.RENAME_VARIABLE,enabled:!0,callback:Blockly.Constants.Data.RENAME_OPTION_CALLBACK_FACTORY(this,"VARIABLE")};b={text:Blockly.Msg.DELETE_VARIABLE.replace("%1",b),enabled:!0,callback:Blockly.Constants.Data.DELETE_OPTION_CALLBACK_FACTORY(this,"VARIABLE")};a.push(c);a.push(b)}else{c=this.workspace.getVariablesOfType("");
  c.sort(function(a,b){return Blockly.scratchBlocksUtils.compareStrings(a.name,b.name)});for(var d=0;d<c.length;d++){var e=c[d].name;if(e!=b){var f={enabled:!0};f.text=e;f.callback=Blockly.Constants.Data.VARIABLE_OPTION_CALLBACK_FACTORY(this,c[d].getId(),"VARIABLE");a.push(f)}}}}}};Blockly.Extensions.registerMixin("contextMenu_getVariableBlock",Blockly.Constants.Data.CUSTOM_CONTEXT_MENU_GET_VARIABLE_MIXIN);
  Blockly.Constants.Data.CUSTOM_CONTEXT_MENU_GET_LIST_MIXIN={customContextMenu:function(a){if(!this.isCollapsed()){var b=this.getField("LIST").text_;if(this.isInFlyout){var c={text:Blockly.Msg.RENAME_LIST,enabled:!0,callback:Blockly.Constants.Data.RENAME_OPTION_CALLBACK_FACTORY(this,"LIST")};b={text:Blockly.Msg.DELETE_LIST.replace("%1",b),enabled:!0,callback:Blockly.Constants.Data.DELETE_OPTION_CALLBACK_FACTORY(this,"LIST")};a.push(c);a.push(b)}else{c=this.workspace.getVariablesOfType("list");c.sort(function(a,
  b){return Blockly.scratchBlocksUtils.compareStrings(a.name,b.name)});for(var d=0;d<c.length;d++){var e=c[d].name;if(e!=b){var f={enabled:!0};f.text=e;f.callback=Blockly.Constants.Data.VARIABLE_OPTION_CALLBACK_FACTORY(this,c[d].getId(),"LIST");a.push(f)}}}}}};Blockly.Extensions.registerMixin("contextMenu_getListBlock",Blockly.Constants.Data.CUSTOM_CONTEXT_MENU_GET_LIST_MIXIN);
  Blockly.Constants.Data.VARIABLE_OPTION_CALLBACK_FACTORY=function(a,b,c){return function(){var d=a.getField(c);d||console.log("Tried to get a variable field on the wrong type of block.");d.setValue(b)}};Blockly.Constants.Data.RENAME_OPTION_CALLBACK_FACTORY=function(a,b){return function(){var c=a.workspace,d=a.getField(b).getVariable();Blockly.Variables.renameVariable(c,d)}};
  Blockly.Constants.Data.DELETE_OPTION_CALLBACK_FACTORY=function(a,b){return function(){var c=a.workspace,d=a.getField(b).getVariable();c.deleteVariableById(d.getId())}};Blockly.Blocks.defaultToolbox='<xml id="toolbox-categories" style="display: none"><category name="%{BKY_CATEGORY_MOTION}" id="motion" colour="#4C97FF" secondaryColour="#3373CC"><block type="motion_movesteps" id="motion_movesteps"><value name="STEPS"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="motion_turnright" id="motion_turnright"><value name="DEGREES"><shadow type="math_number"><field name="NUM">15</field></shadow></value></block><block type="motion_turnleft" id="motion_turnleft"><value name="DEGREES"><shadow type="math_number"><field name="NUM">15</field></shadow></value></block><block type="motion_pointindirection" id="motion_pointindirection"><value name="DIRECTION"><shadow type="math_angle"><field name="NUM">90</field></shadow></value></block><block type="motion_pointtowards" id="motion_pointtowards"><value name="TOWARDS"><shadow type="motion_pointtowards_menu"></shadow></value></block><block type="motion_gotoxy" id="motion_gotoxy"><value name="X"><shadow id="movex" type="math_number"><field name="NUM">0</field></shadow></value><value name="Y"><shadow id="movey" type="math_number"><field name="NUM">0</field></shadow></value></block><block type="motion_goto" id="motion_goto"><value name="TO"><shadow type="motion_goto_menu"></shadow></value></block><block type="motion_glidesecstoxy" id="motion_glidesecstoxy"><value name="SECS"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="X"><shadow id="glidex" type="math_number"><field name="NUM">0</field></shadow></value><value name="Y"><shadow id="glidey" type="math_number"><field name="NUM">0</field></shadow></value></block><block type="motion_glideto" id="motion_glideto"><value name="SECS"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="TO"><shadow type="motion_glideto_menu"></shadow></value></block><block type="motion_changexby" id="motion_changexby"><value name="DX"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="motion_setx" id="motion_setx"><value name="X"><shadow id="setx" type="math_number"><field name="NUM">0</field></shadow></value></block><block type="motion_changeyby" id="motion_changeyby"><value name="DY"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="motion_sety" id="motion_sety"><value name="Y"><shadow id="sety" type="math_number"><field name="NUM">0</field></shadow></value></block><block type="motion_ifonedgebounce" id="motion_ifonedgebounce"></block><block type="motion_setrotationstyle" id="motion_setrotationstyle"></block><block type="motion_xposition" id="motion_xposition"></block><block type="motion_yposition" id="motion_yposition"></block><block type="motion_direction" id="motion_direction"></block></category><category name="%{BKY_CATEGORY_LOOKS}" id="looks" colour="#9966FF" secondaryColour="#774DCB"><block type="looks_show" id="looks_show"></block><block type="looks_hide" id="looks_hide"></block><block type="looks_switchcostumeto" id="looks_switchcostumeto"><value name="COSTUME"><shadow type="looks_costume"></shadow></value></block><block type="looks_nextcostume" id="looks_nextcostume"></block><block type="looks_nextbackdrop" id="looks_nextbackdrop"></block><block type="looks_switchbackdropto" id="looks_switchbackdropto"><value name="BACKDROP"><shadow type="looks_backdrops"></shadow></value></block><block type="looks_switchbackdroptoandwait" id="looks_switchbackdroptoandwait"><value name="BACKDROP"><shadow type="looks_backdrops"></shadow></value></block><block type="looks_changeeffectby" id="looks_changeeffectby"><value name="CHANGE"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="looks_seteffectto" id="looks_seteffectto"><value name="VALUE"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="looks_cleargraphiceffects" id="looks_cleargraphiceffects"></block><block type="looks_changesizeby" id="looks_changesizeby"><value name="CHANGE"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="looks_setsizeto" id="looks_setsizeto"><value name="SIZE"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="looks_gotofrontback" id="looks_gotofrontback"></block><block type="looks_goforwardbackwardlayers" id="looks_goforwardbackwardlayers"><value name="NUM"><shadow type="math_integer"><field name="NUM">1</field></shadow></value></block><block type="looks_costumenumbername" id="looks_costumenumbername"></block><block type="looks_backdropnumbername" id="looks_backdropnumbername"></block><block type="looks_size" id="looks_size"></block></category><category name="%{BKY_CATEGORY_SOUND}" id="sound" colour="#D65CD6" secondaryColour="#BD42BD"><block type="sound_play" id="sound_play"><value name="SOUND_MENU"><shadow type="sound_sounds_menu"></shadow></value></block><block type="sound_playuntildone" id="sound_playuntildone"><value name="SOUND_MENU"><shadow type="sound_sounds_menu"></shadow></value></block><block type="sound_stopallsounds" id="sound_stopallsounds"></block><block type="sound_changeeffectby" id="sound_changeeffectby"><value name="VALUE"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="sound_seteffectto" id="sound_seteffectto"><value name="VALUE"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="sound_cleareffects" id="sound_cleareffects"></block><block type="sound_changevolumeby" id="sound_changevolumeby"><value name="VOLUME"><shadow type="math_number"><field name="NUM">-10</field></shadow></value></block><block type="sound_setvolumeto" id="sound_setvolumeto"><value name="VOLUME"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="sound_volume" id="sound_volume"></block></category><category name="%{BKY_CATEGORY_EVENTS}" id="events" colour="#FFD500" secondaryColour="#CC9900"><block type="event_whenflagclicked" id="event_whenflagclicked"></block><block type="event_whenkeypressed" id="event_whenkeypressed"></block><block type="event_whenthisspriteclicked" id="event_whenthisspriteclicked"></block><block type="event_whenbackdropswitchesto" id="event_whenbackdropswitchesto"></block><block type="event_whengreaterthan" id="event_whengreaterthan"><value name="VALUE"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="event_whenbroadcastreceived" id="event_whenbroadcastreceived"></block><block type="event_broadcast" id="event_broadcast"><value name="BROADCAST_INPUT"><shadow type="event_broadcast_menu"></shadow></value></block><block type="event_broadcastandwait" id="event_broadcastandwait"><value name="BROADCAST_INPUT"><shadow type="event_broadcast_menu"></shadow></value></block></category><category name="%{BKY_CATEGORY_CONTROL}" id="control" colour="#FFAB19" secondaryColour="#CF8B17"><block type="control_wait" id="control_wait"><value name="DURATION"><shadow type="math_positive_number"><field name="NUM">1</field></shadow></value></block><block type="control_repeat" id="control_repeat"><value name="TIMES"><shadow type="math_whole_number"><field name="NUM">10</field></shadow></value></block><block type="control_forever" id="control_forever"></block><block type="control_if" id="control_if"></block><block type="control_if_else" id="control_if_else"></block><block type="control_wait_until" id="control_wait_until"></block><block type="control_repeat_until" id="control_repeat_until"></block><block type="control_stop" id="control_stop"></block><block type="control_start_as_clone" id="control_start_as_clone"></block><block type="control_create_clone_of" id="control_create_clone_of"><value name="CLONE_OPTION"><shadow type="control_create_clone_of_menu"></shadow></value></block><block type="control_delete_this_clone" id="control_delete_this_clone"></block></category><category name="%{BKY_CATEGORY_SENSING}" id="sensing" colour="#4CBFE6" secondaryColour="#2E8EB8"><block type="sensing_touchingobject" id="sensing_touchingobject"><value name="TOUCHINGOBJECTMENU"><shadow type="sensing_touchingobjectmenu"></shadow></value></block><block type="sensing_touchingcolor" id="sensing_touchingcolor"><value name="COLOR"><shadow type="colour_picker"></shadow></value></block><block type="sensing_coloristouchingcolor" id="sensing_coloristouchingcolor"><value name="COLOR"><shadow type="colour_picker"></shadow></value><value name="COLOR2"><shadow type="colour_picker"></shadow></value></block><block type="sensing_distanceto" id="sensing_distanceto"><value name="DISTANCETOMENU"><shadow type="sensing_distancetomenu"></shadow></value></block><block type="sensing_keypressed" id="sensing_keypressed"><value name="KEY_OPTION"><shadow type="sensing_keyoptions"></shadow></value></block><block type="sensing_mousedown" id="sensing_mousedown"></block><block type="sensing_mousex" id="sensing_mousex"></block><block type="sensing_mousey" id="sensing_mousey"></block><block type="sensing_setdragmode" id="sensing_setdragmode"></block><block type="sensing_loudness" id="sensing_loudness"></block><block type="sensing_timer" id="sensing_timer"></block><block type="sensing_resettimer" id="sensing_resettimer"></block><block type="sensing_of" id="sensing_of"><value name="OBJECT"><shadow type="sensing_of_object_menu"></shadow></value></block><block type="sensing_current" id="sensing_current"></block><block type="sensing_dayssince2000" id="sensing_dayssince2000"></block></category><category name="%{BKY_CATEGORY_OPERATORS}" id="operators" colour="#40BF4A" secondaryColour="#389438"><block type="operator_add" id="operator_add"><value name="NUM1"><shadow type="math_number"><field name="NUM"></field></shadow></value><value name="NUM2"><shadow type="math_number"><field name="NUM"></field></shadow></value></block><block type="operator_subtract" id="operator_subtract"><value name="NUM1"><shadow type="math_number"><field name="NUM"></field></shadow></value><value name="NUM2"><shadow type="math_number"><field name="NUM"></field></shadow></value></block><block type="operator_multiply" id="operator_multiply"><value name="NUM1"><shadow type="math_number"><field name="NUM"></field></shadow></value><value name="NUM2"><shadow type="math_number"><field name="NUM"></field></shadow></value></block><block type="operator_divide" id="operator_divide"><value name="NUM1"><shadow type="math_number"><field name="NUM"></field></shadow></value><value name="NUM2"><shadow type="math_number"><field name="NUM"></field></shadow></value></block><block type="operator_random" id="operator_random"><value name="FROM"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="TO"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="operator_lt" id="operator_lt"><value name="OPERAND1"><shadow type="text"><field name="TEXT"></field></shadow></value><value name="OPERAND2"><shadow type="text"><field name="TEXT"></field></shadow></value></block><block type="operator_equals" id="operator_equals"><value name="OPERAND1"><shadow type="text"><field name="TEXT"></field></shadow></value><value name="OPERAND2"><shadow type="text"><field name="TEXT"></field></shadow></value></block><block type="operator_gt" id="operator_gt"><value name="OPERAND1"><shadow type="text"><field name="TEXT"></field></shadow></value><value name="OPERAND2"><shadow type="text"><field name="TEXT"></field></shadow></value></block><block type="operator_and" id="operator_and"></block><block type="operator_or" id="operator_or"></block><block type="operator_not" id="operator_not"></block><block type="operator_join" id="operator_join"><value name="STRING1"><shadow type="text"><field name="TEXT">hello</field></shadow></value><value name="STRING2"><shadow type="text"><field name="TEXT">world</field></shadow></value></block><block type="operator_letter_of" id="operator_letter_of"><value name="LETTER"><shadow type="math_whole_number"><field name="NUM">1</field></shadow></value><value name="STRING"><shadow type="text"><field name="TEXT">world</field></shadow></value></block><block type="operator_length" id="operator_length"><value name="STRING"><shadow type="text"><field name="TEXT">world</field></shadow></value></block><block type="operator_contains" id="operator_contains"><value name="STRING1"><shadow type="text"><field name="TEXT">hello</field></shadow></value><value name="STRING2"><shadow type="text"><field name="TEXT">world</field></shadow></value></block><block type="operator_mod" id="operator_mod"><value name="NUM1"><shadow type="math_number"><field name="NUM"></field></shadow></value><value name="NUM2"><shadow type="math_number"><field name="NUM"></field></shadow></value></block><block type="operator_round" id="operator_round"><value name="NUM"><shadow type="math_number"><field name="NUM"></field></shadow></value></block><block type="operator_mathop" id="operator_mathop"><value name="NUM"><shadow type="math_number"><field name="NUM"></field></shadow></value></block></category><category name="Arduino" colour="#00979C" secondaryColour="#008184"><block type="event_arduinobegin"></block><block type="arduino_pin_mode"><value name="PINNUM"><shadow type="text"><field name="TEXT">3</field></shadow></value><value name="ARDUINO_PIN_MODE_OPTION"><shadow type="arduino_pin_mode_option"></shadow></value></block><block type="arduino_digital_write"><value name="PINNUM"><shadow type="text"><field name="TEXT">3</field></shadow></value><value name="ARDUINO_LEVEL_OPTION"><shadow type="arduino_level_option"></shadow></value></block><block type="arduino_pwm_write"><value name="ARDUINO_PWM_OPTION"><shadow type="arduino_pwm_option"><field name="ARDUINO_PWM_OPTION">3</field></shadow></value><value name="PWM"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="arduino_digital_read"><value name="PINNUM"><shadow type="text"><field name="TEXT">3</field></shadow></value></block><block type="arduino_analog_read"><value name="PINNUM"><shadow type="text"><field name="TEXT">A3</field></shadow></value></block><block type="arduino_tone"><value name="PINNUM"><shadow type="text"><field name="TEXT">3</field></shadow></value><value name="FREQUENCY"><shadow type="math_number"><field name="NUM">200</field></shadow></value><value name="DURATION"><shadow type="math_number"><field name="NUM">500</field></shadow></value></block><block type="arduino_servo"><value name="PINNUM"><shadow type="text"><field name="TEXT">3</field></shadow></value><value name="ANGLE"><shadow type="math_angle"><field name="NUM">90</field></shadow></value></block><block type="arduino_map"><value name="VAL"><shadow type="math_number"><field name="NUM">512</field></shadow></value><value name="FROMLOW"><shadow type="math_number"><field name="NUM">0</field></shadow></value><value name="FROMHIGH"><shadow type="math_number"><field name="NUM">1024</field></shadow></value><value name="TOLOW"><shadow type="math_number"><field name="NUM">0</field></shadow></value><value name="TOHIGH"><shadow type="math_number"><field name="NUM">255</field></shadow></value></block><block type="arduino_pulsein"><value name="PINNUM"><shadow type="text"><field name="TEXT">8</field></shadow></value></block><block type="arduino_println"><value name="TEXT"><shadow type="text"><field name="TEXT">Hello world!</field></shadow></value></block></category><category name="%{BKY_CATEGORY_VARIABLES}" id="data" colour="#FF8C1A" secondaryColour="#DB6E00" custom="VARIABLE"></category><category name="%{BKY_CATEGORY_MYBLOCKS}" id="more" colour="#FF6680" secondaryColour="#FF4D6A" custom="PROCEDURE"></category><category name="Extensions" id="extensions" colour="#FF6680" secondaryColour="#FF4D6A" iconURI="../media/extensions/wedo2-block-icon.svg" showStatusButton="true"><block type="extension_pen_down" id="extension_pen_down"></block><block type="extension_music_drum" id="extension_music_drum"><value name="NUMBER"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="extension_wedo_motor" id="extension_wedo_motor"></block><block type="extension_wedo_hat" id="extension_wedo_hat"></block><block type="extension_wedo_boolean" id="extension_wedo_boolean"></block><block type="extension_wedo_tilt_reporter" id="extension_wedo_reporter"><value name="TILT"><shadow type="extension_wedo_tilt_menu"></shadow></value></block><block type="extension_music_reporter" id="extension_music_reporter"></block><block type="extension_microbit_display" id="extension_microbit_display"><value name="MATRIX"><shadow type="matrix"><field name="MATRIX">0101010101100010101000100</field></shadow></value></block><block type="extension_music_play_note" id="extension_music_play_note"><value name="NOTE"><shadow type="note"><field name="NOTE">60</field></shadow></value><value name="BEATS"><shadow type="math_number"><field name="NUM">0.25</field></shadow></value></block></category></xml>';/*
  
   Visual Blocks Editor
  
   Copyright 2020 Arthur Zheng.
   All rights reserved.
  
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
  
     http://www.apache.org/licenses/LICENSE-2.0
  
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
  */
  Blockly.Blocks.device={};Blockly.Blocks.event_whenarduinobegin={init:function(){this.jsonInit({id:"event_whenarduinobegin",message0:Blockly.Msg.EVENT_WHENARDUINOBEGIN,nextStatement:null,category:Blockly.Categories.event,colour:Blockly.Colours.event.primary,colourSecondary:Blockly.Colours.event.secondary,colourTertiary:Blockly.Colours.event.tertiary})}};
  Blockly.Blocks.event_whenkulbotbegin={init:function(){this.jsonInit({id:"event_whenkulbotbegin",message0:Blockly.Msg.EVENT_WHENKULBOTBEGIN,nextStatement:null,category:Blockly.Categories.event,colour:Blockly.Colours.event.primary,colourSecondary:Blockly.Colours.event.secondary,colourTertiary:Blockly.Colours.event.tertiary})}};
  Blockly.Blocks.event_whenmicrobitbegin={init:function(){this.jsonInit({id:"event_whenmicrobitbegin",message0:Blockly.Msg.EVENT_WHENMICROBITBEGIN,nextStatement:null,category:Blockly.Categories.event,colour:Blockly.Colours.event.primary,colourSecondary:Blockly.Colours.event.secondary,colourTertiary:Blockly.Colours.event.tertiary})}};
  Blockly.Blocks.event_whenmicrobitbuttonpressed={init:function(){this.jsonInit({id:"event_whenmicrobitbuttonpressed",message0:Blockly.Msg.EVENT_WHENMICROBITBUTTONPRESSED,args0:[{type:"field_dropdown",name:"KEY_OPTION",options:[["A","a"],["B","b"],["A+B","ab"]]}],nextStatement:null,category:Blockly.Categories.event,colour:Blockly.Colours.event.primary,colourSecondary:Blockly.Colours.event.secondary,colourTertiary:Blockly.Colours.event.tertiary})}};
  Blockly.Blocks.event_whenmicrobitpinbeingtouched={init:function(){this.jsonInit({id:"event_whenmicrobitpinbeingtouched",message0:Blockly.Msg.EVENT_WHENMICROBITPINBEINGTOUCHED,args0:[{type:"field_dropdown",name:"PIN_OPTION",options:[["0","0"],["1","1"],["2","2"]]}],nextStatement:null,category:Blockly.Categories.event,colour:Blockly.Colours.event.primary,colourSecondary:Blockly.Colours.event.secondary,colourTertiary:Blockly.Colours.event.tertiary})}};
  Blockly.Blocks.event_whenmicrobitgesture={init:function(){this.jsonInit({id:"event_whenmicrobitgesture",message0:Blockly.Msg.EVENT_WHENMICROBITGESTURE,args0:[{type:"field_dropdown",name:"GESTURE_OPTION",options:[[Blockly.Msg.EVENT_WHENMICROBITGESTURE_SHAKEN,"shake"],[Blockly.Msg.EVENT_WHENMICROBITGESTURE_TILTEDUPWARD,"up"],[Blockly.Msg.EVENT_WHENMICROBITGESTURE_TILTEDDOWNWARD,"down"],[Blockly.Msg.EVENT_WHENMICROBITGESTURE_TILTEDDLEFTWARD,"left"],[Blockly.Msg.EVENT_WHENMICROBITGESTURE_TILTEDDRIGHTWARD,
  "right"],[Blockly.Msg.EVENT_WHENMICROBITGESTURE_FACEUP,"face up"],[Blockly.Msg.EVENT_WHENMICROBITGESTURE_FACEDOWN,"face down"],[Blockly.Msg.EVENT_WHENMICROBITGESTURE_FREEFALL,"freefall"],["3g","3g"],["6g","6g"],["8g","8g"]]}],nextStatement:null,category:Blockly.Categories.event,colour:Blockly.Colours.event.primary,colourSecondary:Blockly.Colours.event.secondary,colourTertiary:Blockly.Colours.event.tertiary})}};
  Blockly.Blocks.math_int8_number={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_slider",name:"NUM",value:"0",precision:1,min:"-127",max:"127"}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField})}};
  Blockly.Blocks.math_uint8_number={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_slider",name:"NUM",value:"0",min:"0",max:"255"}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField})}};
  Blockly.Blocks.math_int9_number={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_slider",name:"NUM",value:"0",min:"0",max:"255"}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField})}};
  Blockly.Blocks.math_uint10_number={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_slider",name:"NUM",value:"0",precision:1,min:"0",max:"1024"}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField})}};Blockly.Blocks.event={};Blockly.Blocks.event_whentouchingobject={init:function(){this.jsonInit({message0:Blockly.Msg.EVENT_WHENTOUCHINGOBJECT,args0:[{type:"input_value",name:"TOUCHINGOBJECTMENU"}],category:Blockly.Categories.event,extensions:["colours_event","shape_hat"]})}};
  Blockly.Blocks.event_touchingobjectmenu={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"TOUCHINGOBJECTMENU",options:[[Blockly.Msg.SENSING_TOUCHINGOBJECT_POINTER,"_mouse_"],[Blockly.Msg.SENSING_TOUCHINGOBJECT_EDGE,"_edge_"]]}],extensions:["colours_event","output_string"]})}};
  Blockly.Blocks.event_whenflagclicked={init:function(){this.jsonInit({id:"event_whenflagclicked",message0:Blockly.Msg.EVENT_WHENFLAGCLICKED,args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"green-flag.svg",width:24,height:24,alt:"flag"}],category:Blockly.Categories.event,extensions:["colours_event","shape_hat"]})}};
  Blockly.Blocks.event_whenthisspriteclicked={init:function(){this.jsonInit({message0:Blockly.Msg.EVENT_WHENTHISSPRITECLICKED,category:Blockly.Categories.event,extensions:["colours_event","shape_hat"]})}};Blockly.Blocks.event_whenstageclicked={init:function(){this.jsonInit({message0:Blockly.Msg.EVENT_WHENSTAGECLICKED,category:Blockly.Categories.event,extensions:["colours_event","shape_hat"]})}};
  Blockly.Blocks.event_whenbroadcastreceived={init:function(){this.jsonInit({id:"event_whenbroadcastreceived",message0:Blockly.Msg.EVENT_WHENBROADCASTRECEIVED,args0:[{type:"field_variable",name:"BROADCAST_OPTION",variableTypes:[Blockly.BROADCAST_MESSAGE_VARIABLE_TYPE],variable:Blockly.Msg.DEFAULT_BROADCAST_MESSAGE_NAME}],category:Blockly.Categories.event,extensions:["colours_event","shape_hat"]})}};
  Blockly.Blocks.event_whenbackdropswitchesto={init:function(){this.jsonInit({message0:Blockly.Msg.EVENT_WHENBACKDROPSWITCHESTO,args0:[{type:"field_dropdown",name:"BACKDROP",options:[["backdrop1","BACKDROP1"]]}],category:Blockly.Categories.event,extensions:["colours_event","shape_hat"]})}};
  Blockly.Blocks.event_whengreaterthan={init:function(){this.jsonInit({message0:Blockly.Msg.EVENT_WHENGREATERTHAN,args0:[{type:"field_dropdown",name:"WHENGREATERTHANMENU",options:[[Blockly.Msg.EVENT_WHENGREATERTHAN_LOUDNESS,"LOUDNESS"],[Blockly.Msg.EVENT_WHENGREATERTHAN_TIMER,"TIMER"]]},{type:"input_value",name:"VALUE"}],category:Blockly.Categories.event,extensions:["colours_event","shape_hat"]})}};
  Blockly.Blocks.event_broadcast_menu={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_variable",name:"BROADCAST_OPTION",variableTypes:[Blockly.BROADCAST_MESSAGE_VARIABLE_TYPE],variable:Blockly.Msg.DEFAULT_BROADCAST_MESSAGE_NAME}],colour:Blockly.Colours.event.secondary,colourSecondary:Blockly.Colours.event.secondary,colourTertiary:Blockly.Colours.event.tertiary,extensions:["output_string"]})}};
  Blockly.Blocks.event_broadcast={init:function(){this.jsonInit({id:"event_broadcast",message0:Blockly.Msg.EVENT_BROADCAST,args0:[{type:"input_value",name:"BROADCAST_INPUT"}],category:Blockly.Categories.event,extensions:["colours_event","shape_statement"]})}};Blockly.Blocks.event_broadcastandwait={init:function(){this.jsonInit({message0:Blockly.Msg.EVENT_BROADCASTANDWAIT,args0:[{type:"input_value",name:"BROADCAST_INPUT"}],category:Blockly.Categories.event,extensions:["colours_event","shape_statement"]})}};
  Blockly.Blocks.event_whenkeypressed={init:function(){this.jsonInit({id:"event_whenkeypressed",message0:Blockly.Msg.EVENT_WHENKEYPRESSED,args0:[{type:"field_dropdown",name:"KEY_OPTION",options:[[Blockly.Msg.EVENT_WHENKEYPRESSED_SPACE,"space"],[Blockly.Msg.EVENT_WHENKEYPRESSED_UP,"up arrow"],[Blockly.Msg.EVENT_WHENKEYPRESSED_DOWN,"down arrow"],[Blockly.Msg.EVENT_WHENKEYPRESSED_RIGHT,"right arrow"],[Blockly.Msg.EVENT_WHENKEYPRESSED_LEFT,"left arrow"],[Blockly.Msg.EVENT_WHENKEYPRESSED_ANY,"any"],["a",
  "a"],["b","b"],["c","c"],["d","d"],["e","e"],["f","f"],["g","g"],["h","h"],["i","i"],["j","j"],["k","k"],["l","l"],["m","m"],["n","n"],["o","o"],["p","p"],["q","q"],["r","r"],["s","s"],["t","t"],["u","u"],["v","v"],["w","w"],["x","x"],["y","y"],["z","z"],["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]]}],category:Blockly.Categories.event,extensions:["colours_event","shape_hat"]})}};Blockly.Blocks.extensions={};Blockly.Blocks.extension_pen_down={init:function(){this.jsonInit({message0:"%1 %2 pen down",args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"extensions/pen-block-icon.svg",width:40,height:40},{type:"field_vertical_separator"}],category:Blockly.Categories.more,extensions:["colours_more","shape_statement","scratch_extension"]})}};
  Blockly.Blocks.extension_music_drum={init:function(){this.jsonInit({message0:"%1 %2 play drum %3",args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"extensions/music-block-icon.svg",width:40,height:40},{type:"field_vertical_separator"},{type:"input_value",name:"NUMBER"}],category:Blockly.Categories.more,extensions:["colours_more","shape_statement","scratch_extension"]})}};
  Blockly.Blocks.extension_wedo_motor={init:function(){this.jsonInit({message0:"%1 %2 turn a motor %3",args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"extensions/wedo2-block-icon.svg",width:40,height:40},{type:"field_vertical_separator"},{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"rotate-right.svg",width:24,height:24}],category:Blockly.Categories.more,extensions:["colours_more","shape_statement","scratch_extension"]})}};
  Blockly.Blocks.extension_wedo_hat={init:function(){this.jsonInit({message0:"%1 %2 when I am wearing a hat",args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"extensions/wedo2-block-icon.svg",width:40,height:40},{type:"field_vertical_separator"}],category:Blockly.Categories.more,extensions:["colours_more","shape_hat","scratch_extension"]})}};
  Blockly.Blocks.extension_wedo_boolean={init:function(){this.jsonInit({message0:"%1 %2 O RLY?",args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"extensions/wedo2-block-icon.svg",width:40,height:40},{type:"field_vertical_separator"}],category:Blockly.Categories.more,extensions:["colours_more","output_boolean","scratch_extension"]})}};
  Blockly.Blocks.extension_wedo_tilt_reporter={init:function(){this.jsonInit({message0:"%1 %2 tilt angle %3",args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"extensions/wedo2-block-icon.svg",width:40,height:40},{type:"field_vertical_separator"},{type:"input_value",name:"TILT"}],category:Blockly.Categories.more,extensions:["colours_more","output_number","scratch_extension"]})}};
  Blockly.Blocks.extension_wedo_tilt_menu={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"TILT",options:[["Any","Any"],["Whirl","Whirl"],["South","South"],["Back in time","Back in time"]]}],extensions:["colours_more","output_string"]})}};
  Blockly.Blocks.extension_music_reporter={init:function(){this.jsonInit({message0:"%1 %2 hey now, you're an all-star",args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"extensions/music-block-icon.svg",width:40,height:40},{type:"field_vertical_separator"}],category:Blockly.Categories.more,extensions:["colours_more","output_number","scratch_extension"]})}};
  Blockly.Blocks.extension_microbit_display={init:function(){this.jsonInit({message0:"%1 %2 display %3",args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"extensions/microbit-block-icon.svg",width:40,height:40},{type:"field_vertical_separator"},{type:"input_value",name:"MATRIX"}],category:Blockly.Categories.pen,extensions:["colours_pen","shape_statement","scratch_extension"]})}};
  Blockly.Blocks.extension_music_play_note={init:function(){this.jsonInit({message0:"%1 %2 play note %3 for %4 beats",args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"extensions/music-block-icon.svg",width:40,height:40},{type:"field_vertical_separator"},{type:"input_value",name:"NOTE"},{type:"input_value",name:"BEATS"}],category:Blockly.Categories.pen,extensions:["colours_pen","shape_statement","scratch_extension"]})}};Blockly.Blocks.looks={};Blockly.Blocks.looks_sayforsecs={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_SAYFORSECS,args0:[{type:"input_value",name:"MESSAGE"},{type:"input_value",name:"SECS"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};Blockly.Blocks.looks_say={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_SAY,args0:[{type:"input_value",name:"MESSAGE"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_thinkforsecs={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_THINKFORSECS,args0:[{type:"input_value",name:"MESSAGE"},{type:"input_value",name:"SECS"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};Blockly.Blocks.looks_think={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_THINK,args0:[{type:"input_value",name:"MESSAGE"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_show={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_SHOW,category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};Blockly.Blocks.looks_hide={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_HIDE,category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_hideallsprites={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_HIDEALLSPRITES,category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_changeeffectby={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_CHANGEEFFECTBY,args0:[{type:"field_dropdown",name:"EFFECT",options:[[Blockly.Msg.LOOKS_EFFECT_COLOR,"COLOR"],[Blockly.Msg.LOOKS_EFFECT_FISHEYE,"FISHEYE"],[Blockly.Msg.LOOKS_EFFECT_WHIRL,"WHIRL"],[Blockly.Msg.LOOKS_EFFECT_PIXELATE,"PIXELATE"],[Blockly.Msg.LOOKS_EFFECT_MOSAIC,"MOSAIC"],[Blockly.Msg.LOOKS_EFFECT_BRIGHTNESS,"BRIGHTNESS"],[Blockly.Msg.LOOKS_EFFECT_GHOST,"GHOST"]]},{type:"input_value",name:"CHANGE"}],
  category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_seteffectto={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_SETEFFECTTO,args0:[{type:"field_dropdown",name:"EFFECT",options:[[Blockly.Msg.LOOKS_EFFECT_COLOR,"COLOR"],[Blockly.Msg.LOOKS_EFFECT_FISHEYE,"FISHEYE"],[Blockly.Msg.LOOKS_EFFECT_WHIRL,"WHIRL"],[Blockly.Msg.LOOKS_EFFECT_PIXELATE,"PIXELATE"],[Blockly.Msg.LOOKS_EFFECT_MOSAIC,"MOSAIC"],[Blockly.Msg.LOOKS_EFFECT_BRIGHTNESS,"BRIGHTNESS"],[Blockly.Msg.LOOKS_EFFECT_GHOST,"GHOST"]]},{type:"input_value",name:"VALUE"}],
  category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};Blockly.Blocks.looks_cleargraphiceffects={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_CLEARGRAPHICEFFECTS,category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_changesizeby={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_CHANGESIZEBY,args0:[{type:"input_value",name:"CHANGE"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};Blockly.Blocks.looks_setsizeto={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_SETSIZETO,args0:[{type:"input_value",name:"SIZE"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_size={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_SIZE,category:Blockly.Categories.looks,checkboxInFlyout:!0,extensions:["colours_looks","output_number"]})}};Blockly.Blocks.looks_changestretchby={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_CHANGESTRETCHBY,args0:[{type:"input_value",name:"CHANGE"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_setstretchto={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_SETSTRETCHTO,args0:[{type:"input_value",name:"STRETCH"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_costume={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"COSTUME",options:[["costume1","COSTUME1"],["costume2","COSTUME2"]]}],colour:Blockly.Colours.looks.secondary,colourSecondary:Blockly.Colours.looks.secondary,colourTertiary:Blockly.Colours.looks.tertiary,extensions:["output_string"]})}};
  Blockly.Blocks.looks_switchcostumeto={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_SWITCHCOSTUMETO,args0:[{type:"input_value",name:"COSTUME"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};Blockly.Blocks.looks_nextcostume={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_NEXTCOSTUME,category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_switchbackdropto={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_SWITCHBACKDROPTO,args0:[{type:"input_value",name:"BACKDROP"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_backdrops={init:function(){this.jsonInit({id:"looks_backdrops",message0:"%1",args0:[{type:"field_dropdown",name:"BACKDROP",options:[["backdrop1","BACKDROP1"]]}],colour:Blockly.Colours.looks.secondary,colourSecondary:Blockly.Colours.looks.secondary,colourTertiary:Blockly.Colours.looks.tertiary,extensions:["output_string"]})}};
  Blockly.Blocks.looks_gotofrontback={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_GOTOFRONTBACK,args0:[{type:"field_dropdown",name:"FRONT_BACK",options:[[Blockly.Msg.LOOKS_GOTOFRONTBACK_FRONT,"front"],[Blockly.Msg.LOOKS_GOTOFRONTBACK_BACK,"back"]]}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_goforwardbackwardlayers={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_GOFORWARDBACKWARDLAYERS,args0:[{type:"field_dropdown",name:"FORWARD_BACKWARD",options:[[Blockly.Msg.LOOKS_GOFORWARDBACKWARDLAYERS_FORWARD,"forward"],[Blockly.Msg.LOOKS_GOFORWARDBACKWARDLAYERS_BACKWARD,"backward"]]},{type:"input_value",name:"NUM"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};
  Blockly.Blocks.looks_backdropnumbername={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_BACKDROPNUMBERNAME,args0:[{type:"field_dropdown",name:"NUMBER_NAME",options:[[Blockly.Msg.LOOKS_NUMBERNAME_NUMBER,"number"],[Blockly.Msg.LOOKS_NUMBERNAME_NAME,"name"]]}],category:Blockly.Categories.looks,checkboxInFlyout:!0,extensions:["colours_looks","output_number"]})}};
  Blockly.Blocks.looks_costumenumbername={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_COSTUMENUMBERNAME,args0:[{type:"field_dropdown",name:"NUMBER_NAME",options:[[Blockly.Msg.LOOKS_NUMBERNAME_NUMBER,"number"],[Blockly.Msg.LOOKS_NUMBERNAME_NAME,"name"]]}],category:Blockly.Categories.looks,checkboxInFlyout:!0,extensions:["colours_looks","output_number"]})}};
  Blockly.Blocks.looks_switchbackdroptoandwait={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_SWITCHBACKDROPTOANDWAIT,args0:[{type:"input_value",name:"BACKDROP"}],category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};Blockly.Blocks.looks_nextbackdrop={init:function(){this.jsonInit({message0:Blockly.Msg.LOOKS_NEXTBACKDROP_BLOCK,category:Blockly.Categories.looks,extensions:["colours_looks","shape_statement"]})}};Blockly.Blocks.motion={};Blockly.Blocks.motion_movesteps={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_MOVESTEPS,args0:[{type:"input_value",name:"STEPS"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_turnright={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_TURNRIGHT,args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"rotate-right.svg",width:24,height:24},{type:"input_value",name:"DEGREES"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_turnleft={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_TURNLEFT,args0:[{type:"field_image",src:Blockly.mainWorkspace.options.pathToMedia+"rotate-left.svg",width:24,height:24},{type:"input_value",name:"DEGREES"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_pointindirection={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_POINTINDIRECTION,args0:[{type:"input_value",name:"DIRECTION"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_pointtowards_menu={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"TOWARDS",options:[[Blockly.Msg.MOTION_POINTTOWARDS_POINTER,"_mouse_"],[Blockly.Msg.MOTION_POINTTOWARDS_RANDOM,"_random_"]]}],colour:Blockly.Colours.motion.secondary,colourSecondary:Blockly.Colours.motion.secondary,colourTertiary:Blockly.Colours.motion.tertiary,extensions:["output_string"]})}};
  Blockly.Blocks.motion_pointtowards={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_POINTTOWARDS,args0:[{type:"input_value",name:"TOWARDS"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_goto_menu={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"TO",options:[[Blockly.Msg.MOTION_GOTO_POINTER,"_mouse_"],[Blockly.Msg.MOTION_GOTO_RANDOM,"_random_"]]}],colour:Blockly.Colours.motion.secondary,colourSecondary:Blockly.Colours.motion.secondary,colourTertiary:Blockly.Colours.motion.tertiary,extensions:["output_string"]})}};
  Blockly.Blocks.motion_gotoxy={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_GOTOXY,args0:[{type:"input_value",name:"X"},{type:"input_value",name:"Y"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};Blockly.Blocks.motion_goto={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_GOTO,args0:[{type:"input_value",name:"TO"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_glidesecstoxy={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_GLIDESECSTOXY,args0:[{type:"input_value",name:"SECS"},{type:"input_value",name:"X"},{type:"input_value",name:"Y"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_glideto_menu={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"TO",options:[[Blockly.Msg.MOTION_GLIDETO_POINTER,"_mouse_"],[Blockly.Msg.MOTION_GLIDETO_RANDOM,"_random_"]]}],colour:Blockly.Colours.motion.secondary,colourSecondary:Blockly.Colours.motion.secondary,colourTertiary:Blockly.Colours.motion.tertiary,extensions:["output_string"]})}};
  Blockly.Blocks.motion_glideto={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_GLIDETO,args0:[{type:"input_value",name:"SECS"},{type:"input_value",name:"TO"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};Blockly.Blocks.motion_changexby={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_CHANGEXBY,args0:[{type:"input_value",name:"DX"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_setx={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_SETX,args0:[{type:"input_value",name:"X"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};Blockly.Blocks.motion_changeyby={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_CHANGEYBY,args0:[{type:"input_value",name:"DY"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_sety={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_SETY,args0:[{type:"input_value",name:"Y"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};Blockly.Blocks.motion_ifonedgebounce={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_IFONEDGEBOUNCE,category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_setrotationstyle={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_SETROTATIONSTYLE,args0:[{type:"field_dropdown",name:"STYLE",options:[[Blockly.Msg.MOTION_SETROTATIONSTYLE_LEFTRIGHT,"left-right"],[Blockly.Msg.MOTION_SETROTATIONSTYLE_DONTROTATE,"don't rotate"],[Blockly.Msg.MOTION_SETROTATIONSTYLE_ALLAROUND,"all around"]]}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_xposition={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_XPOSITION,category:Blockly.Categories.motion,checkboxInFlyout:!0,extensions:["colours_motion","output_number"]})}};Blockly.Blocks.motion_yposition={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_YPOSITION,category:Blockly.Categories.motion,checkboxInFlyout:!0,extensions:["colours_motion","output_number"]})}};
  Blockly.Blocks.motion_direction={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_DIRECTION,category:Blockly.Categories.motion,checkboxInFlyout:!0,extensions:["colours_motion","output_number"]})}};Blockly.Blocks.motion_scroll_right={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_SCROLLRIGHT,args0:[{type:"input_value",name:"DISTANCE"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_scroll_up={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_SCROLLUP,args0:[{type:"input_value",name:"DISTANCE"}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_align_scene={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_ALIGNSCENE,args0:[{type:"field_dropdown",name:"ALIGNMENT",options:[[Blockly.Msg.MOTION_ALIGNSCENE_BOTTOMLEFT,"bottom-left"],[Blockly.Msg.MOTION_ALIGNSCENE_BOTTOMRIGHT,"bottom-right"],[Blockly.Msg.MOTION_ALIGNSCENE_MIDDLE,"middle"],[Blockly.Msg.MOTION_ALIGNSCENE_TOPLEFT,"top-left"],[Blockly.Msg.MOTION_ALIGNSCENE_TOPRIGHT,"top-right"]]}],category:Blockly.Categories.motion,extensions:["colours_motion","shape_statement"]})}};
  Blockly.Blocks.motion_xscroll={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_XSCROLL,category:Blockly.Categories.motion,extensions:["colours_motion","output_number"]})}};Blockly.Blocks.motion_yscroll={init:function(){this.jsonInit({message0:Blockly.Msg.MOTION_YSCROLL,category:Blockly.Categories.motion,extensions:["colours_motion","output_number"]})}};
  Blockly.Blocks.operators={};Blockly.Blocks.operator_add={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_ADD,args0:[{type:"input_value",name:"NUM1"},{type:"input_value",name:"NUM2"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_number"]})}};
  Blockly.Blocks.operator_subtract={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_SUBTRACT,args0:[{type:"input_value",name:"NUM1"},{type:"input_value",name:"NUM2"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_number"]})}};
  Blockly.Blocks.operator_multiply={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_MULTIPLY,args0:[{type:"input_value",name:"NUM1"},{type:"input_value",name:"NUM2"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_number"]})}};
  Blockly.Blocks.operator_divide={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_DIVIDE,args0:[{type:"input_value",name:"NUM1"},{type:"input_value",name:"NUM2"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_number"]})}};
  Blockly.Blocks.operator_random={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_RANDOM,args0:[{type:"input_value",name:"FROM"},{type:"input_value",name:"TO"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_number"]})}};
  Blockly.Blocks.operator_lt={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_LT,args0:[{type:"input_value",name:"OPERAND1"},{type:"input_value",name:"OPERAND2"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_boolean"]})}};
  Blockly.Blocks.operator_equals={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_EQUALS,args0:[{type:"input_value",name:"OPERAND1"},{type:"input_value",name:"OPERAND2"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_boolean"]})}};
  Blockly.Blocks.operator_gt={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_GT,args0:[{type:"input_value",name:"OPERAND1"},{type:"input_value",name:"OPERAND2"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_boolean"]})}};
  Blockly.Blocks.operator_and={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_AND,args0:[{type:"input_value",name:"OPERAND1",check:"Boolean"},{type:"input_value",name:"OPERAND2",check:"Boolean"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_boolean"]})}};
  Blockly.Blocks.operator_or={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_OR,args0:[{type:"input_value",name:"OPERAND1",check:"Boolean"},{type:"input_value",name:"OPERAND2",check:"Boolean"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_boolean"]})}};
  Blockly.Blocks.operator_not={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_NOT,args0:[{type:"input_value",name:"OPERAND",check:"Boolean"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_boolean"]})}};Blockly.Blocks.operator_join={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_JOIN,args0:[{type:"input_value",name:"STRING1"},{type:"input_value",name:"STRING2"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_string"]})}};
  Blockly.Blocks.operator_letter_of={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_LETTEROF,args0:[{type:"input_value",name:"LETTER"},{type:"input_value",name:"STRING"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_string"]})}};Blockly.Blocks.operator_length={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_LENGTH,args0:[{type:"input_value",name:"STRING"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_string"]})}};
  Blockly.Blocks.operator_contains={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_CONTAINS,args0:[{type:"input_value",name:"STRING1"},{type:"input_value",name:"STRING2"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_boolean"]})}};
  Blockly.Blocks.operator_mod={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_MOD,args0:[{type:"input_value",name:"NUM1"},{type:"input_value",name:"NUM2"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_number"]})}};Blockly.Blocks.operator_round={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_ROUND,args0:[{type:"input_value",name:"NUM"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_number"]})}};
  Blockly.Blocks.operator_mathop={init:function(){this.jsonInit({message0:Blockly.Msg.OPERATORS_MATHOP,args0:[{type:"field_dropdown",name:"OPERATOR",options:[[Blockly.Msg.OPERATORS_MATHOP_ABS,"abs"],[Blockly.Msg.OPERATORS_MATHOP_FLOOR,"floor"],[Blockly.Msg.OPERATORS_MATHOP_CEILING,"ceiling"],[Blockly.Msg.OPERATORS_MATHOP_SQRT,"sqrt"],[Blockly.Msg.OPERATORS_MATHOP_SIN,"sin"],[Blockly.Msg.OPERATORS_MATHOP_COS,"cos"],[Blockly.Msg.OPERATORS_MATHOP_TAN,"tan"],[Blockly.Msg.OPERATORS_MATHOP_ASIN,"asin"],[Blockly.Msg.OPERATORS_MATHOP_ACOS,
  "acos"],[Blockly.Msg.OPERATORS_MATHOP_ATAN,"atan"],[Blockly.Msg.OPERATORS_MATHOP_LN,"ln"],[Blockly.Msg.OPERATORS_MATHOP_LOG,"log"],[Blockly.Msg.OPERATORS_MATHOP_EEXP,"e ^"],[Blockly.Msg.OPERATORS_MATHOP_10EXP,"10 ^"]]},{type:"input_value",name:"NUM"}],category:Blockly.Categories.operators,extensions:["colours_operators","output_number"]})}};Blockly.ScratchBlocks.ProcedureUtils={};Blockly.ScratchBlocks.ProcedureUtils.callerMutationToDom=function(){var a=document.createElement("mutation");a.setAttribute("proccode",this.procCode_);a.setAttribute("argumentids",JSON.stringify(this.argumentIds_));a.setAttribute("warp",JSON.stringify(this.warp_));return a};
  Blockly.ScratchBlocks.ProcedureUtils.callerDomToMutation=function(a){this.procCode_=a.getAttribute("proccode");this.generateShadows_=JSON.parse(a.getAttribute("generateshadows"));this.argumentIds_=JSON.parse(a.getAttribute("argumentids"));this.warp_=JSON.parse(a.getAttribute("warp"));this.updateDisplay_()};
  Blockly.ScratchBlocks.ProcedureUtils.definitionMutationToDom=function(a){var b=document.createElement("mutation");a&&b.setAttribute("generateshadows",!0);b.setAttribute("proccode",this.procCode_);b.setAttribute("argumentids",JSON.stringify(this.argumentIds_));b.setAttribute("argumentnames",JSON.stringify(this.displayNames_));b.setAttribute("argumentdefaults",JSON.stringify(this.argumentDefaults_));b.setAttribute("warp",JSON.stringify(this.warp_));return b};
  Blockly.ScratchBlocks.ProcedureUtils.definitionDomToMutation=function(a){this.procCode_=a.getAttribute("proccode");this.warp_=JSON.parse(a.getAttribute("warp"));var b=this.argumentIds_,c=this.displayNames_;this.argumentIds_=JSON.parse(a.getAttribute("argumentids"));this.displayNames_=JSON.parse(a.getAttribute("argumentnames"));this.argumentDefaults_=JSON.parse(a.getAttribute("argumentdefaults"));this.updateDisplay_();this.updateArgumentReporterNames_&&this.updateArgumentReporterNames_(b,c)};
  Blockly.ScratchBlocks.ProcedureUtils.getProcCode=function(){return this.procCode_};Blockly.ScratchBlocks.ProcedureUtils.updateDisplay_=function(){var a=this.rendered;this.rendered=!1;var b=this.disconnectOldBlocks_();this.removeAllInputs_();this.createAllInputs_(b);this.deleteShadows_(b);(this.rendered=a)&&!this.isInsertionMarker()&&(this.initSvg(),this.render())};
  Blockly.ScratchBlocks.ProcedureUtils.disconnectOldBlocks_=function(){for(var a={},b=0,c;c=this.inputList[b];b++)if(c.connection){var d=c.connection.targetBlock(),e={shadow:c.connection.getShadowDom(),block:d};a[c.name]=e;c.connection.setShadowDom(null);d&&c.connection.disconnect()}return a};Blockly.ScratchBlocks.ProcedureUtils.removeAllInputs_=function(){for(var a=0,b;b=this.inputList[a];a++)b.dispose();this.inputList=[]};
  Blockly.ScratchBlocks.ProcedureUtils.createAllInputs_=function(a){var b=this.procCode_.split(/(?=[^\\]%[nbs])/);b=b.map(function(a){return a.trim()});for(var c=0,d=0,e;e=b[d];d++){if("%"==e.substring(0,1)){var f=e.substring(1,2);if("n"!=f&&"b"!=f&&"s"!=f)throw Error("Found an custom procedure with an invalid type: "+f);e=e.substring(2).trim();var g=this.argumentIds_[c],h=this.appendValueInput(g);"b"==f&&h.setCheck("Boolean");this.populateArgument_(f,c,a,g,h);c++}else e=e.trim();this.addProcedureLabel_(e.replace(/\\%/,
  "%"))}};Blockly.ScratchBlocks.ProcedureUtils.deleteShadows_=function(a){if(a)for(var b in a){var c=a[b];c&&(c=c.block)&&c.isShadow()&&(c.dispose(),a[b]=null)}};Blockly.ScratchBlocks.ProcedureUtils.addLabelField_=function(a){this.appendDummyInput().appendField(a)};Blockly.ScratchBlocks.ProcedureUtils.addLabelEditor_=function(a){a&&this.appendDummyInput(Blockly.utils.genUid()).appendField(new Blockly.FieldTextInputRemovable(a))};
  Blockly.ScratchBlocks.ProcedureUtils.buildShadowDom_=function(a){var b=goog.dom.createDom("shadow");if("n"==a){var c="math_number";a="NUM";var d="1"}else c="text",a="TEXT",d="";b.setAttribute("type",c);c=goog.dom.createDom("field",null,d);c.setAttribute("name",a);b.appendChild(c);return b};
  Blockly.ScratchBlocks.ProcedureUtils.attachShadow_=function(a,b){if("n"==b||"s"==b){var c="n"==b?"math_number":"text";Blockly.Events.disable();try{var d=this.workspace.newBlock(c);"n"==b?d.setFieldValue("1","NUM"):d.setFieldValue("","TEXT");d.setShadow(!0);this.isInsertionMarker()||(d.initSvg(),d.render(!1))}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(d));d.outputConnection.connect(a.connection)}};
  Blockly.ScratchBlocks.ProcedureUtils.createArgumentReporter_=function(a,b){a="n"==a?"argument_reporter_number":"s"==a?"argument_reporter_string":"argument_reporter_boolean";Blockly.Events.disable();try{var c=this.workspace.newBlock(a);c.setShadow(!0);c.setFieldValue(b,"VALUE");this.isInsertionMarker()||(c.initSvg(),c.render(!1))}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(c));return c};
  Blockly.ScratchBlocks.ProcedureUtils.populateArgumentOnCaller_=function(a,b,c,d,e){var f=b=null;c&&d in c&&(d=c[d],b=d.block,f=d.shadow);c&&b?(c[e.name]=null,b.outputConnection.connect(e.connection),"b"!=a&&this.generateShadows_&&(a=f||this.buildShadowDom_(a),console.log("setting shadow dom: "+a),e.connection.setShadowDom(a))):this.generateShadows_&&this.attachShadow_(e,a)};
  Blockly.ScratchBlocks.ProcedureUtils.populateArgumentOnPrototype_=function(a,b,c,d,e){var f=null;c&&d in c&&(f=c[d].block);d=Blockly.ScratchBlocks.ProcedureUtils.checkOldTypeMatches_(f,a);b=this.displayNames_[b];c&&f&&d?(a=f,a.setFieldValue(b,"VALUE"),c[e.name]=null):a=this.createArgumentReporter_(a,b);e.connection.connect(a.outputConnection)};
  Blockly.ScratchBlocks.ProcedureUtils.populateArgumentOnDeclaration_=function(a,b,c,d,e){var f=null;c&&d in c&&(f=c[d].block);d=Blockly.ScratchBlocks.ProcedureUtils.checkOldTypeMatches_(f,a);b=this.displayNames_[b];f&&d?(a=f,f.setFieldValue(b,"TEXT"),c[e.name]=null):a=this.createArgumentEditor_(a,b);e.connection.connect(a.outputConnection)};
  Blockly.ScratchBlocks.ProcedureUtils.checkOldTypeMatches_=function(a,b){return a?"n"==b&&"argument_reporter_number"==a.type||"s"==b&&"argument_reporter_string"==a.type||"b"==b&&"argument_reporter_boolean"==a.type?!0:!1:!1};
  Blockly.ScratchBlocks.ProcedureUtils.createArgumentEditor_=function(a,b){Blockly.Events.disable();try{var c="n"==a?this.workspace.newBlock("argument_editor_number"):"s"==a?this.workspace.newBlock("argument_editor_string"):this.workspace.newBlock("argument_editor_boolean");c.setFieldValue(b,"TEXT");c.setShadow(!0);this.isInsertionMarker()||(c.initSvg(),c.render(!1))}finally{Blockly.Events.enable()}Blockly.Events.isEnabled()&&Blockly.Events.fire(new Blockly.Events.BlockCreate(c));return c};
  Blockly.ScratchBlocks.ProcedureUtils.updateDeclarationProcCode_=function(){this.procCode_="";this.displayNames_=[];this.argumentIds_=[];for(var a=0;a<this.inputList.length;a++){0!=a&&(this.procCode_+=" ");var b=this.inputList[a];if(b.type==Blockly.DUMMY_INPUT)this.procCode_+=b.fieldRow[0].getValue();else if(b.type==Blockly.INPUT_VALUE){var c=b.connection.targetBlock();this.displayNames_.push(c.getFieldValue("TEXT"));this.argumentIds_.push(b.name);this.procCode_="argument_editor_boolean"==c.type?this.procCode_+
  "%b":"argument_editor_number"==c.type?this.procCode_+"%n":this.procCode_+"%s"}else throw Error("Unexpected input type on a procedure mutator root: "+b.type);}};Blockly.ScratchBlocks.ProcedureUtils.focusLastEditor_=function(){if(0<this.inputList.length){var a=this.inputList[this.inputList.length-1];a.type==Blockly.DUMMY_INPUT?a.fieldRow[0].showEditor_():a.type==Blockly.INPUT_VALUE&&a.connection.targetBlock().getField("TEXT").showEditor_()}};
  Blockly.ScratchBlocks.ProcedureUtils.addLabelExternal=function(){Blockly.WidgetDiv.hide(!0);this.procCode_+=" label text";this.updateDisplay_();this.focusLastEditor_()};Blockly.ScratchBlocks.ProcedureUtils.addBooleanExternal=function(){Blockly.WidgetDiv.hide(!0);this.procCode_+=" %b";this.displayNames_.push("boolean");this.argumentIds_.push(Blockly.utils.genUid());this.argumentDefaults_.push("false");this.updateDisplay_();this.focusLastEditor_()};
  Blockly.ScratchBlocks.ProcedureUtils.addNumberExternal=function(){Blockly.WidgetDiv.hide(!0);this.procCode_+=" %n";this.displayNames_.push("number");this.argumentIds_.push(Blockly.utils.genUid());this.argumentDefaults_.push("");this.updateDisplay_();this.focusLastEditor_()};
  Blockly.ScratchBlocks.ProcedureUtils.addStringExternal=function(){Blockly.WidgetDiv.hide(!0);this.procCode_+=" %s";this.displayNames_.push("text");this.argumentIds_.push(Blockly.utils.genUid());this.argumentDefaults_.push("");this.updateDisplay_();this.focusLastEditor_()};Blockly.ScratchBlocks.ProcedureUtils.getWarp=function(){return this.warp_};Blockly.ScratchBlocks.ProcedureUtils.setWarp=function(a){this.warp_=a};
  Blockly.ScratchBlocks.ProcedureUtils.removeFieldCallback=function(a){if(1!==this.inputList.length){for(var b=null,c=0;c<this.inputList.length;c++){var d=this.inputList[c];if(d.connection)d.connection.targetBlock().getField(a.name)==a&&(b=d.name);else for(var e=0;e<d.fieldRow.length;e++)d.fieldRow[e]==a&&(b=d.name)}b&&(Blockly.WidgetDiv.hide(!0),this.removeInput(b),this.onChangeFn(),this.updateDisplay_())}};
  Blockly.ScratchBlocks.ProcedureUtils.removeArgumentCallback_=function(a){this.parentBlock_&&this.parentBlock_.removeFieldCallback&&this.parentBlock_.removeFieldCallback(a)};
  Blockly.ScratchBlocks.ProcedureUtils.updateArgumentReporterNames_=function(a,b){var c=[],d=[],e=this.getParent();if(e){for(var f=e.getDescendants(!1),g=0;g<f.length;g++)e=f[g],"argument_reporter_number"!==e.type&&"argument_reporter_string"!==e.type&&"argument_reporter_boolean"!==e.type||e.isShadow()||d.push(e);for(g=0;e=this.argumentIds_[g];g++)if(e=a.indexOf(e),-1!=e){var h=b[e];h!=this.displayNames_[g]&&c.push({newName:this.displayNames_[g],blocks:d.filter(function(a){return a.getFieldValue("VALUE")==
  h})})}for(a=0;b=c[a];a++)for(d=0;e=b.blocks[d];d++)e.setFieldValue(b.newName,"VALUE")}};Blockly.Blocks.procedures_definition={init:function(){this.jsonInit({message0:Blockly.Msg.PROCEDURES_DEFINITION,args0:[{type:"input_statement",name:"custom_block"}],extensions:["colours_more","shape_hat","procedure_def_contextmenu"]})}};
  Blockly.Blocks.procedures_call={init:function(){this.jsonInit({extensions:["colours_more","shape_statement","procedure_call_contextmenu"]});this.procCode_="";this.argumentIds_=[];this.warp_=!1},getProcCode:Blockly.ScratchBlocks.ProcedureUtils.getProcCode,removeAllInputs_:Blockly.ScratchBlocks.ProcedureUtils.removeAllInputs_,disconnectOldBlocks_:Blockly.ScratchBlocks.ProcedureUtils.disconnectOldBlocks_,deleteShadows_:Blockly.ScratchBlocks.ProcedureUtils.deleteShadows_,createAllInputs_:Blockly.ScratchBlocks.ProcedureUtils.createAllInputs_,
  updateDisplay_:Blockly.ScratchBlocks.ProcedureUtils.updateDisplay_,mutationToDom:Blockly.ScratchBlocks.ProcedureUtils.callerMutationToDom,domToMutation:Blockly.ScratchBlocks.ProcedureUtils.callerDomToMutation,populateArgument_:Blockly.ScratchBlocks.ProcedureUtils.populateArgumentOnCaller_,addProcedureLabel_:Blockly.ScratchBlocks.ProcedureUtils.addLabelField_,attachShadow_:Blockly.ScratchBlocks.ProcedureUtils.attachShadow_,buildShadowDom_:Blockly.ScratchBlocks.ProcedureUtils.buildShadowDom_};
  Blockly.Blocks.procedures_prototype={init:function(){this.jsonInit({extensions:["colours_more","shape_statement"]});this.procCode_="";this.displayNames_=[];this.argumentIds_=[];this.argumentDefaults_=[];this.warp_=!1},getProcCode:Blockly.ScratchBlocks.ProcedureUtils.getProcCode,removeAllInputs_:Blockly.ScratchBlocks.ProcedureUtils.removeAllInputs_,disconnectOldBlocks_:Blockly.ScratchBlocks.ProcedureUtils.disconnectOldBlocks_,deleteShadows_:Blockly.ScratchBlocks.ProcedureUtils.deleteShadows_,createAllInputs_:Blockly.ScratchBlocks.ProcedureUtils.createAllInputs_,
  updateDisplay_:Blockly.ScratchBlocks.ProcedureUtils.updateDisplay_,mutationToDom:Blockly.ScratchBlocks.ProcedureUtils.definitionMutationToDom,domToMutation:Blockly.ScratchBlocks.ProcedureUtils.definitionDomToMutation,populateArgument_:Blockly.ScratchBlocks.ProcedureUtils.populateArgumentOnPrototype_,addProcedureLabel_:Blockly.ScratchBlocks.ProcedureUtils.addLabelField_,createArgumentReporter_:Blockly.ScratchBlocks.ProcedureUtils.createArgumentReporter_,updateArgumentReporterNames_:Blockly.ScratchBlocks.ProcedureUtils.updateArgumentReporterNames_};
  Blockly.Blocks.procedures_declaration={init:function(){this.jsonInit({extensions:["colours_more","shape_statement"]});this.procCode_="";this.displayNames_=[];this.argumentIds_=[];this.argumentDefaults_=[];this.warp_=!1},getProcCode:Blockly.ScratchBlocks.ProcedureUtils.getProcCode,removeAllInputs_:Blockly.ScratchBlocks.ProcedureUtils.removeAllInputs_,disconnectOldBlocks_:Blockly.ScratchBlocks.ProcedureUtils.disconnectOldBlocks_,deleteShadows_:Blockly.ScratchBlocks.ProcedureUtils.deleteShadows_,createAllInputs_:Blockly.ScratchBlocks.ProcedureUtils.createAllInputs_,
  updateDisplay_:Blockly.ScratchBlocks.ProcedureUtils.updateDisplay_,mutationToDom:Blockly.ScratchBlocks.ProcedureUtils.definitionMutationToDom,domToMutation:Blockly.ScratchBlocks.ProcedureUtils.definitionDomToMutation,populateArgument_:Blockly.ScratchBlocks.ProcedureUtils.populateArgumentOnDeclaration_,addProcedureLabel_:Blockly.ScratchBlocks.ProcedureUtils.addLabelEditor_,removeFieldCallback:Blockly.ScratchBlocks.ProcedureUtils.removeFieldCallback,createArgumentEditor_:Blockly.ScratchBlocks.ProcedureUtils.createArgumentEditor_,
  focusLastEditor_:Blockly.ScratchBlocks.ProcedureUtils.focusLastEditor_,getWarp:Blockly.ScratchBlocks.ProcedureUtils.getWarp,setWarp:Blockly.ScratchBlocks.ProcedureUtils.setWarp,addLabelExternal:Blockly.ScratchBlocks.ProcedureUtils.addLabelExternal,addBooleanExternal:Blockly.ScratchBlocks.ProcedureUtils.addBooleanExternal,addNumberExternal:Blockly.ScratchBlocks.ProcedureUtils.addNumberExternal,addStringExternal:Blockly.ScratchBlocks.ProcedureUtils.addStringExternal,onChangeFn:Blockly.ScratchBlocks.ProcedureUtils.updateDeclarationProcCode_};
  Blockly.Blocks.argument_reporter_boolean={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_label_serializable",name:"VALUE",text:""}],extensions:["colours_more","output_boolean"]})}};Blockly.Blocks.argument_reporter_number={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_label_serializable",name:"VALUE",text:""}],extensions:["colours_more","output_number"]})}};
  Blockly.Blocks.argument_reporter_string={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_label_serializable",name:"VALUE",text:""}],extensions:["colours_more","output_string"]})}};Blockly.Blocks.argument_editor_boolean={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_input_removable",name:"TEXT",text:"foo"}],colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField,extensions:["output_boolean"]})},removeFieldCallback:Blockly.ScratchBlocks.ProcedureUtils.removeArgumentCallback_};
  Blockly.Blocks.argument_editor_number={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_input_removable",name:"TEXT",text:"foo"}],colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField,extensions:["output_number"]})},removeFieldCallback:Blockly.ScratchBlocks.ProcedureUtils.removeArgumentCallback_};
  Blockly.Blocks.argument_editor_string={init:function(){this.jsonInit({message0:" %1",args0:[{type:"field_input_removable",name:"TEXT",text:"foo"}],colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField,extensions:["output_string"]})},removeFieldCallback:Blockly.ScratchBlocks.ProcedureUtils.removeArgumentCallback_};Blockly.Blocks.sensing={};Blockly.Blocks.sensing_touchingobject={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_TOUCHINGOBJECT,args0:[{type:"input_value",name:"TOUCHINGOBJECTMENU"}],category:Blockly.Categories.sensing,extensions:["colours_sensing","output_boolean"]})}};
  Blockly.Blocks.sensing_touchingobjectmenu={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"TOUCHINGOBJECTMENU",options:[[Blockly.Msg.SENSING_TOUCHINGOBJECT_POINTER,"_mouse_"],[Blockly.Msg.SENSING_TOUCHINGOBJECT_EDGE,"_edge_"]]}],extensions:["colours_sensing","output_string"]})}};
  Blockly.Blocks.sensing_touchingcolor={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_TOUCHINGCOLOR,args0:[{type:"input_value",name:"COLOR"}],category:Blockly.Categories.sensing,extensions:["colours_sensing","output_boolean"]})}};
  Blockly.Blocks.sensing_coloristouchingcolor={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_COLORISTOUCHINGCOLOR,args0:[{type:"input_value",name:"COLOR"},{type:"input_value",name:"COLOR2"}],category:Blockly.Categories.sensing,extensions:["colours_sensing","output_boolean"]})}};
  Blockly.Blocks.sensing_distanceto={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_DISTANCETO,args0:[{type:"input_value",name:"DISTANCETOMENU"}],category:Blockly.Categories.sensing,extensions:["colours_sensing","output_number"]})}};Blockly.Blocks.sensing_distancetomenu={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"DISTANCETOMENU",options:[[Blockly.Msg.SENSING_DISTANCETO_POINTER,"_mouse_"]]}],extensions:["colours_sensing","output_string"]})}};
  Blockly.Blocks.sensing_askandwait={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_ASKANDWAIT,args0:[{type:"input_value",name:"QUESTION"}],category:Blockly.Categories.sensing,extensions:["colours_sensing","shape_statement"]})}};Blockly.Blocks.sensing_answer={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_ANSWER,category:Blockly.Categories.sensing,checkboxInFlyout:!0,extensions:["colours_sensing","output_number"]})}};
  Blockly.Blocks.sensing_keypressed={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_KEYPRESSED,args0:[{type:"input_value",name:"KEY_OPTION"}],category:Blockly.Categories.sensing,extensions:["colours_sensing","output_boolean"]})}};
  Blockly.Blocks.sensing_keyoptions={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"KEY_OPTION",options:[[Blockly.Msg.EVENT_WHENKEYPRESSED_SPACE,"space"],[Blockly.Msg.EVENT_WHENKEYPRESSED_UP,"up arrow"],[Blockly.Msg.EVENT_WHENKEYPRESSED_DOWN,"down arrow"],[Blockly.Msg.EVENT_WHENKEYPRESSED_RIGHT,"right arrow"],[Blockly.Msg.EVENT_WHENKEYPRESSED_LEFT,"left arrow"],[Blockly.Msg.EVENT_WHENKEYPRESSED_ANY,"any"],["a","a"],["b","b"],["c","c"],["d","d"],["e","e"],["f","f"],
  ["g","g"],["h","h"],["i","i"],["j","j"],["k","k"],["l","l"],["m","m"],["n","n"],["o","o"],["p","p"],["q","q"],["r","r"],["s","s"],["t","t"],["u","u"],["v","v"],["w","w"],["x","x"],["y","y"],["z","z"],["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]]}],extensions:["colours_sensing","output_string"]})}};
  Blockly.Blocks.sensing_mousedown={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_MOUSEDOWN,category:Blockly.Categories.sensing,extensions:["colours_sensing","output_boolean"]})}};Blockly.Blocks.sensing_mousex={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_MOUSEX,category:Blockly.Categories.sensing,extensions:["colours_sensing","output_number"]})}};
  Blockly.Blocks.sensing_mousey={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_MOUSEY,category:Blockly.Categories.sensing,extensions:["colours_sensing","output_number"]})}};
  Blockly.Blocks.sensing_setdragmode={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_SETDRAGMODE,args0:[{type:"field_dropdown",name:"DRAG_MODE",options:[[Blockly.Msg.SENSING_SETDRAGMODE_DRAGGABLE,"draggable"],[Blockly.Msg.SENSING_SETDRAGMODE_NOTDRAGGABLE,"not draggable"]]}],category:Blockly.Categories.sensing,extensions:["colours_sensing","shape_statement"]})}};
  Blockly.Blocks.sensing_loudness={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_LOUDNESS,category:Blockly.Categories.sensing,checkboxInFlyout:!0,extensions:["colours_sensing","output_number"]})}};Blockly.Blocks.sensing_loud={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_LOUD,category:Blockly.Categories.sensing,extensions:["colours_sensing","output_boolean"]})}};
  Blockly.Blocks.sensing_timer={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_TIMER,category:Blockly.Categories.sensing,checkboxInFlyout:!0,extensions:["colours_sensing","output_number"]})}};Blockly.Blocks.sensing_resettimer={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_RESETTIMER,category:Blockly.Categories.sensing,extensions:["colours_sensing","shape_statement"]})}};
  Blockly.Blocks.sensing_of_object_menu={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"OBJECT",options:[["Sprite1","Sprite1"],["Stage","_stage_"]]}],category:Blockly.Categories.sensing,extensions:["colours_sensing","output_string"]})}};
  Blockly.Blocks.sensing_of={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_OF,args0:[{type:"field_dropdown",name:"PROPERTY",options:[[Blockly.Msg.SENSING_OF_XPOSITION,"x position"],[Blockly.Msg.SENSING_OF_YPOSITION,"y position"],[Blockly.Msg.SENSING_OF_DIRECTION,"direction"],[Blockly.Msg.SENSING_OF_COSTUMENUMBER,"costume #"],[Blockly.Msg.SENSING_OF_COSTUMENAME,"costume name"],[Blockly.Msg.SENSING_OF_SIZE,"size"],[Blockly.Msg.SENSING_OF_VOLUME,"volume"],[Blockly.Msg.SENSING_OF_BACKDROPNUMBER,
  "backdrop #"],[Blockly.Msg.SENSING_OF_BACKDROPNAME,"backdrop name"]]},{type:"input_value",name:"OBJECT"}],output:!0,category:Blockly.Categories.sensing,outputShape:Blockly.OUTPUT_SHAPE_ROUND,extensions:["colours_sensing"]})}};
  Blockly.Blocks.sensing_current={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_CURRENT,args0:[{type:"field_dropdown",name:"CURRENTMENU",options:[[Blockly.Msg.SENSING_CURRENT_YEAR,"YEAR"],[Blockly.Msg.SENSING_CURRENT_MONTH,"MONTH"],[Blockly.Msg.SENSING_CURRENT_DATE,"DATE"],[Blockly.Msg.SENSING_CURRENT_DAYOFWEEK,"DAYOFWEEK"],[Blockly.Msg.SENSING_CURRENT_HOUR,"HOUR"],[Blockly.Msg.SENSING_CURRENT_MINUTE,"MINUTE"],[Blockly.Msg.SENSING_CURRENT_SECOND,"SECOND"]]}],category:Blockly.Categories.sensing,
  checkboxInFlyout:!0,extensions:["colours_sensing","output_number"]})}};Blockly.Blocks.sensing_dayssince2000={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_DAYSSINCE2000,category:Blockly.Categories.sensing,extensions:["colours_sensing","output_number"]})}};Blockly.Blocks.sensing_username={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_USERNAME,category:Blockly.Categories.sensing,checkboxInFlyout:!0,extensions:["colours_sensing","output_number"]})}};
  Blockly.Blocks.sensing_userid={init:function(){this.jsonInit({message0:Blockly.Msg.SENSING_USERID,category:Blockly.Categories.sensing,extensions:["colours_sensing","output_number"]})}};Blockly.Blocks.sound={};Blockly.Blocks.sound_sounds_menu={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_dropdown",name:"SOUND_MENU",options:[["1","0"],["2","1"],["3","2"],["4","3"],["5","4"],["6","5"],["7","6"],["8","7"],["9","8"],["10","9"],["call a function",function(){window.alert("function called!")}]]}],colour:Blockly.Colours.sounds.secondary,colourSecondary:Blockly.Colours.sounds.secondary,colourTertiary:Blockly.Colours.sounds.tertiary,extensions:["output_string"]})}};
  Blockly.Blocks.sound_play={init:function(){this.jsonInit({message0:Blockly.Msg.SOUND_PLAY,args0:[{type:"input_value",name:"SOUND_MENU"}],category:Blockly.Categories.sound,extensions:["colours_sounds","shape_statement"]})}};Blockly.Blocks.sound_playuntildone={init:function(){this.jsonInit({message0:Blockly.Msg.SOUND_PLAYUNTILDONE,args0:[{type:"input_value",name:"SOUND_MENU"}],category:Blockly.Categories.sound,extensions:["colours_sounds","shape_statement"]})}};
  Blockly.Blocks.sound_stopallsounds={init:function(){this.jsonInit({message0:Blockly.Msg.SOUND_STOPALLSOUNDS,category:Blockly.Categories.sound,extensions:["colours_sounds","shape_statement"]})}};
  Blockly.Blocks.sound_seteffectto={init:function(){this.jsonInit({message0:Blockly.Msg.SOUND_SETEFFECTO,args0:[{type:"field_dropdown",name:"EFFECT",options:[[Blockly.Msg.SOUND_EFFECTS_PITCH,"PITCH"],[Blockly.Msg.SOUND_EFFECTS_PAN,"PAN"]]},{type:"input_value",name:"VALUE"}],category:Blockly.Categories.sound,extensions:["colours_sounds","shape_statement"]})}};
  Blockly.Blocks.sound_changeeffectby={init:function(){this.jsonInit({message0:Blockly.Msg.SOUND_CHANGEEFFECTBY,args0:[{type:"field_dropdown",name:"EFFECT",options:[[Blockly.Msg.SOUND_EFFECTS_PITCH,"PITCH"],[Blockly.Msg.SOUND_EFFECTS_PAN,"PAN"]]},{type:"input_value",name:"VALUE"}],category:Blockly.Categories.sound,extensions:["colours_sounds","shape_statement"]})}};
  Blockly.Blocks.sound_cleareffects={init:function(){this.jsonInit({message0:Blockly.Msg.SOUND_CLEAREFFECTS,category:Blockly.Categories.sound,extensions:["colours_sounds","shape_statement"]})}};Blockly.Blocks.sound_changevolumeby={init:function(){this.jsonInit({message0:Blockly.Msg.SOUND_CHANGEVOLUMEBY,args0:[{type:"input_value",name:"VOLUME"}],category:Blockly.Categories.sound,extensions:["colours_sounds","shape_statement"]})}};
  Blockly.Blocks.sound_setvolumeto={init:function(){this.jsonInit({message0:Blockly.Msg.SOUND_SETVOLUMETO,args0:[{type:"input_value",name:"VOLUME"}],category:Blockly.Categories.sound,extensions:["colours_sounds","shape_statement"]})}};Blockly.Blocks.sound_volume={init:function(){this.jsonInit({message0:Blockly.Msg.SOUND_VOLUME,category:Blockly.Categories.sound,checkboxInFlyout:!0,extensions:["colours_sounds","output_number"]})}};Blockly.Blocks.stdint={};Blockly.Blocks.math_int8_number={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_slider",name:"NUM",value:"0",precision:1,min:"-127",max:"127"}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField})}};
  Blockly.Blocks.math_uint8_number={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_slider",name:"NUM",value:"0",min:"0",max:"255"}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField})}};
  Blockly.Blocks.math_int9_number={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_slider",name:"NUM",value:"0",min:"-255",max:"255"}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField})}};
  Blockly.Blocks.math_uint10_number={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_slider",name:"NUM",value:"0",precision:1,min:"0",max:"1023"}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField})}};
  Blockly.Blocks.math_int11_number={init:function(){this.jsonInit({message0:"%1",args0:[{type:"field_slider",name:"NUM",value:"0",precision:1,min:"-1023",max:"1023"}],output:"Number",outputShape:Blockly.OUTPUT_SHAPE_ROUND,colour:Blockly.Colours.textField,colourSecondary:Blockly.Colours.textField,colourTertiary:Blockly.Colours.textField})}};
  